14 Special functions

The special function approximations are defined in the header pnl/pnl_specfun.h.

Most of these functions rely on the Cephes library which uses its own error mechanism which can be activated or deactivated using the two following functions

14.1 Real Bessel functions

14.2 Complex Bessel functions

14.3 Error functions

14.4 Gamma functions

For x > 0, the Gamma Function is defined by

       ∫ ∞  -u  x-1
Γ (x ) =    e   u   du.
        0

14.5 Digamma function

For x > 0, the digamma function ψ is defined as the logarithmic derivative of the Gamma function Γ

                      ′
ψ (x ) =-d-logΓ (x ) = Γ-(x).
       dx            Γ (x)

The function ψ admits the following integral representation

       ∫   (              )
ψ(x) =   ∞   e--u-  -e-xu--  .
        0     u    1- e- u

14.6 Incomplete Gamma functions

For a and x > 0, the Incomplete Gamma Function is defined by

         ∫ ∞
Γ (a,x ) =    e-u ua-1du.
          x

A relation similar to the one existing for the standard Gamma function holds

          - xa-e-x+-Γ (a-+-1,x)
Γ (a,x) =          a         .

Γ(a) = 0ua-1 e-u du
P(a,x) = Γ (a) - Γ (a,x)
----Γ-(a)---- =   1
Γ (a) 0xua-1 e-u du
Q(a,x) = 1 -P(a,x) = Γ (a,x)
 Γ (a) = --1--
Γ (a ) xe-u ua-1du.

14.7 Exponential integrals

For x > 0 and n , the function En is defined by

        ∫ ∞
En (x ) =    e-xu u-ndu
         1

This function is linked to the Incomplete Gamma function by

        ∫ ∞                             ∫ ∞
En (x) =    e- xu(xu )-nxn-1d(xu) = xn-1     e-tt-ndt = xn-1Γ (1 - n,x) ,
         x                               x

from which we can deduce

nE    (x) = e- x- xE  (x ).
   n+1             n

For n > 1, the series expansion is given by

                      [                      2          3       ]
En(x) = xn-1Γ (1 - n)+  ---1-- + --x-- - ---x----+  --x------ ... .
                         1 - n   2 - n   2(3-  n)   6(4 - n)

The asymptotic behaviour is given by

         - x[                     ]
En (x ) = e-- 1 - n-+ n(n-+-1) + ....
         x       x      x2

The special case n = 1 gives

        ∫ ∞  e- u
E1 (x) =     ---du,   |Arg (x )| ≥ π.
         x    u

For any complex number x with positive real part, this can be written

         ∫
          ∞  e-ux-
E1 (x) =  1   u  du,   ℜ(x) ≥ 0.

By integrating the Taylor expansion of e-t ∕t, and extracting the logarithmic singularity, we can derive the following series representation for E1(x),

                   ∑∞ (- 1)kxk
E1(x) = - γ - lnx -   --------    |Arg(x)| < π.
                   k=1  k k!

The function E1 is linked to the exponential integral Ei

        ∫ x  eu        ∫ ∞ e-u
Ei (x) =     u-du =  -     -u--du  ∀x ⁄= 0.
         - ∞            -x

The above definition can be used for positive values of x, but the integral has to be understood in terms of its Cauchy principal value, due to the singularity of the integrand at zero.

Ei(- x) = - E (x ),  ℜ (x) ≥ 0.
             1

We deduce,

                  ∑∞ -xk-
Ei (x ) = γ + lnx +   k k!,  x > 0.
                  k=1

For x

         {
            - Ei (- x) - iπ x < 0,
Γ (0,x) =   - Ei (- x) x > 0.

14.8 Hypergeometric functions