Chapter 8
Integral Representations

8.2 The Euler Transform

Example 8.2

Expressions for the Legendre functions of the second kind can be obtained in Mathematica by evaluating the integral in (8.45) directly using Integrate.  The Q[n,x] are first defined in terms of the operations in (8.45):

Q[n_,x_]:=2^(-n-1)Integrate[(1-t^2)^n/(x-t)^(n+1),
     {t,-1,1}]

To obtain compact expressions for the Q[n,x], we must explicitly declare
certain algebraic relations involving the Log function.  This is done by using the commands Protect and Unprotect for the required operations:

(Unprotect[Log,Plus,Subtract,Times];
 (a_)Log[x_]+(a_)Log[y_]:=(a)Log[x y];
 (a_)Log[x_]-(a_)Log[y_]:=(a)Log[x/y];
 (a_)Log[x_]+(b_)Log[x_]:=(a+b)Log[x];
 Protect[Log,Plus,Subtract,Times])

Expressions for the Legendrte functions be obtained for the required values of n.  For example,

Simplify[Q[0,x]]

Simplify[Q[1,x]]

Simplify[Q[2,x]]

Notice that the factors multiplying the logarithms in the Q[n,x] are proportional to
the P[n,x].  There is in fact a very close relationship between the Legendre
polynomials and the Legendre functions of the second kind.  This will be examined
below and in the problems at the end of the chapter.

8.3 Hypergeometric Functions

Example 8.3

The integral representation in Equation (8.59) can be used to show directly the relationship between the hypergeometric function and several elementary functions by performing the integral in Mathematica and evaluating the resulting expression with particular values of a, b and c.  We define F(a,b;c;x) by performing the definite integral in (8.59) using Integrate and the in-built function Gamma:

F[a_,b_,c_,x_]:=((Gamma[c]/(Gamma[b]Gamma[c-b]))*
     Integrate[t^(b-1) (1-t)^(c-b-1) (1-x t)^(-a),
     {t,0,1}])

The function F[a,b,c,x] can now be used to derive some well-known cases where hypergeometric function reduces to an elementary function.  A comprehensive list of such cases has been compiled by Abramowitz and Stegun (1965):

F[1,1,2,x]

F[1/2,1/2,3/2,x^2]

F[1/2,1/2,3/2,-x^2]

Though somewhat different in appearance, these expressions can be shown to be equivalent to those given in the book,

If a is equal to a negative integer then, in the notation of Problem 5.15, F reduces to an nth-order polynomial.  We can use the function F[a,b,c,x] to obtain particular expressions for these polynomials from the integral representation. For example,

Expand[F[-8,1,2,x]]

The equivalence of this expression to the summation given in the book can be verified easily.

8.4 Bessel Functions

Example 8.4

The integral representations in (8.66) can be used to generate expressions for the spherical Bessel functions, which were discussed in Problems 6.35 and 6.36.  The spherical Bessel function of order n, signified by j[x,n], is related to the half-order Bessel function J[x,n+1/2] by

                                j[x,n]=Sqrt[Pi/2x] J[x,n+1/2]

We can obtain expressions for the j[x,n] by evaluating the integral representations in (8.66) using Mathematica just as in Example 8.3 for the hypergeometric function.  We construct J[x,n] from the third integral representation in (8.66) by using Integrate and the in-built function Gamma:

J[x_,n_]:=2(((x/2)^n/(Gamma[n+1/2]Gamma[1/2]))*
     Integrate[Cos[x u](1-u^2)^(n-1/2),{u,0,1}])

The spherical Bessel functions are now constructed in accordance with the definition given above:

j[x_,n_]:=Sqrt[Pi/(2x)]J[x,n+1/2]

The spherical Bessel functions may now be determined by calling the function
j[x,n].  The first few of these functions are

j[x,0]

Collect[j[x,1],x^(1/2)]

Collect[j[x,2],x^(1/2)]

Figure 8.1

To generate the two panels in Figure 8.1, we form the respective partial sums of the series in (8.77) and (8.80) and then use Plot to display several of the partial sums over the indicated range of x.  For the series in (8.77), we obtain

S[n_,x_]:=BesselJ[0,x]+2Sum[BesselJ[2i,x],{i,1,n}]

SumPlot[n_]:=Plot[S[n,x],{x,0,20},PlotRange->{-1,2},
     Ticks->{Automatic,Range[-0.5,1.5,0.5]},
     AxesLabel->{x,S},DisplayFunction->Identity]

Show[SumPlot[1],SumPlot[5],SumPlot[10],
     DisplayFunction->$DisplayFunction]

An analogous sequence of commands produces the corresponding diagram for the series in (8.80):

S[n_,x_]:=2Sum[(2i+1)BesselJ[2i+1,x],{i,0,n}]

SumPlot[n_]:=Plot[S[n,x],{x,0,20},PlotRange->{-5,20},
     Ticks->{Automatic,Range[-5,20,5]},
     AxesLabel->{x,S},DisplayFunction->Identity]

Show[SumPlot[1],SumPlot[5],SumPlot[10],
     DisplayFunction->$DisplayFunction]

8.5 Hankel Functions

Figure 8.2

The integral representations derived in this section for the Hankel functions, and the methods used to evaluate them, show that these functions remain valid when the arguments take on complex values.  In fact, the Hankel functions exhibit a very
rich structure in the complex plane and considerable insight into their behavior can be gained by examining various graphical representations of these functions evaluated with complex arguments.  An noteworthy example of this approach is the book by Jahnke and Emde (1945), where contour and surface plots of many special functions may be found.

Plot3D and ContourPlot can be used to evaluate the Hankel functions for complex arguments and the results displayed in one of several ways.  Since the functions are complex-valued for complex arguments, we can plot either the real and imaginary parts (using Real and Im), the modulus and phase of the function (using Abs and Arg) or the modulus and phase together (using PlotVectorField).
 
Two examples of such plots are shown in Figure 8.2 for the Hankel function of the first kind of order zero. At the top of the figure a surface plot of the modulus is
shown, and the corresponding contour plot is displayed at the bottom.  Most
evident in the structure of this function are the singularity at the origin, the
branch cut along the negative real axis and the local minimum near z=-2.4-0.7i.

Plot3D[Abs[BesselJ[0,x+I y]+I BesselY[0,x+I y]],
     {x,-4,1},{y,-1,1},PlotPoints->75,
     PlotRange->{0,4},BoxRatios->{1,1,1},
     ViewPoint->{2.0,2.4,2},Shading->False,
     ClipFill->None]

ContourPlot[Abs[BesselJ[0,x+I y]+I BesselY[0,x+I y]],
     {x,-4,1},{y,-1,1},Contours->35,PlotPoints->100,
     Ticks->{Range[-4,1,1],Range[-1,1,0.5]},
     ContourShading->False]