Special Functions

George E. Hrabovsky

MAST

Introduction

We have seen examples of solutions of ODEs resulting in the application of special functions. In this lesson we will explore some of their basic ideas. We will also discuss how they are implemented in Mathematica.

Series Solutions of ODEs

One frequently used method of solving ODEs that has been missing from Mathematica (though it was always possible to construct a solution that produced these results) is the method of power series expansions. Constructing the solution was not straightforward and had to be done in detail for each problem anew. Starting with version 12.1 a new function was added that let’s you do this using the AsymptoticDSolveValue. Here is our harmonic oscillator equation as an IVP centered at the origin.

l5_1.png

l5_2.png

We can plot this solution.

l5_3.png

l5_4.gif

It works well up to 2 π, but beyond that it begins to get errors. We can see a set of successive approximations by a combination of the Accumulate and List mapping commands.

l5_5.png

l5_6.gif

The nice thing about this function is that it detects the nature of the point (ordinary and regular or irregular singular points) and applied the correct method (Taylor series or Frobenius). The method can be used with a small parameter to get a perturbation series, and if you set a limit of infinity it will give you an asymptotic expansion.

How do we tell if a point is ordinary or singular? Let’s say that we Taylor expand a function of x around the point l5_7.png,

l5_8.png

(5.1)

If the function is infinite differentiable at l5_9.png and it also satisfies (5.1), then function is called an analytic function, or sometimes a regular function. Now, say that we have an ODE of the form

l5_10.png

(5.2)

If both l5_11.png and l5_12.png are analytic at some point l5_13.png, then the point l5_14.png is said to be ordinary. A point that is not ordinary is called singular. If a point is singular and the products l5_15.png and l5_16.png are both analytic at l5_17.png, then the point l5_18.png is called a regular singular point for the second-order equation. Otherwise it is called an irregular singular point. Can we get Mathematica to help us find these points?

We can convert a second-order equation into the form of (5.2) and test to see if the functions l5_19.png and l5_20.png are analytic. Take the equation in sol1, we can write it

l5_21.png

(5.3)

where l5_22.png and l5_23.png. We can use the command FunctionAnalytic to test these.

l5_24.png

l5_25.png

l5_26.png

l5_27.png

Thus, any point chosen is an ordinary point. Let’s see what happens if we choose our regular point to be 3 π.

l5_28.png

l5_29.png

The plot for this solution now looks like this.

l5_30.png

l5_31.gif

So it is doing pretty well near the regular point.

What about the equation,

l5_32.png

(5.4)

does it have ordinary or singular points. We again rewrite the equation,

l5_33.png

(5.5)

where l5_34.png and l5_35.png. We can use the command FunctionAnalytic to test these.

l5_36.png

l5_37.png

l5_38.png

l5_39.png

So we have at least one singular point. How do we tell where this point is? We can try to use FunctionSingularities[].

l5_40.png

l5_41.png

So, there is a singular point at l5_42.png. Is it regular or irregular? If we multiply l5_43.png by l5_44.png, we still get 0, so that is analytical. What about l5_45.png? If we multiply that we get l5_46.png.

l5_47.png

l5_48.png

So the singular point is regular.

As an exercise read through the AsymptoticDSolveValue command write up, and come up with some examples.

Gamma and Beta Functions

The gamma function has an extensive treatment in Mathematica. The Gamma function is an integral-defined function.

l5_49.png

(5.6)

Here we plot the gamma function over a real domain.

l5_50.png

l5_51.gif

Here we plot it over a complex domain.

l5_52.png

l5_53.gif

From pl1 we see that there is a singular point at x=-1.

Here is a series expansion near that point.

l5_54.png

l5_55.png

So, what is the real domain of the complete gamma function?

l5_56.png

l5_57.png

How about the incomplete gamma? This is another integral.

l5_58.png

(5.7)

Here we find its domain.

l5_59.png

l5_60.png

What about the complex domains?

l5_61.png

l5_62.png

l5_63.png

l5_64.png

What about the corresponding ranges?

l5_65.png

l5_66.png

l5_67.png

l5_68.png

Is it meromorphic? What does it mean to be meromorphic? A function, f(x), is meromorphic if it can be represented as the ratio between two analytic complex functions. These are sometimes called regular functions.

l5_69.png

l5_70.png

l5_71.png

l5_72.png

As an exercise work through the write up on Gamma, make some of your own examples.

As a historical note the foundations of string theory were laid by Gabriele Veneziano using the properties of the Gamma function in 1968.

We now turn to the Beta function. This is also an integral, but it can be expressed in terms of Gamma functions.

l5_73.png

(5.8)

l5_74.png

l5_75.gif

l5_76.png

l5_77.gif

As an exercise work through the write up on Beta, make some of your own examples.

Also as an exercise look up the write ups on related functions to the Gamma and Beta functions.

Legendre Polynomials

Legendre polynomials are a class of orthogonal polynomials that satisfy the differential equation,

l5_78.png

(5.9)

Specific solutions are in the form of associated polynomials,

l5_79.png

(5.10)

We can, of course, evaluate the Legendre polynomial numerically. For the Legendre polynomial we use LegendreP[n,x].

l5_80.png

l5_81.png

Here we produce a list of the first ten Legendre polynomials, assuming x=2.

l5_82.png

1. 2.
2. 5.5
3. 17.
4. 55.375
5. 185.75
6. 634.938
7. 2199.13
8. 7691.15
9. 27100.7
10. 96060.5

Here we produce a list of the first ten Legendre polynomials symbolically.

l5_83.png

l5_84.png

We can make a plot of these ten over a real domain.

l5_85.png

l5_86.gif

Here is a plot over the complex domain.

l5_87.png

l5_88.gif

Here we produce a list of the first ten second-order associated Legendre polynomials symbolically.

l5_89.png

l5_90.png

Here is the general series expansion.

l5_91.png

l5_92.png

We can expand some of the Legendre terms.

l5_93.png

l5_94.png

We can specify l5_95.png.

l5_96.png

l5_97.png

We can produce the asymptotic expansion  at infinity.

l5_98.png

l5_99.png

As an exercise work through the documentation on LegendreP and create some examples.

Bessel Functions

Bessel functions are solutions of the Bessel equation,

l5_100.png

(5.11)

We can get a table of the first five Bessel functions of the first kind.

l5_101.png

l5_102.png

Here is the plot of these functions.

l5_103.png

l5_104.gif

We can get a table of the first five modified Bessel functions of the first kind.

l5_105.png

l5_106.png

Here is the plot of these functions.

l5_107.png

l5_108.gif

l5_109.png

l5_110.gif

We can get a table of the first five Bessel functions of the second kind.

l5_111.png

l5_112.png

Here is the plot of these functions.

l5_113.png

l5_114.gif

We can get a table of the first five modified Bessel functions of the Second kind.

l5_115.png

l5_116.png

Here is the plot of these functions.

l5_117.png

l5_118.gif

As an exercise work through the write-up for BesselJ, BesselI, BesselY, and BesselK and work through some examples. Look up related Bessel and Hankel functions.

Hermite Polynomials

Hermite polynomials are solutions of the equation

l5_119.png

(5.12)

We can get a table of the first five Hermite polynomials.

l5_120.png

l5_121.png

Here is the plot of these functions.

l5_122.png

l5_123.gif

Here we see the fractional Hermite polynomial on the complex plane.

l5_124.png

l5_125.gif

(This takes a fairly long time to finish).

As an exercise read through the write up on HermiteH and work through some examples.

Laguerre Polynomials

Laguerre polynomials are solutions of the differential equation,

l5_126.png

(5.13)

The default Laguerre polynomial, symbolized l5_127.png assumes a=0, otherwise we write l5_128.png and call it an associated Laguerre polynomial.

Here we write the first five polynomials.

l5_129.png

l5_130.png

Here is the plot of these functions.

l5_131.png

l5_132.gif

Here we write the first five associated Laguerre polynomials.

l5_133.png

l5_134.png

Here is the plot of these polynomials assuming a=5.

l5_135.png

l5_136.gif

Here is the plot of the polynomial over the complex plane.

l5_137.png

l5_138.gif

As an exercise read through the documentation for LaguerreL and work some examples.

Chebyshev Polynomials

Chebyshev polynomials will be the last of the classical orthogonal polynomials we will discuss in detail here. Specifically these polynomials are not the solutions of a differential equation. The Chebyshev polynomials of the first kind are of the form

l5_139.png

(5.14)

At first sight this does not appear to be a polynomial. If we apply trigonometric identities this can be converted. For example, if we choose n=2, then we can write the double angle formula

l5_140.png

(5.15)

Using the notation in (5.14) we write, where we replace cos(x) with x,

l5_141.png

(5.16)

Here we write the first five polynomials.

l5_142.png

l5_143.png

Note that the second entry is the one we derived above. Here is the plot of these functions.

l5_144.png

l5_145.gif

Here is the plot on the complex plane.

l5_146.png

l5_147.gif

Chebyshev polynomials of the second kind are similarly based,

l5_148.png

(5.17)

Here we write the first five polynomials.

l5_149.png

l5_150.png

Here is the plot of these functions.

l5_151.png

l5_152.gif

Here is the plot on the complex plane.

l5_153.png

l5_154.gif

As an exercise work through the documentation for ChebyshevT and ChebyshevU. Work several examples.

Other Orthogonal Polynomials

These are by no means the only orthogonal polynomials in Mathematica. I recommend that you read through the section Orthogonal Polynomials in the tutorial Mathematical Functions. Look up the documentation for any that interest you and work through some examples.

Hypergeometric Functions

The hypergeometric function is defined by a power series, assuming {z}<1,

l5_155.png

(5.18)

It has been realized that a good many special functions can be written as limiting cases or specific cases of the hypergeometric function. In that sense this is a kind of generalized special function. There are thousands of identities associated with hypergeometric functions.

Here we give an example of five functions.

l5_156.png

l5_157.png

Here is the plot of these functions.

l5_158.png

l5_159.gif

As an exercise explore the different hypergeometric functions in the Guide (to listed commands) covering Hypergeometric Functions. As you read through the documentation, work up your own examples.

Other Generalizations

The hypergeometric function is not the only generalization of special functions. We will consider two of them in this section.

The first generalization was first written about in 1936 by the Dutch mathematician Cornelius Meijer (1904-1974). A very large number of special functions can be defined in terms of the Meijer G function. For a list on n values of a and m values of b we can define the G function

l5_160.png

(5.19)

assuming rR. If not specified we assume r=1. To input this function we write MeijerG[{{list of a from l5_161.png to l5_162.png},{list from l5_163.png to l5_164.png}},{{list of b from l5_165.png to l5_166.png},{list from l5_167.png to l5_168.png}},x]. Here are some examples.

l5_169.png

l5_170.png

l5_171.png

l5_172.png

l5_173.png

l5_174.png

As an exercise work through the write up for MeijerG and work some examples.

This function being so general, we might be able to write a function as a Meijer G function.

l5_175.png

l5_176.png

As an exercise read the write up MeijerGReduce and work up some examples.

A generalization of the Meijer G function was accomplished by the British mathematician Charles Fox (1897-1977) in 1961. The Fox H function the Mellin-Barnes integral,

l5_177.png

(5.20)

Here the integration is along a path separating the poles of l5_178.png from the poles of l5_179.png. Read the details of the write-up for more details of the possibilities of the nature of this path. This is an experimental command added to version 12.3. Here are some examples of its use.

l5_180.png

l5_181.png

l5_182.png

l5_183.png

l5_184.png

l5_185.png

l5_186.png

l5_187.png

Here we make a table of values.

l5_188.png

b1 = 0 l5_189.png
b1 = 1 l5_190.png
b1 = 2 l5_191.png
b1 = 3 l5_192.png
b1 = 4 l5_193.png
b1 = 5 l5_194.png

Not much to see here. Here is a plot of these.

l5_195.png

l5_196.gif

This takes a while.

As an exercise read through the write up of FoxH and work some examples.

Elliptic Integrals and Elliptic Functions

There are a class of functions that can be defined by the integral of some rational function R

l5_197.png

(5.21)

where y is a cubic or quartic polynomial. This class is called elliptic integrals.

We begin with the elliptic integral of the first kind on the amplitude interval -π/2<φ<π/2 for the parameter m

l5_198.png

(5.22)

Here we plot a list of elliptic integrals of the first kind for various amplitudes.

l5_199.png

l5_200.gif

As an exercise read through the section on Elliptic Integrals in the tutorial Mathematical Functions. Consult each command listed there and work examples on each.

Elliptic Functions may be handled the same way, go ahead and look through the documentation and come up with some of your own examples.

Mathieu Functions

The final type of special function that we will examine today is the Mathieu function. These functions are solutions of the equation

l5_201.png

(5.23)

The Mathieu S function is odd while the Mathieu C function is even.

Here we make a table of expressions for Mathieu S.

l5_202.png

a = 1 Sin[x]
a = 2 l5_203.png
a = 3 l5_204.png
a = 4 Sin[2 x]
a = 5 l5_205.png

Here we plot these.

l5_206.png

l5_207.gif

Here we make a table of expressions for Mathieu C.

l5_208.png

a = 1 Cos[x]
a = 2 l5_209.png
a = 3 l5_210.png
a = 4 Cos[2 x]
a = 5 l5_211.png

Here we plot these.

l5_212.png

l5_213.gif

As an exercise read through the write up on Mathieu and Related Functions in the tutorial Mathematical Function. Look up each of the listed functions and work through some examples.

There are many more special functions available to Mathematica than we can cover here. Feel free to explore these fascinating functions.

Created with the Wolfram Language