Error Function in LaTeX (\text{erf}(x))

erf(x)\text{erf}(x)
LaTeX command
\text{erf}(x)
Package
Add to your preamble:\usepackage{amsmath}
Mode
Text and math mode

Where it is used

Error function: the scaled integral of the Gaussian e^{-t^2} from 0 to x, used for normal probabilities.

The definition is \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2}\,dt, with limits \pm 1 at \pm\infty. The standard normal CDF is \Phi(x) = \frac{1}{2}\big[1 + \text{erf}(x/\sqrt{2})\big], and erf solves the heat equation for a step initial condition. \text{erf} prints upright, but it follows the surrounding font, so it goes italic inside theorems; \operatorname{erf}, or a \DeclareMathOperator in the preamble, is more robust and adds proper spacing. It is odd: \text{erf}(-x) = -\text{erf}(x). The inverse is \text{erf}^{-1}, used to compute normal quantiles.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

Φ(x)=12[1+erf(x2)]\Phi(x) = \frac{1}{2}\left[1 + \text{erf}\left(\frac{x}{\sqrt{2}}\right)\right]
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Error Function: $\text{erf}(x)$

\[ \Phi(x) = \frac{1}{2}\left[1 + \text{erf}\left(\frac{x}{\sqrt{2}}\right)\right] \]
\end{document}

Related symbols

All 특수 함수 →

Frequently asked questions

How do I write Error Function in LaTeX?
Type \text{erf}(x) in math mode, for example $\Phi(x) = \frac{1}{2}\left[1 + \text{erf}\left(\frac{x}{\sqrt{2}}\right)\right]$. Load amsmath first with \usepackage{amsmath}.
Which package do I need for \text{erf}(x)?
\text{erf}(x) needs amsmath: add \usepackage{amsmath} to your preamble before the document starts.
Can I use \text{erf}(x) in text mode, or only in math mode?
Both. \text{erf}(x) compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기