Tutorials › Calculus II › Recurrence Relations for ODE Taylor Coefficients

Taylor Methods in Computation · Tutorial 895 of 998

Recurrence Relations for ODE Taylor Coefficients

Learn to generate Taylor coefficients directly from an ODE, use them in a high-order step, and distinguish formal coefficients from a convergent Taylor series.

Advanced 11 min read

What You'll Learn

  • Define ODE Taylor coefficients using derivatives and factorials
  • Derive the coefficient recurrence from \(y'=f(t,y)\)
  • Compute coefficients for autonomous, nonlinear, and time-dependent equations
  • Form and check a finite Taylor step
  • Distinguish formal series calculations from claims of convergence
  • Recognize common indexing and factorial errors

Why Compute Taylor Coefficients from the ODE?

A Taylor method advances an initial-value problem by approximating its solution near a known point. A direct approach would repeatedly differentiate the solution to obtain higher derivatives. But for an equation such as \(y'=f(t,y)\), those derivatives can become complicated quickly, especially when \(f\) is nonlinear.

Instead, we can represent the local Taylor coefficients as unknowns and use the differential equation to determine them one at a time. The key idea is that the coefficient of \(h^n\) in the derivative depends on the next solution coefficient, while the coefficient of \(h^n\) in \(f(t,y)\) can be computed from the coefficients already found.

Central idea: Substitute a Taylor expansion into the differential equation and match coefficients of equal powers. This produces a recurrence for the solution coefficients.

Coefficients and the Recurrence

Consider the initial-value problem \(y'=f(t,y)\), \(y(t_0)=y_0\), and let \(h=t-t_0\). If the solution has the required derivatives, define its Taylor coefficients at \(t_0\) by

$$ a_n=\frac{y^{(n)}(t_0)}{n!}, \qquad a_0=y_0. $$

For now, the associated infinite expression is understood as a formal Taylor series: it records coefficients and does not, by itself, assert that the series converges to the solution. For a finite calculation through degree \(p\), use the Taylor polynomial

$$ P_p(h)=\sum_{n=0}^{p}a_nh^n. $$

Write \(F(h,y)=f(t_0+h,y)\). If the coefficient of \(h^n\) in the formal expansion of \(F(h,\sum_{j\ge 0}a_jh^j)\) is \(c_n\), then the recurrence is

$$ (n+1)a_{n+1}=c_n, \qquad a_{n+1}=\frac{c_n}{n+1}. $$

The coefficient \(c_n\) depends only on \(a_0,\ldots,a_n\). Thus, once \(a_0\) is known, the equation determines \(a_1\), then \(a_2\), and so on. The coefficient notation \([h^n]G(h)\), when used, means “the coefficient of \(h^n\) in \(G(h)\).” In this notation, \(c_n=[h^n]F(h,\sum_{j\ge 0}a_jh^j)\).

Why Matching Coefficients Works

The justification follows directly from the derivative of a power series, or, for a finite computation, from the derivative identities for Taylor coefficients. Differentiating the formal expression term by term gives

$$ \frac{d}{dh}\left(\sum_{n\ge0}a_nh^n\right) = \sum_{n\ge0}(n+1)a_{n+1}h^n. $$

The ODE says this derivative equals \(F(h,y)\). If the coefficient of \(h^n\) on the right is \(c_n\), equality of coefficients requires \((n+1)a_{n+1}=c_n\). This also explains the index shift: the \(h^n\) term of the derivative comes from the \(a_{n+1}h^{n+1}\) term of the solution.

For an actual solution with sufficiently many derivatives, the same relation holds for its finite Taylor coefficients. In particular, the coefficient of \(h^n\) in the Taylor expansion of \(y'\) is \(y^{(n+1)}(t_0)/n!=(n+1)a_{n+1}\), and the ODE supplies the matching coefficient from \(f(t_0+h,y(t_0+h))\). This finite-coefficient argument does not require an infinite Taylor series to converge.

Important condition: A finite Taylor polynomial with a remainder is justified when the solution has the required differentiability near \(t_0\). For example, if \(y\) is \(C^{p+1}\), then \(y(t_0+h)=P_p(h)+O(h^{p+1})\) as \(h\to0\). An infinite Taylor series equals the solution near \(t_0\) only when the solution is analytic there.

Worked Example: A Linear Equation with Explicit Time Dependence

Worked Example: Finding Coefficients for \(y'=t+y\)

Find the Taylor coefficients at \(t_0=0\) for \(y'=t+y\), \(y(0)=1\), through degree four.

Set \(h=t\) and write the formal coefficients as \(a_0,a_1,\ldots\), with \(a_0=1\). The right side is \(h+\sum_{n\ge0}a_nh^n\). Its coefficient of \(h^n\) is \(a_n+1\) when \(n=1\), and \(a_n\) otherwise. Therefore

$$ (n+1)a_{n+1}=a_n+\delta_{n1}, $$

where \(\delta_{n1}=1\) if \(n=1\) and \(0\) otherwise. Compute each coefficient:

$$ a_0=1, \qquad a_1=a_0=1, $$
$$ 2a_2=a_1+1=1+1=2, \qquad a_2=1, $$
$$ 3a_3=a_2=1, \qquad a_3=\frac13, $$
$$ 4a_4=a_3=\frac13, \qquad a_4=\frac1{12}. $$

Thus the degree-four Taylor polynomial is

$$ P_4(h)=1+h+h^2+\frac{h^3}{3}+\frac{h^4}{12}. $$

For a step of \(h=0.1\), calculate each term:

$$ P_4(0.1) =1+0.1+0.01+\frac{0.001}{3}+\frac{0.0001}{12} =1.110341666\ldots. $$

Check the coefficients against the ODE using the exact solution. Solving \(y'-y=t\) gives \(y=2e^t-t-1\): its derivative is \(2e^t-1\), and \(t+y=t+2e^t-t-1=2e^t-1\); also \(y(0)=1\). Its Taylor expansion begins \(1+t+t^2+t^3/3+t^4/12\), confirming the coefficients. At \(t=0.1\), the exact value is \(2e^{0.1}-1.1\approx1.110340371976\), so the degree-four step differs by about \(0.000001294691\). This comparison checks the calculation; the recurrence itself did not require the exact solution.

Worked Example: A Nonlinear Equation

Worked Example: Finding Coefficients for \(y'=y^2\)

Find the coefficients through degree four for \(y'=y^2\), \(y(0)=1\). Here the coefficient of \(h^n\) in \(y^2\) is the convolution sum \(\sum_{k=0}^{n}a_ka_{n-k}\). Hence

$$ (n+1)a_{n+1}=\sum_{k=0}^{n}a_ka_{n-k}. $$

Starting with \(a_0=1\), calculate in order:

$$ a_1=a_0^2=1, $$
$$ 2a_2=a_0a_1+a_1a_0=1+1=2, \qquad a_2=1, $$
$$ 3a_3=a_0a_2+a_1a_1+a_2a_0=1+1+1=3, \qquad a_3=1, $$
$$ 4a_4=a_0a_3+a_1a_2+a_2a_1+a_3a_0=1+1+1+1=4, \qquad a_4=1. $$

Therefore \(P_3(h)=1+h+h^2+h^3\). Taking a third-order step with \(h=0.2\) gives

$$ P_3(0.2)=1+0.2+0.04+0.008=1.248. $$

Check against the exact solution \(y=1/(1-t)\), valid near \(t=0\). Its derivative is \(1/(1-t)^2=y^2\), and its initial value is \(1\). At \(t=0.2\), it equals \(1/0.8=1.25\), differing from the cubic step by \(0.002\). Its geometric expansion \(1+t+t^2+t^3+\cdots\) confirms the coefficients calculated by the recurrence.

Worked Example: Explicit Time Dependence and Nonlinearity

Worked Example: Finding Coefficients for \(y'=ty+t^2\)

Let \(y(0)=1\). The coefficient of \(h^n\) in \(hy\) is zero for \(n=0\), and is \(a_{n-1}\) for \(n\ge1\). The added term \(h^2\) contributes \(1\) when \(n=2\). Thus

$$ (n+1)a_{n+1}= \begin{cases} 0, & n=0,\\ a_{n-1}, & n\ge1,\ n\ne2,\\ a_1+1, & n=2. \end{cases} $$

Now compute successively, beginning with \(a_0=1\):

$$ a_1=0, \qquad 2a_2=a_0=1, \qquad a_2=\frac12, $$
$$ 3a_3=a_1+1=0+1=1, \qquad a_3=\frac13, $$
$$ 4a_4=a_2=\frac12, \qquad a_4=\frac18. $$

The degree-four polynomial is \(P_4(h)=1+h^2/2+h^3/3+h^4/8\). For \(h=0.2\),

$$ P_4(0.2) =1+\frac{0.04}{2}+\frac{0.008}{3}+\frac{0.0016}{8} =1+0.02+0.002666\ldots+0.0002 =1.022866\ldots. $$

Check the recurrence by differentiating the polynomial and comparing coefficients in the ODE. Its derivative is \(P_4'(h)=h+h^2+h^3/2\), while

$$ hP_4(h)+h^2 =h+h^2+\frac{h^3}{2}+\frac{h^4}{3}+\frac{h^5}{8}. $$

The coefficients match through degree three, as required for a degree-four solution polynomial: differentiating \(P_4\) lowers its degree by one. The higher-degree terms on the right reflect coefficients not included in \(P_4\).

Using the Recurrence in a Taylor Step

For an initial value \(y(t_0)=y_0\), once \(a_0,\ldots,a_p\) have been computed, the degree-\(p\) Taylor step to \(t_0+h\) is

$$ y(t_0+h)\approx \sum_{n=0}^{p}a_nh^n. $$

This is a finite approximation. If the solution has \(p+1\) continuous derivatives near \(t_0\), Taylor's theorem gives a remainder of order \(h^{p+1}\) as \(h\) approaches zero. The recurrence supplies the coefficients; the smoothness condition justifies the finite approximation and its remainder statement. Do not infer convergence of an infinite series merely because the recurrence can be continued indefinitely.

For a general right-hand side, a practical calculation forms only the terms needed. For instance, if \(F\) contains products, multiply the truncated polynomials and retain coefficients through the required degree. If \(F\) contains a known smooth function of \(h\), use its Taylor coefficients to the required finite order. This is coefficient arithmetic, not a claim that the resulting infinite series represents the solution.

A Common Factorial and Indexing Mistake

The numbers \(a_n\) are Taylor coefficients, not the derivatives themselves. Since \(a_n=y^{(n)}(t_0)/n!\), omitting the factorial gives incorrect values. For \(y'=y^2\), \(y(0)=1\), the recurrence gives \(a_2=1\). A mistaken calculation might identify \(a_2\) with \(y''(0)\) and conclude \(y''(0)=1\). But differentiating the ODE gives \(y''=2yy'\), so \(y''(0)=2\).

The correction is \(a_2=y''(0)/2!=2/2=1\). The recurrence’s factor \(n+1\) is also essential: \((n+1)a_{n+1}\), not \(a_{n+1}\), is the coefficient of \(h^n\) after differentiating the series. Keeping these two facts separate prevents a common off-by-one error.

Why These Recurrences Matter

Recurrences turn a differential equation into a systematic process for generating local Taylor data. They are especially useful when differentiating the solution repeatedly by hand would be cumbersome, or when the right-hand side has a structure—such as a polynomial or a simple product—that makes coefficient extraction efficient.

The method also makes its assumptions visible. A list of recursively generated coefficients is always useful as formal or finite-order information, but it does not prove that an infinite series converges to the solution. For numerical work, a finite Taylor polynomial is the object used for a step, with its accuracy understood through the differentiability and remainder conditions appropriate to that finite order.

Check Your Understanding

Use the coefficient recurrence and the distinction between formal and convergent series to answer these questions.

  1. For \(y'=f(t,y)\), why does the coefficient of \(h^n\) in \(y'\) equal \((n+1)a_{n+1}\)?
  2. For \(y'=y^2\), \(y(0)=1\), calculate \(a_1\) and \(a_2\) from the convolution recurrence.
  3. For \(y'=t+y\), \(y(0)=1\), what contribution does the explicit \(t\) term make to the coefficient of \(h^n\)?
  4. What differentiability condition justifies a degree-\(p\) Taylor polynomial with an \(O(h^{p+1})\) remainder?
  5. Does generating infinitely many formal coefficients prove that their series converges to the solution? Explain.