Why this matters for simulation: Bessel functions describe the vibration of a drumhead and flow in round pipes.
By the end of this lesson you can…
Substitute $y = \sum a_nt^n$ into a linear equation, shift indices and read off a recurrence relation for the coefficients.
Derive the Airy recurrence $a_{n+3} = a_n/((n+3)(n+2))$, explain why only every third coefficient is nonzero in each family, and compare the series with scipy's Airy function.
Predict a radius of convergence from the complex singularities of the coefficient functions and from the coefficient ratio, and demonstrate numerically that partial sums diverge outside it.
Solve Euler's equation through its indicial equation $r(r-1) + \alpha r + \beta = 0$, and explain why a repeated root brings a logarithm.
Derive the Frobenius series for Bessel's equation of order 0, obtain $J_0$ and its first zeros, and say why the second solution has a $\ln t$ term.
Derive Legendre's recurrence and show that integer $n$ gives polynomial solutions $P_n$.
Measure how much accuracy a float64 Taylor sum loses to cancellation, and say when to use a solver or a special-function library instead.
Every equation so far had constant coefficients, which is what made ert an eigenfunction. Variable coefficients break that: Airy’s y′′=ty describes a wave whose local frequency changes with position, and Bessel’s t2y′′+ty′+t2y=0 describes a round drumhead. Neither has a solution built from exponentials and powers. What survives is the idea behind 2.4 Taylor Series in One and Several Variables: a smooth solution is a power series, and the equation tells us the coefficients one at a time. This lesson turns that idea into a recipe (recurrence relations), finds out how far the result can be trusted (the radius of convergence), extends it to equations with a singular point (the Frobenius method), and ends with a numerical warning that matters for anyone who evaluates series on a computer. It builds on 5.1 Second-Order Linear Equations: Structure and 5.7 Higher-Order Linear Equations, and is the last lesson of the module.
▶ VideoPlugging in a power series, the Airy recurrence, partial sums converging and then diverging past the radius, Euler's indicial equation, J0 and its zeros, and cancellation in float64captions only
Transcript
Airy's and Bessel's equations have no exponential solutions, so try a power series and let the equation find the coefficients. The ratio test gives a radius, one over L: infinite for e to the t, but 1 for one over one plus t squared.
Put the series into Airy's equation and shift indices until every sum has t to the n. The constant term forces a 2 to be zero; every other power gives a n plus 3 equals a n over n plus 3 times n plus 2.
The recurrence links indices three apart: three chains, and the one from a 2 stays zero. The others give 1, 1 over 6, 1 over 180, 1 over 12960, and 1, 1 over 12, 1 over 504, 1 over 45360. The Wronskian is 1, and the radius is infinite.
With a 0 and a 1 equal to Ai at zero, about 0.355, and Ai prime at zero, about minus 0.259, the series is the Airy function. An error below 10 to the minus 10 needs degree 16 at t equals 1, 24 at t equals 2, 51 at t equals minus 5.
Tame coefficients can hide a short radius. In one plus t squared times y double prime plus y equals zero, the coefficient blows up at plus or minus i, distance 1 from the origin, and the recurrence factor tends to minus 1: the radius is exactly 1.
Sum to degree 10, 20, 40, 80 and 160 and compare with a solver. At t equals 0.9 the error falls to about 1.5 times 10 to the minus 12; at 1.2 it grows to about 1.9 times 10 to the 8; at t equals 2 it reaches 8.26 times 10 to the 43.
Near a regular singular point, Euler's equation is the model. Try t to the r: the indicial equation r times r minus 1 plus alpha r plus beta equals zero. A double root, r equals 2, brings a log: t squared times one minus 2 ln t, and y of 2 is about minus 1.5452.
Bessel of order zero has indicial equation r squared equals zero. With r equals 0, a n equals minus a n minus 2 over n squared, so only even terms survive, and J zero is 1 minus t squared over 4 plus t to the fourth over 64.
Root-finding gives the zeros 2.404826, 5.520078 and 8.653728. The 8-term partial sum, degree 14, gets the first zero but puts the second at 5.539919, off by 0.02. From memory, a drum's modes have frequency ratios 1, 2.2954, 3.5985, 4.9033: not whole numbers, so no pitch.
A double root gives one Frobenius series. Abel gives W equals C over t, so y 2 equals J zero times the integral of dt over t J zero squared. Near zero that is like the integral of 1 over t: a ln t. From memory, Y zero at 10 to the minus 6 is minus 8.869031, matching the log.
Legendre's numerator, k times k plus 1 minus n times n plus 1, vanishes at k equals n, so for integer n the chain stops. P 2 is 3 t squared minus 1 over 2, P 3 is 5 t cubed minus 3 t over 2, with exact residual 0.
For J zero at t equals 20 the terms grow to 7.6 times 10 to the 6, yet the answer is 0.167, so 7.7 digits are lost. The table compares float64 with exact fractions; digits lost is log ten of the largest term over the answer.
At t equals 40, the largest term is 1.9 times 10 to the 15: 17.4 digits lost, more than float64 holds. The sum returns minus 0.0901; the truth is plus 0.00737. Series are local tools: use libraries or solvers for numbers, series for structure. Next: Laplace transforms.
Power series, a recap
A power series about t0 is ∑n≥0cn(t−t0)n. If ∣cn+1/cn∣→L (or ∣cn∣1/n→L), the ratio test says the series converges absolutely for ∣t−t0∣<1/L and diverges for ∣t−t0∣>1/L. That number ρ=1/L is the radius of convergence (ρ=∞ if L=0); the endpoints must be checked by hand. Inside the radius we may differentiate term by term, (∑cntn)′=∑ncntn−1 (Calc II, from memory), and a power series that is zero on an interval has all cn=0. The second fact lets us match coefficients of each power separately, the whole basis of the method.
For et, cn+1/cn=1/(n+1)→0, so ρ=∞. For 1/(1+t2)=∑(−1)kt2k the ratio of consecutive nonzero terms is t2 in magnitude, so ρ=1, although the function is smooth on the whole real line (the cause was discussed in 2.4 Taylor Series in One and Several Variables, and returns below).
Solutions near an ordinary point
Write the equation in standard form y′′+p(t)y′+q(t)y=0. A point t0 is ordinary if p and q both have convergent power series about t0. The theorem (Boyce and DiPrima, stated here without proof, from memory) says that near an ordinary point every solution is a power series y=∑an(t−t0)n with a0=y(t0) and a1=y′(t0) free, converging at least as far as the series of p and q do. For rational p,q that distance is the distance from t0 to the nearest singularity of p or q in the complex plane.
The recipe, for t0=0:
Put y=∑n≥0antn, so y′=∑nantn−1 and y′′=∑n(n−1)antn−2.
Substitute, and shift indices until every sum is written with tn. For example ∑n≥2n(n−1)antn−2=∑n≥0(n+2)(n+1)an+2tn.
Collect the coefficient of each tn and set it to 0. This gives a recurrence relation: an equation for an+2 (or an+3) in terms of earlier coefficients.
Choose a0,a1 freely and generate the rest.
The Airy equation
Take y′′=ty. Then y′′=∑(n+2)(n+1)an+2tn and ty=∑antn+1=∑n≥1an−1tn. The powers match as follows.
Coefficient of t0: the right side has no constant term, so 2⋅1⋅a2=0 and a2=0.
Coefficient of tn, n≥1: (n+2)(n+1)an+2=an−1. Replacing n by n+1,
an+3=(n+3)(n+2)an.
The recurrence links indices three apart, so there are three independent chains: a0,a3,a6,… and a1,a4,a7,… and a2,a5,a8,…. The last chain starts at a2=0 and is zero forever. Two chains survive, each fed by one free constant:
(for example a9=a6/(9⋅8)=1/(180⋅72)=1/12960). So y=a0f+a1g=y(0)f+y′(0)g. Their Wronskian at 0 is f(0)g′(0)−f′(0)g(0)=1, so they are independent. Because ∣an+3tn+3∣/∣antn∣=∣t∣3/((n+3)(n+2))→0 for every t, the radius is infinite, as promised by the theorem: p=0 and q=−t have no singularities.
All coefficients are positive, so for t>0 both f and g grow without bound. For t<0 the equation reads y′′=−∣t∣y, an oscillator whose frequency ∣t∣ increases as we go left, so the solutions oscillate faster and faster. The Airy functionAi(t) is the combination that decays for t>0; it has Ai(0)=0.3550280538878172 and Ai′(0)=−0.2588194037928068 (both from scipy.special.airy). In the sim below you can see its partial sums; in the exercise you build them yourself.
🧪 Coding exerciseExercise: Airy coefficients from the recurrence, compared with scipy.special.airy✓ passed
⌘/Ctrl + Enter
💡 Cumulative partial sums: S = np.cumsum(a * t ** np.arange(len(a))). Then degree_needed is the last index where the error is still too big, plus 1.
With the cell completed, it reports degrees 16, 24 and 51 at t=1,2,−5 for an error below 10−10: the farther from the center, the more terms, because the terms ∣antn∣ must first grow before they shrink.
A finite radius
An equation with perfectly tame real coefficients can still have a short radius. Take (1+t2)y′′+y=0, in standard form y′′+1+t21y=0. The origin is ordinary. The function 1/(1+t2) is singular where 1+t2=0, at t=±i, a distance 1 from the origin, so the theorem guarantees ρ≥1. Expand (1+t2)∑n(n−1)antn−2+∑antn=0 and collect tn:
For large n this ratio tends to −1, so ∣an+2tn+2∣/∣antn∣→t2. The ratio test then gives convergence for ∣t∣<1 and divergence for ∣t∣>1: the radius is exactly 1 for the solution with y(0)=1, y′(0)=0. No feature on the real axis announces this; the singularities live in the complex plane, which is why a series can fail at a place where the solution looks harmless.
The lab cell below sums the series to degrees 10,20,40,80,160 and compares with DOP853 at tolerance 10−13. At t=0.9 the errors fall steadily, from 2.34×10−3 (degree 10) to 1.51×10−12 (degree 160). At t=1.2 they grow: 5.76×10−2, 9.62×10−2, 9.53×10−1, then 3.56×102 and 1.94×108 at degree 160. At t=2 the degree-160 partial sum is off by 8.26×1043 (the reference there is −0.1708804675). At the boundary t=1 the error shrinks, but slowly: 7.63×10−3 at degree 10 and 3.51×10−5 at degree 160. More terms make things worse outside the radius, because the individual terms no longer tend to zero.
◆ InteractiveRaise the degree N and watch the partial sums converge, or fail to, against an RK4 reference
Loading simulation…
On the sim’s finite radius preset with N=40, the maximum error on [−0.9,0.9] is 7.167×10−6 (the lab’s t=0.9 row), but on [−1.6,1.6] it is 1.170×105. The sim also estimates the radius from the coefficients, ρ≈(∣am−2∣/∣am∣)1/2 for the last two nonzero coefficients. At N=10 it reads 1.2566, at N=40 it reads 1.0530 and at N=160 it reads 1.0127: it creeps toward 1, because ∣an/an+2∣1/2≈1+2/n for the lower index n (at n=158 that is 1.0127). A coefficient ratio can only show a trend, never an exact radius. Switch to the Airy and Bessel presets: there the estimate keeps growing with N (for Bessel it equals the highest even degree kept, m, exactly, since ∣am−2/am∣=m2), the signature of an infinite radius.
🐍 PythonLab: partial sums versus DOP853, zeros of J0, float64 cancellation, and the second Bessel solution (blocks A to D)
⌘/Ctrl + Enter
Regular singular points and the Frobenius idea
Bessel’s equation t2y′′+ty′+t2y=0, in standard form y′′+t1y′+y=0, has p=1/t, which blows up at 0, so 0 is not ordinary. A power series can fail there (we will see lnt). The point is nevertheless tame: tp(t) and t2q(t) are analytic at 0. Such a point is a regular singular point: near it the equation looks like y′′+(p0/t)y′+(q0/t2)y=0, with p0=limtp and q0=limt2q.
That model equation is Euler’s equationt2y′′+αty′+βy=0. Its coefficients scale with t, which suggests a power of t. With y=tr (for t>0),
t2⋅r(r−1)tr−2+αt⋅rtr−1+βtr=[r(r−1)+αr+β]tr,
so y=tr is a solution exactly when
r(r−1)+αr+β=0,
the indicial equation. Example: t2y′′+2ty′−6y=0 gives r2+r−6=(r−2)(r+3)=0, so y=c1t2+c2t−3. One solution is smooth at the origin and the other blows up, which is typical.
To see what a repeated or complex root does, substitute s=lnt and u(s)=y(t). Then ty′=us and t2y′′=uss−us, so the equation becomes the constant-coefficient equation uss+(α−1)us+βu=0, whose characteristic polynomial is r2+(α−1)r+β=r(r−1)+αr+β. This is the indicial equation again. By 5.2 Constant Coefficients & the Characteristic Equation, a double root r gives u=(c1+c2s)ers, that is,
y=tr(c1+c2lnt),
and roots a±ib give tacos(blnt) and tasin(blnt), which oscillate infinitely often as t→0+. The logarithm is the mechanism behind every “repeated indicial root” below.
Frobenius’ idea (from memory for the general theorem): at a regular singular point, look for y=tr∑n≥0antn with a0=0. The lowest power of t in the substituted equation has coefficient a0[r(r−1)+p0r+q0], so r must satisfy the indicial equation; the higher powers give a recurrence for an. The larger root always yields a series solution; the second solution may need a lnt term when the roots are equal or differ by an integer.
Bessel’s equation of order 0
Here p0=1 and q0=0, so the indicial equation is r(r−1)+r=r2=0: a double root r=0. Insert y=∑antn+r:
and the coefficient of tn+r is (n+r)2an+an−2=0 for n≥2, while n=1 gives (1+r)2a1=0. With r=0: a1=0 and an=−an−2/n2. So only even indices survive, a2k=−a2k−2/(2k)2, and with a0=1:
J0(t)=k=0∑∞(k!)2(−1)k(2t)2k=1−4t2+64t4−⋯.
The ratio of terms is t2/(4k2)→0, so the radius is infinite. J0 is even, has J0(0)=1 and oscillates like a damped cosine. Its first three positive zeros, from jn_zeros and (in block B) from root-finding on the 60-term series, are
2.404826,5.520078,8.653728.
Partial sums find the zeros one at a time: the degree-14 polynomial (8 terms) has its first zero at 2.404826 already, but its second at 5.539919, off by 0.02.
Why not a second series? A double root gives only one Frobenius series. To find the other solution, use Abel’s theorem (5.1 Second-Order Linear Equations: Structure): for y′′+y′/t+y=0, W=Ce−∫dt/t=C/t. Reduction of order gives y2=J0∫tJ02dt. Near 0, J02→1, so the integrand behaves like 1/t and the integral like lnt. The second solution therefore has a logarithmic singularity, as in the trlnt of Euler’s equation. Block D checks the shape: Y0(10−6)=−8.869031 against π2(ln(t/2)+γ)=−8.869031, where γ=0.5772156649 is Euler’s constant and Y0≈π2(ln2t+γ)J0+⋯ is the standard form (from memory). Wherever the solution must stay bounded at t=0, only J0 is allowed.
Legendre’s equation
(1−t2)y′′−2ty′+n(n+1)y=0 has p=−2t/(1−t2) and q=n(n+1)/(1−t2), singular at t=±1. The origin is ordinary, and the theorem guarantees ρ≥1. Substituting y=∑aktk and collecting tk:
The numerator vanishes at k=n. For integer n, that chain therefore stops: an+2=an+4=⋯=0, and one of the two families is a polynomial of degree n. (The other family never terminates and has ratio →1, so it diverges at t=±1; from memory, logarithmically.) Normalize so that Pn(1)=1.
n=2, start the even chain at a0: a2=20−6a0=−3a0, a4=126−6a2=0. With a0=−21: P2=23t2−1.
n=3, start the odd chain at a1: a3=62−12a1=−35a1, a5=0. With a1=−23: P3=25t3−3t.
The lab cell below builds Pn from the recurrence and checks the differential equation. Both residuals come out exactly 0 in exact (rational) arithmetic; evaluated in float64 at 200 points of [−1,1] the largest residual is 0 for P2 and 7.1×10−15 for P3. From memory, ∫−11PmPndt=0 for m=n (orthogonality, the basis of later lessons on generalized Fourier series), and the Pn give the angular dependence of solutions of Laplace’s equation in spherical coordinates, the starting point of spherical harmonics.
🐍 PythonLab: Legendre polynomials from the recurrence; residual of the equation in exact and in float arithmetic
⌘/Ctrl + Enter
Numerical honesty: cancellation
A convergent series is not automatically a good algorithm. Look at J0(20). The terms (t/2)2k/(k!)2 grow until k=9, where the term is 7.6×106, and only then decay; the answer is J0(20)=0.1670246643. Adding numbers of size 107 with alternating signs to get 0.17 throws away digits: float64 carries about 16, so only about 16−7.7≈8 digits survive (the measured error 7.8×10−11 on an answer of 0.167 corresponds to about 9). Block C compares float64 summation with exact rational arithmetic (Python’s Fraction, 200 terms):
t
largest term
digits lost
float64 error
5
9.8
1.7
1.7×10−16
10
6.8×102
3.4
2.3×10−14
20
7.6×106
7.7
7.8×10−11
30
1.1×1011
12.1
1.2×10−5
40
1.9×1015
17.4
9.7×10−2
Here “digits lost” is log10(largest term/∣J0∣). At t=40 it exceeds 16: float64 returns −0.0901, but the true value is +0.00737. The error is not a truncation error (the series was summed to convergence) and not a convergence failure (the radius is infinite); it is rounding error, of order ε×(largest term), amplified because nothing in the sum is small. Library routines such as scipy.special.j0 avoid the problem (their errors in block C are below 10−16 at every row); the algorithms are different, and I only know the general idea (from memory).
The sim shows the same tradeoff. On the Bessel preset with window W=20, N=60 gives a maximum error of 1.346×10−6, truncation still dominant; N=150 gives 1.200×10−9, and more terms will not help, since the readout says the float64 floor, about 1.1×10−16 times the largest term 7.59×106, is 8.35×10−10. The lab’s 7.8×10−11 at t=20 is smaller than the sim’s number because the two sums round differently (the sim uses Horner’s rule and a separate RK4 reference); both are within an order of magnitude of ε×(largest term). That product is a scale, not a guarantee.
Check yourself
✅ Concept check
For $(t^2 + 6t + 13)y'' + ty' + y = 0$, what is the largest radius of convergence about $t_0 = 0$ that the ordinary-point theorem guarantees? (Give a number.)
Why: The leading coefficient vanishes where t^2 + 6t + 13 = 0, i.e. t = -3 plus or minus 2i. The distance from 0 to -3 + 2i is sqrt(9 + 4) = sqrt(13), about 3.6056. Real-axis behavior is irrelevant: only the complex singularities count.
✅ Concept check
In the Airy series, with $a_0$ and $a_1$ arbitrary, why is $a_5 = 0$?
Why: Three chains by index mod 3; the one that starts at a_2 = 0 is zero, so exactly two independent solutions come from a_0 and a_1.
✅ Concept check
The 200-term series for $J_0(40)$ in float64 returns $-0.0901$, but the true value is $+0.00737$. Why?
Why: Truncation was not the cause: exact arithmetic on the same terms is fine. The loss is cancellation: absolute error is about 1e-16 times the largest term.
Problems
✏️ Pen & paperA series with a closed form●○○
Solve y′′−ty′−y=0 near t0=0 with y(0)=1, y′(0)=0. (a) Derive the recurrence. (b) Find a2,a4,a6,a8 and recognize the series. (c) Add the terms through t8 at t=1 and compare with the closed form. What is the radius of convergence?
Show worked solution
(a) y′′=∑(n+2)(n+1)an+2tn, ty′=∑nantn and y=∑antn. The coefficient of tn gives (n+2)(n+1)an+2−nan−an=0, so (n+2)(n+1)an+2=(n+1)an and
an+2=n+2an.
(b) a1=0 gives all odd coefficients zero. With a0=1: a2=21, a4=2⋅41=81, a6=2⋅4⋅61=481, a8=3841. In general a2k=1/(2kk!), so y=∑k(t2/2)k/k!=et2/2. Check: y′=ty, hence y′′=y+ty′=y+t2y, and ty′+y=t2y+y. Yes.
(c) At t=1 the sum through t8 is 1+21+81+481+3841=128211=1.6484375, against e1/2=1.6487212707, an error of 2.84×10−4 (the first omitted term is 1/3840=2.6×10−4). Since an+2/an=1/(n+2)→0, the radius is infinite, as expected from p=−t and q=−1 having no singularities.
✏️ Pen & paperEuler's equation with a repeated root●●○
Solve t2y′′−3ty′+4y=0 for t>0 with y(1)=1, y′(1)=0. Where does y first cross zero, and what is y(2)?
Show worked solution
Here α=−3 and β=4, so the indicial equation is r(r−1)−3r+4=r2−4r+4=(r−2)2: a double root r=2. By the substitution s=lnt the equation becomes uss−4us+4u=0, with solution u=(c1+c2s)e2s, that is, y=t2(c1+c2lnt). Then y(1)=c1=1. Differentiating, y′=2t(c1+c2lnt)+tc2, so y′(1)=2c1+c2=0 and c2=−2:
y=t2(1−2lnt).
It crosses zero where lnt=21, at t=e1/2=1.6487212707. At t=2: y(2)=4(1−2ln2)=−1.5451774445, which matches solve_ivp (relative tolerance 10−12) to 3.5×10−13. Without the logarithm, the single solution t2 could not meet both initial conditions.
✏️ Pen & paperA terminating series●●○
Consider y′′−2ty′+6y=0. (a) Derive the recurrence. (b) Show that the solution with y(0)=0, y′(0)=−12 is a polynomial, and find it. (c) Check it in the equation at t=1. (d) Is the family started at a0 a polynomial? What is its radius of convergence?
Show worked solution
(a) The coefficient of tk is (k+2)(k+1)ak+2−2kak+6ak=0, so
ak+2=(k+2)(k+1)2k−6ak.
(b) With a0=0 the even chain is zero. From a1=−12: a3=3⋅22−6(−12)=8 and a5=5⋅46−6a3=0, and everything beyond vanishes. So y=8t3−12t.
(c) At t=1: y=−4, y′=24t2−12=12, y′′=48t=48, and 48−2⋅1⋅12+6⋅(−4)=0. Yes.
(d) The numerator 2k−6 vanishes only at k=3, which is odd, so the even chain never stops: a2=−3a0, a4=124−6a2=2a0, and so on. Since ak+2/ak∼2/k→0, the radius is infinite. This is the same mechanism as Legendre’s equation: the series terminates when the numerator of the recurrence vanishes on the chain’s own parity.
Key Takeaways
A power series y=∑antn inserted into a linear equation, with indices shifted so that every sum has tn, turns the ODE into a recurrence for the coefficients, with a0=y(0) and a1=y′(0) free.
For Airy’s y′′=ty, a2=0 and an+3=an/((n+3)(n+2)): three index chains, two of them live, giving f=1+t3/6+⋯ and g=t+t4/12+⋯ with infinite radius.
The radius of convergence is at least the distance from the center to the nearest complex singularity of the coefficient functions; (1+t2)y′′+y=0 has radius exactly 1 (ratio of consecutive coefficients tends to −1), and partial sums blow up at t=1.2 and beyond.
At a regular singular point, try tr∑antn; the lowest power gives the indicial equation r(r−1)+p0r+q0=0. For Euler’s equation y=tr is exact, and a double root gives trlnt (via s=lnt).
Bessel order 0 has a double indicial root r=0: J0=∑(−1)k(t/2)2k/(k!)2 with zeros 2.404826, 5.520078, 8.653728; the second solution carries lnt (from W=C/t and reduction of order).
Legendre’s recurrence ak+2=[k(k+1)−n(n+1)]ak/((k+2)(k+1)) terminates for integer n, giving P2=(3t2−1)/2 and P3=(5t3−3t)/2.
Summing a Taylor series in float64 loses roughly log10(largest term/∣y∣) digits: 7.7 at J0(20), and all of them by t=40. Convergence in exact arithmetic is not an algorithm.
A series solution is a local tool. For computation, use special-function libraries and ODE solvers, and use the series for structure and understanding.
Finished this lesson?
Mark it complete to track your progress (saved in this browser). Reading every section does this for you.