Main Content

whittakerW

Whittaker W function

Description

whittakerW(a,b,z) returns the value of the Whittaker W function.

example

Examples

Compute Whittaker W Function for Numeric Input

Compute the Whittaker W function for these numbers. Because these numbers are not symbolic objects, you get floating-point results.

[whittakerW(1, 1, 1), whittakerW(-2, 1, 3/2 + 2*i),...
whittakerW(2, 2, 2), whittakerW(3, -0.3, 1/101)]
ans =
   1.1953            -0.0156 - 0.0225i   4.8616            -0.1692

Compute Whittaker W Function for Symbolic Input

Compute the Whittaker W function for the numbers converted to symbolic objects. For most symbolic (exact) numbers, whittakerW returns unresolved symbolic calls.

[whittakerW(sym(1), 1, 1), whittakerW(-2, sym(1), 3/2 + 2*i),...
whittakerW(2, 2, sym(2)), whittakerW(sym(3), -0.3, 1/101)]
ans =
[ whittakerW(1, 1, 1), whittakerW(-2, 1, 3/2 + 2i),
whittakerW(2, 2, 2), whittakerW(3, -3/10, 1/101)]

For symbolic variables and expressions, whittakerW also returns unresolved symbolic calls:

syms a b x y
[whittakerW(a, b, x), whittakerW(1, x, x^2),...
whittakerW(2, x, y), whittakerW(3, x + y, x*y)]
ans =
[ whittakerW(a, b, x), whittakerW(1, x, x^2),
whittakerW(2, x, y), whittakerW(3, x + y, x*y)]

Solve ODE for Whittaker Functions

Solve this second-order differential equation. The solutions are given in terms of the Whittaker functions.

syms a b w(z)
dsolve(diff(w, 2) + (-1/4 + a/z + (1/4 - b^2)/z^2)*w == 0)
ans =
C2*whittakerM(-a, -b, -z) + C3*whittakerW(-a, -b, -z)

Verify Whittaker Functions are Solution of ODE

Verify that the Whittaker W function is a valid solution of this differential equation:

syms a b z
isAlways(diff(whittakerW(a, b, z), z, 2) +...
(-1/4 + a/z + (1/4 - b^2)/z^2)*whittakerW(a, b, z) == 0)
ans =
  logical
   1

Verify that whittakerW(-a, -b, -z) also is a valid solution of this differential equation:

syms a b z
isAlways(diff(whittakerW(-a, -b, -z), z, 2) +...
(-1/4 + a/z + (1/4 - b^2)/z^2)*whittakerW(-a, -b, -z) == 0)
ans =
  logical
   1

Compute Special Values of Whittaker W Function

The Whittaker W function has special values for some parameters:

whittakerW(sym(-3/2), 1/2, 0)
ans =
4/(3*pi^(1/2))
syms a b x
whittakerW(0, b, x)
ans =
(x^(b + 1/2)*besselk(b, x/2))/(x^b*pi^(1/2))
whittakerW(a, -a + 1/2, x)
ans =
x^(1 - a)*x^(2*a - 1)*exp(-x/2)
whittakerW(a - 1/2, a, x)
ans =
(x^(a + 1/2)*exp(-x/2)*exp(x)*igamma(2*a, x))/x^(2*a)

Differentiate Whittaker W Function

Differentiate the expression involving the Whittaker W function:

syms a b z
diff(whittakerW(a,b,z), z)
ans =
- (a/z - 1/2)*whittakerW(a, b, z) -...
whittakerW(a + 1, b, z)/z

Compute Whittaker W Function for Matrix Input

Compute the Whittaker W function for the elements of matrix A:

syms x
A = [-1, x^2; 0, x];
whittakerW(-1/2, 0, A)
ans =
[ -exp(-1/2)*(ei(1) + pi*1i)*1i,...
   exp(x^2)*exp(-x^2/2)*expint(x^2)*(x^2)^(1/2)]
[  0,...
             x^(1/2)*exp(-x/2)*exp(x)*expint(x)]

Input Arguments

collapse all

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

If a is a vector or matrix, whittakerW returns the beta function for each element of a.

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

If b is a vector or matrix, whittakerW returns the beta function for each element of b.

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

If x is a vector or matrix, whittakerW returns the beta function for each element of z.

More About

collapse all

Whittaker W Function

The Whittaker functions Ma,b(z) and Wa,b(z) are linearly independent solutions of this differential equation:

d2wdz2+(14+az+1/4b2z2)w=0

The Whittaker W function is defined via the confluent hypergeometric functions:

Wa,b(z)=ez/2zb+1/2U(ba+12,1+2b,z)

Tips

  • All non-scalar arguments must have the same size. If one or two input arguments are non-scalar, then whittakerW expands the scalars into vectors or matrices of the same size as the non-scalar arguments, with all elements equal to the corresponding scalar.

References

[1] Slater, L. J. “Confluent Hypergeometric Functions.” Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. (M. Abramowitz and I. A. Stegun, eds.). New York: Dover, 1972.

Version History

Introduced in R2012a