Fungsi Khusus

Fungsi gamma, zeta, Bessel, Legendre, dan error.

Special functions in LaTeX: Gamma, Beta, zeta, erf and Bessel

Special functions in LaTeX are written with Greek letters or upright names. The Gamma function is \Gamma(z), the Riemann zeta function \zeta(s), the digamma function \psi(x) and the Dirac delta \delta(x). Functions named by Latin letters should be upright: there is no built-in \erf, so write \operatorname{erf}(x) or declare it once with \DeclareMathOperator from amsmath. Bessel functions and orthogonal polynomials are indexed letters such as J_n(x) and P_n(x), and the hypergeometric function is {}_2F_1(a, b; c; z). The table lists the special functions people use most, with the package each one needs; the full list follows below.

Quick reference: the most used special functions

SymbolCommandUsePackageCopy
Γ(z)\Gamma(z)
\Gamma(z)Gamma functionbuilt in
B(x,y)\mathrm{B}(x, y)
\mathrm{B}(x, y)Beta function (upright capital B)built in
ζ(s)\zeta(s)
\zeta(s)Riemann zeta functionbuilt in
erf⁡(x)\operatorname{erf}(x)
\operatorname{erf}(x)Error functionamsmath
erfc⁡(x)\operatorname{erfc}(x)
\operatorname{erfc}(x)Complementary error functionamsmath
Jn(x)J_n(x)
J_n(x)Bessel function of the first kindbuilt in
Yn(x)Y_n(x)
Y_n(x)Bessel function of the second kindbuilt in
Pn(x)P_n(x)
P_n(x)Legendre polynomialbuilt in
Hn(x)H_n(x)
H_n(x)Hermite polynomialbuilt in
2F1(a,b;c;z){}_2F_1(a, b; c; z)
{}_2F_1(a, b; c; z)Gauss hypergeometric functionbuilt in
ψ(x)\psi(x)
\psi(x)Digamma functionbuilt in
δ(x)\delta(x)
\delta(x)Dirac deltabuilt in

If you use a function often, declare it in the preamble so it prints upright with operator spacing everywhere:

\usepackage{amsmath}
\DeclareMathOperator{\erf}{erf}
\DeclareMathOperator{\erfc}{erfc}

Frequently asked questions about special functions in LaTeX

How do I write the Gamma function in LaTeX?
Use the uppercase Greek letter: $\Gamma(z) = \int_0^\infty t^{z-1} e^{-t}\,dt$. No package is needed. The Beta function is usually an upright B, \mathrm{B}(x, y), so it is not mistaken for a variable.
How do I write the error function erf in LaTeX?
LaTeX has no \erf command. Use \operatorname{erf}(x) from amsmath, or add \DeclareMathOperator{\erf}{erf} to the preamble and write \erf(x). This sets erf upright with operator spacing, unlike plain erf, which prints three italic variables.
How do I write the hypergeometric function in LaTeX?
Use an empty group to attach the left subscript: {}_2F_1(a, b; c; z). The mathtools package also provides \prescript{}{2}{F}_{1} for prescripts, and the generalised {}_pF_q follows the same pattern.
Γ(z)\Gamma(z)
B(x,y)B(x, y)
ζ(s)\zeta(s)

Riemann Zeta

\zeta(s)
erf(x)\text{erf}(x)

Error Function

\text{erf}(x)
erfc(x)\text{erfc}(x)

Complementary Error

\text{erfc}(x)
Jn(x)J_n(x)

Bessel J

J_n(x)
Yn(x)Y_n(x)

Bessel Y

Y_n(x)
In(x)I_n(x)
Kn(x)K_n(x)
Pn(x)P_n(x)
Qn(x)Q_n(x)
Hn(x)H_n(x)
Ln(x)L_n(x)
Tn(x)T_n(x)
Un(x)U_n(x)
2F1(a,b;c;z){}_2F_1(a,b;c;z)

Hypergeometric

{}_2F_1(a,b;c;z)
ψ(x)\psi(x)

Digamma

\psi(x)
ψ(n)(x)\psi^{(n)}(x)

Polygamma

\psi^{(n)}(x)
K(k)K(k)
E(k)E(k)
δ(x)\delta(x)

Dirac Delta

\delta(x)
H(x)H(x)