This module implements Airy functions and their generalized derivatives. It supports symbolic functionality through Maxima and numeric evaluation through mpmath and scipy.
Airy functions are solutions to the differential equation \(f''(x) - x f(x) = 0\).
Four global function symbols are immediately available, please see
airy_ai(): for the Airy Ai function
airy_ai_prime(): for the first differential of the Airy Ai function
airy_bi(): for the Airy Bi function
of the Airy Bi function
AUTHORS:
EXAMPLES:
Verify that the Airy functions are solutions to the differential equation:
sage: diff(airy_ai(x), x, 2) - x * airy_ai(x)
0
sage: diff(airy_bi(x), x, 2) - x * airy_bi(x)
0
Bases: sage.symbolic.function.BuiltinFunction
The generalized derivative of the Airy Ai function
INPUT:
EXAMPLES:
sage: from sage.functions.airy import airy_ai_general
sage: x, n = var('x n')
sage: airy_ai_general(-2, x)
airy_ai(-2, x)
sage: derivative(airy_ai_general(-2, x), x)
airy_ai(-1, x)
sage: airy_ai_general(n, x)
airy_ai(n, x)
sage: derivative(airy_ai_general(n, x), x)
airy_ai(n + 1, x)
Bases: sage.symbolic.function.BuiltinFunction
The derivative of the Airy Ai function; see airy_ai() for the full documentation.
EXAMPLES:
sage: x, n = var('x n')
sage: airy_ai_prime(x)
airy_ai_prime(x)
sage: airy_ai_prime(0)
-1/3*3^(2/3)/gamma(1/3)
Bases: sage.symbolic.function.BuiltinFunction
The class for the Airy Ai function.
EXAMPLES:
sage: from sage.functions.airy import airy_ai_simple
sage: f = airy_ai_simple(x); f
airy_ai(x)
Bases: sage.symbolic.function.BuiltinFunction
The generalized derivative of the Airy Bi function.
INPUT:
EXAMPLES:
sage: from sage.functions.airy import airy_bi_general
sage: x, n = var('x n')
sage: airy_bi_general(-2, x)
airy_bi(-2, x)
sage: derivative(airy_bi_general(-2, x), x)
airy_bi(-1, x)
sage: airy_bi_general(n, x)
airy_bi(n, x)
sage: derivative(airy_bi_general(n, x), x)
airy_bi(n + 1, x)
Bases: sage.symbolic.function.BuiltinFunction
The derivative of the Airy Bi function; see airy_bi() for the full documentation.
EXAMPLES:
sage: x, n = var('x n')
sage: airy_bi_prime(x)
airy_bi_prime(x)
sage: airy_bi_prime(0)
3^(1/6)/gamma(1/3)
Bases: sage.symbolic.function.BuiltinFunction
The class for the Airy Bi function.
EXAMPLES:
sage: from sage.functions.airy import airy_bi_simple
sage: f = airy_bi_simple(x); f
airy_bi(x)
The Airy Ai function
The Airy Ai function \(\operatorname{Ai}(x)\) is (along with \(\operatorname{Bi}(x)\)) one of the two linearly independent standard solutions to the Airy differential equation \(f''(x) - x f(x) = 0\). It is defined by the initial conditions:
Another way to define the Airy Ai function is:
INPUT:
See also
EXAMPLES:
sage: n, x = var('n x')
sage: airy_ai(x)
airy_ai(x)
It can return derivatives or integrals:
sage: airy_ai(2, x)
airy_ai(2, x)
sage: airy_ai(1, x, hold_derivative=False)
airy_ai_prime(x)
sage: airy_ai(2, x, hold_derivative=False)
x*airy_ai(x)
sage: airy_ai(-2, x, hold_derivative=False)
airy_ai(-2, x)
sage: airy_ai(n, x)
airy_ai(n, x)
It can be evaluated symbolically or numerically for real or complex values:
sage: airy_ai(0)
1/3*3^(1/3)/gamma(2/3)
sage: airy_ai(0.0)
0.355028053887817
sage: airy_ai(I)
airy_ai(I)
sage: airy_ai(1.0*I)
0.331493305432141 - 0.317449858968444*I
The functions can be evaluated numerically either using mpmath. which can compute the values to arbitrary precision, and scipy:
sage: airy_ai(2).n(prec=100)
0.034924130423274379135322080792
sage: airy_ai(2).n(algorithm='mpmath', prec=100)
0.034924130423274379135322080792
sage: airy_ai(2).n(algorithm='scipy') # rel tol 1e-10
0.03492413042327323
And the derivatives can be evaluated:
sage: airy_ai(1, 0)
-1/3*3^(2/3)/gamma(1/3)
sage: airy_ai(1, 0.0)
-0.258819403792807
Plots:
sage: plot(airy_ai(x), (x, -10, 5)) + plot(airy_ai_prime(x),
....: (x, -10, 5), color='red')
Graphics object consisting of 2 graphics primitives
References
The Airy Bi function
The Airy Bi function \(\operatorname{Bi}(x)\) is (along with \(\operatorname{Ai}(x)\)) one of the two linearly independent standard solutions to the Airy differential equation \(f''(x) - x f(x) = 0\). It is defined by the initial conditions:
Another way to define the Airy Bi function is:
INPUT:
See also
EXAMPLES:
sage: n, x = var('n x')
sage: airy_bi(x)
airy_bi(x)
It can return derivatives or integrals:
sage: airy_bi(2, x)
airy_bi(2, x)
sage: airy_bi(1, x, hold_derivative=False)
airy_bi_prime(x)
sage: airy_bi(2, x, hold_derivative=False)
x*airy_bi(x)
sage: airy_bi(-2, x, hold_derivative=False)
airy_bi(-2, x)
sage: airy_bi(n, x)
airy_bi(n, x)
It can be evaluated symbolically or numerically for real or complex values:
sage: airy_bi(0)
1/3*3^(5/6)/gamma(2/3)
sage: airy_bi(0.0)
0.614926627446001
sage: airy_bi(I)
airy_bi(I)
sage: airy_bi(1.0*I)
0.648858208330395 + 0.344958634768048*I
The functions can be evaluated numerically using mpmath, which can compute the values to arbitrary precision, and scipy:
sage: airy_bi(2).n(prec=100)
3.2980949999782147102806044252
sage: airy_bi(2).n(algorithm='mpmath', prec=100)
3.2980949999782147102806044252
sage: airy_bi(2).n(algorithm='scipy') # rel tol 1e-10
3.2980949999782134
And the derivatives can be evaluated:
sage: airy_bi(1, 0)
3^(1/6)/gamma(1/3)
sage: airy_bi(1, 0.0)
0.448288357353826
Plots:
sage: plot(airy_bi(x), (x, -10, 5)) + plot(airy_bi_prime(x),
....: (x, -10, 5), color='red')
Graphics object consisting of 2 graphics primitives
References