In [17]:

using ApproxFun, Plots, ComplexPhasePortrait, ApproxFun,  SingularIntegralEquations,
SpecialFunctions

using SingularIntegralEquations.HypergeometricFunctions
gr();



# M3M6: Methods of Mathematical Physics

$$\def\dashint{{\int\!\!\!\!\!\!-\,}} \def\infdashint{\dashint_{\!\!\!-\infty}^{\,\infty}} \def\D{\,{\rm d}} \def\E{{\rm e}} \def\dx{\D x} \def\dt{\D t} \def\dz{\D z} \def\ds{\D s} \def\C{{\mathbb C}} \def\R{{\mathbb R}} \def\H{{\mathbb H}} \def\CC{{\cal C}} \def\HH{{\cal H}} \def\FF{{\cal F}} \def\I{{\rm i}} \def\Ei{{\rm Ei}\,} \def\qqqquad{\qquad\qquad} \def\qqand{\qquad\hbox{and}\qquad} \def\qqfor{\qquad\hbox{for}\qquad} \def\qqwhere{\qquad\hbox{where}\qquad} \def\Res_#1{\underset{#1}{\rm Res}}\, \def\sech{{\rm sech}\,} \def\acos{\,{\rm acos}\,} \def\erfc{\,{\rm erfc}\,} \def\vc#1{{\mathbf #1}} \def\ip<#1,#2>{\left\langle#1,#2\right\rangle} \def\br[#1]{\left[#1\right]} \def\norm#1{\left\|#1\right\|} \def\half{{1 \over 2}} \def\fL{f_{\rm L}} \def\fR{f_{\rm R}} \def\HF(#1,#2,#3,#4){{}_2F_1\!\left({#1,#2 \atop #3}; #4 \right)} \def\questionequals{= \!\!\!\!\!\!{\scriptstyle ? \atop }\,\,\,}$$

Dr Sheehan Olver
s.olver@imperial.ac.uk

Office Hours: 3-4pm Mondays, 11-12am Thursdays, Huxley 6M40
Website: https://github.com/dlfivefifty/M3M6LectureNotes

# Lecture 28: Hypergeometric functions

1. Hypergeometric differential equation
2. Taylor series
3. Second solution of differential equations

## Hypergeometric differential equation

The hypergeometric equation has three regular singular points at $0$, $1$ and $\infty$: $$z(1-z) {\D^2 u \over \D u^2} + \br[c-(a+b+1) z] {\D u \over \dz} - ab u =0$$ It's importance follows from the following theorem.

Theorem Any homogenous 2nd order linear differential equation whose singularities in $\bar\C$ are regular and not more than three in number can be transformed into the hypergeometric functions.

Proof See [Chapter 5.8, Olver 1975]. ⬛️

If we solve this ODE along a straight contour starting from $z_0 = -1$, we have that all solutions are analytic off $[0,\infty)$. Interestingly, there exists a special solution that is analytic off $[1,\infty)$, the (Gauss) hypergeometric function, which we denote $$u(z) = {}_2F_1\!\left({a,b \atop c}; z \right)$$

To see this, consider the indicial equation at zero: $$\alpha(\alpha-1) + a_{-1} \alpha + b_{-2} = 0$$ where $a_{-1} = c$ and $b_{-2} = 0$. This has two solutions: $\alpha = 0$ and $\alpha = 1 - c$. The choice $\alpha = 0$ has no singularity, and forward substitution proceeds provided $1-c$ is not a positive integer.

Here is a phase plot of a typical hypergeometric function, showing the branch cut from $(1,∞)$:



In [2]:

phaseplot(z -> _₂F₁(0.5,-0.2,0.1,z), (-3,3), (-3,3))




Out[2]:

-3

-2

-1

0

1

2

3

-3

-2

-1

0

1

2

3



Note some special cases are entire:



In [3]:

n = 5;
a ,b = 0.0, 0.0
phaseplot(z -> _₂F₁(-n,n+a+b+1,a+1,z+eps()*im), (-3,3), (-3,3))




Out[3]:

-3

-2

-1

0

1

2

3

-3

-2

-1

0

1

2

3



When c is a negative integer, we see that it is not well-define:



In [4]:

_₂F₁(0.5,-0.2,-3,0.1)  # errors out for 1-c = 2




Out[4]:

Inf



Remark The regularized hypergeometric function ${\mathbf F}\!\left({a,b \atop c}; z \right)$ extends the definition to $1-c$ being a positive integer. In these cases, one has the initial condition $u(0) = 0$, or more specifically, $u(z) = O(z^{1-c})$. In practical applications, one should normally use ${\mathbf F}$.

### Taylor coefficients of hypergeometric function

We can determine the Taylor coefficients of $u(z) = \HF(a,b,c,z)$ by solving the equation $$z(1-z) {\D^2 u \over \D z^2} + \br[c-(a+b+1) z] {\D u \over \dz} - ab u =0 \qqand u(0) = 1$$ (only one initial condition is specified since the other solution is singular) as a lower triangular system:

We do so by representing the various operators: $$z (1-z){\D^2 \over \D z^2} \equiv \begin{pmatrix} 0 & 0 \\ & 0 & 2 \\ &&-2 & 6 \\ &&&-6 & 12 \\ &&&&\ddots & \ddots \end{pmatrix}$$



In [5]:

z = Fun(Taylor(Circle(1.0)))
a = 0.1; b = 0.3; c= 0.4;
D = Derivative() : space(z)

z*(1-z)*D^2




Out[5]:

TimesOperator:Taylor(🕒)→Taylor(🕒)
0.0+0.0im  0.0+0.0im   0.0+0.0im              …
0.0+0.0im  0.0+0.0im   2.0+0.0im   0.0+0.0im
0.0+0.0im  0.0+0.0im  -2.0+0.0im   6.0+0.0im
0.0+0.0im   0.0+0.0im  -6.0+0.0im
0.0+0.0im   0.0+0.0im
0.0+0.0im  …
0.0+0.0im
56.0+0.0im    0.0+0.0im
-56.0+0.0im   72.0+0.0im  ⋱
0.0+0.0im  -72.0+0.0im  ⋱
…        ⋱            ⋱      ⋱


$$[c - (a+b+1)z]{\D \over \D z} \equiv \begin{pmatrix} 0 & c \\ 0 & -(a+b+1) & 2c \\ && -2(a+b+1) & 3c \\ &&& -3(a+b+1) & 4c \\ &&&&\ddots & \ddots \end{pmatrix}$$


In [6]:

(c-(a+b+1)*z)*D




Out[6]:

TimesOperator:Taylor(🕒)→Taylor(🕒)
0.0+0.0im   0.4+0.0im              …
0.0+0.0im  -1.4+0.0im   0.8+0.0im
0.0+0.0im  -2.8+0.0im
0.0+0.0im

…

3.2+0.0im
-11.2+0.0im    3.6+0.0im
0.0+0.0im  -12.6+0.0im  ⋱
…                     ⋱      ⋱



Adding in the boundary row, we get a really nice, simple formula for the taylor coefficients: $$\begin{pmatrix} 1 \\ -ab & c \\ & -(a+b+1)-ab & 2+2c \\ && -2-2(a+b+1)-ab & 6+3c \\ &&& -6-3(a+b+1)-ab & 12+4c \\ &&&&\ddots & \ddots \end{pmatrix} \begin{pmatrix} u_0 \\ u_1 \\ \vdots \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ \vdots \end{pmatrix}$$

That is, we have \begin{align*} u_0 &= 1 \\ u_{k+1} &= { k(k+a+b)+ab \over (k+1)(k + c)} u_k &= { (a+k)(b+k) \over (k+1)(k + c)} u_k \end{align*}



In [7]:

n = 100
u = Array{Float64}(n)
u[1] = 1
for k=0:n-2
u[k+2] =(a+k)*(b+k)/((k+1)*(k+c))*u[k+1]
end
u = Fun(Taylor(), u)

(z*(1-z)*D^2 + (c-(a+b+1)*z)*D - a*b*I)*u  # zero apart from tail




Out[7]:

Fun(Taylor(🕒),Complex{Float64}[0.0+0.0im, 0.0+0.0im, 2.77556e-17+0.0im, 5.55112e-17+0.0im, -1.11022e-16+0.0im, -1.66533e-16+0.0im, -1.66533e-16+0.0im, 0.0+0.0im, -1.11022e-16+0.0im, 1.11022e-16+0.0im  …  0.0+0.0im, -1.77636e-15+0.0im, -1.77636e-15+0.0im, -3.55271e-15+0.0im, -2.66454e-15+0.0im, 0.0+0.0im, -1.77636e-15+0.0im, -7.74477+0.0im, 0.0+0.0im, 0.0+0.0im])




In [8]:

u(0.1) - _₂F₁(a,b,c,0.1)




Out[8]:

2.220446049250313e-16



Recall the Pochhammer symbol: Definition (Pochhammer) $$(a)_n := a(a+1)(a+2) \cdots (a+n-1)$$

We have thus arrived at a nice formula for the Taylor series:

Theorem (Hypergeometric function Taylor series) For $|z| < 1$, $$\HF(a,b,c,z) = \sum_{k=0} {(a)_k (b)_k \over (c)_k} {z^k \over k!}$$ solves the hypergeometric equation with $\HF(a,b,c,0) = 1$.

### Second solution

This gives us one solution to the equation, but we know all ODEs have two linearly independent solutions. In fact, we know from the indicial equation that the second solution has a singularity of the form $(-z)^{1-c}$. It turns out after we change variables we arrive back at a Hypergeometric function:

Theorem (Hypergeometric function second solution) Suppose $c$ is not an integer. Then $$(-z)^{1-c} \HF(a-c+1, b-c+1,2-c, z)$$ solves the hypergeometric function off $[0,\infty)$.

Proof This is fairly straightforward: Making the change of variables: $$u(z) = (-z)^{1-c} v(z)$$ that is, \begin{align*} u'(z) &= (c-1)(-z)^{-c} v(z) + (-z)^{1-c} v'(z)\\ u''(z) &= c(c-1)(-z)^{-c-1} v(z) + 2(c-1)(-z)^{-c} v'(z) + (-z)^{1-c} v''(z) \end{align*} the hypergeometric function becomes \begin{align*} z(1-z)(-z)^{1-c} v''(z) - 2(c-1) (1-z) (-z)^{1-c} v'(z) -(1-z) c(c-1)(-z)^{-c} v(z) + (c-(a+b+1) z) ((c-1)(-z)^{-c} v(z) + (-z)^{1-c} v'(z)) - ab (-z)^{1-c} v(z) = 0 \Rightarrow z(1-z) v''(z) +\br[2-c - (3+a+b-2c)] v'(z) - (a-c+1)(b-c+1)v(z) = 0 \end{align*} This is again the hypergeometric function, with the altered parameters.

⬛️

Let's check it out:



In [13]:

a,b,c = 0.1,0.3,0.4

u = z -> (-z)^(1-c)*_₂F₁(a-c+1,b-c+1,2-c,z)
phaseplot(u, (-3,3), (-3,3))




Out[13]:

-3

-2

-1

0

1

2

3

-3

-2

-1

0

1

2

3



Let's double check it satisfies the original ODE:



In [16]:

# dual numbers don't work to second degree so let's check numerically:
z = Fun(0.1+im .. 0.2+im)
uf = Fun(u, domain(z))
norm(z*(1-z)*uf'' + (c - (a+b+1)*z)*uf' - a*b*uf)




Out[16]:

1.5080992645962192e-10