34
Math 391 Problems — with Answers Professor Chavel To the student: The following problems are lifted from my files. Some errors may have crept into the text during the copy/paste. Some problems might be repeated. Also, note the approach to second order equations with regular singular points changes in midstream. My advice: Copy a batch of problems, do them and then, give yourself a grade. Question 1. Solve for the general solution: x 4 dy/dx +5x 3 y = x 5 . Answer: We have x 4 y 0 +5x 3 y = x 5 , x 5 y 0 +5x 4 y = x 6 , (x 5 y) 0 = x 6 , x 5 y = x 7 /7+ c, y = x 2 /7+ cx -5 . The longer way to do it is to rewrite the equation as: dy dx + 5 x y = x, and solve ϕ 0 = (5/x)ϕ for ϕ = x 5 . One then multiplies the equation by x 5 , and proceeds as above. Question 2. Solve for the general solution: (x 2 + e y ) dx +(xe y +2/y 4 ) dy = 0. Answer. Reorganize the equation as: x 2 dx +2y -4 dy + e y dx + xe y dy =0, and realize that e y dx + xe y dy is the total differential of xe y . Then the solution is: x 3 /3 - (2/3)y -3 + xe y = C. The longer way is to set M = x 2 + e y and N = xe y +2/y 4 and check that ∂M/∂y = ∂N/∂x. So, there is a function F (x, y) so that F x = M and F y = N . From F x = M one has F (x, y)= x 3 /3+ xe y + h(y), which implies F y = xe y + h 0 (y)= N (x, y)= xe y +2/y 4 . Therefore h 0 (y)=2/y 4 which implies h(y)= -(2/3)y -3 . Therefore the solution to the equation is F (x, y)= C , that is, x 3 /3 - (2/3)y -3 + xe y = C. Question 3. Solve for the general solution: y 00 - 2y 0 - 15y = 0, y(0) = 1, y 0 (0) = 0. Answer: The associated polynomial problem is m 2 - 2m - 15 = 0 (m - 5)(m + 3) = 0 m =5, -3. Therefore the general solution is given by y(x)= Ae 5x + Be -3x .

ODE solution ODE solution ODE solution ODE solution

  • Upload
    vincent

  • View
    164

  • Download
    5

Embed Size (px)

DESCRIPTION

ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution ODE solution

Citation preview

Page 1: ODE solution ODE solution ODE solution ODE solution

Math 391 Problems — with Answers Professor Chavel

To the student: The following problems are lifted from my files. Some errors may have creptinto the text during the copy/paste. Some problems might be repeated. Also, note the approachto second order equations with regular singular points changes in midstream. My advice: Copya batch of problems, do them and then, give yourself a grade.

Question 1. Solve for the general solution: x4dy/dx + 5x3y = x5.

Answer: We have

x4y′ + 5x3y = x5,

x5y′ + 5x4y = x6,

(x5y)′ = x6,

x5y = x7/7 + c,

y = x2/7 + cx−5.

The longer way to do it is to rewrite the equation as:

dy

dx+

5x

y = x,

and solve ϕ′ = (5/x)ϕ for ϕ = x5. One then multiplies the equation by x5, and proceeds as above.

Question 2. Solve for the general solution: (x2 + ey) dx + (xey + 2/y4) dy = 0.

Answer. Reorganize the equation as:

x2 dx + 2y−4 dy + ey dx + xey dy = 0,

and realize that ey dx + xey dy is the total differential of xey. Then the solution is:

x3/3− (2/3)y−3 + xey = C.

The longer way is to set M = x2 + ey and N = xey + 2/y4 and check that ∂M/∂y = ∂N/∂x. So, thereis a function F (x, y) so that Fx = M and Fy = N . From Fx = M one has

F (x, y) = x3/3 + xey + h(y),

which impliesFy = xey + h′(y) = N(x, y) = xey + 2/y4.

Therefore h′(y) = 2/y4 which implies h(y) = −(2/3)y−3. Therefore the solution to the equation isF (x, y) = C , that is,

x3/3− (2/3)y−3 + xey = C.

Question 3. Solve for the general solution: y′′ − 2y′ − 15y = 0, y(0) = 1, y′(0) = 0.

Answer: The associated polynomial problem is

m2 − 2m− 15 = 0 ⇒ (m− 5)(m + 3) = 0 ⇒ m = 5,−3.

Therefore the general solution is given by

y(x) = Ae5x + Be−3x.

Page 2: ODE solution ODE solution ODE solution ODE solution

Now input the initial conditions:

1 = A + B

0 = 5A− 3B,

and obtain: A = 3/8 and B = 5/8. So the solution is

y(x) =38e5x +

58e−3x.

Question 4. A tank originally contains 500 gallons of fresh water. Then water containing 3lb/gal of salt is poured into the tank at the rate of 5 gal/min, and the mixture is allowed toleave at the same rate. Find the amount of salt in the tank at the end of 10 minutes.

Answer: Let S(t) denote the amount of salt in the tank at time t. Certainly, S(0) = 0.Next, the amount of salt going in at any time t is 3 lb/gal at 5 gal/min, that is, 15 lb/min.

The amount of salt leaving the tank at time t is 5 times the concentration of salt at time t, that is,5 · (S(t)/500) = S(t)/100. Therefore the differential equation is

dS

dt= 15− S

100,

dS

dt+

S

100= 15,

et/100 dS

dt+

et/100S

100= 15et/100,

d

dtet/100S = 15et/100,

et/100S = 1500et/100 + c,

S(t) = 1500 + ce−t/100,

0 = S(0) = 1500 + c,

S(t) = 1500(1− e−t/100),S(10) = 1500(1− e−1/10).

Question 5. Suppose that the temperature of a cup of coffeee standing in a room obeysNewton’s law of cooling. Suppose the room temperature is 70oF, at noon the coffee is 150o andat 2PM the coffee is 90oF. What temperature was the coffee at 1PM?

Answer. If T (t) denotes the temperature of the coffee at time t, then the differential equation for T is:

dT

dt= −k{T − 70}, T (0) = 150.

We are setting time t = 0 to be noon. The solution to the equation is:

T (t) = 70 + De−kt.

To calculate D set t = 0. Then 150 = 70 + D, so D = 80. Therefore

T (t) = 70 + 80e−kt.

We want to calculate T (1), but we first must know k. To find k we use T (2) = 90.

90 = 70 + 80e−2k ⇒ 14

= e−2k ⇒ k =ln 42

= ln 2.

Page 3: ODE solution ODE solution ODE solution ODE solution

SoT (t) = 70 + 80e−t(ln 4)/2 ⇒ T (1) = 70 + 80e− ln 2 = 110.

Question 6. a tough problem A body is discovered dead at 2AM in a room heated at 70oF,with body temperature measured to be 86oF (normal ‘live’ body temperature is 98.6oF). Laterat the morgue, in a room maintain at 40oF, the body is first measured to be at 60oF and 1 hourlater to be at 53F. Determine the time of death.

Answer: The differential equation for Newtonian cooling is given by

dT

dt= −k(T − To),

where T (t) is the temperature of the body at time t, and To is the ambient room temperature. Since thek is unknown, therefore the measurements are taken in the morgue — to calculate k.

First, the solution to the differential equation is

T (t) = To + De−kt.

To calculate k we look at the measurements in the morgue. There, To = 40F, T (0) = 60F, whichimplies D = 60− 40 = 20. Since T (1) = 53F, we have

53 = 40 + 20e−k ⇒ k = ln (20/13).

So k is now determined.Back to the scene of the death. There, T (0) = 98.6F, and To = 70F. Therefore, the constant D is

given byD = T (0)− To = 98.6− 70 = 28.6.

We want to establish the “time” at which the temperature of the body was taken. Then

86 = T (t) = 70 + 28.6e−t ln(20/13) ⇒ t =ln (28.6)/16)ln (20/13)

.

Therefore the person diedln (28.6)/16)ln (20/13)

hours before 2AM.

Question 7. Solve for the solution of the intial-value problem:

y′′ + 4y′ + 20y = 0, y(0) = 0, y′(0) = −1.

Answer: The associated polynomial problem is

m2 + 4m + 20 = 0 ⇒ m = −2± 4i.

Therefore the general solution is given by

y(x) = Ae−2x cos 4x + Be−2x sin 4x.

For the initial conditions y(0) = 0, y′(0) = −1 we have A = 0 and B = −1/4. So

y(x) = −14e−2x sin 4x.

Page 4: ODE solution ODE solution ODE solution ODE solution

As an aside, suppose you wrote the general solution to the differential equation as:

y(x) = αe(−2+4i)x + βe(−2−4i)x,

where α and β are complex. Then y(0) = 0 implies 0 = α + β, and y′(0) = −1 implies −1 = α(−2 +4i) + β(−2− 4i). Therefore, solving the two equations

0 = α + β,

−1 = α(−2 + 4i) + β(−2− 4i) = −2(α + β) + 4i(α− β)

for α and β yieldsα = i/8 and β = −i/8;

Therefore

y(x) = (i/8)e−2x{cos 4x + i sin 4x} − (i/8)e−2x{cos 4x− i sin 4x} = −(1/4)e−2x sin 4x,

as above.

Question 8. Solve for the general solution: (e−x + y4 cos x) dx + (4y3 sin x + 2y) dy = 0.

Answer:

(e−x + y4 cos x)dx + (4y3 sin x + 2y)dy = 0,

e−x dx + (y4 cos x dx + 4y3 sin x dy) + 2y dy = 0,

−e−x + y4 sin x + y2 = c.

Question 9. Solve for the general solution: x3dy/dx + 4x2y = e−x.

Answer:

x3y′ + 4x2y = e−x,

x4y′ + 4x3y = xe−x,

(x4y)′ = xe−x,

x4y =∫

xe−x dx.

But, by integration by parts,∫

xe−x dx = −xe−x +∫

e−x dx = −xe−x − e−x + c.

Therefore,

y =1x4{−xe−x − e−x + c}.

Question 1. 0 Solve for the general solution: y′′ − 2y′ − 48y = 0.

Answer: The associated polynomial equation is:

r2 − 2r − 48 = 0 ⇒ (r − 8)(r + 6) = 0,

which implies r = 8 and r = −6. Therefore the general solution is given by

y = c1e8t + c2e

−6t.

Page 5: ODE solution ODE solution ODE solution ODE solution

Question 11. Solve for the solution of the intial-value problem:

y′′ + 6y′ + 10y = 0, y(0) = 0, y′(0) = 2.

Answer: The associated polynomial equation is given by

r2 + 6r + 10 = 0 ⇒ (r + 3)2 + 1 = 0.

Therefore r = −3± i, which implies that the general solution is given by

y = Ae−3x cos x + Be−3x sin x.

Since y(0) = 0, we have A = 0. Therefore y = Be−3x sin x. Now use the initial condition y′(0) = 2.Then

2 = y′(0) = B {−3e−3x sin x + e−3x cos x}∣∣x=0

= B.

Thereforey(x) = 2e−3x sin x.

Question 12. A tank originally contains 1000 gallons of fresh water. Then water containing2 lb/gal of salt is poured into the tank at the rate of 4 gal/min, and the mixture is allowed toleave at the same rate. Find the amount of salt in the tank at the end of 8 minutes.

Answer: Let S(t) denote the amount of salt in the tank at time t. Then the instantaneous change ofS with respect to t is the derivative S′(t). The total amount of salt per minute entering the tank is(4)(2) = 8 gal/min. The density of the salt in the tank at time t is S(t)/1000 lb/gal, and the tank islosing 4 gal/min. Therefore the tank is losing (4)(S(t)/1000) lb/min of salt. This implies

S′(t) = 8− 41000S(t), ⇒

S′(t) + 1250S(t) = 8, ⇒

et/250S′(t) + (et/250/250)S(t) = 8et/250, ⇒

(et/250S(t))′ = 8et/250, ⇒

et/250S(t) = 8(250)et/250 + c, ⇒

S(t)) = 2000 + ce−t/250.

To calculate c, we use the initial condition S(0) = 0 — we are assuming that at time t = 0 the water isfresh. Then one concludes c = −2000. We therefore have

S(t) = 2000(1− e−t/250) ⇒ S(8) = 2000(1− e−8/250).

Question 13. Solve for the general solution: (x + y) dx + (x + 2y) dy = 0.

Answer:

(x + y)dx + (x + 2y)dy = 0,

x dx + (y dx + x dy) + 2y dy = 0,

x2

2+ xy + y2 = c.

Page 6: ODE solution ODE solution ODE solution ODE solution

Question 14. Solve for the solution of the initial-value problem:

y′′ + 6y′ + 10y = 0, y(0) = 0, y′(0) = 2.

Answer: The associated polynomial equation is given by

r2 + 6r + 10 = 0 ⇒ (r + 3)2 + 1 = 0.

Therefore r = −3± i, which implies that the general solution is given by

y = Ae−3x cos x + Be−3x sin x.

Since y(0) = 0, we have A = 0. Therefore y = Be−3x sin x. Now use the initial condition y′(0) = 2.Then

2 = y′(0) = B {−3e−3x sin x + e−x cos x}∣∣x=0

= B.

Thereforey(x) = 2e−x sin x.

Question 15. Solve for the general solution of: y′′ − 2y′ − 3y = 3tet.

Answer: For the solution to the corresponding homogeneous equation, one first solves the polynomialequation

0 = m2 − 2m− 3 = (m− 3)(m + 1).

Therefore the general solution to the corresponding homogeneous equation is

yh = Ae3t + Be−t.

For a particular solution to the inhomogeneous equation one tries the function

yp = (a + tb)et,

and determines the constants a and b. Then

yp = aet + btet

y′p = aet + b(et + tet) = (a + b)et + btet

y′′p = (a + 2b)et + btet.

Substitute yp into the equation. Then one has

3tet = y′′p − 2y′p − 3yp

= (a + 2b)et + btet − 2{(a + b)et + btet} − 3(aet + btet)= {a− 2a− 3a + 2b− 2b}et + {b− 2b− 3b}tet

= −4aet − 4btet,

which impliesa = 0 and b = −3/4.

Therefore the general solution is:

y = −34tet + Ae3t + Be−t.

Question 16. Solve for the general solution of:

x2y′′ + 3xy′ +34y = x3

Page 7: ODE solution ODE solution ODE solution ODE solution

where two linearly independent solutions to the corresponding homogeneous problem are givenby

y1(x) = x−1/2 y2(x) = x−3/2.

Answer: There are two ways to solve the problem. The first is to look at the equation and notice that aparticular solution of the form yp = ax3 will satisfy the equation! One easily finds that a = 4/63. whichimplies that the general solution to the equation is:

y =463

x3 + Ax−1/2 + Bx−3/2.

The second method is to use variation of parameters. Here, to use the method from memory, one has torewrite the equation as:

y′′ +3x

y′ +3

4x2y = x,

that is, divide the equation by the coefficient x2 of y′′. We set the general solution to be of the form:

y(x) = A(x)x−1/2 + B(x)x−3/2,

where A and B satisfyA′x−1/2 + B′x−3/2 = 0,A′(−1/2)x3/2 + B′(−3/2)x−5/2 = x.

ThenA′ = x5/2 B′ = −x7/2,

which implies

A =27x7/2 + a, B = −2

9x9/2 + b.

So the general solution is:

y ={

27x7/2 + a

}x−1/2 +

{−2

9x9/2 + b

}x−3/2

={

27− 2

9

}x3 + ax−1/2 + bx−3/2

=463

x3 + ax−1/2 + bx−3/2.

Question 17. Solve for the general solution of:

(1− t)y′′ + ty′ − y = −3t2e−t, t > 0,

where two linearly independent solutions to the corresponding homogeneous problem are givenby

y1(t) = 1 + t, y2(t) = et.

Answer: We use the method of variation of parameters. So we look for solutions of the form

y(t) = A(t)(1 + t) + B(t)et,

with the property thatA′(1 + t) + B′et = o.

Page 8: ODE solution ODE solution ODE solution ODE solution

ThenA′(1 + t)′ + B′(et)′ = −3t2e−t,

that is, we must solve the system of equations

A′(1 + t) + B′et = 0,

A′ + B′et = −3t2e−t.

ThenB′et = −A′(1 + t) ⇒ A′ −A′(1 + t) = −3t2e−t,

which impliesA′ = 3te−t, and B′ = e−t{−A′ − 3t2e−t} = −3{t + t2}e−2t.

Integration by parts implies

A = a− 3te−t + 3∫

e−t dt = a− 3te−t − 3e−t = a− 3(1 + t)e−t,

and

B = b +32{t + t2}e−2t − 3

2

∫{1 + 2t}e−2t dt

= b +32{t + t2}e−2t +

34{1 + 2t}e−2t − 3

4

∫2e−2t dt

= b +32{t + t2}e−2t +

34{1 + 2t}e−2t − 3

4

∫2e−2t dt

= b +32{t + t2}e−2t +

34{1 + 2t}e−2t +

34e−2t

= b +{

32

+ 3t +32t2

}e−2t

= b +32(1 + t)2e−2t.

Therefore, the general solution is given by

y = {a− 3(1 + t)e−t}(1 + t) + {b +32(1 + t)2e−2t}et

= a(1 + t) + bet − 3(1 + t)2e−t + (3/2)(1 + t)2e−t

= a(1 + t) + bet − (3/2)(1 + t)2e−t.

Question 18. Solve for the general solution of: y(4) − 5y′′ + 4y = 0.

Answer: The associated polynomial equation is:

0 = m4 − 5m2 + 4 = (m2 − 4)(m2 − 1) = (m + 2)(m− 2)(m + 1)(m− 1).

Therefore the general solution is

y = Ae−2x + Be2x + Ce−x + Dex.

Question 19. Solve for the general solution of:

y(4) + y(3) + y′ + y = 0.

Page 9: ODE solution ODE solution ODE solution ODE solution

Answer: The associated polynomial problem is:

0 = m4 + m3 + m + 1 = m3(m + 1) + m + 1 = (m3 + 1)(m + 1)

which is solved by m = −1 and the three cube roots, in the complex plane, of −1. To solve for the cuberoots, write −1 and m in polar coordinates:

m = reiθ, −1 = ei(π+2πk),

where k ranges over all the integers. Then

r3 = 1, 3θ = π + 2πk, ⇒ r = 1, θ =π

3+

3k.

This produces three complex numbers:

k = 0 ↔ r = 1, θ = π/3 ⇒ m = 1/2 + i√

3/2,

k = 1 ↔ r = 1, θ = π ⇒ m = −1,

k = 2 ↔ r = 1, θ = 5π/3 ⇒ m = 1/2− i√

3/2.

In particular, m = −1 is a double root. Therefore the general solution of the equation is:

y(t) = (At + B)e−t + et/2(C cos√

3t/2 + D sin√

3t/2).

Question 20. Solve for the general solution of:

y(8) − 256y = 0.

Answer. For a solution of the form y = emx we have

m8 − 256 = 0,

som8 = 256ei(0+2πk), ⇒ m = 2eiπk/4,

where k varies over all the integers. Thus there are 8 distinct answers:

2, −2, ±2i,√

2±√

2i, −√

2±√

2i,

which implies that the general solution is given by

y = Ae2x + Be−2x + C cos 2x + D sin 2x

+Ee√

2x cos√

2x + Fe√

2x sin√

2x + Ge−√

2x cos√

2x + He−√

2x sin√

2x.

Question 21. Solve for the solution of the intial-value problem:

y′′′ − 3y′′ + 2y′ = et, y(0) = 0, y′(0) = −1, y′′(0) = 0.

Answer: We start with the polynomial equation

0 = m3 − 3m2 + 2m = m(m2 − 3m + 2) = m(m− 2)(m− 1).

So the general solution to the corresponding homogeneous equation is

yh = A + Bet + Ce2t.

Page 10: ODE solution ODE solution ODE solution ODE solution

To find a particular solution to the inhomogeneous problem, we consider

yp = atet ⇒ yp′ = a(et + tet) yp

′′ = a(2et + tet) yp′′′ = a(3et + tet).

Then we have, substituting into the original equation,

et = (3− 6 + 2)aet,

which implies a = −1. Therefore the general solution is

y = −tet + A + Bet + Ce2t.

Now we use the initial conditions:

0 = 0 + A + B + C

−1 = −1 + 0A + B + 2C

0 = −2 + 0A + B + 4C.

ThenB + 2C = 0 ⇒ A− C = 0 − 2 + 2C = 0.

ThereforeA = 1, B = −2, C = 1, y = −tet + 1− 2et + e2t.

Question 22. Solve using power series the initial-value problem:

y′ + xy = 0, y(0) = 1.

Then identify the solution in terms of known functions.

Answer: If one did not have to use power series, then one would say

y′

y= −x,

which impliesln y = −x2/2 + c ⇒ y = De−x2/2.

Since y(0) = 1 then D = 1; so y = e−x2/2.

To do it with power series, one lets the solution be written as:

y =∞∑

n=0

anxn,

y′ =∞∑

n=1

nanxn−1.

The equation then reads as

0 =∞∑

n=1

nanxn−1 +∞∑

n=0

anxn+1.

To write both series with coefficients of the powers xn, we have to rewrite the equation as:

0 =∞∑

n=0

(n + 1)an+1xn +

∞∑n=1

an−1xn = a1 +

∞∑n=1

{(n + 1)an+1 + an−1}xn.

Page 11: ODE solution ODE solution ODE solution ODE solution

Then the recurrence equations are:

a1 = 0, (n + 1)an+1 + an−1 = 0 n = 1, 2, . . . .

Since a1 = 0, all odd coefficients are zero. For even coefficients, the recurrence relation reads as:

a2k =−a2(k−1)

2k=

(−1)ka0

2k(k!),

and a0 = y(0) = 1, by hypothesis. Therefore

y(x) =∞∑

k=0

(−1)kx2k

2k(k!)=

∞∑

k=0

(−x2/2)k

k!= e−x2/2.

Question 23. Use power series to solve:

y′ − 2xy = 0, y(0) = 32.

Be sure to identify the answer as a known function.

Answer: Set

y =∞∑

n=0

anxn ⇒ y′ =∞∑

n=1

nanxn−1.

Then

0 =∞∑

n=1

nanxn−1 −∞∑

n=0

2anxn+1

=∞∑

n=0

(n + 1)an+1xn −

∞∑n=1

2an−1xn

= a1 +∞∑

n=1

{(n + 1)an+1 − 2an−1}xn,

which implies

a0 = 32 a1 = 0, an+2 =2an

n + 2for all n = 0, 1, 2, . . . .

Therefore,a2k+1 = 0 for all k = 0, 1, 2, . . . .

For the even coefficients we have

a2(k+1) = a2k+2 =2a2k

2(k + 1)=

a2k

k + 1,

which implies

a2k =a0

k!=

32k!

;

therefore

y = 32∞∑

k=0

x2k

k!= 32

∞∑

k=0

(x2)k

k!= 32ex2

.

Question 24. Solve the initial-value problem

y′′ + 2xy′ + 2y = 0, y(0) = −2, y′(0) = 0.

Page 12: ODE solution ODE solution ODE solution ODE solution

Namely, derive the appropriate recursion relation for expressing the solution as a power series;then solve the recursion to obtain, if possible, a formula for all the coefficients. If you cannotsolve the recursion relation, then calculate the coefficients a0, a1, a2, a3, a4, a5; if you can solvethe recursion relation, identify, if possible, the solution.

Answer. We use power series expanded around xo = 0. So

y =∞∑

n=0

anxn

y′ =∞∑

n=1

nanxn−1

y′′ =∞∑

n=2

n(n− 1)anxn−2,

which implies

0 =∞∑

n=2

n(n− 1)anxn−2 +∞∑

n=1

2nanxn +∞∑

n=0

2anxn

=∞∑

n=0

(n + 2)(n + 1)an+2xn +

∞∑n=1

2nanxn +∞∑

n=0

2anxn

= 2a2 + 2a0 +∞∑

n=1

{(n + 2)(n + 1)an+2 + 2nan + 2an}xn

= 2a2 + 2a0 +∞∑

n=1

(n + 1){(n + 2)an+2 + 2an}xn.,

which implies

a2 = −a0, and an+2 = − 2an

n + 2for all n = 1, 2, 3, . . . .

The initial data are: a0 = −2 and a1 = 0, which implies, for odd coefficients, a2k+1 = 0 for allk = 1, 2, 3, . . .. For the even coefficients we have

a2 = −a0, a4 = −2a2

4= +

a0

2, a6 = −2a4

6= − a0

3 · 2 , a8 = −2a6

8= +

a0

4 · 3 · 2 ,

more generally,

a2k =(−1)k

k!(−2).

So

y(x) = −2∞∑

k=0

(−1)kx2k

k!= −2

∞∑

k=0

(−x2)k

k!= −2e−x2

.

Question 25. Find the general solution to

x2y′′ + xy′ − 4y = 0.

Answer. Try a solution of the form y = xr. Then r must satisfy

r(r − 1) + r − 4 = 0,

Page 13: ODE solution ODE solution ODE solution ODE solution

which implies r2 − 4 = 0 ⇒ r = ±2. So the general solution is

y = Ax2 + Bx−2.

Question 26. Solve for the general solution: x2y′′ − 5xy′ + 9y = 0.

Answer. This is an Euler equation, so we attempt a solution of the form

y = xr =⇒ xr{r(r − 1)− 5r + 9} = 0,

that is,0 = r2 − 6r + 9 = (r − 3)2,

which implies the two linearly independent solutions are

y = x3, y = x3 ln x.

extra: To obtain the second solution, use “reduction of order”: That is, set

y = vx3, y′ = v′x3 + 3vx2 y′′ = v′′x3 + 6v′x2 + 6vx,

which implies

0 = v′′x5 + 6v′x4 + 6vx3 − 5(v′x4 + 3vx3) + 9vx3

= v′′x5 + v′x4,

which implies

v′′

v′= − 1

x=⇒ ln v′ = − ln x + C =⇒ v′ =

D

x=⇒ v = D ln x + E.

Therefore,y = x3v = Dx3 ln x + Ex3.

Question 27. A spring is stretched 1 ft by a force of 10 lbs. A weight of 64 lb is hung from thespring and is also attached to a viscuous damper that exerts a force of 8 lb when the velocityof the mass is 2 ft/sec. If the mass is pulled down 2 ft below its equilibrium position and givenan initial downward velocity of 3 ft/sec, determine its position at any time t.

Answer: The differential equation governing the problem is:

mu′′ + γu′ + ku = 0,

where m is the mass , γ is the damping constant, and k is the spring constant. The units we use are:pounds for force, pounds/32 for mass, feet for length, and seconds for time.

The mass m = 64/32 = 2 lb.The viscosity constant γ is given by: “Force=γ·velocity,” that is,

8 lb = γ2 ft/sec,

which implies γ = 4.The spring constant k is given by

10 lb = k(1) ft,

which implies k = 10.

Page 14: ODE solution ODE solution ODE solution ODE solution

The equation, therefore, is2u′′ + 4u′ + 10u = 0.

The associated polynomial equation is

2m2 + 4m + 10 = 0 = 2(m2 + 2m + 5) = 2{(m + 1)2 + 4},with roots given by

m = −1± 2i.

Thereforeu = Ae−t cos 2t + Be−t sin 2t.

To determine A and B we turn to the initial data. We are given

u(0) = 2, u′(0) = 3 .

Therefore

2 = A,

3 = −Ae−t{cos 2t + 2 sin 2t}+ Be−t{− sin 2t + 2 cos 2t}∣∣t=0

= −A + 2B

which implies

A = 2, B =52.

In sum,

u(t) = 2e−t cos 2t +52e−t sin 2t.

Question 28. Solve for the solution of the initial-value problem:

y′′′ − 3y′′ + 2y′ = et, y(0) = 0, y′(0) = −1, y′′(0) = 0.

Answer: We start with the polynomial equation

0 = m3 − 3m2 + 2m = m(m2 − 3m + 2) = m(m− 2)(m− 1).

So the general solution to the corresponding homogeneous equation is

yh = A + Bet + Ce2t.

To find a particular solution to the inhomogeneous problem, we consider

yp = atet ⇒ yp′ = a(et + tet) yp

′′ = a(2et + tet) yp′′′ = a(3et + tet).

Then we have, substituting into the original equation,

et = (3− 6 + 2)aet,

which implies a = −1. Therefore the general solution is

y = −tet + A + Bet + Ce2t.

Now we use the initial conditions:

0 = 0 + A + B + C

−1 = −1 + 0A + B + 2C

0 = −2 + 0A + B + 4C.

Page 15: ODE solution ODE solution ODE solution ODE solution

ThenB + 2C = 0 ⇒ A− C = 0 − 2 + 2C = 0.

ThereforeA = 1, B = −2, C = 1, y = −tet + 1− 2et + e2t.

Question 29. A mass that weighs 6 lb stretches a spring 3 in. The system is acted on by anexternal force of 8 sin 4t lb. If the mass is pulled down by 1in, and then released, determine theposition of the mass at any time.

Answer: We work, in pounds-inches. Therefore, if g denotes the force of gravity, then g = (32)(12) in/sec2.So, to calculate the mass we have

6 = mg = m(32)(12) ⇒ m =6

(32)(12)=

164

.

To calculate the spring constant we have

6 = kL = 3k ⇒ k = 2.

The differential equaiton is:164

u′′ + 2u = 8 sin 4t,

oru′′ + 128u = 83 sin 4t.

The solution of the corresponding homogeneous equation is:

uh = A cos√

128t + B sin√

128t.

A particular solution is of the formup = a sin 4t.

Then

16a + 128a = 83 ⇒ a =83

144=

29

24 · 32=

329

.

Therefore the general solution is:

u =329

sin 4t + A cos√

128t + B sin√

128t.

Now use the initial data: u(0) = 1 and u′(0) = 0. Then A = 1 and

0 =32 · 4

9+ 8

√2B ⇒ B = − 16

9√

2,

which implies

u =329

sin 4t + cos√

128t− 169√

2sin

√128t.

Question 30. A mass that weighs 8 lb stretches a spring 6 in. The system is acted on by anexternal force of 8 sin 6t lb. If the mass is pulled down by 3in, and then released, determine theposition of the mass at any time.

Answer: We work, in pounds-feet. Therefore, if g denotes the force of gravity, then g = (32) ft/sec2.So, to calculate the mass we have

8 = mg = 32m ⇒ m =832

=14.

Page 16: ODE solution ODE solution ODE solution ODE solution

To calculate the spring constant we have

8 = kL = k/2 ⇒ k = 16.

The differential equaiton is:14u′′ + 16u = 8 sin 6t,

oru′′ + 64u = 32 sin 6t.

The solution of the corresponding homogeneous equation is:

uh = A cos 8t + B sin 8t.

A particular solution is of the formup = a sin 6t.

Then−36a + 64a = 32 ⇒ a =

3228

=87.

Therefore the general solution is:

u =87

sin 6t + A cos 8t + B sin 8t.

Now use the initial data: u(0) = 1/4 and u′(0) = 0. Then A = 1/4 and B = − 67 , which implies

u =87

sin 6t +14

cos 8t− 67

sin 8t.

Question 31. Give the first five coefficients (that is, through the fourth-order term) of thepower series solution of:

y′′ + xy′ + y = 0, y(0) = 0, y′(0) = 1.

Answer. We have

y =∞∑

n=0

anxn, y′ =∞∑

n=1

nanxn−1, y′′ =∞∑

n=2

n(n− 1)anxn−2,

which implies

0 = y′′ + xy′ + y

=∞∑

n=2

n(n− 1)anxn−2 +∞∑

n=1

nanxn +∞∑

n=0

anxn

=∞∑

n=0

(n + 2)(n + 1)an+2xn +

∞∑n=1

nanxn +∞∑

n=0

anxn

= 2 · 1 · a2 + a0 +∞∑

n=1

{(n + 2)(n + 1)an+2 + (n + 1)an}xn,

which implies2a2 + a0 = 0, (n + 2)(n + 1)an+2 + (n + 1)an = 0;

thereforea2 = −a0

2, an+2 = − an

n + 2.

Page 17: ODE solution ODE solution ODE solution ODE solution

Note that y(0) = 0 implies a0 = 0, which implies a2k = 0 for all k = 0, 1, . . .. Also,

a1 = 1, a3 = −13, x5 =

115

.

So

y = x− x3

3+

x5

15+ . . . .

Question 32. Solve the initial-value problem:

x2y′′ − 3xy′ + 8y = 0. y(1) = 3, y′(1) = 0.

Answer: This is Euler’s equation, so we check for solutions of the form y = xr. Then we have theindicial equation:

0 = r(r − 1)− 3r + 8 = r2 − 4r + 8 = (r − 2)2 + 4.

Thereforer = 2± 2i, x2±2i = x2x±2i = x2e±(2 ln x)i,

which impliesy = Ax2 cos (2 ln x) + Bx2 sin (2 ln x).

For the initial conditions, we have

3 = y(1) = A, 0 = y′(1) = 6 + 2B,

which impliesy = 3x2 cos (2 ln x)− 3x2 sin (2 ln x).

Question 33. (a) Find the roots to the indicial equation associated with:

x2y′′ −(

x− 29

)y = 0.

(b) Then consider the expansion corresponding to the higher root, and calculate the recurrencerelation for the coefficients. (c) Finally, find the first four coefficients of the expansion.

Answer: The associated Euler equation is

x2y′′ +29y = 0,

with indicial equation

0 = r(r − 1) +29

= r2 − r +29

=(

r − 13

) (r − 2

3

),

so (a) r = 1/3, 2/3. We now find the solution corresponding to r = 2/3:

y =∞∑

n=0

anxn+2/3, y′ =∞∑

n=0

(n + 2/3)anxn−1+2/3, y′′ =∞∑

n=0

(n + 2/3)(n− 1/3)anxn−2+2/3,

Page 18: ODE solution ODE solution ODE solution ODE solution

which implies

0 =∞∑

n=0

(n + 2/3)(n− 1/3)anxn+2/3 −∞∑

n=0

anxn+1+2/3 +29

∞∑n=0

anxn+2/3

=∞∑

n=0

{(n + 2/3)(n− 1/3)an + 2/9}xn+2/3 −∞∑

n=0

anxn+1+2/3

=∞∑

n=0

n(n + 1/3)anxn+2/3 −∞∑

n=1

an−1xn+2/3

=∞∑

n=1

{n(n + 1/3)an − an−1}xn+2/3,

which impliesan =

an−1

n(n + 1/3)n = 1, 2, 3, . . . .

Therefore

a1 =a0

4/3, a2 =

a0

2(7/3)(4/3),

a3 =a0

3 · 2(10/3)(7/3)(4/3), a4 =

a0

4 · 3 · 2(13/3)(10/3)(7/3)(4/3).

Question 34. Use Laplace transforms to solve the initial value problem:

y′ − y = t2et y(0) = 0.

Answer: We haveLy = z, Ly′ = sz, L{t2et}(s) =

2(s− 1)3

,

which implies

sz − z =2

(s− 1)3⇒ z =

2(s− 1)4

=23!

3!(s− 1)4

.

Thereforey = L−1z =

13t3et.

Question 35. Expand the function f(x) = x2, 0 < x < 1, in a sine series.

Answer. Here we have

f(x) =∞∑

n=1

bn sin πnx,

bn = 2∫ 1

0

x2 sin πnx dx (n = 1, 2, 3, . . .)

= 2

{−x2 cos πnx

πn

∣∣∣∣1

0

+2

πn

∫ 1

0

x cos πnx dx

}

=(−1)n+12

πn+

4πn

{x sin πnx

πn

∣∣∣∣1

0

− 1πn

∫ 1

0

sin πnx dx

}

Page 19: ODE solution ODE solution ODE solution ODE solution

=(−1)n+12

πn− 4

π2n2

∫ 1

0

sin πnx dx

=(−1)n+12

πn+

4π3n3

cos πnx

∣∣∣∣1

0

=(−1)n+12

πn+

4π3n3

{(−1)n − 1} .

(If you took the answer to here you get full credit.) To take it a step further one has

b2k−1 =2

πn− 8

π3n3, b2k = − 1

πk, k = 1, 2, . . . .

So

x2 ∼∞∑

k=1

[{2

πn− 8

π3n3

}sin π(2k − 1)x− sin 2πkx

πk

].

Question 36. Find the inverse Laplace transform of:

L−1{

4s + 2s2 − 6s + 10

}(t)

Answer: We have4s + 2

s2 − 6s + 10=

4s + 2s2 + 6s + 9 + 1

=4(s− 3) + 14(s− 3)2 + 1

.

Therefore

L−1

{4s + 2

s2 − 6s + 10

}(t) = L−1

{4(s− 3) + 14(s− 3)2 + 1

}(t) = 4e3t cos t + 14e3t sin t.

Question 37. Use Laplace transforms to solve the initial value problem:

y′ − y = t2et y(0) = 0.

Answer: We haveLy = z, Ly′ = sz, L{t2et}(s) =

2(s− 1)3

,

which implies

sz − z =2

(s− 1)3⇒ z =

2(s− 1)4

=23!

3!(s− 1)4

.

Thereforey = L−1z =

13t3et.

Question 38. Solve:x2y′′ + 5xy′ + 8y = 0.

Answer: Of course, this is an Euler equation; so we try a solution of the form y = xr. Then one hasthe indicial equation:

0 = r(r − 1) + 5r + 8 = r2 + 4r + 8 = (r + 2)2 + 4.

Page 20: ODE solution ODE solution ODE solution ODE solution

Therefore r = −2± 2i, which implies

y = Ae−2x cos (2 ln x) + Be−2x sin (2 ln, x)

is the general solution.

Question 39. Find the coefficients a0 through a4 of the power series expansion of the solutionto:

(1 + x2)y′′ − 3y′ + 4(cos x)y = 0, y(0) = 1 y′(0) = 0.

Answer: Set

y =∞∑

n=0

anxn = a0 + a1x + a2x2 + a3x

3 + a4x4 + · · ·

Then a0 = 1 and a1 = 0, which implies

y = 1 + a2x2 + a3x

3 + a4x4 + · · · ,

y′ = 2a2x + 3a3x2 + 4a4x

3 + · · · ,y′′ = 2a2 + 6a3x + 12a4x

2 + · · · .

Then

0 = (1 + x2)(2a2 + 6a3x + 12a4x2 + · · ·)

−3(2a2x + 3a3x2 + 4a4x

3 + · · ·)+4(1− x2/2 + · · ·)(1 + a2x

2 + a3x3 + a4x

4 + · · ·)= 2a2 + 4 + x(6a3 − 6a2) + x2(12a4 + 2a2 − 9a3 + 4) + · · · ,

which implies

2a2 + 4 = 0 ⇒ a2 = −2,

6a3 − 6a2 = 0 ⇒ a3 = −2,

12a4 + 2a2 − 9a3 + 4 = 0 ⇒ a4 = −3/2.

Soy = 1− 2x2 − 2x3 − (3/2)x4 + · · · .

Question 40. (a) Find the roots to the indicial equation (that is, the polynomial equationbelonging to the associated Euler equation) associated with:

2x2y′′ − 3xy′ + (x + 3)y = 0.

(b) Then consider the expansion corresponding to the higher root, and calculate the recurrencerelation for the coefficients. (c) Finally, find the first five coefficients (that is, a0 through a4)of the expansion. Give a general expression for the coefficient an.

Answer: The associated Euler equation is

2x2y′′ − 3xy′ + 3y = 0,

with indicial equation2r(r − 1)− 3r + 3 = 0.

The two roots are: r = 1 and r = 3/2. So we give the solution associated with r = 3/2.

Page 21: ODE solution ODE solution ODE solution ODE solution

So we write

y = x3/2∞∑

n=0

anxn =∞∑

n=0

anxn+3/2,

which implies

0 =∞∑

n=0

2(n + 3/2)(n + 1/2)anxn+3/2 − 3∞∑

n=0

(n + 3/2)anxn+3/2

+∞∑

n=0

anxn+3/2+1 +∞∑

n=0

3anxn+3/2

=∞∑

n=0

{2(n + 3/2)(n + 1/2)− 3(n + 3/2) + 3} anxn+3/2

+∞∑

n=1

an−1xn+3/2

=∞∑

n=1

{(2n2 + 8n +

32− 3n− 9

2+ 3)an + an−1

}xn+3/2

=∞∑

n=1

{(2n2 + 5n)an + an−1

}xn+3/2.

Soan = − an−1

2n2 + 5nfor all n = 1, 2, . . . ,

which implies

a1 = −17a0, a2 =

118

17a0, a3 = − 1

33118

17a0, a4 =

152

133

118

17a0.

Question 41. Consider the differential equation

x2y′′ + xy′ − (1 + x2)y = 0.

Determine the corresponding Euler equation, then the indicial equation and its roots. For the higherroot, determine the recurrence relation. If you can solve it for all the coefficients, do so and give theseries. If not, solve for a0, . . . , a3 and give the partial sum.

Answer. The associated Euler equation is

x2y′′ + xy′ − y = 0,

whose associated indicial equation isr(r − 1) + r − 1,

which has solution r = 1 and r = −1. For r = 1 we have

y = x

∞∑n=0

anxn =∞∑

n=0

anxn+1

y′ =∞∑

n=0

(n + 1)anxn

y′′ =∞∑

n=1

n(n + 1)anxn−1,

Page 22: ODE solution ODE solution ODE solution ODE solution

which implies

0 =∞∑

n=1

n(n + 1)anxn+1 +∞∑

n=0

(n + 1)anxn+1

−∞∑

n=0

anxn+1 −∞∑

n=0

anxn+3

=∞∑

n=2

n(n− 1)an−1xn +

∞∑n=1

nan−1xn

−∞∑

n=1

an−1xn +

∞∑n=3

an−3xn

(a0 − a0)x + (2a1 + 2a1 − a1)x2 +∞∑

n=3

{n(n− 1)an−1 + nan−1 − an−1 + an−3}xn

= 3a1x2 +

∞∑n=3

{(n + 1)(n− 1)an−1 + an−3}xn,

which implies a1 = 0 and

an−1 = − an−3

(n + 1)(n− 1)for all n ≥ 3,

that is, an = − an−2

(n + 2)nfor all n ≥ 2.

In particular, a2 = −a0/8 and a3 = −a1/15 = 0; so

y = a0

{x− x3

8+ · · ·

}.

Question 42. Find the roots to the indicial equation associated with:

x2y′′ − 2xy′ + (x + 2)y = 0.

(b) Then consider the expansion corresponding to the higher root, and calculate the recurrence relationfor the coefficients. (c) Finally, find the first four coefficients of the expansion.

Answer. (a) The associated indicial equation is:

0 = r(r − 1)− 2r + 2 = r2 − 3r + 2 = (r − 2)(r − 1).

(remember: One can think of the given as a perturbation of an Euler equation. Which Euler equation?x2y′′ − 2xy′ + 2y = 0. Near the origin, x = 0, the dominant term of x + 2 is 2.) So the roots are r = 1and r = 2. (b) Set, for r = 2,

y =∞∑

n=0

anxn+2 =⇒ y′ =∞∑

n=0

(n + 2)anxn+1 =⇒ y′′ =∞∑

n=0

(n + 2)(n + 1)anxn,

which implies

0 = x2y′′ − 2xy′ + (x + 2)y

=∞∑

n=0

(n + 2)(n + 1)anxn+2 − 2∞∑

n=0

(n + 2)anxn+2 +∞∑

n=0

anxn+3 + 2∞∑

n=0

anxn+2

Page 23: ODE solution ODE solution ODE solution ODE solution

=∞∑

n=0

{(n + 2)(n + 1)− 2(n + 2) + 2} anxn+2 +∞∑

n=0

anxn+3

=∞∑

n=1

[{(n + 2)(n + 1)− 2(n + 2) + 2} an + an−1] xn+2

=∞∑

n=1

[n(n + 1)an + an−1] xn+2.

Therefore the recurrence relation is:an = − an−1

n(n + 1).

(c) The first four coefficients are

a0, a1 = −a0

2, a2 = +

a0

(2 · 3)2, a3 = − a0

4 · 32 · 22, a4 = +

a0

5 · 42 · 32 · 22;

soan = (−1)n a0

(n + 1)(n!)2.

Question 43. Use Laplace transforms to solve the initial value problem:

y′′ + 4y + 5y = 2et, y(0) = 1, y′(0) = 0.

Answer. Let L denote the Laplace transform, and set

Ly = Y, =⇒ Ly′ = −1 + sY =⇒ Ly′′ = 0 + sLy′ = −s + s2Y.

Now take the Laplace transform of the differential equation

21

s− 1= −s + s2Y + 4(−1 + sY ) + 5Y = −s− 4 + {s2 + 4s + 5}Y,

which implies

Y =s + 4 + 2/(s− 1)

s2 + 4s + 5=

(s + 4)(s− 1) + 2(s− 1){(s + 2)2 + 1} =

s2 + 3s− 2(s− 1){(s + 2)2 + 1} .

One now writes Y in a partial fraction decomposition.

Y =s2 + 3s− 2

(s− 1)(s + 2)2 + 1=

A

s− 1+

B(s + 2) + C

(s + 2)2 + 1.

Sos2 + 3s− 2 = A{(s + 2)2 + 1}+ (s− 1){B(s + 2) + C} (1)

for all s. For s = 1 one has in (1):

2 = 10A =⇒ A =15.

For s = −2 one has in (1):

−4 = A− 3C =15− 3C =⇒ C =

75.

For s = 0 one has in (1):

−2 = 5A− {2B + C} = 1−{

2B +75

}= −2

5− 2B =⇒ B =

45.

Page 24: ODE solution ODE solution ODE solution ODE solution

Therefore,

Y (s) =1/5

s− 1+

(4/5)(s + 2) + 7/5(s + 2)2 + 1

,

which implies

y(t) =15et +

45e−2t cos t +

75e−2t sin t.

Question 44. (a) Expand the function f(x) = x, 0 ≤ x ≤ π, in a sine Fourier series. (b)Solve the initial-boundary value problem for the heat equation on 0 ≤ x ≤ π:

uxx = ut, u = u(x, t), 0 ≤ x ≤ π, t > 0,

u(0, t) = u(π, t) = 0,

u(x, 0) = x.

Answer. For (a) We have

x =∞∑

n=1

bn sin nx, 0 ≤ x ≤ π,

bn =2π

∫ π

0

x sin nx dx

=2π

{ −x cos nx

n

∣∣∣∣π

0

+1n

∫ π

0

cos nx dx

}

=2(−1)n−1

n;

so

x = 2∞∑

n=1

(−1)n−1

nsin nx, 0 ≤ x ≤ π.

For (b), we therefore have

u(x, t) = 2∞∑

n=1

(−1)n−1

ne−n2t sin nx.

Question 45. Find the partial sum consisting of the first 4 terms of the power series expansion (thatis, a0 through a3x

3) of the solution to:

(1 + x2)y′′ − 3y′ + 4xy = 0, y(0) = 1 y′(0) = 0.

Answer. We sety = a0 + a1x + a2x

2 + a3x3 + · · · .

The initial conditions imply a0 = 1 and a1 = 0. Then

y = 1 + a2x2 + a3x

3 + · · · ,y′ = 2a2x + 3a3x

2 + · · · ,y′′ = 2a2 + 6a3x + · · · .

which implies

0 = (1 + x2)(2a2 + 6a3x + · · ·)− 3(2a2x + 3a3x2 + · · ·) + 4x(1 + a2x

2 + a3x3 + · · ·)

= 2a2 + x(6a3 − 6a2 + 4) + · · ·

Page 25: ODE solution ODE solution ODE solution ODE solution

which implies a2 = 0 and a3 = −2/3. Therefore

y = 1− 23x3 + · · · .

Question 46. (a) Find the roots to the indicial equation (that is, the polynomial equationbelonging to the associated Euler equation) associated with:

x2y′′ + 2xy′ +(

x +14

)y = 0.

(b) Then consider the expansion corresponding to the higher root, and calculate the recurrencerelation for the coefficients. (c) Finally, Find the partial sum consisting of the first 4 terms(that is, a0 + · · ·+ a3x

3) of the expansion.

Answer: The associated Euler equation is

x2y′′ + 2xy′ +14y = 0,

with indicial equation

r(r − 1) + 2r +14

= 0,

which implies r = −1/2 is a double root.

We therefore consider the solution

y =∞∑

n=0

anxn−1/2,

y′ =∞∑

n=0

(n− 1/2)anxn−3/2,

y =∞∑

n=0

(n− 1/2)(n− 3/2)anxn−5/2,

which implies

0 =∞∑

n=0

(n− 1/2)(n− 3/2)anxn−1/2 +∞∑

n=0

2(n− 1/2)anxn−1/2

+∞∑

n=0

(1/4)anxn−1/2 +∞∑

n=1

an−1xn−1/2

= (3/4− 1 + 1/4)a0 +∞∑

n=1

{[(n− 1/2)(n− 3/2) + 2(n− 1/2) + (1/4)]an + an−1}xn−1/2

=∞∑

n=1

{n2an + an−1}xn−1/2,

which impliesan = −an−1/n2 for all n = 1, 2, . . . .

Thereforea1 = −a0, a2 = −a1/4 = a0/4, a3 = −a2/9 = −a0/36,

Page 26: ODE solution ODE solution ODE solution ODE solution

which implies

y = a0{1− x +x2

4− x3

36+ · · ·}.

Question 47. Give the Fourier series for the 2π–periodic function f(x) given by

f(x) =

{−π − x when − π < x < 0π − x when 0 < x < π

.

Then evaluate the Fourier at (b) x = 0, and at (c) x = π/2.

Answer. (a) First note that f(x) is an odd function with period 2π. So we only have to calculate thesine terms.

f(x) =∞∑

n=1

bn sin nx,

bn =2π

∫ π

0

(π − x) sin nx dx

=2π

{−(π − x)

cos nx

n

∣∣∣π

0− 1

n

∫ π

0

cos nx dx

}

=2π

n− sin nx

n2

∣∣∣∣π

0

}

=2n

.

So

f(x) ∼∞∑

n=1

2n

sin nx.

(b) At x = 0, the Fourier is (obviously) equal to 0.

(c) At x = π/2, the Fourier series converges to the value of f(x) at x = π/2, that is f(π/2) = π/2.

Question 48. Extend the function f(x) = x2, 0 < x < 1, in a cosine series.

Answer. Here we have

f(x) =a0

2+

∞∑n=1

an cos πnx,

a0 = 2∫ π

0

x2 dx =23

an = 2∫ π

0

x2 cos πnx dx (n = 1, 2, 3, . . .)

= 2{

x2 sin πnx

πn

∣∣∣∣π

0

− 2πn

∫ 1

0

x sin πnx dx

}

=4

πn

{x cos πnx

πn

∣∣∣1

0− 1

πn

∫ 1

0

cos πnx dx

}

=4

π2n2cos πn =

(−1)n4π2n2

.

Page 27: ODE solution ODE solution ODE solution ODE solution

So

x2 ∼ 13

+4π2

∞∑n=1

(−1)n

n2cos πnx.

Question 49. Given the heat equation

uxx = ut, 0 < x < 1, t > 0,

with initial-boundary data

u(0, t) = 0, u(1, t) = 0, , u(x, 0) = 3 sin πx− 4 sin 4πx.

Find the solution u(x, t).

Answer. Here we have, it in general,

u(x, t) =∞∑

n=1

bne−π2n2t sin πnx,

where (bn) are the coefficients of the Fourier expansion of the initial data in a sine series on the interval(0, π). But in our problem we are given, explicitly, that

b1 = 3, b4 = 4, bn = 0 for all n 6= 1, 4.

Thereforeu(x, t) = 3e−π2t sin πx− 4e−16π2t sin 4πx.

Final Exam, Spring 2005

Part I. Answer all questions.

Question 1. [13 points] Solve the initial value problem:

y′′ − 4y′ + 4y = x2 + 12e2x, y(0) = 1, y′(0) = 0.

Answer. The corresponding homogeneous equation is:

y′′ − 4y′ + 4y = 0,

which has the solution:yh(x) = Axe2x + Be2x.

For a particular solution, one therefore sets

yp = ax2 + bx + c + dx2e2x,

yp′ = 2ax + b + d{2x2e2x + 2xe2x},

yp′′ = 2a + d{4x2e2x + 8xe2x + 2e2x},

which implies

x2 + 12e2x = 2a + 4dx2e2x + 8dxe2x + 2de2x

−8ax− 4b− 8dx2e2x− 8dxe2x

+4ax2 + 4bx + 4c + 4dx2e2x

= 4ax2 + (4b− 8a)x + 4c− 4b + 2a + 2de2x.

Page 28: ODE solution ODE solution ODE solution ODE solution

Therefore we have

4a = 1, 4b− 8a = 0, 4c− 4b + 2a = 0, 2d = 12,

which impliesa = 1/4, b = 1/2, c = 3/8, d = 6.

The general solution is therefore

y = Axe2x + Be2x + (1/4)x2 + (1/2)x + 3/8 + 6x2e2x.

To solve the initial value problem (to determine A and B) we have

1 = B + 3/8,

0 = A + 2B + 1/2,

which impliesB = 5/8, A = −7/4.

The solution is:y = (−7/4)xe2x + (5/8)e2x + (1/4)x2 + (1/2)x + 3/8 + 6x2e2x.

Question 2. [8 points] Solve(

y cos (xy) +y

2x

)dx +

(x cos (xy) +

12

ln x +1ey

)dy = 0.

Answer. Rewrite the equation as

cos (xy){y dx + x dy}+(

y

2xdx +

12

ln x dy

)+ e−ydy = 0.

This impliessin (xy) +

y

2ln x− e−y = C.

Question 3. [9 points] Find the general solution to

y′′ − 2y′ + y =ex

x.

Answer: The solution to the corresponding homogeneous equation is

yh(x) = Axex + Bex, A,B =constants.

For the solution to the inhomogeneous equation, set

yh(x) = Axex + Bex,

where A = A(x) and B = B(x) are now functions of x satisfying

A′xex + B′ex = 0.

Then A and B must also satisfyA′(x + 1)ex + B′ex = ex/x.

Page 29: ODE solution ODE solution ODE solution ODE solution

We can factor ex from both equations, and obtain

A′x + B′ = 0,

A′(x + 1) + B′ = 1/x.

The solution of the two equations in the two unkowns A′ and B′ is

A′ = 1/x B′ = −1,

which impliesA = ln x + C B = −x + D.

Therefore the solution is

y(x) = (ln x + C)xex + (−x + D)ex = C ′xex + Dex + xex ln x.

Question 4. [7 points] Solvexy′ − 2y = xy + xex.

Answer: Rewrite as

xy′ − (2 + x)y = xex,

y′ − 2 + x

xy = ex.

To find an integration factor φ, φ must satisfy

φ′

φ= −2 + x

x= − 2

x− 1,

which implies

ln φ = −x− 2 ln x = −x + ln x−2,

φ(x) = x−2e−x.

The differential equation then becomes

d

dx

(x−2e−xy

)= x−2,

x−2e−xy = − 1x

+ C,

y = −xex + Cx2ex.

Question 5. [13 points] For the equation

2xy′′ − y′ + y = 0,

(a) Show x = 0 is a regular singular point.(b) Find the indicial equation and the recurrence relation corresponding the larger root.(c) Find the first four terms of the series solution valid near x > 0 corresponding to the

larger root.

Answer: First rewrite the differential equation as

y′′ − 12x

y′ +12x

= 0;

Page 30: ODE solution ODE solution ODE solution ODE solution

then the associated Euler equation is:

y′′ − 12x

y′ = 0,

which implies the indicial equation is

r(r − 1)− 12r = 0,

r2 − r − 12r = 0,

r2 − 32r = 0.

The two roots are r = 0 and r = 3/2. So consider the solution associated with r = 3/2, that is,

y =∞∑

n=0

anxn+3/2,

y′ =∞∑

n=0

(n + 3/2)anxn+1/2,

y′′ =∞∑

n=0

(n + 3/2)(n + 1/2)anxn−1/2.

Then

0 = 2xy′′ − y′ + y

=∞∑

n=0

2(n + 3/2)(n + 1/2)anxn+1/2

−∞∑

n=0

(n + 3/2)anxn+1/2

+∞∑

n=0

anxn+3/2

=∞∑

n=0

{2(n + 3/2)(n + 1/2)− (n + 3/2)} anxn+1/2

+∞∑

n=0

anxn+3/2

=∞∑

n=0

(n + 3/2){(2n + 1)− 1}anxn+1/2

+∞∑

n=0

anxn+3/2

=∞∑

n=0

(n + 3/2)(2n)anxn+1/2

+∞∑

n=1

an−1xn+1/2

= 0a0 +∞∑

n=1

{n(2n + 3)an + an−1}xn+1/2.

The recurrence relation is

n(2n + 3)an + an−1 = 0 for all n = 1, 2, . . . ,

Page 31: ODE solution ODE solution ODE solution ODE solution

that isan = − an−1

n(2n + 3)for all n = 1, 2, . . . .

We therefore obtain

a1 = − a0

1 · 5 , a2 = +a0

2 · 1 · 7 · 5 a3 = − a0

3 · 2 · 1 · 9 · 7 · 5 ,

which implies

y = a0

{x3/2 − x5/2

1 · 5 +x7/2

2 · 1 · 7 · 5 −x9/2

3 · 2 · 1 · 9 · 7 · 5 + · · ·}

.

Question 6. [4 points] Use separation of variables to replace the partial differential equation:

xtuxx + uxt + tux = 0,

where u is a function of x and t, by two ordinary differential equations.

Answer: Set u(x, t) = X(x)T (t). Then the equation becomes

xtX ′′T + X ′T ′ + tX ′T = 0,

where the primes denote differentiation with repsect to the single variable. Rewrite the equation as

xtX ′′T = −X ′{T ′ + tT},xX ′′

X ′ = −T ′ + tT

tT= λ,

which implies

xX ′′ − λX = 0,

T ′ + (1 + λ)tT = 0.

Question 6. [10 points] Use the Laplace transform method to solve:

y′′ + 4y = 2, y(0) = 1, y′(0) = 3.

Answer: If (Ly)(s) = Y (s) is the Laplace transform of y, then

(Ly′)(s) = −y(0) + s(Ly)(s),

which implies

(Ly′)(s) = −1 + sY (s),(Ly′′)(s) = −3 + s(−1 + sY (s)) = −3− s + s2Y (s).

Taking the Laplace transform of both sides of the equation, we obtain

s2Y − 3− s + 4Y =2s,

(s2 + 4)Y =2s

+ s + 3,

Y =2

s(s2 + 4)+

s + 3s2 + 4

.

Page 32: ODE solution ODE solution ODE solution ODE solution

Set2

s(s2 + 4)+

s + 3s2 + 4

=A

s+

Bs + C

s2 + 4

=A(s2 + 4) + s(Bs + C)

s(s2 + 4);

then the standard argument shows that

A =12, B =

12, C = 3,

which implies

Y (s) =12

1s

+s/2 + 3s2 + 4

,

y(t) =12

+12

cos 2t +32

sin 2t.

Part II. Answer any of THREE COMPLETE questions.

Question 8. [12 points] Find the Fourier series for

f(x) =

{x + 2 −2 ≤ x ≤ 0,2− x 0 < x ≤ 2.

,

where f(x + 4) = f(x) for all x.

Answer: First note that f(x) is an even function. One can see that by drawing the graph of thefunction, or by realizing that

f(x) = 2− |x|, −2 ≤ x ≤ 2.

Therefore all the coefficients for the sine terms vanish, and

f(x) =a0

2+

∞∑n=1

an cosnπx

2,

where

a0 =12

∫ 2

−2

f(x) dx =∫ 2

0

(2− x) dx = 2,

an =12

∫ 2

−2

f(x) cosnπx

2dx

=∫ 2

0

(2− x) cosnπx

2dx

=2

nπ(2− x) sin

nπx

2

∣∣∣∣2

0

+2

∫ 2

0

sinnπx

2dx

=2

∫ 2

0

sinnπx

2dx

= − 4n2π2

cosnπx

2

∣∣∣∣2

0

= − 4n2π2

{cos nπ − 1}

=4

n2π2{1− (−1)n}

={

8n2π2 n =odd0 n =even .

Page 33: ODE solution ODE solution ODE solution ODE solution

Therefore

f(x) = 1 +8π2

∞∑

k=0

cos ((2k + 1)πx/2)(2k + 1)2

.

Question 9. [12 points] Find the terms of the power series through x4 of

y′′ − y′ + xy = 0, y(0) = 1, y′(0) = 2.

Answer: The expansion of the power series is

y(x) = 1 + 2x + a2x2 + a3x

3 + a4x4 + · · · ,

y′(x) = 2 + 2a2x + 3a3x2 + 4a4x

3 + · · · ,y′′(x) = 2a2 + 6a3x + 12a4x

2 + · · · ,

which implies

0 = y′′ − y′ + xy

= 2a2 + 6a3x + 12a4x2 + · · · − (2 + 2a2x + 3a3x

2 + 4a4x3 + · · ·)

+x(1 + 2x + a2x2 + a3x

3 + a4x4 + · · ·)

= 2a2 + 6a3x + 12a4x2 − 2− 2a2x− 3a3x

2 − 4a4x3

+x + 2x2 + a2x3 + a3x

4 + a4x5 + · · ·

= 2a2 − 2 + (6a3 − 2a2 + 1)x + (12a4 − 3a3 + 2)x2 + · · · ;

Therefore2a2 − 2 = 0, 6a3 − 2a2 + 1 = 0, 12a4 − 3a3 + 2 = 0,

which impliesa2 = 1, a3 = 1/6, a4 = −1/8.

The series is

y(x) = 1 + 2x + x2 +x3

6− 3x4

2+ · · · .

Question 10. [12 points] A mass weighing two pounds stretches a spring 6 inches. The massis pulled down 3 inches and given an upward velocity of 1 ft/sec. Find u(t), the displacementof the mass in feet from its eqiuilibrium position at time t seconds after release. assume thatthe acceleration due to gravity is 32 ft/sec2 and that air resitance is negligible.

Answer: Do not forget to change inches to feet!!

The force on the spring satisfies Hooke’s law: F = kL; in our case that is

2 = k(1/2) ⇒ k = 4.

The force of gravity is given by: F = mg;in our case that is

2 = 32m ⇒ m = 1/16.

The initial value problem, therefore, is

116

u′′ + 4u = 0, u(0) = 1/4, u′(0) = 1,

Page 34: ODE solution ODE solution ODE solution ODE solution

which impliesu′′ + 64u = 0, u(0) = 1/4, u′(0) = 1,

Therefore,u(t) = A cos 8t + B sin 8t, u(0) = 1/4, u′(0) = −1.

The initial conditions yield A = 1/4 and B = −1/8, which implies

u(t) =14

cos 8t− 18

sin 8t.

Question 11. [12 points] A 200 gallon tank is half full of pure water. A salt solution with aconcentration of 5 lb/gal is flowing into the tank at the rate of 4 gal/min while the rest of thewell-mixed solution is flowing out at the rate of 2 gal/min.

(a) Find S(t), the amount of salt in lbs in the tank at time t minutes.(b) Find the concentration of salt in the tank when the tank overflows.

Answer: Let V (t) denote the amount of water in the tank at time t. Then V (0) = 100 and V ′(t) =4− 2 = 2. So

V (t) = 100 + 2t,

and the tank overflows at time t = 50.

The initial condition for the salt S(t) is given by S(0) = 0. The rate of change of the salt is given by

dS

dt= 5

lbgal

· 4 galmin

− S(t)V (t)

lbgal

· 2 galmin

= 20− 2S(t)2t + 100

= 20− S(t)t + 50

,

that is,

dS

dt= 20− S

t + 50,

dS

dt+

S

t + 50= 20,

(t + 50)dS

dt+ S = 20(t + 50),

d

dt((t + 50)S) = 20(t + 50),

S(t) = 10(t + 50) +C

t + 50.

S(0) = 0 implies C = 25, 000. So

S(t) = 10(t + 50) +25, 000t + 50

.

The concentration at overflow is, therefore,

S(50)200

=254

lbgal

.