Chapter 7
Nonconstant Coefficients
We return to second-order linear ODEs, but with nonconstant coefficients. That
is, we consider
(7.1)
y + p(t)y + q(t)y = 0,
with not both p(t) and q(t) constant. The theory developed in Chapter 3 still holds,
and in particular Theorem 3.4 is still valid. Specifically, the general solution is still
y(t) = c1 y1 + c2 y2
with y1 , y2 independent solutions to (7.1) and c1 , c2 arbitrary constants. Unfortunately, there is no method to find explicit formulas for y1 and y2 . There are
however some special cases.
7.1. Reduction of Order
If somehow we are lucky enough to fine one solution to (7.1), then a method exists
to find the other. The method is similar to the technique we employed in the
repeated root section of Chapter 3.1.3, and in deriving the variation of parameters
in Chapter 3.3. Suppose somehow we find y1 solving (7.1). We try to find a second
independent solution by modifying it; y2 = u(t)y1 (t). Substituting this back into
(7.1), we find
u y1 + (2y1 + py1 )u = 0.
Since u does not appear in the ODE, we may immediately integrate. Indeed, set
z = u . Then z satisfies the first-order ODE
y
(7.2)
z + p(t) + 2 1 z = 0.
y1
In principle this can be solved explicitly using methods in Chapter 1.2.
81
82
7. Nonconstant Coefficients
Example 7.1. Consider the second-order, linear, nonconstant coefficient ODE
1+x 1
y + y=0
x
x
x
Note that y1 = e is a solution. To find another independent solution, we reduce
the order. Here p(x) = (1 + x)/x. Equation (7.2) is
y
x1
z = 0.
x
The integrating factor is (Chapter 1.2)
z +
=e
x1
x
dx
ex
.
x
Thus (ex z/x) = 0. That is, u = z = cxex or u = c(xex + ex ), and y2 =
u(x)y1 (x) = u(x)ex = 1 + x. The general solution is therefore
y = c1 ex + c2 (1 + x).
Homework 7.1 (Reduction of Order)
Find the general solution.
1. t2 y 4ty + 6y = 0,
y1 (t) = t2
2. t2 y + 3ty + y = 0,
y1 (t) = t1
3. xy y + 4x y = 0,
y1 (t) = sin x2
y1 (t) = ex
4. xy (x + 1)y + y = 0,
5. x2 y 2xy 4y = 0,
y1 (t) = 1/x
Answers
1. y2 = t
2. y2 = t1 ln t
3. y2 = cos t2
4. y2 = x + 1
5. y2 = x4
7.2. Cauchy-Euler Equations
The Cauchy-Euler equation is a special form of Equation (7.1). It is given by
(7.3)
x2 y + axy + by = 0,
where aand b are real numbers. Note that the powers of x match the number of
derivatives. The may seem fortuitous, but the ODE arises in many physical settings
including heat conduction and electrostatics.
The form of the equation suggests y = x may be a solution. Indeed, y =
x
and y = ( 1)x2 . Putting these in (7.3), we find
1
( 1) + a + b = 0.
83
7.3. Series Solutions
Using the quadratic formula we can solve for . If the roots, r1 , r2 are real, the
general solution is
y = c1 xr1 + c2 xr2 .
If the roots are complex, i, then
y
=
=
=
c1 x xi + c2 x xi
x c1 ei ln x + c2 ei ln x
C1 x cos( ln x) + C2 x sin( ln x),
where C1 = c1 + c2 and C2 = i(c1 c2 ).
Suppose the roots are repeated, r1 = r2 = r. Then we know one solution,
y1 = xr . To find the other solution we employ the method of the previous section.
We find in this case
y = c1 xr + c2 ln(x) xr .
Homework 7.2 (Cauchy-Euler Equations)
Find the (general) solution.
1. 2x2 y + xy 3y = 0,
y(1) = 1, y (1) = 4
2. 4x2 y + 8xy + 17y = 0
3. x2 y 3xy + 4y = 0,
y(1) = 2, y (1) = 3
4. By making the substitution x = et show that (7.3) can be written y + (a
1)y + by = 0, where differentiation is now with respect to t. Note the coefficients are now constant.
Answers
3/2
1. y = 2x
1/2
2. y = c1 x
cos(2 ln x) + c2 x1/2 sin(2 ln x)
3. y = 2x2 7x2 ln |x|
7.3. Series Solutions
There is a general method of finding solutions to (7.1). Let us suppose that the
solution to (7.1) is analytic. That is, we suppose the solution y has a Taylor series
which converges on an interval. Specifically, we suppose
(7.4)
y(x)
= a0 + a1 x + a2 x2 + a3 x3 + + an xn +
X
=
an xn ,
n=0
on some interval containing the origin, or more generally
y(x) =
=
a0 + a1 (x x0 ) + a2 (x x0 )2 + a3 (x x0 )3 + + an (x x0 )n +
X
an (x x0 )n ,
n=0
84
7. Nonconstant Coefficients
on some interval containing x0 . We suppose p(x) and q(x) are analytic as well.
Familiar examples might include
e
X
xn
x3
x2
+
+ =
= 1+x+
2!
3!
n!
n=0
sin x
= x
n
X
(1)n
x3
x5
+
+ =
x2n+1
3!
5!
(2n
+
1)!
n=0
cos x
= 1
n
X
(1)n1 2n
x4
x2
+
+ =
x .
2!
4!
(2n)!
n=0
The idea is to put (7.4) into the ODE and find the coefficients. To do so we will
need some shifting formulas. One can easily verify the following.
y(x)
y (x)
y (x)
(7.5)
=
=
=
=
an xn ,
n=0
n=1
nan xn1 =
(n + 1)an+1 xn,
n=0
n(n 1)an xn2 =
n=2
(n + 1)nan+1 xn1,
n=1
(n + 2)(n + 1)an+2 xn .
n=0
Example 7.2. Find the general solution to
y + y = 0.
Solution. We just have to compute the an in (7.4). Using the formula (7.5), we
get
n2
(n)(n 1)an x
n=2
X
an x =
(n + 2)(n + 1)an+2 + an xn = 0.
n
n=0
n=0
The polynomials on either side of the equation must balance. So, (n + 2)(n +
1)an+2 + an = 0 for n = 0, 1, 2, . . .. This last equation is called an Recurrence
Relation. We can use it to find the coefficients in (7.4). It would also be easy to
use in computations. If we know a0 , then the recurrence relation provides us with
a0 , a2 , a4 . . . and knowledge of a1 gives us a1 , a3 , a5 , . . .. In particular, if we set
a0 = c1 , then
a0
= c1
a2
a4
a2n
a0
=
(0 + 2)(0 + 1)
a2
=
(2 + 2)(2 + 1)
a2n
(2n + 2)(2n + 1)
c1
2
1
c1
a2 =
43
4!
c1
=
(2n)!
85
7.3. Series Solutions
Similarly, if we set a1 = c2 , we find
a1
a3
a5
a2n+1
c2
a1
=
(1 + 2)(1 + 1)
a3
=
(3 + 2)(3 + 1)
a2n+1
(2n + 3)(2n + 2)
c1
32
1
c1
a3 =
54
5!
c1
=
.
(2n + 1)!
Thus the general solution is
x2
x3
x4
x5
y(x) = c1 1
+
+ + c2 x
+
+
2!
4!
3!
5!
= c1 cos x + c2 sin x
as expected.
Example 7.3. Find the series solution to Airys equation
y xy = 0,
y(0) = 1, y (0) = 1.
Solution. Again we put (7.4) into the ode. We find
n(n 1)an xn2 x
n=2
an xn = 0
an1 xn = 0.
n=0
or
(n + 2)(n + 1)an+2 x
n=0
n=1
That is,
2a2 +
X
n=1
(n + 2)(n + 1)an+2 an1 xn = 0.
We see a2 = 0, and the recurrence relation is
(n + 2)(n + 1)an+2 an1 = 0
n 1.
Knowledge of a0 , provides a3 , a6 , a9 . . ., and knowledge of a1 gives us a4 , a7 , a10 . . ..
Thus,
a0
= a0
a3
a6
a9
a0
a0
=
(1 + 2)(1 + 1)
32
a0
a3
=
(4 + 2)(4 + 1)
2356
a6
a0
=
(7 + 2)(7 + 1)
235689
86
7. Nonconstant Coefficients
and
a1
a4
a1
a0
a1
=
(2 + 2)(2 + 1)
43
a0
a4
=
a7 =
(5 + 2)(5 + 1)
3467
a7
a0
a10 =
=
(8 + 2)(8 + 1)
3 4 6 7 9 10
and the general solution is y = a0 y1 + a1 y2 . That is,
x3
x6
x9
y(x) = a0 1 +
+
+
+
23 2356 235689
x7
x10
x4
+
+
+
+a1 x +
3 4 3 4 6 7 3 4 6 7 9 10
n=15
n=30
n=45
n=60
n=75
n=90
-1
-2
-10
-8
-6
-4
X
-2
Figure 1. Polynomial approximations of the solution y1 in Airys Equation.
87
7.3. Series Solutions
Example 7.4. Find the solution to
y + xy + y = 0,
y(0) = 1, y (0) = 0.
We put (7.4) back into the ode and find
X
X
X
n(n 1)an xn2 + x
nan xn1 +
an xn = 0
n=2
or
n=1
(n + 2)(n + 1)an+2 xn +
n=0
n=0
nan xn +
n=0
an xn = 0.
n=0
That is,
X
(n + 2)(n + 1)an+2 + nan + an xn = 0,
n=0
and the recurrence relation is
(n + 2)(n + 1)an+2 + (n + 1)an = 0
or
an
.
n+2
Knowledge of a0 reveals a2 , a4 , . . ., and knowledge of a1 gives us a3 , a5 , . . ..
an+2 =
a0
a2
a4
a6
= a0
a0
a0
=
=
(0 + 2)
2
a0
a2
=
=
2+2
24
a4
a0
=
=
4+2
246
and
a1
a3
a5
a7
a1
a1
a1
=
1+2
3
a3
a1
=
3+2
35
a1
a5
=
.
5+2
357
The general solution is
y(x)
x2
x4
x6
a0 1
+
+
2
24 246
x3
x5
x7
+a1 x
+
+
3
35 357
X
X
(1)n 2n n! 2n+1
(1)n 2n
x
+
a
x
.
a0
1
n
2 n!
(2n + 1)!
n=0
n=0
88
7. Nonconstant Coefficients
Homework 7.3 (Power Series)
Find the recurrence relation on the first four terms in each of two solutions y1 and
y2 (unless the series truncates sooner).
1. y y = 0
2. y xy y = 0
3. (1 x)y + y = 0
4. (1 + x2 )y 4xy + 6y = 0
Partial Answers
1. an+2 = an /(n + 2)(n + 1)
2. an+2 = an /(n + 2)
3. (n + 2)(n + 1)an+2 n(n + 1)an+1 + an = 0 for n 1; a2 = 21 a0
4. y1 = 1 3x2 , y2 = x x3 /3.
Index
asymptotically stable, 76
second order linear ODE, 17
stable critical point, 76
backward Euler, 12
trajectory, 75
Center, 59
Characteristic Polynomial, 20
Complex roots, 21
Convolution, 50
critical point, 75
Critically Damped, 32
unstable critical point), 76
Wronskian, 30
Delta function, 47
Eigenvalues, 55
Eigenvectors, 55
Euler Formula, 21
exponential order, 37
exponentially bounded, 37
Focus, 59
forward Euler, 10
Heaviside function, 42
improved Euler, 14
integrating factor, 4
Jacobian, 76
Laplace transform, 37
linear, 17
ODE, 1
Over Damped, 31
Partial Differential Equation, 1
Phase Portrait, 56
piecewise continuous, 37
piecewise smooth, 37
Real distinct roots, 20
Recurrence Relation, 84
Repeated roots, 23
Saddle, 56
89