MATH198 Solution Sheet 4
1. Find the general solutions to the following first-order differential equation: dy + 2xy = 5x dx This is both separable and linear, so we have a choice of methods. Let’s solve it by the integrating factor method. It is already in the standard form y 0 + P (x)y = Q(x), so we can immediately read off P (x) = 2x. The integrating factor is Z 2 µ(x) = exp 2x dx = ex . Multiply the whole equation by the integrating factor dy 2 2 + 2xex y = 5xex dx d h x2 i 2 e y = 5xex . dx
ex ⇒
2
This automatically allows us to collect both terms on the LHS into a single derivative. Now solve the equation by integrating both sides Z 5 2 2 x2 e y = 5xex dx = ex + C 2 5 2 ⇒ y = + Ce−x 2 (This time it is important to remember the constant of integration C. When we calculate the integrating factor µ it doesn’t matter one way or the other whether a constant of integration is included.) Check :
2
y 0 = −2xCe−x 2 2 LHS = y 0 + 2xy = −2xCe−x + 5x + 2xCe−x = 5x = RHS
2. Solve the following differential equations with the initial condition y(0) = 1. (i)
dy 3(y + 1) = 2 dt t + 5t + 6
Both separable and linear, so we have plenty of methods. Z Z dy 3(y + 1) dy 3 dt = 2 ⇒ = dt t + 5t + 6 y+1 (t + 2)(t + 3)
X
Use partial fractions to do the t integration. 3 3 3 = ······ = − (t + 2)(t + 3) t+2 t+3 ⇒ ⇒
ln(y + 1) = 3 ln(t + 2) − 3 ln(t + 3) + C 3 3 t+2 t+2 C y+1= e =A (where A = eC ) t+3 t+3
To satisfy the initial condition y(0) = 1 we need A = 33 /22 , 27 y= 4
Check : LHS = y 0 =
t+2 t+3
3 − 1.
27 27 3(t + 2)2 (t + 3)−3 − 3(t + 2)3 (t + 3)−4 4 4
81 (t + 2)2 81 (t + 2)2 (t + 3 − t − 2) = 4 (t + 3)4 4 (t + 3)4 3 81 t + 2 81 (t + 2)2 1 3(y + 1) = = = LHS t2 + 5t + 6 4 t + 3 (t + 2)(t + 3) 4 (t + 3)4
= RHS
=
y(0) =
(ii)
27 23 −1=2−1 4 33
X
y 0 − y tan x = 4
A linear equation, let’s do it by integrating factor. Z Z sin x dx = eln(cos x) = cos x . µ(x) = exp − tan x dx = exp − cos x Multiply the whole equation by cos x
⇒
y 0 cos x − y sin x = 4 cos x d [y cos x] = 4 cos x dx Z
⇒
y cos x =
⇒
y = 4 tan x + C sec x
4 cos x dx = 4 sin x + C
To satisfy the initial condition y(0) = 1 we need C = 1 y = 4 tan x + sec x.
X
Check :
4 sin x 4 sin2 x sin x + − − =4 2 2 2 cos x cos x cos x cos2 x y(0) = 4 × 0 + 1 X y 0 − y tan x =
X
3. Solve these second order differential equations with the initial conditions y(0) = 1, y 0 (0) = 0. (i)
d2 y dy − 6 + 8y = 0 2 dx dx
Trial solution eλx gives (λ2 − 6λ + 8)eλx = 0 ⇒ (λ − 4)(λ − 2) = 0 ⇒ λ = 4 or 2. y = Ae4x + Be2x
General Solution:
⇒
y 0 = 4Ae4x + 2Be2x
To satisfy the initial conditions we need
and ⇒ Solution is
(ii)
A+B =1 4A + 2B = 0 A = −1, B=2 4x y = −e + 2e2x
dy d2 y − 6 + 9y = 0 2 dx dx
The characteristic polynomial is λ2 − 6λ + 9 = (λ − 3)2 . We have a repeated root, so the general solution is y = (A + Bx)e3x To satisfy the initial conditions A = 1, B = −3, solution y = (1 − 3x)e3x . 4. Solve the following second order differential equations with the initial conditions y(0) = 1, y 0 (0) = −1: These should be fairly straight-forward, they are all recipe-following problems. The main points are to remember the standard guess for the free problem (erx for the constant coefficient operator); and the guesses for the inhomogeneous case (roughly speaking, - try a particular solution that looks similar to the RHS).
d2 y dy + 6y = 2ex + 5 dx2 dx First solve the free equation. Put in a trial solution of the type y = erx . This satisfies the free equation if (i)
⇒
r2 erx + 5rerx + 6erx = 0 (r + 3)(r + 2) = 0 ⇒
for all x r = −3 or r = −2.
The general solution to the free equation is yc = Ae−3x + Be−2x . For a particular solution, we try something with the same form as the RHS, yp = Cex Cex + 5Cex + 6Cex = 2ex C = 16 ⇒ yp = 61 ex
⇒ ⇒
Our equation is linear, so to get the general solution of the complete equation, we just add yc and yp y = yc + yp = Ae−3x + Be−2x + 61 ex . To satisfy the initial conditions y(0) = 1, y 0 (0) = −1 we need A+B+ −3A − 2B + These are satisfied if A = − 21 , B =
4 3
1 6 1 6
= 1 = −1
so
y = − 21 e−3x + 43 e−2x + 61 ex
(ii)
d2 y dy + 6 + 9y = 3t + 5 2 dt dt
For a free solution we guess y = exp(λt) which gives the characteristic polynomial λ2 + 6λ + 9 = (λ + 3)2 We have a repeated root, λ = −3, so the free solution is yc = (A + Bt)e−3t .
For the particular solution try yp = αt + β (same form as RHS). yp = αt + β yp0 = α yp00 = 0
⇒ ⇒ ⇒
yp00 + 6yp0 + 9yp = 6α + 9αt + 9β = 3t + 5 9α = 3, 6α + 9β = 5 (Matching coefficients) 1 1 α = 3, β = 3 yp = 13 t + 31 .
The general solution to the equation is y = yc + yp = (A + Bt)e−3t + 31 t + y 0 = Be−3t − 3(A + Bt)e−3t +
1 3
1 3
(In this equation the unknown function is a function of t. Several people were so used to looking for functions of x that they wrote down mixed-up expressions like y = (A+Bx)e−3x + 1 t + 13 . Try not to do that – it can cause problems later on.) 3 We now use the initial conditions to fix A and B: y(0) = 1 y 0 (0) = −1
⇒ A + 13 = 1 ⇒ B − 3A + 31 = −1 ⇒ A = 23 , B = 23
Therefore y = 23 (1 + t)e−3t + 13 (1 + t) (iii)
y 00 + 2y 0 + 2y = sin x
The guess y = exp(λx) gives the characteristic equation λ2 + 2λ + 2 = 0 which has the complex solutions λ = −1 ± i This means that the complementary function is yc = (A cos x + B sin x)e−x . For the particular solution we guess yp = a cos x + b sin x yp0 = −a sin x + b cos x yp00 = −a cos x − b sin x
yp00 + 2yp0 + 2yp = (a + 2b) cos x + (−2a + b) sin x This matches the RHS if a = − 25 , b = 15 . The general solution of the equation is y = yc + yp = (A cos x + B sin x)e−x −
2 5
cos x + 15 sin x.
y 0 = (−A sin x + B cos x)e−x − (A cos x + B sin x)e−x + 52 sin x + 51 cos x The initial conditions require A− B−A+ y=
7 5
⇒
= 1 = −1
A = 75 B = 51
⇒ ⇒
cos x + 15 sin x e−x −
Check : y 0 = − y 00
2 5 1 5
2 5
cos x + 15 sin x
cos x + 58 sin x e−x + 15 cos x + 52 sin x = − 25 cos x − 14 sin x e−x + 25 cos x − 51 sin x 5 6 5
y 00 + 2y 0 + 2y = sin x
X y(0) = 57 − 25 = 1 0 6 1 y (0) = − 5 + 5 = −1 X
X