Math 334 (A1) Spring 2009
Introduction to Differential Equations
Solutions to Midterm Examination
Saturday May 23, 2009
Department of Mathematical and Statistical Sciences
University of Alberta
Question 1. Given the differential equation
(x2 + 3xy)dx + (Ax2 + 4y)dy = 0
where A is a constant.
(a) Find the value of the constant A such that the differential equation is exact.
(b) Solve the differential equation when A has the value found above.
Solution:
(a) The differential equation is
(x2 + 3xy )dx + (Ax2 + 4y)dy = 0,
| {z } | {z }
M (x,y) N (x,y)
where
M (x, y) = x2 + 3xy and N (x, y) = Ax2 + 4y.
In order for this equation to be exact, we need
∂M ∂N
(x, y) = 3x = 2Ax = (x, y),
∂y ∂x
3
so the equation is exact if and only if A = .
2
3
(b) If A = , the differential equation
2
3
(x2 + 3xy )dx + ( x2 + 4y)dy = 0
| {z } |2 {z }
M (x,y)
N (x,y)
is exact, so there exists a function F (x, y) such that
∂F ∂F 3
M (x, y) = (x, y) = x2 + 3xy and N (x, y) = (x, y) = x2 + 4y.
∂x ∂y 2
We integrate M (x, y) with respect to x, holding y fixed, to get
Z
1 3
F (x, y) = M (x, y)dx = x3 + x2 y + g(y)
3 2
where g(y) is an arbitrary “constant”.
∂F 3
We want (x, y) = N (x, y) = x2 + 4y, and differentiating, we have
∂y 2
3 2 3
x + g 0 (y) = x2 + 4y,
2 2
so that
g 0 (y) = 4y and g(y) = 2y 2 .
Therefore,
1 3 3 2
F (x, y) = x + x + 2y 2 ,
3 2
and the general solution is
2x3 + 9x2 + 12y 2 = c
where c is an arbitrary constant.
Question 2. Solve the initial value problem
p
(y + x2 + y 2 )dx − xdy = 0
y(1) = 0.
Solution: Writing the differential equation in the form
p
dy y + x2 + y 2
= ,
dx x
√
since the initial value of x is 1, we take x = + x2 , so the equation becomes
dy y p
= + 1 + (y/x)2 ,
dx x
and the equation is homogeneous. If we let y = νx, then
dν p
ν+x = ν + 1 + ν 2,
dx
or
dν p
x = 1 + ν2,
dx
which is a separable equation.
Separating and integrating, we have Z Z
dν dx
√ = ,
ν2 + 1 x
and making the substitution ν = tan θ in the integral on the left, we have
Z Z
sec2 θ dθ dx
√ = ,
2
tan θ + 1 x
that is, Z Z
dx
sec θ dθ = ,
x
so that p
log |ν + ν 2 + 1| = log |x| + log |c|,
that is, p
ν+ ν 2 + 1 = cx.
y
Replacing ν by , the general solution of the differential equation is
x
r
y y2
+ + 1 = cx,
x x2
that is, p
y+ x2 + y 2 = cx2 .
Finally, applying the initial condition that y = 0 when x = 1, we get c = 1, and the solution is
p
y + x2 + y 2 = x2 ,
that is,
1 2
y= x −1 .
2
Question 3. Solve the initial value problem
dy
(x2 + 1) + 4xy = x
dx
y(2) = 1.
Solution: Putting the differential equation into standard form, we have
dy 4x x
+ y= 2 ,
dx x2 + 1 x +1
4x x
which is a first order linear equation with P (x) = and Q(x) = 2 .
x2 +1 x +1
An integrating factor is
Z Z
4x dx
exp P dx = exp = exp 2 log(x2 + 1) = (x2 + 1)2 ,
x2 + 1
and multiplying the differential equation by this integrating factor, we have
dy
(x2 + 1)2 + 4x(x2 + 1) y = x(x2 + 1),
dx
that is,
d
(x + 1) y = x3 + x.
2 2
dx
Integrating, the general solution to the differential equation is
x4 x2
(x2 + 1)2 y = + + c,
4 2
where c is an arbitrary constant.
Applying the initial condition y = 1 when x = 2, we have
25 = 4 + 2 + c,
so that c = 19, and the solution to the initial value problem is
x4 x2
(x2 + 1)2 y = + + 19.
4 2
Question 4. Find a particular solution to the nonhomogeneous equation
y 00 + 2y 0 + y = 3xe−x
using the method of undertermined coefficients and then write the general solution.
Solution: The homogeneous equation
y 00 + 2y 0 + y = 0
has characteristic equation r 2 + 2r + 1 = 0, and r = −1 is a repeated root, so two linearly independent
solutions to the homogeneous equation are
φ1 (x) = e−x and φ2 (x) = xe−x .
Therefore we try a particular solution of the nonhomogeneous equation of the form
φp (x) = Ax2 e−x + Bx3 e−x ,
so that
φ0p (x) = 2Axe−x + (−A + 3B)x2 e−x − Bx3 e−x
and
φ00p (x) = 2Ae−x + (−4A + 6B)xe−x + (A − 6B)x2 e−x + Bx3 e−x ,
and
φ00p + 2φ0p + φp = x3 e−x B − 2B + B]
+x2 e−x − 6B + A − 2A + 6B + A
+xe−x 6B − 4A + 4A
+e−x 2A .
Thus, we want
A=0 and 6B = 3,
and a particular solution is
1 3 −x
φp (x) =
x e .
2
The general solution to the nonhomogeneous equation is
1
y(x) = c1 e−x + c2 xe−x + x3 e−x .
2
Question 5. Use the method of variation of parameters to find a particular solution to the nonhomogeneous
equation
x2 y 00 − 4xy 0 + 6y = x4 sin x
on the interval 0 < x < ∞.
Solution: Note that the homogeneous equation
x2 y 00 − 4xy 0 + 6y = 0
is a Cauchy-Euler equation, so we assume a solution of the form
φ(x) = xα
and obtain the characteristic equation
α(α − 1) − 4α + 6 = 0,
that is
α2 − 5α + 6 = 0,
with roots α1 = 2 and α2 = 3.
Two linearly independent solutions of the homogeneous equation are
φ1 (x) = x2 and φ2 (x) = x3 ,
with Wronskian 2
x x3
W [φ1 , φ2 ](x) =
= 3x4 − 2x4 = x4
2x 3x2
which is nonzero on the interval 0 < x < ∞.
Writing the nonhomogeneous equstion in standard form, we have
4 0 6
y 00 − y + 2 = x2 sin x,
x x
and assuming a particular solution of the form
φp (x) = v1 (x)φ1 (x) + v2 (x)φ2 (x) = x2 v1 (x) + x3 v2 (x),
then v10 and v20 are given by
v10 (x) = −x sin x and v20 (x) = sin x.
Integrating, we have
Z Z
v1 (x) = − x sin x dx = x cos x − cos x dx = x cos x − sin x
and Z
v2 (x) = sin x dx = − cos x.
A particular solution to the nonhomogeneous equation is
φp (x) = −x2 sin x
for 0 < x < ∞.