Solutions - UCI Math

Midterm Review Problems
1. Find as a power series the general solution to the equation y 00 − xy 0 − 2y = 0.
P∞
P∞
n
0
n−1
WeP
assume the solution takes the form
y(x)
=
c
x
.
Then
y
=
,
n
n=0
n=1 ncn x
P∞
∞
00
n−2
0
n
y = n=2 n(n − 1)cn x , and xy = n=1 ncn x , so the ODE takes the form
∞
X
n(n − 1)cn x
n−2
−
n=2
∞
X
n
ncn x −
n=1
∞
X
2cn xn = 0.
n=0
P∞
n
n=0 (n+2)(n+1)cn+2 x ,
By re-indexing (replacing n by n+2) the first series as
that we’re free to start the second series at n = 0, and combining, we get
X
[(n + 1)(n + 2)cn+2 − (n + 2)cn ] xn = 0.
observing
n=0
Equating coefficients of like powers of x on both sides, we get the algebraic system
(n + 1)(n + 2)cn+2 − (n + 2)cn = 0,
which gives the recursion relation
1
cn .
n+1
Thus every even-order coefficient is determined by c0 and every odd-order coefficient
1
1
1
from c1 . More precisely c2 = 11 c0 , c4 = 13 c2 = 3·1
c0 , c6 = 5·3·1
c4 = 15
c0 , c8 = 71 c6 =
1
1
1
1
c . . ., while c3 = 12 c1 , c5 = 41 c3 = 4·2
c1 , c7 = 16 c5 = 6·4·2
c1 , c9 = 18 c7 = 8·6·4·2
c1 , . . ., so
7·5·3·1 0
the general solution is
1 6
1
1 4
8
2
y(x) = c0 1 + x + x +
x +
x + ···
3
5·3
7·5·3
1 5
1
1
1 3
7
9
+ c1 x + x +
x +
x +
x + ··· .
2
4·2
6·4·2
8·6·4·2
cn+2 =
Incidentally this can P
be written more compactly using the double factorial : y(x) =
P
∞
1
1
2n
2n+1
c0 n=0 (2n−1)!! x + c1 ∞
, but you’re not expected to be familiar with this
n=0 (2n)!! x
notation, and in any case if I give you a problem like this on the exam, I would ask for
just the first few (maybe four) nonzero terms.
2. Find as a power series the general solution to the equation y 00 − 2xy 0 + y = 0.
Assuming y(x) =
P∞
∞
X
n=2
n=0 cn x
n
, the equation becomes
n(n − 1)cn x
n−2
−
∞
X
n=1
n
2ncn x +
∞
X
n=0
cn xn = 0.
Much like the last problem we can rewrite this as
∞
X
[(n + 2)(n + 1)cn+2 + (1 − 2n)cn ] xn = 0,
n=0
from which we get the recursion relation
cn+2 =
2n − 1
cn ,
(n + 1)(n + 2)
3
7
so c2 = −1
c , c4 = 4·3
c2 = −3
c , c6 = 6·5
c4 = −7·3
, . . .,
2 0
4! 0
6!
9·5·1
9
c7 = 7·6 c5 = 7! c1 , . . ., so the general solution can be
1 2 3·1 4 7·3·1 6
y(x) = c0 1 − x −
x −
x · · · +c1 x +
2
4!
6!
while c3 =
written
1
c,
3·2 1
c5 =
5
c
5·4 3
=
5·1
c,
5! 1
1 3 5·1 5 9·5·1 7
x +
x +
x + ···
3!
5!
7!
.
3. Find the general solution to the ODE y 0 = x2 y.
This equation is separable, so we take the following steps to solve it:
dy
= x2 y
dx
y −1 dy = x2 dx
1
ln |y| = x3 + c
3
1 3
y(x) = Ce 3 x
This last line gives the general solution. (The first step assume y 6= 0, but, as we have
observed in similar situations, the general solution arrived at actually includes this possibility in the case that C = 0.)
4. Solve the previous problem using power series. Compare your answers.
Assuming y(x) =
P∞
n=0 cn x
n
, the equation reads
∞
X
ncn x
n=1
n−1
=
∞
X
cn xn+2 .
n=0
P∞
m
Substituting m = n − 1, we can re-index the first series
as
m=0 (m + 1)cm+1 x , and
P∞
m
substituting m = n + 2 we can re-index the second as m=2 cm−2 x , so we can rewrite
the above equation as
c1 + 2c2 x +
∞
X
(m + 1)cm+1 xm =
m=2
∞
X
cm−2 xm ,
m=2
where we have written the constant (x0 ) and linear (x1 ) terms of the series on the left
separately since the second series starts at m = 2.
Equating coefficients of like powers on the two sides, we find
c1 = 0,
2c2 = 0, and
(m + 1)cm+1 = cm−2 for m ≥ 2.
Thus c1 = c2 = 0, and we have the recursion relation
1
cm−2 for m ≥ 2
m+1
cm+1 =
or equivalently
1
cn−3 for n ≥ 3.
n
It follows that 0 = c4 = c7 = c10 = · · · and 0 = c5 = c8 = c11 = · · · , while c3 = 31 c0 ,
1
1
c0 , c9 = 91 c6 = 313 3·2·1
, . . .. In general we find that for any integer
c6 = 16 c3 = 16 13 c0 = 312 2·1
n≥0
1 1
c3n+1 = c3n+2 = 0 and c3n = n c0 ,
3 n!
so the general solution to the ODE is
cn =
y(x) =
∞
X
cn x n
n=0
1 1
1
= c0 1 + x 3 + 2 x 6 + · · ·
3
3 2!
∞
X 1 1
x3n
= c0
n n!
3
n=0
n
∞
X
1 1 3
= c0
x
n! 3
n=0
1 3
= c0 e 3 x .
5. Find the first four nonzero terms in the power series expansion for the solution to the
initial value problem y 00 + x2 y 0 + xy = 0, y(0) = 0, y 0 (0) = 1.
P
n
Once again we start with the assumption that y(x) = ∞
n=0 cn x . This time the ODE
becomes
∞
∞
∞
X
X
X
n−2
n+1
n(n − 1)cn x
+
ncn x
+
cn xn+1 = 0,
n=2
n=1
n=0
which by re-indexing each series we can rewrite as
∞
∞
∞
X
X
X
n
n
(n + 1)(n + 2)cn+2 x +
(n − 1)cn−1 x +
cn−1 xn = 0,
n=0
n=2
n=1
and then after collecting like terms
∞
X
2c2 + (6c3 + c0 ) x +
[(n + 1)(n + 2)cn+2 + ncn−1 ] xn = 0.
n=2
Thus
2c2 = 0,
6c3 + c0 = 0, and
(n + 1)(n + 2)cn+2 + ncn−1 = 0 for n ≥ 2.
The initial condition y(0) = 0 implies c0 = 0, so using the first two equations above
c0 = c2 = c3 = 0, while the initial condition y 0 (0) = 1 implies c1 = 1. The third equation
above can be written as the recursion relation
2−n
cn−3 for n ≥ 4.
cn =
n(n − 1)
Consequently 0 = c0 = c3 = c6 = c9 = · · · and 0 = c2 = c5 = c8 = c11 = · · · , while
c1 = 1
−2
1
c4 =
c1 = −
12
6
−5
5
c7 =
c4 =
42
252
−8
1
c10 =
c7 = −
,
90
567
so the solution is
1
5 7
1 10
y(x) = x − x4 +
x −
x + ··· .
6
252
567
6. Find the general solution to each of the following differential equations.
(a) y 00 + y 0 − 2y = x2
First we solve the complementary homogeneous ODE y 00 + y 0 − 2y = 0. The characteristic equation is r2 + r − 2 = 0, or equivalently (r + 2)(r − 1) = 0, so the
complementary solution is
yc (x) = C1 ex + C2 e−2x .
The form of the inhomogeneous term x2 makes this problem a good candidate for the
method of undetermined coefficients. We look for a particular solution of the form
yp (x) = Ax2 +Bx+C. Then yp0 (x) = 2Ax+B and yp00 (x) = 2A, so the inhomogeneous
equation reads
2A + 2Ax + B − 2Ax2 − 2Bx − 2C = x2 or equivalently
− 2Ax2 + (2A − 2B)x + (2A + B − 2C) = 1x2 + 0x + 0,
whence A = − 21 , B = − 21 , and C = − 34 , so one particular solution is
1
1
3
yp (x) = − x2 − x −
2
2
4
and therefore the general solution to the given inhomogeneous equation can be written
as
1
3
1
y(x) = yc (x) + yp (x) = C1 ex + C2 e−2x − x2 − x − .
2
2
4
(b) y 00 + y = csc x, 0 < x < π/2
The associated homogeneous equation y 00 + y = 0 has characteristic equation r2 + 1 =
0, with roots r = ±i, so the complementary solution is
yc (x) = C1 sin x + C2 cos x.
The right-hand side csc x of the inhomogeneous equation does not seem very well
suited for the method of undetermined coefficients, so instead we’ll use variation of
parameters. We look for a particular solution of the form yp (x) = u1 (x)y1 (x) +
u2 (x)y2 (x), where for this problem y1 (x) = sin x and y2 (x) = cos x. The method
requires us to solve the system
y1 u01 + y2 u02 = 0
y10 u01 + y20 u02 = f (x),
for u01 and u02 , where for this problem f (x) = csc x. Here the system is
u01 sin x + u02 cos x = 0
u01 cos x − u02 sin x = csc x.
We can multiply the top equation by sin x and the bottom equation by cos x and
then add to get
u01 = cot x.
Substituting this into the top equation yields
u02 = −1.
Integrating we find
u1 (x) = ln sin x
u2 (x) = −x,
where we ignore (or set to 0) constants of integration since we need just one particular
solution and where we don’t need absolute value bars around sin x, because we are
interested only in the interal (0, π/2), on which sin x is positive.
Thus one particular solution is
yp (x) = u1 y1 + u2 y2 = (ln sin x) sin x − x cos x,
so the general solution is
y(x) = yc (x) + yp (x) = (C1 + ln sin x) sin x + (C2 − x) cos x.
(c) y 00 + 4y = sin 2x
The associated homogeneous equation y 00 + 4y = 0 has characteristic equation r2 + 4,
with roots r = ±2i, so the complementary solution is
yc (x) = C1 sin 2x + C2 cos 2x.
The right-hand side sin 2x for the given inhomogeneous equation lends itself to the
method of undetermined coefficients. Since sin 2x and cos 2x solve the homogeneous
problem, we look for a particular solution of the form
yp (x) = Ax sin 2x + Bx cos 2x.
Then yp0 (x) = (A − 2Bx) sin 2x + (2Ax + B) cos 2x and yp00 (x) = (−4Ax − 4B) sin 2x +
(4A − 4Bx) cos 2x so the equation becomes
−4B sin 2x + 4A cos 2x = sin 2x,
so A = 0 and B = − 41 .
The general solution is therefore
1
y(x) = yc (x) + yp (x) = C1 sin 2x + C2 cos 2x − x cos 2x.
4
7. Solve the following initial-value problems.
dy
= xe−y , y(0) = 0
(a) dx
R
R
This equation is separable. We get ey dy = x dx, so ey = 21 x2 + C. The initial
condition implies 1 = 0 + C, so the solution is
1 2
y(x) = ln
x +1 .
2
(b) y 0 − y − ex = 0, y(1) = e
0
x
This ODE can be put in the
R standard first-order linear
R form y − y = e . We use
−1 dx
−x
−x
integrating factor r(x) = e
= e , so e y = 1 dx = x + C. The initial
condition implies 1 = 1 + C, so the solution is
y(x) = xex .
(c) 9y 00 + y = 3x + e−x , y(0) = 1, y 0 (0) = 2
This is an inhomogeneous second-order linear ODE with constant coefficients. The
associated homogeneous problem 9y 00 + y = 0 has characteristic equation 9r2 + 1 = 0,
with roots r = ± 31 i, so the complementary solution is
1
1
y(x) = C1 sin x + C2 cos x.
3
3
The right-hand side 3x + e−x suggests applying the method of undetermined coefficients with particular solution of the form yp (x) = Ax + B + Ce−x . Then
yp0 (x) = A − Ce−x and yp00 (x) = Ce−x , so the equation reads
Ax + B + 10Ce−x = 3x + e−x ,
whence A = 3, B = 0, and C =
yg (x) = 3x +
1
,
10
giving the general solution
1
1
1 −x
e + C1 sin x + C2 cos x.
10
3
3
Now
yg0 (x) = 3 −
1 −x 1
1
1
1
e + C1 cos x − C2 sin x,
10
3
3x
3
3
so the initial condition y 0 (0) = 2 implies
2=3−
1
1
+ C1
10 3
and the initial condition y(0) = 1 implies
1=
so C2 =
9
10
1
+ C2 ,
10
and C1 = − 27
, making the solution to the given IVP
10
y(x) = 3x +
1 −x 27
1
9
1
e −
sin x +
cos x.
10
10
3
10
3
8. For the ODE ẋ = x3 − x2 (a) draw a phase diagram, identifying stable and unstable
critical points and (b) sketch (very roughly) the corresponding equilibrium curves along
with a few other solution curves.
The critical points are the solutions of x3 − x2 = 0. Equivalently x2 (x − 1) = 0, so the
critical points are x = 0 and x = 1. The function f (x) = x3 − x2 is negative for x < 0,
negative for 0 < x < 1, and positive for x > 1. (One way to see this is to observe that the
graph of f (x) “bounces” off the x-axis at the double root x = 0 but cuts through it at the
simple root x = 1, touching the x-axis only at those two points, and that lim f (x) = ∞,
x→∞
while lim f (x) = −∞.) Thus x = 0 and x = 1 are both unstable critical points.
x→−∞
9. A vat initially contains 200 liters of pure water. Salt water, at a concentration of 2 grams
of salt per liter, is then added to the vat at a rate of 1 liter per hour. Simultaneously the
well-mixed solution is drained from the vat at 2 liters per hour. What is the concentration
of salt in the vat 100 hours before it is empty?
Let s(t) be the number of grams of salt dissolved in the water in the tank t hours after
the initial time, and let V (t) be the number of liters of water in the tank t hours after the
initial time. Since water flows into the tank at a rate of 1 L/h and flows out at a rate of
2 L/h, we have
dV
= 1 − 2 = −1,
dt
so, after integrating and applying the initial condition V (0) = 200,
V (t) = 200 − t.
g
g
On the other hand salt enters the tank at a rate of 1 L · 2 L = 2 and exits at a rate of
h
h
s(t) g
s(t) g
2 L · V (t) L = 2 200−t
, so
h
h
ds
2
=2−
s,
dt
200 − t
which can be put into the standard first-order linear form
ds
2
+
s = 2.
dt 200 − t
We compute the integrating factor
R
r(x) = e
2
200−t
Then
−2
(200 − t) s =
Z
dt
= e−2 ln|200−t| = (200 − t)−2 .
2(200 − t)−2 dt = 2(200 − t)−1 + C,
so the initial condition s(0) = 0 implies
0 = 2(200)−1 + C,
1
whereby C = 100
= −.01.
The solution is therefore
s(t) = 2(200 − t) − .01(200 − t)2 .
From V (t) = 200 − t we can see that the tank is empty after 200 hours, so 100 hours
before it is empty the total amount of salt dissolved is
s(200 − 100) = s(100) = 2(100) − .01(100)2 = 200 − 100 = 100
grams. The corresponding concentration of salt is then
s(100)
100
=
=1
V (100)
200 − 100
gram per liter.
10. For each part decide if the given functions are linearly dependent or independent. Explain
your answer.
(a) x and 2x
These functions are linearly dependent, since 2(x) − 1(2x) = 0 for all x in (−∞, ∞).
(b) 1, x2 , and 3x2 − 4
These functions are also linearly dependent, since 4(1) − 3(x2 ) + 1(3x2 − 4) = 0 for
all x in (−∞, ∞).
(c) sin x and sin 2x
These functions are linearly independent. To see this suppose there are constants a
and b so that
a sin x + b sin 2x = 0 for every x in (−∞, ∞).
Then in particular the equation must hold at x = π/2, where it reads
a(1) + b(0) = 0,
so a = 0, but then plugging back into the original equation, we have
b sin 2x = 0 for every x,
so in particular the equation must hold at x = π/4, which means
b(1) = 0,
so a = b = 0. This proves linear independence.
(d) ln x and ln x2
Since ln x2 = 2 ln x, we have 2(ln x) − 1(ln x2 ) = 0 for every x in (0, ∞), so these
functions are linearly dependent.