LECTURE 5
Taylor Series Methods
In this lecture I shall describe one last general method that is available to use to find approximate solutions
of a first order differential equation.
Recall that the nth order Taylor expansion of a (smooth) function f (x) about the point x = xo is the degree
n polynomial defined by
(5.1) Tn ( x) =
1 f ( ) ( x ) (x −
n
i
xo )
i
i=0
i! o
= 1
f (xo ) + f (xo ) (x − xo ) + f (xo ) (x − xo )
2 + 1 f (x ) (x − x0 )3 + · ··
2 6 o
and that such expansions are extremely useful in that they can (for sufficiently small |x − x0 |) be used as
approximate expressions for the original function f . Indeed, Taylor’s theorem says
f (x) = Tn (x) + O |x − xo |n+1
and that moreover
f (x) = limn→∞ Tn (x)
(so long as f (x) is smooth).
Therefore, one way to get an approximate solution of a differential equations would be to figure out what
its Taylor series looks like and this turns out to be a relatively easy thing to do.
Suppose y(x) is a solution of
(5.2) y = F (x, y)
satisfying the initial condition
(5.3) y (x o ) = y o .
Since x = xo implies y = yo , and because the differential equation tells us what y (x) must be given x and
y, we can infer that
y(xo ) = yo .
Thus, we already know the first two terms of the Taylor expansion of y(x):
y ( x) = y(xo ) + y (xo )(x − x0 ) + ·· ·
= yo + F (xo , yo )(x − xo ) + · ··
1
5. TAYLOR SERIES METHODS 2
What about the higher order terms? To get the second order term we can differentiate the original differential
equation with respect to x to get
d
y (x) =
F (x, y(x))
dx
∂F dx ∂F dy
= ∂x dx
+ ∂y dx
∂F ∂F
= ∂x
+ ∂y
y (x)
∂F
= ∂x
+ ∂F
∂y
F (x, y(x))
So
∂F ∂F
y (xo ) =
+ F (x, y) x = x
∂x x = xo
∂y o
y = yo y = yo
which after carrying out the partial differentiations and plugging in for x and y is just a number. And so
we now have the second order term of the Taylor expansion of our solution y(x) about x = xo . To get the
third order term, we can differentiate the differential equation again to obtain
d2 dy d2
(5.4) y (x) = = 2 F (x, y(x))
dx2 dx dx
So
d2
y (xo ) = 2 F (x, y(x)) x = x
dx o
y = yo
Let’s now look at a specific example.
Example 5.1. Find the first four terms of the Taylor expansion of the solution of
(5.5) y = x + y2
(5.6) y(0) = 1
about x = xo = 0.
Suppose y(x) is a solution of the differential equation (5.5). Its Taylor series about x = 0 is then
(5.7) y(x) = y(0) + y(0)(x − 0) +
1 y (0)(x − 0)2 + 1 y (0)(x − 0)3 + ···
2! 3!
(5.8)
1 1
= y(0) + y (0)x + 2 y (0)x + 6 y (0)x + · ··
2 3
Now the initial condition (5.6) gives us a value f or the first term; namely, y(0) = 1. The differential
equation gives us a value for the factor y (0) in the second term; for Equation (??) says
(5.9) y (x) = x + (y(x))2
so in particular
y(0) = 0 + (y(0))2 = 0 + 12 = 1.
To get the factor y (0) in the third term we differentiate Equation (5.9) with respect to x:
d
(5.10) y (x) = x + (y(x))2
dx
(5.11) = 1 + 2y(x)y (x)
(5.12) = 1 + 2y(x) x + (y(x))2
(5.13) = 1 + 2xy(x) + 2 (y(x))3
5. TAYLOR SERIES METHODS 3
(In passiing from the second line to the third we have again employed Equation (5.9).) At x = 0, we then
have
y (0) = 1 + 2 · 0 · y(0) + 2 (y(0))3
= 1 + 0 + 2 · 13
= 3
To get a number for y (0), we differentiate Equation (5.13) to get
y (x) = 0 + 2y(x) + 2xy (x) + 6 (y(x))2 y (x)
= 0 + 2y(x) + 2x x + (y(x))2 + 6 (y(x))2 x + (y(x))2
= 2y(x) + 2x2 + 2x (y(x))2 + 6x (y(x))2 + 6 (y(x))4
Evaluating this equation at x = 0 yields
y (0) = 2y(0) + 2 · 02 + 2 · 0 · (y(0))2 + 6 · 0 · (y(0))2 + 6 (y(0))4
= 2 · 1 + 0 + 0 + 0 + 6 · 14
= 2+6
= 8
Finally, we can plug the values we found for y(0), y (0), y (0), and y (0) into the right hand side of Equation
(5.8) to get
1 1
y(x) = 1 + 1 · x + · 3 · x2 + · 8 · x3 + · ··
2 6
3 4
= 1 + x + 2 x + 3 x + · ··
2 3
which we would could then view as an approximate solution of the intial value problem, accurate to order
x4 .