# NMath User's Guide

15.1 Special Functions (.NET, C#, CSharp, VB, Visual Basic, F#)

Class SpecialFunctions provides the special functions shown in Table 1.

 Function Description Airy() The Airy and Bairy functions are the two solu­tions of the differential equation y''(x) = xy. BesselI0() Modified Bessel function of the first kind, order zero. BesselI1() Modified Bessel function of the first kind, first order. BesselIv() Modified Bessel function of the first kind, non-integer order. BesselJ0() Bessel function of the first kind, order zero. BesselJ1() Bessel function of the first kind, first order. BesselJn() Bessel function of the first kind, arbitrary inte­ger order. BesselJv() Bessel function of the first kind, non-integer order. BesselK0() Modified Bessel function of the second kind, order zero. BesselK1() Modified Bessel function of the second kind, order one. BesselKn() Modified Bessel function of the second kind, arbitrary integer order. BesselY0() Bessel function of the second kind, order zero. BesselY1() Bessel function of the second kind, order one. BesselYn() Bessel function of the second kind of integer order. BesselYv() Bessel function of the second kind, non-integer order. Beta() The beta function (also known as the Eulerian integral of the first kind): Beta(a, b) = Gamma(a) * Gamma(b) / Gamma(a+b). Binomial() The binomial coefficient (n choose k)—the number of ways of picking k unordered out­comes from n possibilities. BinomialLn() The natural log of the binomial coefficient. Cn() Jacobian elliptic function Cn() for real, pure imaginary, or complex arguments. Digamma() The digamma, or psi, function, defined as Gamma'(z)/Gamma(z). Ei() Exponential integral. EllipJ() The real valued Jacobi elliptic functions. EllipticE() The complete elliptic integral of the second kind. EllipticF() The incomplete elliptic integral of the first kind. EllipticK() The complete elliptic integral, K(m), of the first kind. EulerGamma A constant, also known as the Euler-Macheroni constant. Famously, rationality unknown. Factorial() Factorial. The number of ways that n objects can be permuted. FactorialLn() The natural log factorial of n, ln(n!). Gamma() The gamma function. GammaLn() The natural log of the gamma function. GammaReciprocal() The reciprocal of the gamma function. HarmonicNumber() The harmonic number, Hn, is a truncated sum of the harmonic series. Hypergeometric1F1() The confluent hypergeometric series of the first kind. Hypergeometric2F1() The Gauss or generalized hypergeometric function. IncompleteBeta() The incomplete beta function(). IncompleteGamma() The incomplete gamma integral. IncompleteGammaComplement() The complemented incomplete gamma integral. PolyLogarithm() The polylogarithm, Li_n(x). Sn() The Jacobian elliptic function Sn() for real, pure imaginary, or complex arguments. Zeta() The Riemann zeta function.

Using these special functions in your code is easy.

Code Example – C# special functions

```// Compute the Jacobi function Sn() with a complex argument.
```
```var cmplx = new DoubleComplex( 0.1, 3.3 );
```
```DoubleComplex sn = SpecialFunctions.Sn( cmplx, .3 );

```

```// Compute the elliptic integral, K(m)
```
```double ei = SpecialFunctions.EllipticK( 0.432 );
```

Code Example – VB special functions

```' Compute the Jacobi function Sn() with a complex argument.
```
```Dim Complex As New DoubleComplex( 0.1, 3.3 )
```
```Dim SN as DoubleComplex = SpecialFunctions( Complex, 0.3 )

```

```' Compute the elliptic integral, K(m)
```
```Dim EI as Double = SpecialFunctions.EllipticK( 0.432 )

```

Top

Top