MATHEMATICAL FUNCTIONS

Tigran Ishkhanyan 
Wolfram Research, Inc.

Join the Conversation #WolframTechConf

ABSTRACT

The wide range of mathematical functions that includes the classes of elementary and special functions has played a crucial role in solving real-world problems for centuries: nowadays these functions appear in almost any field of contemporary Science which, however, requires more and more advanced powerful functions. 

New developments in Wolfram Language include implementation of the 10 Heun functions that are special functions of the next generation, making the Wolfram Language more powerful for solving different modern problems originating from astrophysics, quantum mechanics, lattice systems in statistical mechanics and other fields. Also new fundamental developments in the area of numerical evaluation of the general holonomic functions and fully updated documentation pages for elementary and Special Functions will be presented.

New in WL 12.0 and 12.1

Improvement

250+ Math Funcions documentation pages update focusing on Scope section (12.0)

Updating Basic examples section (12.1) for these 250+ functionss

Development

Asymptotics (12.0 and running)

5 Heun functions and their primes have been implemented (12.1)

Holonomic functions are being redesigned

etc.

Overview on Mathematical Functions

Key idea: Mathematical Functions as solutions of ODE’s.

Elementary functions (trigonometric, hyperbolic, etc.)

DSolveValue[{w'[z]-w[z]==0},w,z]

DSolveValue[z w'[z]-1==0,w,z]

Bessel and related functions

DSolveValue[w''[z]+(1/z) w'[z]+((((z^2)-(n^2)))/((z^2)))w[z]==0,w,z]

DSolveValue[{w''[z]-((2 z )/((1-z)(1+z)))w'[z]+((n(n+1))/((1-z)(1+z))) w[z]==0},w[z],z]

DSolveValue[{w''[z]-2 z w'[z]+2 n w[z]==0},w[z],z]

Hypergeometric functions

0F1

DSolveValue[w''[z]+(c/z)w'[z]-(1/z)w[z]==0,w[z],z]//FullSimplify

DSolveValue[w''[z]+(c/z)w'[z]-(1/z)w[z]==0,w[z],z]

1F1

DSolveValue[w''[z]+((c/z)-1)w'[z]-(a/z)w[z]==0,w[z],z]

eq=w''[z]+((c/z)-1)w'[z]-(a/z)w[z];

w[z_]:=Hypergeometric1F1[a,c,z]
eq//FullSimplify

Clear[eq,w]

2F1

DSolveValue[w''[z]+((c/z)+((1+a+b-c)/(z-1)))w'[z]+((a b)/(z(z-1)))w[z]==0,w[z],z]

Remark : 
 	hypergeometric functions formed the basis of theoretical physics of 20-th century. 
 	Check the documentation page for examples.

Advanced Special Functions

Mathieu functions

The Mathieu equation:

DSolveValue[w''[z]+(a-2q Cos[2z])w[z]==0,w[z],z]

The Mathieu equation in algebraic form:

DSolveValue[w''[z]-(z/((1+z)(1-z)))w'[z]+(((a+2q(1-2(z^2)) ))/((1+z)(1-z)))w[z]==0,w[z],z]

The Schrödinger equation with a periodic potential:

DSolve[y''[x]-Cos[x]y[x]==ℰ y[x],y[x],x]

Spheroidal functions

The Spheroidal equation:

DSolveValue[y''[z]-((2z)/((1+z)(1-z))) y'[z]+(SpheroidalEigenvalue[n,m,γ]+(γ^2)(1-(z^2))-((m^2)/(1-(z^2))))/((1+z)(1-z))y[z]==0,y[z],z]

Spheroidal functions generalize Legendre functions:

SpheroidalQS[n,m,0,z]
SpheroidalPS[n,m,0,z]

Lamé functions

Solve the Lamé equation!?

DSolve[ y''[z]+(1/2)((1/z)+(1/(z-1))+(1/(z-a)))y'[z]+((a h-ν(ν+1)z)/(4z(z-1)(z-a)))y[z]==0,y[z],z]

New in WL 12.1:
Heun functions

Overview on Heun functions

10 new Heun functions

?Heun*

Next step in the theory of Special Functions

Generalization of hypergeometric class of functions

Generalization of Mathieu, Spheroidal and Lamé functions/equations

Black holes, Quantum Physics, etc., etc.

The HeunG function

General Heun equation:

w''(z)+ ((γ/z)+(δ/(z-1))+((1+α+β-γ-δ)/(z-a)))w'(z)+((αβ z-q)/(z (z-1) (z-a)))w(z) =0

HeunG[a,q,α,β,γ,δ,z]
HeunGPrime[a,q,α,β,γ,δ,z]

Direct generalization of the hypergeometric equation

w''(z)+ ((c/z)+((1+a+b-c)/(z-1)))w'(z)+((a b)/(z (z-1) ))w(z) =0

Generalization of the Lamé equation

w''(z)+ (1/2)((1/z)+(1/(z-1))+(1/(z-a)))w'(z)+((a h-ν(1+ν) z)/(4z (z-1) (z-a)))w(z) =0

HeunG[a, q, α, β, γ, δ, z]

DSolveValue[ y''[z]+((γ/z)+(δ/(z-1))+((1+α+β-γ-δ)/(z-a)))y'[z]+((α β z-q)/(z(z-1)(z-a)))y[z]==0,y[z],z]

HeunG special cases

HeunG vs Lamé equation

Solve the Lamé's differential equation in terms of HeunG:

eq=y''[z]+(1/2)((1/z)+(1/(z-1))+(1/(z-a)))y'[z]+((a h-ν(ν+1)z)/(4z(z-1)(z-a)))y[z];

y[z_]:=(C[1]) HeunG[a,-((a h)/4),-(ν/2),((1+ν)/2),(1/2),(1/2),z]+(Sqrt[z]) (C[2]) HeunG[a,(1/4) (1+a-a h),((1-ν)/2),((2+ν)/2),(3/2),(1/2),z]

eq//FullSimplify

Plot the absolute value of the solution for different h:

{a,ν}={3/4,3};

Plot[Abs[y[z]/.{(C[1])->1/3,(C[2])->1/3}]/.h->{-100,-10,0,10,100}//Evaluate,{z,-1/2,1/2},PlotRange->{0,2}]

Clear[eq,y,a,ν]

HeunG in Quantum Mechanics

This infinite potential well is solved in HeunG functions:

V[x_]:=(V0/((((E^(2 x))-1))^2))

Plot[V[x]/.V0->-1,{x,-4,4}]

The fundamental solution of the Schrödinger equation in terms of HeunG:

ψ[x_]:=((((E^x)))^(Sqrt[C1-C2])) (((-1+(E^x)))^((1/2) (1+(Sqrt[1+C1])))) (((1+(E^x)))^((1/2) (1-(Sqrt[1+C1]))))HeunG[-1,q,α,β,γ,δ,(E^x)]

{q,α,β,γ,δ}=;

{C1,C2}={((2 m V0)/(ℏ^2)),((2 m EE)/(ℏ^2))};

Verify this solution by direct substitution:

ψ''[x]+((2m)/(ℏ^2))(EE-(V0/(((-1+(E^(2 x))))^2)))ψ[x]==0//Simplify

The Confluent Heun functions

The complete set of Heun equations

General Heun equation:

w''(z)+ ((γ/z)+(δ/(z-1))+((1+α+β-γ-δ)/(z-a)))w'(z)+((α β z-q)/(z (z-1)(z-a) ))w(z) =0

Confluent Heun equation:

w''(z)+ ((γ/z)+(δ/(z-1))+ϵ)w'(z)+((α z-q)/(z (z-1) ))w(z) =0

Double-confluent Heun equation:

w''(z)+((γ/(z^2))+(δ/z)+ϵ)w'(z)+((α z -q)/((z^2) ))w(z)=0

Bi-confluent Heun equation:

w''(z)+((γ/z)+δ+ϵ z)w'(z)+((α z-q)/z)w(z)=0

Tri-confluent Heun equation:

w''(z)+ (γ+δ z+ϵ (z^2))w'(z)+(α z-q)w(z) =0

Confluent Heun function

w''(z)+ ((γ/z)+(δ/(z-1))+ϵ)w'(z)+((α z-q)/(z (z-1) ))w(z) =0


HeunC[q,α,γ,δ,ϵ,z]

HeunCPrime[q,α,γ,δ,ϵ,z]

HeunC generalizes

HeunC vs Spheroidal equation

Solve the spheroidal wave equation in its general form in terms of HeunC:

eq=(1-(z^2))y''[z]-2z y'[z]+(λ+(γ^2)(1-(z^2))-((m^2)/(1-(z^2))))y[z];

y[z_]:=(E^(I z γ)) (((((1+z)/(-1+z))))^(m/2)) ((((-1+z))^m) (C[2]) HeunC[(-1-m) (m+2 I γ)+λ,-4 I (1+m) γ,1+m,1+m,-4 I γ,((1-z)/2)]+(C[1]) HeunC[2 I (-1+m) γ+λ,-4 I γ,1-m,1+m,-4 I γ,((1-z)/2)])

eq//Simplify

Plot the absolute value of the general solution for different values of λ:

{m,γ}={4/3,7/2};

Plot[Abs[y[z]]/.{(C[1])->1/3,(C[2])->1/3}/.λ->{-2,-1,0,1,2}//Evaluate,{z,-3/4,3/4}]

Clear[eq,y,m,γ]

Double confluent Heun function

w''(z)+((γ/(z^2))+(δ/z)+ϵ)w'(z)+((α z -q)/((z^2) ))w(z)=0


HeunD[q, α, γ, δ, ϵ, z]

HeunDPrime[q, α, γ, δ, ϵ, z]

Bi-confluent Heun function

w''(z)+((γ/z)+δ+ϵ z)w'(z)+((α z-q)/z)w(z)=0


HeunB[q, α, γ, δ, ϵ, z]

HeunBPrime[q, α, γ, δ, ϵ, z]

HeunB generalizes

HeunB in Quantum Mechanics 1

The quantum-mechanical doubly anharmonic oscillator potential is:

V[x_]:=μ (x^2)+λ (x^4)+η (x^6)

Plot[V[x]/.{μ->-7,λ->-5,η->1},{x,-3,3}]

The general solution of the Schrödinger equation is written in terms of HeunB functions:

(Subscript[ψ, 1])[x_]:=(E^(((x^2) ((x^2) η+λ))/(4 (Sqrt[η])))) HeunB[-(EE/4)-(λ/(8 (Sqrt[η]))),((12 (η^(3/2))+(λ^2)-4 η μ)/(16 η)),(1/2),(λ/(2 (Sqrt[η]))),(Sqrt[η]),(x^2)]
(Subscript[ψ, 2])[x_]:=(E^(((x^2) ((x^2) η+λ))/(4 (Sqrt[η])))) x HeunB[-(EE/4)-((3 λ)/(8 (Sqrt[η]))),((20 (η^(3/2))+(λ^2)-4 η μ)/(16 η)),(3/2),(λ/(2 (Sqrt[η]))),(Sqrt[η]),(x^2)]

ψ[x_]=(C[1])(Subscript[ψ, 1])[x]+(C[2])(Subscript[ψ, 2])[x]

Verify this solution by direct substitution:

ψ''[x]+(EE-μ (x^2)-λ (x^4)-η (x^6))ψ[x]==0//Simplify

HeunB in Quantum Mechanics 2

Solve the class of confinement potentials for the radial Schrödinger equation in terms of HeunB functions:

V[r_]:=(a/r)+b r+c (r^2)+((l(l+1))/(r^2))

Plot[V[r]/.{a->-30,b->-25,c->3,l->1},{r,-5,5}]

This general potential is solved in terms of HeunB functions:

{a,b,c}={1,4,4};

R[r_]:=(E^(r+(r^2))) (r^(-l)) (C[2]) ((r^(1+2 l)) HeunB[-1-2 l,7+4 l+((2 Ee m)/(ℏ^2)),2 (1+l),2,4,r]+HeunB[1+2 l,3-4 l+((2 Ee m)/(ℏ^2)),-2 l,2,4,r]);


eq=R''[r]+(((2m)/(ℏ^2))Ee-V[r])R[r]==0//Simplify

Clear[eq,R,a,b,c,V]

Tri-confluent Heun function

w''(z)+ (γ+δ z+ϵ (z^2))w'(z)+(α z-q)w(z) =0


HeunT[q,α,γ,δ,ϵ,z]

HeunTPrime[q,α,γ,δ,ϵ,z]

HeunT solves the Airy equation

y[z_]:=HeunT[0,-1,0,0,0,z]

y''[z]- z y[z]==0

HeunT in Classical Mechanics

Classical anharmonic oscillator equation is solved in terms of HeunT:

eq=u''[z]+((Subscript[λ, 0])+(Subscript[λ, 2])(z^2)+(Subscript[λ, 4]) (z^4))u[z]==0;

u[z_]:=(E^(-((I z (3 (Subscript[λ, 2])+2 (z^2) (Subscript[λ, 4])))/(6 (Sqrt[(Subscript[λ, 4])]))))) (C[2]) HeunT[-(Subscript[λ, 0])+((Subscript[λ, 2]^2)/(4 (Subscript[λ, 4]))),-2 I (Sqrt[(Subscript[λ, 4])]),-((I (Subscript[λ, 2]))/(Sqrt[(Subscript[λ, 4])])),0,-2 I (Sqrt[(Subscript[λ, 4])]),z]+(E^((I z (3 (Subscript[λ, 2])+2 (z^2) (Subscript[λ, 4])))/(6 (Sqrt[(Subscript[λ, 4])])))) (C[1]) HeunT[-(Subscript[λ, 0])+((Subscript[λ, 2]^2)/(4 (Subscript[λ, 4]))),2 I (Sqrt[(Subscript[λ, 4])]),((I (Subscript[λ, 2]))/(Sqrt[(Subscript[λ, 4])])),0,2 I (Sqrt[(Subscript[λ, 4])]),z]

eq//Simplify

Simulate the anharmonic oscillator dynamics:

{(Subscript[λ, 0]),(Subscript[λ, 2]),(Subscript[λ, 4])}={1,1/2,1/4};

Plot[{u[z]/.{(C[1])->1,(C[2])->1}},{z,0,9/2}]

Clear[eq,u]

HeunTPrime in Quantum Mechanics!!!

Schrödinger equation for the following infinite potential well is solved in HeunPrime functions:

V[x_]:=(V0/(Sqrt[x]))

Plot[V[x]/.{V0->-1},{x,0,1}]

The general solution of the Schrödinger equation is written in terms of HeunTPrime functions:

(Subscript[ψ, 1])[x_]:=(E^(((Sqrt[-2 EE m]) x)/ℏ)) HeunTPrime[0,-((2 (Sqrt[2]) m V0)/(ℏ^2)),0,((2 (Sqrt[-2 EE m]) )/ℏ),0,(Sqrt[2x])]
(Subscript[ψ, 2])[x_]:=(E^(-(((Sqrt[-2 EE m])x)/ℏ))) HeunTPrime[0,-((2 (Sqrt[2]) m V0)/(ℏ^2)),0,-((2 (Sqrt[-2 EE m]) )/ℏ),0,(Sqrt[2x])]

ψ[x_]=(C[1])(Subscript[ψ, 1])[x]+(C[2])(Subscript[ψ, 2])[x];

Verify this solution by direct substitution:

ψ''[x]+((2m)/(ℏ^2))(EE-(V0/(Sqrt[x])))ψ[x]==0//Simplify

Next: Holonomic Evaluator

Key idea: everyone is able to define its own Special Function.

Steps that we are working now:

Totally new documentation pages with big sets of examples

New method of calculations for DifferentialRoot based on series-based analytic continuation

Optimized algorithms for holonomic evaluators