Mathematics for Engineers and Scientists (MATH1551) · 2015-05-01 · Mathematics for Engineers and...
Transcript of Mathematics for Engineers and Scientists (MATH1551) · 2015-05-01 · Mathematics for Engineers and...
Mathematics for Engineers and Scientists (MATH1551)
Partial Differentiation
1. Calculate ∂f/∂x and ∂f/∂y when f(x, y) is given by:
a) x2 + y2 sin(xy), b) (x+ y)/(x− y), c)√x2 + y2, d)
(√x2 + y2
)−1,
e) xy, f) log(x2 + y2), g) xy + x3 cos(xy), h) xy/(x+ y).
Solution:
(a) ∂f/∂x = 2x+ y3 cos(xy)∂f/∂y = 2y sin(xy) + xy2 cos(xy)
(b) ∂f/∂x = (x− y)−2 ((x− y)− (x+ y)) = −2y(x− y)−2
∂f/∂y = (x− y)−2 ((x− y) + (x+ y)) = 2x(x− y)−2
(c) ∂f/∂x = x (x2 + y2)− 1
2
∂f/∂y = y (x2 + y2)− 1
2
(d) ∂f/∂x = −x (x2 + y2)− 3
2
∂f/∂y = −y (x2 + y2)− 3
2
(e) ∂f/∂x = yxy−1
∂f/∂y = xy log x (to see this, use f(x, y) = xy = ey log x.)(f) ∂f/∂x = 2x/ (x2 + y2)
∂f/∂y = 2y/ (x2 + y2)(g) ∂f/∂x = y + 3x2 cos(xy)− x3y sin(xy)
∂f/∂y = x− x4 sin(xy)(h) ∂f/∂x = y/(x+ y)− xy/(x+ y)2
∂f/∂y = x/(x+ y)− xy/(x+ y)2
2. Calculate all the first order partial derivatives of the following functions of the three variablesx, y and z:
a) xy3 − yz2, b) z(x−yx+y
), c) xyz, d) x cos(yz).
Solution:
(a) ∂f/∂x = y3, ∂f/∂y = 3xy2 − z2, ∂f/∂z = −2yz.
(b) ∂f/∂x = z(
1x+y− x−y
(x+y)2
)= 2yz(x+ y)−2.
∂f/∂y = −2xz(x+ y)−2 (by symmetry).∂f/∂z = (x− y)/(x+ y).
(c) ∂f/∂x = yxy−1z, ∂f/∂y = zxy log x, ∂f/∂z = xy.(d) ∂f/∂x = cos(yz), ∂f/∂y = −xz sin(yz), ∂f/∂z = −xy sin(yz).
3. Calculate ∂f/∂x, ∂f/∂y, ∂2f/∂x∂y and ∂2f/∂y∂x when f(x, y) is given by
a) x2y3 + ex + log y, b) x2 cos y + x2 + cos y, c) x tan (y2),
d) tan−1(y/x), e) (x2 + y2)−1/2.
1
Solution:
(a) ∂f/∂x = 2xy3 + ex, ∂f/∂y = 3x2y2 + 1y, ∂2f/∂x∂y = 6xy2 = ∂2f/∂y∂x.
(b) ∂f/∂x = 2x cos y + 2x, ∂f/∂y = −x2 sin y − sin y, ∂2f/∂x∂y = −2x sin y = ∂2f/∂y∂x.(c) ∂f/∂x = tan (y2), ∂f/∂y = 2xy sec2 y2,
∂2f
∂x∂y=
∂
∂x
(∂f
∂y
)=
∂
∂x
(2xy sec2 y2
)= 2y sec2 y2
∂2f
∂y∂x=
∂
∂y
(∂f
∂x
)=
∂
∂y
(tan(y2))
= 2y sec2 y2
(d) ∂f/∂x = −yx−2(
1 +(yx
)2)−1= −y (x2 + y2)
−1,
∂f/∂y = x−1(
1 +(yx
)2)−1= x (x2 + y2)
−1,
∂2f/∂x∂y = (x2 + y2)−2
((x2 + y2) (−1) + 2y2) = (y2 − x2) (x2 + y2)−2
= ∂2f/∂y∂x.
(e) ∂f/∂x = −x (x2 + y2)− 3
2 , ∂f/∂y = −y (x2 + y2)− 3
2 ,
∂2f/∂x∂y = 3xy (x2 + y2)− 5
2 = ∂2f/∂y∂x.
4. Let v(r, t) = tne−r2/4t. Find a value of the constant n such that v satisfies the equation
∂v
∂t=
1
r2∂
∂r
(r2∂v
∂r
).
Solution:
First note that
∂v
∂t=(ntn−1 + tnr2(2t)−2
)e−r
2/4t,∂v
∂r= −1
2rtn−1e−r
2/4t.
Hence
∂
∂r
(r2∂v
∂r
)=
∂
∂r
(−1
2r3tn−1e−r
2/4t
)= −3
2r2tn−1e−r
2/4t +1
4r4tn−2e−r
2/4t
=
(−3
2r2tn−1 +
1
4r4tn−2
)e−r
2/4t
So we need n = −32.
5. Let f(x, y) = u(x, y)eax+by, where u(x, y) is a function for which ∂2u/∂x∂y = 0. Find valuesof a and b such that
∂2f
∂x∂y− ∂f
∂x− ∂f
∂y+ f = 0.
Page 2
Solution:
First note that, using the product rule
∂f
∂x=
(∂u
∂x+ au
)eax+by,
∂f
∂y=
(∂u
∂y+ bu
)eax+by,
∂2f
∂x∂y=
(∂2u
∂x∂y+ a
∂u
∂y+ b
∂u
∂x+ abu
)eax+by.
So, using∂2u
∂x∂y= 0, we get
∂2f
∂x∂y− ∂f
∂x− ∂f
∂y+ f =
((a− 1)
∂u
∂y+ (b− 1)
∂u
∂x+ (ab− a− b+ 1)u
)eax+by
Hence a = b = 1 does the trick.
6. The two-dimensional Laplace equation is ∂2f/∂x2 + ∂2f/∂y2 = 0. Find all solutions of theform ax3 + bx2y + cxy2 + dy3, with a, b, c and d constant.
Solution:
If f(x, y) = ax3 + bx2y + cxy2 + dy3, then
∂f
∂x= 3ax2 + 2bxy + cy2,
∂f
∂y= bx2 + 2cxy + 3dy2,
∂2f
∂x2= 6ax+ 2by,
∂2f
∂y2= 2cx+ 6dy
and so∂2f
∂x2+∂2f
∂y2= (6a+ 2c)x+ (2b+ 6d)y.
Notice that this is true for all x and y. Hence we need 6a + 2c = 0, 2b + 6d = 0 which givesc = −3a, b = −3d. The most general solution of the required form is
f(x, y) = ax3 − 3dx2y − 3axy2 + dy3.
7. For the following functions, find df/dt by (i) using the chain rule, and (ii) substituting forx, y (and z in (c)) to find f(t) explicitly and then differentiating with respect to t:
(a) f(x, y) = x2 + y2 and x(t) = cos t, y(t) = sin t.
(b) f(x, y) = x2 − y2 and x(t) = cos t+ sin t, y(t) = cos t− sin t.
(c) f(x, y, z) = x/z + y/z and x(t) = cos2 t, y(t) = sin2 t, z(t) = 1/t.
Page 3
Solution:
(a) (i) We have
df
dt=∂f
∂x
dx
dt+∂f
∂y
dy
dt
= −2x sin t+ 2y cos t = 0.
(ii) Now f(t) = cos2 t+ sin2 t = 1, sodf
dt= −2 sin t cos t+ 2 cos t sin t = 0.
(b) (i) We have
df
dt=∂f
∂x
dx
dt+∂f
∂y
dy
dt
= 2x (cos t− sin t)− 2y (− sin t− cos t) = 4(cos2 t− sin2 t
)= 4 cos 2t
(ii) Now f(t) = (cos t+ sin t)2 − (cos t− sin t)2 = 4 cos t sin t, so
df
dt= −4 sin2 t+ 4 cos2 t = 4 cos 2t.
(c) (i) We have
df
dt=∂f
∂x
dx
dt+∂f
∂y
dy
dt+∂f
∂z
dz
dt
= −2
zcos t sin t+
2
zsin t cos t+ (x+ y)z−2t−2 = 1.
(ii) Now f(t) = t cos2 t+ t sin2 t = t, sodf
dt= 1.
—————-Q8—————————————————————
8. The temperature at a point (x, y, z) in space is given by T (x, y, z) = λ√x2 + y2 + z2, where
λ is a constant. Use the chain rule to find the rate of change of temperature with respect to talong the helix r(t) = (cos t) i + (sin t) j + tk.
Solution:
dT
dt=∂T
∂x
dx
dt+∂T
∂y
dy
dt+∂T
∂z
dz
dt
= λ(x2 + y2 + z2
)− 12 (−x sin t+ y cos t+ z)
= λt(1 + t2
)− 12
9. Let f(x, y, z) = x2e2y cos 3z. Find the value of df/dt at the point (1, log 2, 0) on the curvex = cos t, y = log(t+ 2), z = t.
Page 4
Solution:
Using the chain rule,
df
dt=∂f
∂x
dx
dt+∂f
∂y
dy
dt+∂f
∂z
dz
dt
= 2xe2y cos 3z(− sin t) + 2x2e2y cos 3z (t+ 2)−1 − 3x2e2y sin 3z.
When t = 0, we have x = 1, y = log 2, z = 0, and sodf
dt
∣∣∣∣t=0
= 2× 4× 2−1 = 4.
10. If f(x, y, z) is a function of x, y and z, and if x = s2 + t2, y = s2 − t2, z = 2st, find ∂f/∂sand ∂f/∂t in terms of ∂f/∂x, ∂f/∂y, ∂f/∂z, s and t.
Solution:
Applying the chain rule, we get
∂f
∂s=∂f
∂x
∂x
∂s+∂f
∂y
∂y
∂s+∂f
∂z
∂z
∂s
= 2s∂f
∂x+ 2s
∂f
∂y+ 2t
∂f
∂z
and∂f
∂t=∂f
∂x
∂x
∂t+∂f
∂y
∂y
∂t+∂f
∂z
∂z
∂t
= 2t∂f
∂x− 2t
∂f
∂y+ 2s
∂f
∂z.
11. Repeat the previous question but with x = s+ t, y = s− t, z = st.
Solution:∂f
∂s=∂f
∂x+∂f
∂y+ t
∂f
∂zand
∂f
∂t=∂f
∂x− ∂f
∂y+ s
∂f
∂z.
12. If f(x, y, z) is a function of x, y and z, and if x = s3 + t2, y = s2− t3, z = s2t3, find ∂f/∂sand ∂f/∂t in terms of ∂f/∂x, ∂f/∂y, ∂f/∂z, s and t.
Solution:
Applying the chain rule, we get
∂f
∂s=∂f
∂x
∂x
∂s+∂f
∂y
∂y
∂s+∂f
∂z
∂z
∂s
= 3s2∂f
∂x+ 2s
∂f
∂y+ 2st3
∂f
∂z
and∂f
∂t=∂f
∂x
∂x
∂t+∂f
∂y
∂y
∂t+∂f
∂z
∂z
∂t
= 2t∂f
∂x− 3t2
∂f
∂y+ 3s2t2
∂f
∂z.
Page 5
13. Repeat the previous question but with x = s+ sin t, y = cos s− t, z = s cos t.
Solution:∂f
∂s=∂f
∂x− sin s
∂f
∂y+ cos t
∂f
∂zand
∂f
∂t= cos t
∂f
∂x− ∂f
∂y+ s sin t
∂f
∂z.
14. Let f(x, y) = xesin y. If x = sin (u2 + v2) and y = u2 + v2, write down the appropriate
form of the chain rule to express∂f
∂uand
∂f
∂vin terms of ∂f/∂x, ∂f/∂y, ∂x/∂u, ∂x/∂v, ∂y/∂u,
and ∂y/∂v. To check your result, calculate∂f
∂ufrom your chain rule and verify that it agrees
with the result of making the substitution to find f(u, v) explicitly, followed by calculating∂f
∂udirectly.
Solution:∂f
∂u=∂f
∂x
∂x
∂u+∂f
∂y
∂y
∂uand
∂f
∂v=∂f
∂x
∂x
∂v+∂f
∂y
∂y
∂v.
So checking:
∂f
∂u= esin y2u cos
(u2 + v2
)+ x(cos y)2uesin y2u
= 2uesin(u2+v2) cos
(u2 + v2
) (1 + sin
(u2 + v2
))Making the substitutions, we get
f(u, v) = sin(u2 + v2
)esin(u
2+v2)
and∂f
∂u= esin(u
2+v2) (2u cos(u2 + v2
)+ sin
(u2 + v2
)2u cos
(u2 + v2
))
15. If f(x, y) is a function of x and y, and if x = eu cosh v and y = eu sinh v, prove that
∂f
∂u= x
∂f
∂x+ y
∂f
∂y,
∂f
∂v= y
∂f
∂x+ x
∂f
∂y,
and∂2f
∂u∂v− ∂f
∂v= xy
(∂2f
∂x2+∂2f
∂y2
)+ (x2 + y2)
∂2f
∂x∂y.
Solution:
First note that
∂x
∂u= eu cosh v = x,
∂x
∂v= eu sinh v = y,
∂y
∂u= eu sinh v = y,
∂y
∂v= eu cosh v = x.
Using the chain rule we obtain
∂f
∂u=∂f
∂x
∂x
∂u+∂f
∂y
∂y
∂u= x
∂f
∂x+ y
∂f
∂y∂f
∂v=∂f
∂x
∂x
∂v+∂f
∂y
∂y
∂v= y
∂f
∂x+ x
∂f
∂y.
Page 6
Note that we have not used any special property of f , so these formulae hold for any functionof x and y. In particular, we can replace f with ∂f/∂x or ∂f/∂y to get
∂
∂u
(∂f
∂x
)= x
∂2f
∂x2+ y
∂2f
∂x∂y,
∂
∂u
(∂f
∂y
)= x
∂2f
∂x∂y+ y
∂2f
∂y2
Hence, using the above formulae and the product rule,
∂2f
∂u∂v=
∂
∂u
(∂f
∂v
)=
∂
∂u
(y∂f
∂x+ x
∂f
∂y
)=∂y
∂u
∂f
∂x+ y
∂
∂u
(∂f
∂x
)+∂x
∂u
∂f
∂y+ x
∂
∂u
(∂f
∂y
)= y
∂f
∂x+ y
(x∂2f
∂x2+ y
∂2f
∂x∂y
)+ x
∂f
∂y+ x
(x∂2f
∂y∂x+ y
∂2f
∂y2
)= y
∂f
∂x+ xy
∂2f
∂x2+ y2
∂2f
∂x∂y+ x
∂f
∂y+ x2
∂2f
∂y∂x+ xy
∂2f
∂y2
So∂2f
∂u∂v− ∂f
∂v= xy
(∂2f
∂x2+∂2f
∂y2
)+ (x2 + y2)
∂2f
∂x∂y.
16. If f(x, y) is a function of x and y, and if x = eu cos v and y = eu sin v, express ∂f/∂u and∂f/∂v in terms of ∂f/∂x and ∂f/∂y, and prove that
∂2f
∂u2+∂2f
∂v2= e2u
(∂2f
∂x2+∂2f
∂y2
).
Solution:
By the chain rule,
∂f
∂u=∂f
∂x
∂x
∂u+∂f
∂y
∂y
∂u= eu cos v
∂f
∂x+ eu sin v
∂f
∂y(1)
∂f
∂v=∂f
∂x
∂x
∂v+∂f
∂y
∂y
∂v= −eu sin v
∂f
∂x+ eu cos v
∂f
∂y(2)
Replace f by∂f
∂xin (1) to get
∂
∂u
(∂f
∂x
)= eu cos v
∂2f
∂x2+ eu sin v
∂2f
∂y∂x(3)
Replace f by∂f
∂yin (1) to get
∂
∂u
(∂f
∂y
)= eu cos v
∂2f
∂x∂y+ eu sin v
∂2f
∂y2(4)
Replace f by∂f
∂xin (2) to get
∂
∂v
(∂f
∂x
)= −eu sin v
∂2f
∂x2+ eu cos v
∂2f
∂y∂x(5)
Page 7
Replace f by∂f
∂yin (2) to get
∂
∂v
(∂f
∂y
)= −eu sin v
∂2f
∂x∂y+ eu cos v
∂2f
∂y2(6)
Differentiate (1) with respect to u and use (3) and (4) to get
∂2f
∂u2= eu cos v
∂f
∂x+ eu cos v
∂
∂u
(∂f
∂x
)+ eu sin v
∂f
∂y+ eu sin v
∂
∂u
(∂f
∂y
)= eu cos v
(∂f
∂x+ eu cos v
∂2f
∂x2+ eu sin v
∂2f
∂y∂x
)+ eu sin v
(∂f
∂y+ eu cos v
∂2f
∂x∂y+ eu sin v
∂2f
∂y2
)Differentiate (2) with respect to v and use (5) and (6) to get
∂2f
∂v2= −eu cos v
∂f
∂x− eu sin v
∂
∂v
(∂f
∂x
)− eu sin v
∂f
∂y+ eu cos v
∂
∂v
(∂f
∂y
)= −eu cos v
∂f
∂x− eu sin v
(−eu sin v
∂2f
∂x2+ eu cos v
∂2f
∂x∂y
)− eu sin v
∂f
∂y+ eu cos v
(−eu sin v
∂2f
∂x∂y+ eu cos v
∂2f
∂y2
)So when we add, most of the terms cancel and we get
∂2f
∂u2+∂2f
∂v2=∂2f
∂x2(e2u cos2 v + e2u sin2 v
)+∂2f
∂y2(e2u cos2 v + e2u sin2 v
)= e2u
(∂2f
∂x2+∂2f
∂y2
)
17. If f(x, y) is a function of x and y, and if x = eu cosh v and y = eu sinh v, express ∂f/∂uand ∂f/∂v in terms of ∂f/∂x and ∂f/∂y, and prove that
∂2f
∂u2− ∂2f
∂v2= e2u
(∂2f
∂x2− ∂2f
∂y2
).
Solution:
By the chain rule,
∂f
∂u=∂f
∂x
∂x
∂u+∂f
∂y
∂y
∂u= eu cosh v
∂f
∂x+ eu sinh v
∂f
∂y(1)
∂f
∂v=∂f
∂x
∂x
∂v+∂f
∂y
∂y
∂v= eu sinh v
∂f
∂x+ eu cosh v
∂f
∂y(2)
Replace f by∂f
∂xin (1) to get
∂
∂u
(∂f
∂x
)= eu cosh v
∂2f
∂x2+ eu sinh v
∂2f
∂y∂x(3)
Page 8
Replace f by∂f
∂yin (1) to get
∂
∂u
(∂f
∂y
)= eu cosh v
∂2f
∂x∂y+ eu sinh v
∂2f
∂y2(4)
Replace f by∂f
∂xin (2) to get
∂
∂v
(∂f
∂x
)= eu sinh v
∂2f
∂x2+ eu cosh v
∂2f
∂y∂x(5)
Replace f by∂f
∂yin (2) to get
∂
∂v
(∂f
∂y
)= eu sinh v
∂2f
∂x∂y+ eu cosh v
∂2f
∂y2(6)
Differentiate (1) with respect to u and use (3) and (4) to get
∂2f
∂u2= eu cosh v
∂f
∂x+ eu cosh v
∂
∂u
(∂f
∂x
)+ eu sinh v
∂f
∂y+ eu sinh v
∂
∂u
(∂f
∂y
)= eu cosh v
(∂f
∂x+ eu cosh v
∂2f
∂x2+ eu sinh v
∂2f
∂y∂x
)+ eu sinh v
(∂f
∂y+ eu cosh v
∂2f
∂x∂y+ eu sinh v
∂2f
∂y2
)Differentiate (2) with respect to v and use (5) and (6) to get
∂2f
∂v2= eu cosh v
∂f
∂x+ eu sinh v
∂
∂v
(∂f
∂x
)+ eu sinh v
∂f
∂y+ eu cosh v
∂
∂v
(∂f
∂y
)= eu cosh v
∂f
∂x+ eu sinh v
(eu sinh v
∂2f
∂x2+ eu cosh v
∂2f
∂x∂y
)eu sinh v
∂f
∂y+ eu cosh v
(eu sinh v
∂2f
∂x∂y+ eu cosh v
∂2f
∂y2
)So when we subtract, most of the terms cancel and we get
∂2f
∂u2− ∂2f
∂v2=∂2f
∂x2(e2u cosh2 v − e2u sinh2 v
)+∂2f
∂y2(−e2u cosh2 v + e2u sinh2 v
)= e2u
(∂2f
∂x2− ∂2f
∂y2
)
18. Let f(r) be a function of r and assume that r =√x2 + y2. Prove that
∂2f
∂x2+∂2f
∂y2=d2f
dr2+
1
r
df
dr.
Page 9
Solution:
First note that∂r
∂x=
x√x2 + y2
=x
r.
By the chain rule,
∂f
∂x=df
dr
∂r
∂x=df
dr
x
r∂2f
∂x2=
∂
∂x
(df
dr
x
r
)=d2f
dr2∂r
∂x
x
r+df
dr
(1
r− x
r2∂r
∂x
)=d2f
dr2x2
r2+df
dr
(1
r− x2
r3
)=d2f
dr2x2
r2+df
dr
(r2 − x2
r3
)=d2f
dr2x2
r2+df
dr
(y2
r3
)By symmetry,
∂2f
∂y2=d2f
dr2y2
r2+df
dr
(x2
r3
)and so
∂2f
∂x2+∂2f
∂y2=d2f
dr2
(x2 + y2
r2
)+df
dr
(x2 + y2
r3
)=d2f
dr2+
1
r
df
dr.
19. Write Laplace’s equation∂2f
∂x2+∂2f
∂y2= 0
in terms of polar coordinates (r, θ) where x = r cos θ, y = r sin θ.
Solution:
We use the chain rule:
∂f
∂r=∂f
∂x
∂x
∂r+∂f
∂y
∂y
∂θ=∂f
∂xcos θ +
∂f
∂ysin θ
∂f
∂θ=∂f
∂x
∂x
∂θ+∂f
∂y
∂y
∂θ= −∂f
∂xr sin θ +
∂f
∂yr cos θ
Hence
∂
∂r
(∂f
∂x
)=
∂
∂x
(∂f
∂x
)cos θ +
∂
∂y
(∂f
∂x
)sin θ =
∂2f
∂x2cos θ +
∂2f
∂y∂xsin θ
∂
∂θ
(∂f
∂x
)= −∂
2f
∂x2r sin θ +
∂2f
∂y∂xr cos θ
∂
∂r
(∂f
∂y
)=
∂
∂x
(∂f
∂y
)cos θ +
∂
∂y
(∂f
∂y
)sin θ =
∂2f
∂x∂ycos θ +
∂2f
∂y2sin θ
∂
∂θ
(∂f
∂y
)= − ∂2f
∂x∂yr sin θ +
∂2f
∂y2r cos θ
Page 10
Thus
∂2f
∂r2=
∂
∂r
(∂f
∂xcos θ +
∂f
∂ysin θ
)=
∂
∂r
(∂f
∂x
)cos θ +
∂
∂r
(∂f
∂y
)sin θ
=∂2f
∂x2cos2 θ +
∂2f
∂y∂xsin θ cos θ +
∂2f
∂x∂ycos θ sin θ +
∂2f
∂y2sin2 θ
=∂2f
∂x2cos2 θ + 2
∂2f
∂x∂ycos θ sin θ +
∂2f
∂y2sin2 θ
and
∂2f
∂θ2=
∂
∂θ
(−∂f∂xr sin θ +
∂f
∂yr cos θ
)= − ∂
∂θ
(∂f
∂x
)r sin θ − ∂f
∂xr cos θ +
∂
∂θ
(∂f
∂y
)r cos θ − ∂f
∂yr sin θ
= −(−∂
2f
∂x2r sin θ +
∂2f
∂y∂xr cos θ
)r sin θ − ∂f
∂xr cos θ +
(− ∂2f
∂x∂yr sin θ +
∂2f
∂y2r cos θ
)r cos θ − ∂f
∂yr sin θ
=∂2f
∂x2r2 sin2 θ − ∂f
∂xr cos θ +
∂2f
∂y2r2 cos2 θ − ∂f
∂yr sin θ − 2
∂2f
∂y∂xr2 cos θ sin θ
Moreover
∂2f
∂θ∂r=
∂
∂θ
(∂f
∂xcos θ +
∂f
∂ysin θ
)=
∂
∂θ
(∂f
∂x
)cos θ − ∂f
∂xsin θ +
∂
∂θ
(∂f
∂y
)sin θ +
∂f
∂ycos θ
=
(−∂
2f
∂x2r sin θ +
∂2f
∂y∂xr cos θ
)cos θ − ∂f
∂xsin θ +
(− ∂2f
∂x∂yr sin θ +
∂2f
∂y2r cos θ
)sin θ +
∂f
∂ycos θ
= −∂2f
∂x2r sin θ cos θ − ∂f
∂xsin θ +
∂2f
∂x∂yr(cos2 θ − sin2 θ
)+∂2f
∂y2r cos θ sin θ +
∂f
∂ycos θ
So
r2∂2f
∂r2+∂2f
∂θ2= r2
(∂2f
∂x2cos2 θ + 2
∂2f
∂x∂ycos θ sin θ +
∂2f
∂y2sin2 θ
)+
+∂2f
∂x2r2 sin2 θ − ∂f
∂xr cos θ +
∂2f
∂y2r2 cos2 θ − ∂f
∂yr sin θ − 2
∂2f
∂y∂xr2 cos θ sin θ
= r2∂2f
∂x2+ r2
∂2f
∂y2− ∂f
∂xr cos θ − ∂f
∂yr sin θ
= r2∂2f
∂x2+ r2
∂2f
∂y2− r∂f
∂r
and hence∂2f
∂r2+
1
r2∂2f
∂θ2+
1
r
∂f
∂r=∂2f
∂x2+∂2f
∂y2
and we can write Laplace’s equation as
r2∂2f
∂r2+∂2f
∂θ2+ r
∂f
∂r= 0.
Page 11
20. Show that r cos θ is a solution of Laplace’s equation.
Solution:
Let f = r cos θ; then
∂f
∂r= cos θ
∂2f
∂r2= 0
∂f
∂θ= −r sin θ
∂2f
∂θ2= −r cos θ
Thus
r2∂2f
∂r2+∂2f
∂θ2+ r
∂f
∂r= 0− r cos θ + r cos θ = 0
as required.
21. Show that cos θ is not a solution of Laplace’s equation.
Solution:
Let f = cos θ; then
∂f
∂r= 0
∂2f
∂r2= 0
∂f
∂θ= − sin θ
∂2f
∂θ2= − cos θ
Thus
r2∂2f
∂r2+∂2f
∂θ2+ r
∂f
∂r= 0− r cos θ + 0 6= 0
22. Find the most general solution of Laplace’s equation of the form
ar2 cos2 θ + br2 sin2 θ + cr2 cos θ sin θ.
Solution:
Let f = ar2 cos2 θ + br2 sin2 θ + cr2 cos θ sin θ. Then
∂f
∂r= 2ar cos2 θ + 2br sin2 θ + 2cr cos θ sin θ
∂2f
∂r2= 2a cos2 θ + 2b sin2 θ + 2c cos θ sin θ
∂f
∂θ= −2ar2 cos θ sin θ + 2br2 sin θ cos θ − cr2 sin2 θ + cr2 cos2 θ
= 2 (b− a) r2 cos θ sin θ + cr2(cos2 θ − sin2 θ
)∂2f
∂θ2= 2 (b− a) r2
(cos2 θ − sin2 θ
)− 4cr2 cos θ sin θ
Page 12
Thus writing Laplace’s equation as
∂2f
∂r2+
1
r2∂2f
∂θ2+
1
r
∂f
∂r= 0
we need
2a cos2 θ + 2b sin2 θ + 2c cos θ sin θ + 2a cos2 θ + 2b sin2 θ + 2c cos θ sin θ
+2 (b− a)(cos2 θ − sin2 θ
)− 4c cos θ sin θ = 0
2 (a+ b) cos2 θ + 2 (a+ b) sin2 θ = 0
a+ b = 0
Thus the most general solution of this form is
ar2(cos2 θ − sin2 θ
)+ cr2 cos θ sin θ
which using trigonometric identities is
Ar2 cos 2θ +Br2 sin 2θ
Page 13
Surfaces
23. Find the directional derivative of f(x, y, z) = x2 + 2y2 + 3z2 at (1, 1, 0) in the directioni− j + 2k.
Solution:
We have ∇f = (2x, 4y, 6z) so ∇f(1, 1, 0) = (2, 4, 0). Hence the required directional derivativeis
(2, 4, 0) • (1,−1, 2)√1 + 1 + 4
= − 2√6.
24. Find the gradient vectors for the following functions:
a) f(x, y) = ex cos y, b) f(x, y, z) = log(x2 + 2y2 − 3z2).
Solution:
(a)
∇f =
(∂f
∂x,∂f
∂y
)= (ex cos y,−ex sin y)
(b)
∇f =
(∂f
∂x,∂f
∂y,∂f
∂z
)=
(2x
x2 + 2y2 − 3z2,
4y
x2 + 2y2 − 3z2,
−6z
x2 + 2y2 − 3z2
)
25. A function f(x, y) has at the point (1, 2) a directional derivative +2 in direction i and −√
2in direction i + j. Determine grad f at (1, 2), and calculate the directional derivative at (1, 2)in direction 3i + 4j.
Solution:
Let ∇f = (a, b) at (1, 2). Then (a, b) • (1, 0) = 2, so a = 2. Also
(a, b) • (1, 1)√1 + 1
= −√
2 =⇒ 2 + b = −2 =⇒ b = −4
Thus ∇f(1, 2) = (2,−4) and the required directional derivative is (2,−4) • (3, 4)√9 + 16
= −2.
26. Find the directional derivative of f(x, y, z) = x + y2 + xz2 at (1, 2,−1) in the directioni + j− 3k.
Solution:
We have ∇f = (1 + z2, 2y, 2xz) so ∇f(1, 2,−1) = (2, 4,−2). Hence the required directionalderivative is
(2, 4,−2) • (1, 1,−3)√1 + 1 + 9
=12√11
Page 14
27. Find the directional derivative of f(x, y, z) = x3yz − x2 + z2 at (2,−1, 1) in the direction2i + j + 2k.
Solution:
We have ∇f = (3x2yz−2x, x3z, x3y+2z) so ∇f(2,−1, 1) = (−16, 8,−6). Hence the requireddirectional derivative is
(−16, 8,−6) • (2,−1, 1)√4 + 1 + 4
=−36√
3= −12
28. Find the directional derivative of f(x, y, z) = x + y2 + z3 + x3y2z at (1,−1,−2) in thedirection i + 2j− 3k.
Solution:
We have ∇f = (1 + 3x2y2z, 2y+ 2x3yz, 3z2 +x3y2) so ∇f(1,−1,−2) = (−5, 2, 13). Hence therequired directional derivative is
(−5, 2, 13) • (1, 2,−3)√1 + 4 + 9
=−40√
14
29. A function f(x, y, z) has, at the point (1,−1, 2), a directional derivative −√
2 in directioni + k, 1√
2in direction j + k and 0 in direction i + j + k. Determine grad f at (1,−1, 2), and
calculate the directional derivative at (1,−1, 2) in direction i− 2j + 3k.
Solution:
Let ∇f = (a, b, c) at (1,−1, 2). Then
(a, b, c) • (1, 0, 1)√1 + 0 + 1
= −√
2
(a, b, c) • (0, 1, 1)√0 + 1 + 1
=1√2
(a, b, c) • (1, 1, 1)√1 + 1 + 1
= 0
=⇒
a + c = −2
b+ c = 1
a+ b+ c = 0
giving ∇f(1,−1, 2) = (a, b, c) = (−1, 2,−1). Hence the required directional derivative is
(−1, 2,−1) • (1,−2, 3)√1 + 4 + 9
=−8√
14
30. A function f(x, y, z) has, at the point (1, 1, 1) a directional derivative 3 in direction k, 2√
3in direction i+ j+ k and 1√
2in direction i− j. Determine grad f at (1, 1, 1), and calculate the
directional derivative at (1, 1, 1) in direction i− j + k.
Page 15
Solution:
Let ∇f = (a, b, c) at (1, 1, 1). Then
(a, b, c) • (0, 0, 1)√0 + 0 + 1
= 3
(a, b, c) • (1, 1, 1)√1 + 1 + 1
= 2√
3
(a, b, c) • (1,−1, 0)√1 + 1
=1√2
=⇒
c = 3
a+ b+ c = 6
a− b = 1
giving ∇f(1, 1, 1) = (a, b, c) = (2, 1, 3). Hence the required directional derivative is
(2, 1, 3) • (1,−1, 1)√1 + 1 + 1
=4√3
31. Let f(x, y, z) = axy2 + byz + cz2x3. Find values of the constants a, b and c such that atthe point (1, 2,−1) the directional derivative of f takes its maximum value in the direction ofthe positive z-axis and that value is 64.
Solution:
We have ∇f = (ay2 + 3cz2x2, 2axy + bz, by + 2czx3) so
∇f(1, 2,−1) = (4a+ 3c, 4a− b, 2b− 2c)
Since the directional derivative of f at (1, 2,−1) takes its greatest value in the direction of∇f(1, 2,−1), we need
(4a+ 3c, 4a− b, 2b− 2c = (0, 0, k)
for some k. But the greatest value is 64, so we must have k = (0, 0, k)• (0, 0, 1) = 64 and thus
4a+ 3c = 0
4a− b = 0
2b− 2c = 64
=⇒ a = 6, b = 24, c = −8
32. Write down the equations of the tangent plane and the normal line to the surface x2+2yz =2 at the point (a, b, c). Find the equations of the tangent planes to this surface which are parallelto the plane 4x + y − 7z = 0. Find also the co-ordinates of the point where the normal at(2, 1,−1) meets the surface again.
Solution:
Let f = x2 + 2yz − 2. Then ∇f = (2x, 2z, 2y) and so ∇f(a, b, c) = (2a, 2c, 2b).
The tangent plane at (a, b, c) hence has equation 2ax + 2cy + 2bz = d for some constant d.Evaluating this at the point (x, y, z) = (a, b, c) gives d = 2a2 + 4bc, so the equation of thetangent plane there is
ax+ cy + bz = a2 + 2bc
Page 16
We also find the normal line at (a, b, c) has equation
x− aa
=y − bc
=z − cb
For the tangent plane to be parallel to the given plane we need (a, c, b) = λ(4, 1,−7). Substi-tuting these values of a, c, b into f(a, b, c) = 0, we get 16λ2 + 2(−7λ)(λ)− 2 = 0, ie λ = ±1.Thus (a, c, b) = ±(4, 1,−7), giving a2 + 2bc = 16 + 2(−7) = 2, and so the equations are
4x+ y − 7z = ±2.
The normal at (2, 1,−1) isx− 2
2=y − 1
−1=z + 1
1
which in parametric form is
(x, y, z) = (2µ+ 2,−µ+ 1, µ− 1)
So we need
(2µ+ 2)2 + 2 (−µ+ 1) (µ− 1)− 2 = 0
2µ2 + 12µ = 0
so µ = 0 or µ = −6. Thus the required point is (−10, 7,−7).
33. Let S be the surface with equation xy + 2yz + 3zx = 0 and let P be the point (1,−1, 1)on the surface. Find the equations of the normal line and the tangent plane to S at P . Findthe point where the normal at P meets S again.
Solution:
Let f = xy + 2yz + 3zx; then ∇f = (3z + y, x+ 2z, 2y + 3x) so the normal direction to thesurface at p = (1,−1, 1) is
n = ∇f(p) = ∇f(1,−1, 1) = (2, 3, 1) .
The normal line at p in parametric form is
x = p + λn = (1,−1, 1) + λ(2, 3, 1)
or equivalently,x− 1
2=y + 1
3=z
1.
The equation of the tangent plane at p is (x− p) · n = 0 which is
2(x− 1) + 3(y + 1) + z − 1 = 0 i.e. 2x+ 3y + z = 0.
Points on the normal line have coordinates
x = (x, y, z) = (1 + 2λ,−1 + 3λ, 1 + λ)
and these lie on the surface when
xy + 2yz + 3zx = (1 + 2λ)(−1 + 3λ) + 2(−1 + 3λ)(1 + λ) + 3(1 + 2λ)(1 + λ)
= 18λ2 + 14λ = 0.
Page 17
The solutions λ = 0 and λ = −79
correspond to the point p and the other point of intersection(−5
9,−30
9,2
9
)respectively.
34. Find a unit normal to the surface 2x3z + x2y2 + xyz − 4 = 0 at the point (2, 1, 0).
Solution:
Let f = 2x3z + x2y2 + xyz − 4; then ∇f = (6x2z + 2xy2 + yz, 2x2y + xz, 2x3 + xy) and so∇f(2, 1, 0) = (4, 8, 18) is normal to the surface. Thus the unit normal is
1√101
(2, 4, 9).
35. (Harder). Find the equations of the tangent plane and the normal line to the surfacexy + yz + zx = 0 at the point (a, b, c). Let P be a point on the surface and suppose that thenormal at P meets the surface again at Q, and the normal at Q meets the surface again at R.Prove that the line through R and P passes through the origin O and that the distance fromO to P is 9 times the distance from O to R.
Solution:
Let f = xy+ yz+ zx. Then ∇f = (y+ z, z+ x, x+ y) and so the normal to S at p = (a, b, c)has direction
n = ∇f(p) = (b+ c, c+ a, a+ b).
Thus the equation of the tangent plane at p is (x− p) · n = 0, i.e.
x(b+ c) + y(c+ a) + z(a+ b) = a(b+ c) + b(c+ a) + c(a+ b)
a(y + z) + b(z + x) + c(x+ y) = 2(ab+ bc+ ca)
The normal line has parametric form x = p + λn, i.e.
(x, y, z) = (a, b, c) + λ(b+ c, c+ a, a+ b)
This meets S again when xy + yz + zx = 0, i.e.(a+ λ(b+ c)
)(b+ λ(c+ a)
)+(b+ λ(c+ a)
)(c+ λ(a+ b)
)+(
c+ λ(a+ b))(a+ λ(b+ c)
)= 0
This simplifies to
λ2(a2 + b2 + c2 + 3ab+ 3bc+ 3ca)
)+λ(
2a2 + 2b2 + 2c2 + 2ab+ 2bc+ 2ca)
+(ab+ bc+ ca
)= 0
But (a, b, c) is on S so ab+ bc+ ca = 0, hence
λ2(a2 + b2 + c2
)+ 2λ
(a2 + b2 + c2
)= 0
Page 18
Assuming (a, b, c) is no the origin, this gives λ(λ + 2) = 0. Thus the normal meets S againwhen λ = −2, i.e. at the point
q = (a− 2b− 2c, b− 2c− 2a, c− 2a− 2b)
Replacing (a, b, c) with (a− 2b− 2c, b− 2c− 2a, c− 2a− 2b) in this will then give the secondintersection of S with the normal through q, i.e. at
r =(
(a− 2b− 2c)− 2(b− 2c− 2a)− 2(c− 2a− 2b),
(b− 2c− 2a)− 2(c− 2a− 2b)− 2(a− 2b− 2c),
(c− 2a− 2b)− 2(a− 2b− 2c)− 2(b− 2c− 2a))
i.e. r = (9a, 9b, 9c) = 9p and the result follows.
36. Find a vector v in terms of x, y and z which is normal to the surface z =√x2 + y2 +
(x2 + y2)3/2 at a general point (x, y, z) 6= (0, 0, 0) of the surface. Find the cosine of the angle θbetween v and the z-axis and determine the limit of cos θ as (x, y, z)→ (0, 0, 0).
Solution:
Let f =√x2 + y2 + (x2 + y2)3/2 − z. Then
v = ∇f =(x(x2 + y2
)−1/2+ 3x
(x2 + y2
)1/2, y(x2 + y2
)−1/2+ 3y
(x2 + y2
)1/2,−1
)is normal to the surface. Also,
cos θ =v · (0, 0, 1)
|v|
=−1
x2(x2 + y2)−1 + 9x2(x2 + y2) + 6x2 + y2(x2 + y2)−1 + 9y2(x2 + y2) + 6y2 + 1
=−1
2 + 9x2 + y2)2 + 6(x2 + y2)−→ −1
2as (x, y, z)→ (0, 0, 0)
37. Find divu where u = (cosx, cos y, cos z). Hence find divu at(π4, π3, π2
).
Solution:
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)• (cosx, cos y, cos z)
=∂
∂xcosx+
∂
∂ycos y +
∂
∂zcos z
= − sinx− sin y − sin z
Hence divu(π4, π3, π2
)= − 1√
2−√32− 1.
38. Find curl u where u = (cosx, cos y, cos z). Hence find curl u at(π4, π3, π2
).
Page 19
Solution:
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zcosx cos y cos z
∣∣∣∣∣∣∣∣=
(∂
∂ycos z − ∂
∂zcos y
)i−(∂
∂xcos z − ∂
∂zcosx
)j
+
(∂
∂xcos y − ∂
∂ycosx
)k
= 0i + 0j + 0k = 0
Hence curl u(π4, π3, π2
)= 0.
39. Find divu where u = (cos y, cos z, cosx). Hence find divu at(π4, π3, π2
).
Solution:
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)• (cos y, cos z, cosx)
=∂
∂xcos y +
∂
∂ycos z +
∂
∂zcosx
= 0 + 0 + 0 = 0
Hence divu(π4, π3, π2
)= 0.
40. Find curl u where u = (cos y, cos z, cosx). Hence find curl u at(π4, π3, π2
).
Solution:
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zcos y cos z cosx
∣∣∣∣∣∣∣∣=
(∂
∂ycosx− ∂
∂zcos z
)i−(∂
∂xcosx− ∂
∂zcos y
)j
+
(∂
∂xcos z − ∂
∂ycos y
)k
= (sin z)i + (sinx)j + (sin yk
Hence curl u(π4, π3, π2
)= i + 1√
2j +
√32k.
41. Find divu where u = (x2 + y2 + z2, yz+ zx+ xy, x2y2z2). Hence find divu at (1, 2,−1).
Page 20
Solution:
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)•(x2 + y2 + z2, yz + zx+ xy, x2y2z2
)=
∂
∂x(x2 + y2 + z2) +
∂
∂y(yz + zx+ xy) +
∂
∂z(x2y2z2)
= 2x+ z + x+ 2x2y2z
= 3x+ z + 2x2y2z
Hence divu(1, 2,−1) = 3− 1− 8 = −6.
42. Find curl u where u = (x2 + y2 + z2, yz+ zx+xy, x2y2z2). Hence find curl u at (1, 2,−1).
Solution:
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zx2 + y2 + z2 yz + zx+ xy x2y2z2
∣∣∣∣∣∣∣∣=
(∂
∂y
(x2y2z2
)− ∂
∂z(yz + zx+ xy)
)i−(∂
∂x
(x2y2z2
)− ∂
∂z
(x2 + y2 + z2
))j
+
(∂
∂x(yz + zx+ xy)− ∂
∂y
(x2 + y2 + z2
))k
=(2x2yz2 − y − x
)i−(2xy2z2 − 2z
)j + (z + y − 2y)k
=(2x2yz2 − y − x
)i +(2z − 2xy2z2
)j + (z − y)k
Hence curl u(1, 2,−1) = i− 10j− 3k.
43. Find divu where u = (xy2 − z cos2 x, x2 sin y, xyz). Hence find divu at(π4, π4,−1
).
Solution:
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)•(xy2 − z cos2 x, x2 sin y, xyz
)=
∂
∂x
(xy2 − z cos2 x
)+
∂
∂y
(x2 sin y
)+
∂
∂z(xyz)
= y2 + 2z sinx cosx+ x2 cos y + xy
Hence divu(π4, π4,−1
)= π2
16− 1 + π2
16√2
+ π2
16= 2+
√2
32π2 − 1.
44. Find curl u where u = (xy2 − z cos2 x, x2 sin y, xyz). Hence find curl u at(π4, π4,−1
).
Solution:
Page 21
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zxy2 − z cos2 x x2 sin y xyz
∣∣∣∣∣∣∣∣=
(∂
∂y(xyz)− ∂
∂z
(x2 sin y
))i−(∂
∂x(xyz)− ∂
∂z
(xy2 − z cos2 x
))j
+
(∂
∂x
(x2 sin y
)− ∂
∂y
(xy2 − z cos2 x
))k
= (xz) i−(yz + cos2 x
)j + (2x sin y − 2xy)k
Hence curl u(π4, π4,−1
)=(−π
4
)i +(π4− 1
2
)j +(
π2√2− π2
8
)k.
45. Find divu where u = (sinx, sin y, sin z). Hence find divu at(π4, π3, π2
).
Solution:
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)• (sinx, sin y, sin z)
=∂
∂xsinx+
∂
∂ysin y +
∂
∂zsin z
= cosx+ cos y + cos z
Hence divu(π4, π3, π2
)= 1√
2+ 1
2.
46. Find curl u where u = (sinx, sin y, sin z). Hence find curl u at(π4, π3, π2
).
Solution:
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zsinx sin y sin z
∣∣∣∣∣∣∣∣=
(∂
∂ysin z − ∂
∂zsin y
)i−(∂
∂xsin z − ∂
∂zsinx
)j
+
(∂
∂xsin y − ∂
∂ysinx
)k
= 0i + 0j + 0k = 0
Hence curl u(π4, π3, π2
)= 0.
47. Find divu where u = (z sinx, x sin y, y sin z). Hence find divu at(π4, π3, π2
).
Solution:
Page 22
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)• (z sinx, x sin y, y sin z)
=∂
∂x(z sinx) +
∂
∂y(x sin y) +
∂
∂z(y sin z)
= z cosx+ x cos y + y cos z
Hence divu(π4, π3, π2
)= π
2√2
+ π8.
48. Find curl u where u = (z sinx, x sin y, y sin z). Hence find curl u at(π4, π3, π2
).
Solution:
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zz sinx x sin y y sin z
∣∣∣∣∣∣∣∣=
(∂
∂y(y sin z)− ∂
∂z(x sin y)
)i−(∂
∂x(y sin z)− ∂
∂z(z sinx)
)j
+
(∂
∂x(x sin y)− ∂
∂y(z sinx)
)k
= (sin z)i + (sinx)j + (sin y)k
Hence curl u(π4, π3, π2
)= i + 1√
2j +
√32k.
49. Find divu where u = (y sinx, z sin y, x sin z). Hence find divu at(π4, π3, π2
).
Solution:
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)• (y sinx, z sin y, x sin z)
=∂
∂x(y sinx) +
∂
∂y(z sin y) +
∂
∂z(x sin z)
= y cosx+ z cos y + x cos z
Hence divu(π4, π3, π2
)= π
3√2
+ π4.
50. Find curl u where u = (y sinx, z sin y, x sin z). Hence find curl u at(π4, π3, π2
).
Solution:
Page 23
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zy sinx z sin y x sin z
∣∣∣∣∣∣∣∣=
(∂
∂y(x sin z)− ∂
∂z(z sin y)
)i−(∂
∂x(x sin z)− ∂
∂z(y sinx)
)j
+
(∂
∂x(z sin y)− ∂
∂y(y sinx)
)k
= (− sin y)i + (− sin z)j + (− sinx)k
Hence curl u(π4, π3, π2
)= −
√32i− j− 1√
2k.
51. Find divu where u = (xy sin z, yz sinx, zx sin y). Hence find divu at(π4, π3, π2
).
Solution:
divu = ∇ • u =
(∂
∂x,∂
∂y,∂
∂z
)• (y sinx, z sin y, x sin z)
=∂
∂x(xy sin z) +
∂
∂y(yz sinx) +
∂
∂z(zx sin y)
= y sin z + z sinx+ x sin y
Hence divu(π4, π3, π2
)= π
3+ π
2√2
+ π√3
8.
52. Find curl u where u = (xy sin z, yz sinx, zx sin y). Hence find curl u at(π4, π3, π2
).
Solution:
curl u = ∇× u =
∣∣∣∣∣∣∣∣i j k∂
∂x
∂
∂y
∂
∂zxy sin z yz sinx zx sin y
∣∣∣∣∣∣∣∣=
(∂
∂y(zx sin y)− ∂
∂z(yz sinx)
)i−(∂
∂x(zx sin y)− ∂
∂z(xy sin z)
)j
+
(∂
∂x(yz sinx)− ∂
∂y(xy sin z)
)k
= (zx cos y − y sinx)i + (xy cos z − z sin y)j + (yz cosx− x sin z)k
Hence curl u(π4, π3, π2
)=(π2
16− π
3√2
)i− π
√3
4j +(
π2
6√2− π
4
)k.
53. Find all the critical points of the following functions and classify each as a local maximum,minimum or saddle point.
a) x2 + y4 − 2x− 4y2 + 5 b) 2x3 − 9x2y + 12xy2 − 60y,
c) (x2 + y2)2 − 8(x2 − y2), d) x2y2 − x2 − y2,
Page 24
e) y2 + xy + x2 + 4y − 4x+ 5.
Solution:
We will use the notation fx = ∂f/∂x, fxx = ∂2f/∂x2, etc.
(a) We have
fx = 2x− 2 = 0 and fy = 4y3 − 8y = 0
⇐⇒ x = 1 and y(y2 − 2) = 0
⇐⇒ x = 1 and y = 0,±√
2
So the critical points are (1, 0), (1,√
2) and (1,−√
2). Also,
fxx = 2, fyy = 12y2 − 8 and fxy = 0.
Hence
• at (1, 0), fxxfyy − f 2xy = −16 < 0 so this is a saddle point,
• at (1,√
2), fxxfyy − f 2xy = 32 > 0 and fxx = 2 > 0 so this is a local minimum,
• at (1,−√
2), fxxfyy − f 2xy = 32 > 0 and fxx = 2 > 0 so this is a local minimum.
(b) We have
fx = 6x2 − 18xy + 12y2 = 0 and fy = −9x2 + 24xy − 60 = 0
⇐⇒ 6(x− y)(x− 2y) = 0 and 3x2 − 8xy + 20 = 0
When x = y, we have 3x2 − 8xy + 20 = −5y2 + 20 = 0 so y = ±2.
When x = 2y, we have 3x2 − 8xy + 20 = −4y2 + 20 = 0 so y = ±√
5.
So the critical points are (2, 2), (−2,−2), (2√
5,√
5) and (−2√
5,−√
5). Also,
fxx = 12x− 18y, fyy = 24x and fxy = −18x+ 24y.
Hence
• at (2, 2), fxxfyy − f 2xy = (−12)(48)− 122 < 0 so this is a saddle point,
• at (−2,−2), fxxfyy − f 2xy = (12)(−48)− (−12)2 < 0 so this is a saddle point,
• at (2√
5,√
5), fxxfyy − f 2xy = (−12
√5)(48
√5)− (−12
√5)2 > 0 and fxx = 6
√5 > 0 so
this is a local minimum,
• at (−2√
5,−√
5), fxxfyy − f 2xy = (12
√5)(−48
√5)− (12
√5)2 < 0 and fxx = −6
√5 > 0
so this is a local maximum,
(c) We have
fx = 4x(x2 + y2)− 16x = 0 and fy = 4y(x2 + y2) + 16y = 0
⇐⇒ x(x2 + y2 − 4) = 0 and y(x2 + y2 + 4) = 0
⇐⇒ x(x2 + y2 − 4) = 0 and y = 0 (as x2 + y2 can’t be negative)
⇐⇒ x(x2 − 4) = 0 and y = 0
So the critical points are (0, 0), (2, 0) and (−2, 0). Also,
fxx = 12x2 + 4y2 − 16, fyy = 4x2 + 12y2 + 16 and fxy = 8xy.
Hence
Page 25
• at (0, 0), fxxfyy − f 2xy = (−16)(16) < 0 so this is a saddle point,
• at (2, 0), fxxfyy − f 2xy = (32)(32) > 0 and fxx = 32 > 0 so this is a local minimum.
• at (−2, 0), fxxfyy − f 2xy = (32)(32) > 0 and fxx = 32 > 0 so this is a local minimum.
(d) We have
fx = 2xy2 − 2x = 0 and fy = 2x2y − 2y = 0
⇐⇒ x(y2 − 1) = 0 and y(x2 − 1) = 0
⇐⇒ x = y = 0 or x2 = y2 = 1
So the critical points are (0, 0), (1, 1), (−1,−1), (1,−1) and (−1, 1). Also,
fxx = 2y2 − 2, fyy = 2x2 − 2 and fxy = 4xy.
Hence
• at (0, 0), fxxfyy − f 2xy = (−2)(−2) > 0 and fxx = −2 < 0 so this is a local maximum.
• at all the other critical points, fxxfyy − f 2xy = −16 < 0 so these are saddle points.
(e) We have
fx = y + 2x− 4 = 0 and fy = 2y + x+ 4 = 0
⇐⇒ x = 4 and y = −4
So there is only one critical points at (4,−4). Also,
fxx = 2, fyy = 2 and fxy = 1
so at (4,−4), fxxfyy − f 2xy = (2)(2)− 1 > 0 and fxx = 2 > 0 so this is a local minimum.
54. Find all the critical points of f(x, y) = y2 + sinx and classify each as a local maximum,minimum or saddle point.
Solution:
We have
fx = cosx = 0 and fy = 2y = 0
⇐⇒ x =(n+ 1
2
)π and y = 0
for any integer n so the critical points are((n+ 1
2
)π, 0). Also,
fxx = − sinx, fyy = 2 and fxy = 0
and since sin(n+ 1
2
)π = (−1)n,
• for n even, fxxfyy− f 2xy = −2(−1)n = −2 < 0 so in this case,
((n+ 1
2
)π, 0)
is a saddlepoint,
• for n odd, fxxfyy − f 2xy = −2(−1)n = 2 > 0 and fxx = (−1)n = 1 < 0 so in this case,((
n+ 12
)π, 0)
is a local minimum.
Page 26
55. Find all the critical points of f(x, y) = x2 − sin y and classify each as a local maximum,minimum or saddle point.
Solution:
We have
fx = 2x = 0 and fy = − cos y = 0
⇐⇒ x = 0 and y =(n+ 1
2
)π
for any integer n so the critical points are(0,(n+ 1
2
)π). Also,
fxx = 2, fyy = sin y and fxy = 0
and since sin(n+ 1
2
)π = (−1)n,
• for n odd, fxxfyy − f 2xy = 2(−1)n = −2 < 0 so in this case,
(0,(n+ 1
2
)π)
is a saddlepoint,
• for n even, fxxfyy−f 2xy = 2(−1)n = 2 > 0 and fxx = 2 > 0 so in this case,
(0,(n+ 1
2
)π)
is a local minimum.
56. Find all the critical points of f(x, y) = cosx sin y and classify each as a local maximum,minimum or saddle point.
Solution:
We have
fx = − sinx sin y = 0 ⇐⇒ sinx = 0 or sin y = 0
⇐⇒ x = mπ or y = nπ
where m and n are integers. Similarly,
fy = cosx cos y = 0 ⇐⇒ cosx = 0 or cos y = 0
⇐⇒ x =(m+ 1
2
)π or y =
(n+ 1
2
)π
Combining these, we find the critical points are(mπ,
(n+ 1
2
)π)
and((m+ 1
2
)π, nπ
)for integers m and n. Also,
fxx = − cosx sin y, fyy = − cosx sin y and fxy = − sinx cos y
and so
• at(mπ,
(n+ 1
2
)π), we have
sinx = 0, cosx = (−1)m, sin y = (−1)n, cos y = 0
so fxxfyy − f 2xy = 1 > 0. Also, fxx = (−1)m+n+1 hence this is a local maximum if
m+ n+ 1 is odd and a local minimum if m+ n+ 1 is even.
• at((m+ 1
2
)π, nπ
),
sinx = (−1)m, cosx = 0, sin y = 0, cos y = (−1)n
so fxxfyy − f 2xy = −1 < 0 and hence this is a saddle point for all m, n.
Page 27
57. Find all the critical points of f(x, y) = sin x sin y and classify each as a local maximum,minimum or saddle point.
Solution:
We have
fx = cosx sin y = 0 ⇐⇒ cosx = 0 or sin y = 0
⇐⇒ x =(m+ 1
2
)π or y = nπ
where m and n are integers. Similarly,
fy = sinx cos y = 0 ⇐⇒ sinx = 0 or cos y = 0
⇐⇒ x = mπ or y =(n+ 1
2
)π
Combining these, we find the critical points are
(mπ, nπ) and((m+ 1
2
)π,(n+ 1
2
))for integers m and n. Also,
fxx = − sinx sin y, fyy = − sinx sin y and fxy = cosx cos y
and so
• at (mπ, nπ), we have
sinx = 0, cosx = (−1)m, sin y = 0, cos y = (−1)n
so fxxfyy − f 2xy = −1 < 0 so this is a saddle point for all m, n.
• at((m+ 1
2
)π,(n+ 1
2
)π),
sinx = (−1)m, cosx = 0, sin y = (−1)n, cos y = 0
so fxxfyy − f 2xy = 1 > 0. Also, fxx = (−1)m+n+1 hence this is a local maximum if
m+ n+ 1 is odd and a local minimum if m+ n+ 1 is even.
58. On a map of the Lake District (scale 1:100,000 = 1cm : 1 km), the height of a pointwith coordinates (x, y) is h(x, y) = 125y2 − 100x2 + 50xy + 400 metres above sea level. Findthe direction and rate of fastest ascent when at the point with coordinates (2, 1) and walkingat one km per hour. Also find the directions in which one can traverse the slope, i.e. walkhorizontally.
Solution:
We have ∇h(x, y) = (−200x+ 50 y, 250 y + 50x) and so
∇h(2, 1) = (−350, 350)
The rate of change of h(x, y) is maximum in the direction of this vector and is equal to it’s
length, i.e. in direction(− 1√
2, 1√
2
)and at rate 350
√2.
Page 28
To see this explicitly, suppose we move in direction (cos θ, sin θ) from the point (2, 1). Thenthe directional derivative is
∇h(2, 1) · (cos θ, sin θ) = −350 cos θ + 350 sin θ
so we wish to maximise the function f(θ) = −350 cos θ + 350 sin θ. It has turning pointswhen f ′(θ) = 350 sin θ + 350 cos θ = 0, i.e. tan θ = −1 so θ = −π
4, 3π
4. In these directions,
f(θ) = ±350√
2.
Similarly, to find which directions are horizontal on the surface, we want f(θ) = 0. Thishappens precisely tan θ = 0 and so when θ = π
4, 5π
4.
Page 29
First Order Ordinary Differential Equations
59. Solve each of the following separable equations:
a)dy
dx=y
x, b)
dy
dx= x3y3, c)
dy
dx= 1 + y2,
d)dy
dx=
5x+ 7
3y + 2, e)
dy
dx=
3y + 2
5x+ 7, f)
dy
dx=
1 + y2
1 + x2,
g) xdy
dx= y − xy, h)
dy
dx= 1 + x+ y + xy.
Solution:
Each time, separate the variables then integrate, being careful with the integrating constants:
(a) ∫1
ydy =
∫1
xdx =⇒ log y = log x+ logC =⇒ y = Cx
where C is a constant.
(b) ∫1
y3dy =
∫x3 dx =⇒ − 1
2y2=x4
4+ C =⇒ y = ±
√−2
x4 + 4C
where C is a constant.
(c) ∫1
1 + y2dy =
∫dx =⇒ tan−1 y = x+ C =⇒ y = tan (x+ C)
where C is a constant.
(d) ∫3y + 2 dy =
∫5x+ 7 dx =⇒ 3
2y2 + 2y =
5
2x2 + 7x+ C
where C is a constant. We could further solve this as a quadratic in y to get
y =−2±
√4 + 5x2 + 14x+ 2C
3
(e) ∫1
3y + 2dy =
∫1
5x+ 7dx =⇒ 1
3log(3y + 2) =
1
5log(5x+ 7) + C
=⇒ 3y + 2 = (5x+ 7)3/5e3C
=⇒ y =D(5x+ 7)3/5 − 2
3
where D is a constant.
(f)∫1
1 + y2dy =
∫1
1 + x2dx =⇒ tan−1 y = tan−1 x+C =⇒ y = tan
(tan−1 x+ C
)where C is a constant.
Page 30
(g) ∫1
ydy =
∫1− xx
dx =⇒ log y = log x− x+ C =⇒ y = xeC−x
where C is a constant.
(h)∫1
1 + ydy =
∫1 + x dx =⇒ log (1 + y) = x+
1
2x2 + C =⇒ y = eCxx+x
2/2 − 1
where C is a constant.
60. A hemispherical bowl of radius 2 metres is filled with water which gradually leaks awaythrough a circular hole of radius 1 millimetre in the bottom of the bowl. Torricelli’s law showsthat if h(t) is the depth in cms of water above the hole after t seconds, then h(t) satisfies thedifferential equation
1000h(400− h)dh
dt= −6
√2gh, where g = 981.
Calculate the time the bowl takes to empty.
Solution:
Separating variables, we have ∫1000h(400− h)
6√
2ghdh = −
∫dt
=⇒∫ (
4× 105h1/2 − 103h3/2)dh = −6
√2g
∫dt
=⇒ 8
3× 105h3/2 − 103 × 2
5h5/2 = −6
√2g t+ C
The initial condition is h(0) = 200, which gives
C =8
3× 108 × 2
√2− 108 × 8
√2
5=
56√
2× 108
15
The bowl is empty when h = 0 which happens at time t0 satisfying 0 = −6√
2g t0 + C, i.e.
t0 =56√
2× 108
15
1
6√
2g=
28× 108
45g' 1.987× 106 seconds ' 23 days
61. (Separable variables) Solve the following equations:
a) (x2 + 1)ydy
dx= 1 where y(0) = −3.
b)dy
dx= 3x2e−y where y(−1) = 0.
c)dy
dx= sec y where y(0) = 0.
d)dy
dx= y2 sinx where y(π) = −1/5.
Page 31
Solution:
(a) ∫y dy =
∫1
x2 + 1dx =⇒ 1
2y2 = tan−1 x+ C
From the given condition we get C =9
2, so y = ±
√2 tan−1 x+ 9. Furthermore, since y(0) is
negative we must have the negative square root i.e.
y = −√
2 tan−1 x+ 9
(b) ∫ey dy =
∫3x2 dx =⇒ ey = x3 + C
From the given condition we get C = 2, so y = log (x3 + 2).
(c) ∫cos y dy =
∫dx =⇒ sin y = x+ C
From the given condition we get C = 0, so y = sin−1 x.
(d) ∫1
y2dy =
∫sinx dx =⇒ −1
y= − cosx+ C
From the given condition we get C = −6, so y =1
cosx+ 6.
62. A wet porous substance in the open air loses its moisture at a rate proportional to themoisture content. If a sheet hung in the wind loses half its moisture during the first hour, whenwill it have lost 99%, assuming weather conditions remaining the same?
Solution:
Let y(t) be the moisture content at time t in hours. Then y′ = −ky, so separating variablesgives ∫
1
ydy = −
∫k dt =⇒ log |y| = −kt+ C =⇒ y = eC−kt
The conditions imply that y(0) = 2y(1), so that eC = 2eC−k, i.e. k = − log 2. Hence
y = eC−t log 2 = 2−teC
We now want t such that y(0) = 100y(t), i.e. eC = 100× 2−teC . Thus the required time is
t =log 100
log 2' 6.64
63. Solve the following homogeneous equations:
a)dy
dx=y
x+(yx
)2, b) 2
dy
dx=
(x+ y
x
)2
,
Page 32
c)dy
dx=y2 − x2
xy, d)
dy
dx=y2 − 2xy
x2 − 2xy.
Solution:
(a) Put y = xu, so that dydx
= xdudx
+ u. Then the equation says
xdu
dx+ u = u+ u2 =⇒ x
du
dx= u2
This is now separable and∫1
u2du =
∫1
xdx =⇒ −1
u= log |x|+ C =⇒ u =
−1
log |x|+ C
Hence
y =−x
log |x|+ C
where C is a constant.
(b) Put y = xu, so that dydx
= xdudx
+ u. Then the equation says
2xdu
dx+ 2u = (1 + u)2 =⇒ 2x
du
dx= 1 + u2
This is now separable and∫2
1 + u2du =
∫1
xdx =⇒ 2 tan−1 u = log |x|+ C =⇒ u = tan
(log |x|+ C
2
)Hence
y = x tan
(log |x|+ C
2
)where C is a constant.
(c) Put y = xu, so that dydx
= xdudx
+ u. Then the equation says
dy
dx=y
x− x
y=⇒ x
du
dx+ u = u− 1
u=⇒ x
du
dx= −1
u
This is now separable and∫u du = −
∫1
xdx =⇒ 1
2u2 = − log |x|+ C =⇒ u = ±
√2C − 2 log |x|
Hencey = ±x
√2C − 2 log |x|
where C is a constant.
(d) Put y = xu, so that dydx
= xdudx
+ u. Then the equation says
dy
dx=
y2
x2− 2 y
x
1− 2 yx
=⇒ xdu
dx+u =
u2 − 2u
1− 2u=⇒ x
du
dx=u2 − 2u− u+ 2u2
1− 2u=
3 (u2 − u)
1− 2u
Page 33
This is now separable and∫2u− 1
u2 − udu =
∫−3
xdx =⇒ log |u2 − u| = −3 log |x|+ C
=⇒ |u2 − u| = |x−3|eC
=⇒ x3u2 − x3u+D = 0 for some D = ±eC
=⇒ u =x3 ±
√x6 − 4Dx3
2x3=
1±√
1− 4Dx−3
2
=⇒ y =x± x
√1− 4Dx−3
2
where D is an arbitrary constant (positive or negative).
64. Solve the following linear equations:
a)dy
dx+y
x= x2, b)
dy
dx+ y cotx = 2 cos x,
c)dy
dx+ 2y = ex, d) x
dy
dx= y + x3.
Solution:
(a) The integrating factor is
I = e∫
1xdx = elog x = x
and multiplying the equation by this gives
d
dx(xy) = x
dy
dx+ y = x3
Integrating gives the general solution
xy =1
4x4 + C =⇒ y =
1
4x3 +
C
x
(b) The integrating factor is
I = e∫cotx dx = elog sinx = sinx
and multiplying the equation by this gives
d
dx(y sinx) = sin x
dy
dx+ cosxy = 2 cos x sinx
Integrating gives the general solution
y sinx = sin2 x+ C =⇒ y = sinx+ C cscx
(c) The integrating factor isI = e
∫2 dx = e2x
and multiplying the equation by this gives
d
dx
(e2xy
)= e2x
dy
dx+ 2e2xy = e3x
Page 34
Integrating gives the general solution
e2xy =1
3e3x + C =⇒ y =
1
3ex + Ce−2x
(d) In standard form this isdy
dx− 1
xy = x2
The integrating factor is
I = e∫− 1
xdx = e− log x =
1
x
and multiplying the equation by this gives
d
dx
(1
xy
)=
1
x
dy
dx− 1
x2y = x
Integrating gives the general solution
1
xy =
1
2x2 + C =⇒ y =
1
2x3 + Cx
65. Solve the following linear equations:
a) y′ − y tanx = secx where y(0) = 1, b) xy′ + y − ex = 0 where y(2) = 1.
Solution:
(a) The integrating factor is
I = e∫− tanx dx = e− log secx = cosx
and multiplying the equation by this gives
d
dx(y cosx) = cos x
dy
dx− y sinx = 1
Integrating gives the general solution y cosx = x+ C. The initial conditions give 1 = C, so
y = (x+ 1) secx
(b) In standard form this isdy
dx+
1
xy =
ex
xThe integrating factor is
I = e∫
1xdx = x
and multiplying the equation by this gives
d
dx(xy) = x
dy
dx+ y = ex
Integrating gives the general solution
yx = ex + C =⇒ y =ex + C
x
The initial conditions give 1 = 12
(e2 + C), so C = 2− e2. Thus y =ex + 2− e2
x.
Page 35
66. The circuit below is a condenser consisting of a voltage source V volts, a capacitor C faradsand resistors R and S ohms.
R
V C
S
The charge Q(t) at time t in the circuit is known to satisfy
RSCdQ
dt+ (R + S)Q = SCV.
If R = 5 ohms, S = 10 ohms, C = 10−3 farads and V = 30 volts, calculate Q(t) if Q(0) = 0coulombs.
Solution:
Substituting for R, S,C,E we obtain
dQ
dt+ 300Q = 6
This is linear with integrating factor is e∫300 dt = e300t and
d
dt
(Qe300t
)= e300t
dQ
dt+ 300e300tQ = 6e300t
Integrating gives
Qe300t =6
300e300t + k =⇒ Q =
1
50+ ke−300t
The initial condition Q(0) = 0 = 150
+ k gives k = − 150
and so
Q(t) =1− e−300t
50
67. Write down differential equations governing the current flow in the LR electrical circuitsillustrated below and solve the two equations.
a)
V (t) = V0
L
R
b)
V (t) = V0 sin(ωt)
L
R
Also, find the current at time t in circuit (a) if R = 1 ohm, L = 10 henrys, V0 = 6 volts, andthe current at time t = 0 is 6 amperes.
Page 36
Solution:
The differential equation is
LdI
dt+RI = V
which is linear with integrating factor is e∫
RLdt = eRt/L. We have
d
dt
(eRt/LI
)= eRt/L
dI
dt+R
LeRt/LI =
V
LeRt/L
(a) In this case, integrating gives
eRt/LI =
∫V0LeRt/L dt =
V0ReRt/L + k =⇒ I =
V0R
+ ke−Rt/L
Notice this is a constant plus an exponentially decaying term. The initial conditionsgive 6 = 6 + k and so k = 0 and I = V0/R is constant.
(b) This time, integrating gives
eRt/LI =
∫V0LeRt/L sinωt dt
=V0L
eRt/L
R2
L2 + ω2
(R
Lsinωt− ω cosωt
)+ k
=V0e
RtL (R sinωt− ωL sinωt)
R2 + ω2L2+ k
and so
I =V0
R2 + ω2L2(R sinωt− ωL sinωt) + ke−Rt/L
Notice this is a sinusoidal term plus an exponentially decaying term.
We have used here the standard integral∫eat sin bt dt =
1
2i
∫eat(eibt − e−ibt
)dt
=1
2i
∫ (e(a+ib)t − e(a−ib)t
)dt
=1
2i
(e(a+ib)t
(a+ ib)− e(a−ib)t
(a− ib)
)=eat
2i
(eibt
(a+ ib)− e−ibt
(a− ib)
)=
eat
2i (a2 + b2)
(eibt(a− ib)− e−ibt(a+ ib)
)=
eat
2i (a2 + b2)
[a(eibt − e−ibt
)− ib
(eibt + e−ibt
)]=
eat
a2 + b2[a sin bt− b cos bt]
68. Solve the following Bernoulli equations:
a) y′ + (y/x) = xy2 sinx, b) 2xy′ = 10x3y5 + y, c) xy − y′ = y3e−x2.
Page 37
Solution:
The standard form of a Bernoulli equation is
dy
dx+ f(x)y = g(x)yn
and the method is to substitute u = y1−n to obtain a linear equation.
(a) Set u =1
yso that
du
dx= − 1
y2dy
dx. The equation becomes
−y2dudx
+y
x= xy2 sinx =⇒ du
dx− 1
xu = −x sinx
This is first order linear with integrating factor e∫− 1
xdx = 1
x. Thus
d
dx
(1
xu
)=
1
x
du
dx− 1
x2u = − sinx =⇒ u
x= cosx+ C
=⇒ y =1
u=
1
x(cosx+ C)
(b) Set u =1
y4so that
du
dx= − 4
y5dy
dx. The equation becomes
−2xy5
4
du
dx= 10x3y5 + y =⇒ du
dx+
2u
x= −20x2
This is first order linear with integrating factor is e∫
2xdx = x2. Thus
d
dx
(x2u)
= x2du
dx+ 2xu = −20x4 =⇒ ux2 = −4x5 + C
=⇒ u =C − 4x5
x2
=⇒ y =1
u1/4=
x1/2
(C − 4x5)1/4
(c) Set u =1
y2so that
du
dx= − 2
y3dy
dx. The equation becomes
y3
2
du
dx+ xy = y3e−x
2
=⇒ du
dx+ 2xu = 2e−x
2
This is first order linear with integrating factor e∫2x dx = ex
2. Thus
d
dx
(ex
2
u)
= ex2 du
dx+ 2xex
2
u = 2 =⇒ ex2
u = 2x+ C
=⇒ u = e−x2
(2x+ C)
=⇒ y =1
u1/2=
ex2/2
(2x+ C)1/2
Page 38
69. Check that the following O.D.E. is exact and solve it.(x3 + 2y
) dydx
+ 3x2y + 1 = 0.
Solution:
In the standard form Qdy
dx+ P = 0, we have
Q(x, y) = x3 + 2y and P (x, y) = 3x2y + 1
We check that∂Q
∂x= 3x2 =
∂P
∂y= 3x2
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = 3x2y + 1 and
∂f
∂y= Q = x3 + 2y
Integrating the first of these with respect to x gives
f(x, y) = x3y + x+ g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= x3 + g′(y) = x3 + 2y =⇒ g′(y) = 2y so take g(y) = y2
Hencef(x, y) = x3y + x+ y2
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
y2 + x3y + x = A =⇒ y =−x3 ±
√x6 − 4Ax
2
70. Check that the following O.D.E. is exact and solve it.
2y(x4 + 1
) dydx
+ 4x3y2 − 2x− 1 = 0.
Solution:
In the standard form Qdy
dx+ P = 0, we have
Q(x, y) = 2x4y + 2y and P (x, y) = 4x3y2 − 2x− 1
We check that∂Q
∂x= 8x3y =
∂P
∂y= 8x3y
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = 4x3y2 − 2x− 1 and
∂f
∂y= Q = 2x4y + 2y
Page 39
Integrating the first of these with respect to x gives
f(x, y) = x4y2 − x2 − x+ g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= 2x4y + g′(y) = 2x4y + 2y =⇒ g′(y) = 2y so take g(y) = y2
Hencef(x, y) = x4y2 − x2 − x+ y2
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
(x4 + 1)y2 − x2 − x = A =⇒ y = ±√x2 + x+ A
x4 + 1
71. Check that the following O.D.E. is exact and solve it.
x3 cos ydy
dx+ 3x2 sin y + 1 = 0.
Solution:
In the standard form Qdy
dx+ P = 0, we have
Q(x, y) = x3 cos y and P (x, y) = 3x2 sin y + 1
We check that∂Q
∂x= 3x2 cos y =
∂P
∂y= 3x2 cos y
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = 3x2 sin y + 1 and
∂f
∂y= Q = x3 cos y
Integrating the first of these with respect to x gives
f(x, y) = x3 sin y + x+ g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= x3 cos y + g′(y) = x3 cos y =⇒ g′(y) = 0 so take g(y) = 0
Hencef(x, y) = x3 sin y + x
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
x3 sin y + x = A =⇒ y = sin−1(A− xx3
)
Page 40
72. Check that the following O.D.E. is exact and solve it.(x2 sec2 y + 1
) dydx
+ 2x tan y − sinx = 0.
Solution:
In the standard form Qdy
dx+ P = 0, we have
Q(x, y) = x2 sec2 y + 1 and P (x, y) = 2x tan y − sinx
We check that∂Q
∂x= 2x sec2 y =
∂P
∂y= 2x sec2 y
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = 2x tan y − sinx and
∂f
∂y= Q = x2 sec2 y + 1
Integrating the first of these with respect to x gives
f(x, y) = x2 tan y + cosx+ g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= x2 sec2 y + g′(y) = x2 sec2 y + 1 =⇒ g′(y) = 1 so take g(y) = y
Hencef(x, y) = x2 tan y + cosx+ y
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
x2 tan y + cosx+ y = A
73. Determine if the following differential equations are exact and solve those which are:
a) (1 + x3)y′ + 3x2y + 1 = 0, b) y + (1 + y)y′ = 0, c) (2y + y′)e2x = 0,
d) (5y − 2x)y′ = x+ 2y, e) (2y + y′)e2x + 1 = 0.
Solution:
(a) In the standard form Qdy
dx+ P = 0, we have
Q(x, y) = 1 + x3 and P (x, y) = 3x2y + 1
We check that∂Q
∂x= 3x2 =
∂P
∂y= 3x2
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = 3x2y + 1 and
∂f
∂y= Q = 1 + x3
Page 41
Integrating the first of these with respect to x gives
f(x, y) = x3y + x+ g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= x3 + g′(y) = 1 + x3 =⇒ g′(y) = 1 so take g(y) = y
Hencef(x, y) = x3y + x+ y
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
x3y + x+ y = A =⇒ y =A− x1 + x3
(b) NowQ(x, y) = 1 + y and P (x, y) = y
We check that∂Q
∂x= 0 6= ∂P
∂y= 1
so the ODE is not exact.
(c) NowQ(x, y) = e2x and P (x, y) = 2ye2x
We check that∂Q
∂x= 2e2x =
∂P
∂y= 2e2x
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = 2ye2x and
∂f
∂y= Q = e2x
Integrating the first of these with respect to x gives
f(x, y) = ye2x + g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= e2x + g′(y) = 1 + x3 =⇒ g′(y) = 0 so take g(y) = 0
Hencef(x, y) = ye2x
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
ye2x = A =⇒ y = Ae−2x
(d) NowQ(x, y) = 5y − 2x and P (x, y) = −2y − x
We check that∂Q
∂x= −2 =
∂P
∂y= −2
Page 42
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = −2y − x and
∂f
∂y= Q = 5y − 2x
Integrating the first of these with respect to x gives
f(x, y) = −2xy − 1
2x2 + g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= −2x+ g′(y) = 5y − 2x =⇒ g′(y) = 5y so take g(y) =
5
2y2
Hence
f(x, y) = −2xy − 1
2x2 +
5
2y2
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
−2xy − 1
2x2 +
5
2y2 = A =⇒ y =
2x±√
9x2 + 10A
5
(e) NowQ(x, y) = e2x and P (x, y) = 2ye2x + 1
We check that∂Q
∂x= 2e2x =
∂P
∂y= 2e2x
so the ODE is exact. To solve, we need to find f(x, y) such that
∂f
∂x= P = 2ye2x + 1 and
∂f
∂y= Q = e2x
Integrating the first of these with respect to x gives
f(x, y) = ye2x + x+ g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
∂y= e2x + g′(y) = e2x =⇒ g′(y) = 0 so take g(y) = 0
Hencef(x, y) = ye2x + x
and the solutions of the original O.D.E. are found by setting f(x, y) to be constant, i.e.
ye2x + x = A =⇒ y = (A− x)e−2x
74. Solve the following mixed bag of equations.
a) y′ = (exy)2 − y, b) y′ = y2 − 5y + 6,
c) 2y′ =y
x+y2
x2, d) y′ =
1 + sin y
cos y,
Page 43
e) x2y′ = y(x+ y), given that y(1) = −1,
f) y′e−x cosx− ye−x sinx = x, given that y(0) = 0,
g) x(x− 1)y′ + y = x2e−x.
Solution:
(a) The equation can be rewritten
dy
dx+ y = e2xy2
which is a Bernoulli equation. Make the substitution u = y−1 so thatdu
dx= −y−2 dy
dxand the
equation becomesdu
dx− u = −e2x
This is linear with integrating factor e∫−1 dx = e−x and
d
dx
(e−xu
)= e−x
du
dx− e−xu = −ex
Integrating gives
e−xu = A− ex =⇒ y = u−1 =1
Ae−x − 1
(b) This is separable and integrating gives∫dy
y2 − 5y + 6=
∫dx =⇒
∫dy
(y − 2)(y − 3)= x+ C
=⇒∫
1
y − 3− 1
y − 2dy = x+ C
=⇒ log(y − 3)− log(y − 2) = x+ C
=⇒ y − 3
y − 2= ex+C
=⇒ y =3− 2ex+C
1− ex+C
(c) This is homogeneous so put y = xu anddy
dx= x
du
dx+ u. Then
2xdu
dx+ 2u = u+ u2 =⇒ 2x
du
dx= u2 − u
This is separable and
2
∫1
u2 − u=
∫1
xdx =⇒ 2
∫1
u− 1− 1
udu = log x+ C
=⇒ 2 log(u− 1)− 2 log u = log x+ C
=⇒(
1− 1
u
)2
= eCx
=⇒ 1− 1
u= ±eC/2
√x = Dx for arbitrary D
=⇒ u =1
1−D√x
=⇒ y =x
1−D√x
Page 44
(d) This is separable:∫cos y
1 + sin ydy =
∫dx =⇒ log (1 + sin y) = x+ C
=⇒ y = sin−1(ex+C − 1
)where C is a constant.
(e) This is homogeneous so put y = xu anddy
dx= x
du
dx+ u. Then
du
dx+ u = u+ u2 =⇒ du
dx= u2
This is separable and ∫1
u2=
∫dx =⇒ −1
u= log |x|+ C
=⇒ u = − 1
log |x|+ C
=⇒ y = − x
log |x|+ C
The given conditions imply −1 = − 1C
, so C = 1 and y = − x
log |x|+ 1.
(f) This is linear and in standard form is
dy
dx− y tanx =
xex
cosx
The integrating factor is e∫− tanx dx = e− log secx = cosx. Thus we have
d
dx(y cosx) = cos x
dy
dx− y sinx = xex
Integrating gives the general solution
y cosx =
∫xex dx = xex −
∫ex dx = xex − ex + C
The initial conditions give 0 = −1 + C so
y =xex − ex + 1
cosx
(g) This can be rewritten asdy
dx+
y
x(x− 1)=xe−x
x− 1
which is linear with integrating factor I = e∫
1x(x−1)
dx. Now∫1
x(x− 1)dx =
∫1
x− 1− 1
xdx = log(x− 1)− log x = log
x− 1
x
so I =x− 1
x. Multiplying the ODE by this gives
d
dx
(x− 1
xy
)=x− 1
x
dy
dx− 1
x2y = e−x
Integrating givesx− 1
xy = −e−x + C =⇒ y =
x(C − e−x)x− 1
Page 45
Second Order Linear O.D.E.s
75. Find the general solution of each of the following.
a) y′′ + 2y′ − 15y = 0, b) 2y′′ + 3y′ − 2y = 0,
c) y′′ − 6y′ + 25y = 0 d) y′′ + 6y′ + 9y = 0,
e) y′′ + y′ − 2y = 2e−x, f) y′′ + y′ − 2y = ex,
g) y′′ + y′ − 6y = 52 cos 2x, h) 2y′′ + 3y′ − 2y = sinx,
i) y′′ + y = 2 sin x, j) y′′ − 2y′ + 2y = ex cosx.
Solution:
(a) The auxiliary equation λ2 + 2λ− 15 = (λ + 5)(λ− 3) = 0 has roots 3,−5 so the generalsolution is
y = Ae3x +Be−5x where A, B are constants.
(b) The auxiliary equation 2λ2 + 3λ− 2 = (2λ− 1)(λ+ 2) = 0 has roots 12,−2 so the general
solution isy = Aex/2 +Be−2x where A, B are constants.
(c) The auxiliary equation λ2 − 6λ+ 25 = 0 has complex roots 3± 4i so the general solutionis
y = e3x(A cos 4x+B sin 4x) where A, B are constants.
(d) The auxiliary equation λ2 + 6λ9 = 0 has equal roots −3,−3 so the general solution is
y = e−3x(A+Bx) where A, B are constants.
(e) The auxiliary equation λ2+λ−2 = (λ−1)(λ+2) = 0 has roots 1,−2 so the complementaryfunction is
yc = Aex +Be−2x where A, B are constants.
For a particular solution, try yp = ae−x. Then
y′′p + y′p − 2yp = ae−x − ae−x − 2ae−x = 2e−x =⇒ a = −1
and so the general solution is y = yc + yp, i.e.
y = Aex +Be−2x − e−x where A, B are constants.
(f) The auxiliary equation λ2+λ−2 = (λ−1)(λ+2) = 0 has roots 1,−2 so the complementaryfunction is
yc = Aex +Be−2x where A, B are constants.
For a particular solution, notice aex is already a solution of the homogeneous equation so tryyp = axex. Then
y′′p + y′p − 2yp = (2aex + axex) + (aex + axex)− 2axex = ex =⇒ a =1
3
and so the general solution is y = yc + yp, i.e.
y = Aex +Be−2x +1
3xe−x where A, B are constants.
Page 46
(g) The auxiliary equation λ2+λ−6 = (λ−2)(λ+3) = 0 has roots 2,−3 so the complementaryfunction is
yc = y = Ae2x +Be−3x where A, B are constants.
For a particular solution, try yp = a cos 2x+ b sin 2x. Then
y′′p + y′p − 6yp = (−4a cos 2x− 4b sin 2x) + (−2a sin 2x+ 2b cos 2x)− 6(a cos 2x+ b sin 2x)
= (−10a+ 2b) cos 2x+ (−2a− 10b) sin 2x = 52 cos 2x
=⇒
{−10a+ 2b = 52
−2a− 10b = 0=⇒ a = −5 and b = 1
and so the general solution is y = yc + yp, i.e.
y = Ae2x +Be−3x − 5 cos 2x+ sinx where A, B are constants.
(h) The auxiliary equation 2λ2 + 3λ − 2 = (2λ − 1)(λ + 2) = 0 has roots 12,−2 so the
complementary function is
yc = Aex/2 +Be−2x where A, B are constants.
For a particular solution, try yp = a cosx+ b sinx. Then
2y′′p + 3y′p − 2yp = 2(−a cosx− b sinx) + 3(−a sinx+ b cosx)− 2(a cosx+ b sinx)
= −4a+ 3b cos 2x+ (−3a− 4b) sin 2x = sinx
=⇒
{−4a+ 3b = 0
−3a− 4b = 1=⇒ a = − 3
25and b = − 4
25
and so the general solution is y = yc + yp, i.e.
y = Aex/2 +Be−2x − 3
25cosx− 4
25sinx where A, B are constants.
(i) The auxiliary equation λ2 + 1 = 0 has roots ±i so the complementary function is
yc = A cosx+B sinx where A, B are constants.
For a particular solution, notice a cosx + b sinx is already a solution of the homogeneousequation so try yp = ax cosx+ bx sinx. Then
y′′p + yp = (−ax cosx− bx sinx+ 2b cosx− 2a sinx) + (ax cosx+ bx sinx)
= 2b cosx− 2a sinx = 2 sin x
=⇒ a = −1 and b = 0
and so the general solution is y = yc + yp, i.e.
y = A cosx+B sinx− x cosx where A, B are constants.
(j) The auxiliary equation λ2 − 2λ + 2 = 0 has complex roots 1 ± i so the complementaryfunction is
yc = ex(A cosx+B sinx) where A, B are constants.
Page 47
For a particular solution, notice aex cosx+ bex sinx is already a solution of the homogeneousequation so try yp = axex cosx+ bxex sinx. Then
y′′p − 2y′p + 2yp = (2bx cosx− 2ax sinx+ (2a+ 2b) cosx+ (2b− 2a) sinx)
− 2 ((a+ b)xex cosx+ (b− a)xex sinx+ aex cosx+ bex sinx)
+ 2(axex cosx+ bxex sinx)
= 2bex cosx− 2aex sinx = ex cosx
=⇒ a = 0 and b =1
2
and so the general solution is y = yc + yp, i.e.
y = ex(A cosx+B sinx) +1
2xex sinx where A, B are constants.
76. Solve 3y′′ + 5y′ − 2y = 0 with initial conditions y(0) = 4, y′(0) = −1.
Solution:
The auxiliary equation 3λ2 + 5λ − 2 = (3λ − 1)(λ + 2) = 0 has roots 13,−2 so the general
solution isy = Aex/3 +Be−2x where A, B are constants.
Now fit the initial conditions:{y(0) = A+B = 4
y′(0) = 13A− 2B = −1
=⇒ A = 3 and B = 1
Hence the solution isy = 3ex/3 + e−2x
77. Solve 2y′′ + 5y′ + 2y = 0 with initial conditions y(0) = 4, y′(0) = −1/2.
Solution:
The auxiliary equation 2λ2 + 5λ + 2 = (2λ + 1)(λ + 2) = 0 has roots −12,−2 so the general
solution isy = Ae−x/2 +Be−2x where A, B are constants.
Now fit the initial conditions:{y(0) = A+B = 4
y′(0) = −12A− 2B = −1
2
=⇒ A = 5 and B = −1
Hence the solution isy = 5e−x/2 − e−2x
78. Solve 3y′′ − 8y′ − 3y = 0 with initial conditions y(0) = 2, y′(0) = −4.
Page 48
Solution:
The auxiliary equation 3λ2 − 8λ − 3 = (3λ + 1)(λ − 3) = 0 has roots −13, 3 so the general
solution isy = Ae−x/3 +Be3x where A, B are constants.
Now fit the initial conditions:{y(0) = A+B = 2
y′(0) = −13A+ 3B = −4
=⇒ A = 3 and B = −1
Hence the solution isy = 3e−x/3 − e3x
79. Solve 3y′′ + 11y′ − 4y = 0 with initial conditions y(0) = −1, y′(0) = −9.
Solution:
The auxiliary equation 3λ2 + 11λ − 4 = (3λ − 1)(λ + 5) = 0 has roots 13,−4 so the general
solution isy = Aex/3 +Be−4x where A, B are constants.
Now fit the initial conditions:{y(0) = A+B = 1
y′(0) = 13A− 4B = −9
=⇒ A = −3 and B = 2
Hence the solution isy = −3ex/3 + 2e−4x
80. Solve y′′ + 2y′ + 5y = 0 with initial conditions y(0) = 1, y′(0) = −3.
Solution:
The auxiliary equation λ2 +2λ+5 = (λ+1)2 +4 = 0 has complex roots −1±2i so the generalsolution is
y = e−x (A cos 2x+B sin 2x) where A, B are constants.
Now y′ = −e−x(A cos 2x+B sin 2x) + e−x(−2A sin 2x+ 2B cos 2x) so{y(0) = A = 1
y′(0) = −A+ 2B = −3=⇒ A = 1 and B = −1
Hence the solution isy = e−x(cos 2x− sin 2x)
81. Solve y′′ − 4y′ + 29y = 0 with initial conditions y(0) = 2, y′(0) = −1.
Solution:
Page 49
The auxiliary equation λ2 − 4λ + 29 = (λ − 2)2 + 25 = 0 has complex roots 2 ± 5i so thegeneral solution is
y = e2x (A cos 5x+B sin 5x) where A, B are constants.
Now y′ = 2e2x(A cos 5x+B sin 5x) + e2x(−5A sin 2x+ 5B cos 2x) so{y(0) = A = 2
y′(0) = 2A+ 5B = −1=⇒ A = 2 and B = −1
Hence the solution isy = e2x(2 cos 5x− sin 5x)
82. Solve y′′ − 4y′ + 13y = 0 with initial conditions y(0) = 1, y′(0) = 8.
Solution:
The auxiliary equation λ2−4λ+13 = (λ−2)2 +9 = 0 has complex roots 2±3i so the generalsolution is
y = e2x (A cos 3x+B sin 3x) where A, B are constants.
Now y′ = 2e2x(A cos 3x+B sin 3x) + e2x(−3A sin 2x+ 3B cos 3x) so{y(0) = A = 1
y′(0) = 2A+ 3B = 8=⇒ A = 1 and B = 2
Hence the solution isy = e2x(cos 3x+ 2 sin 3x)
83. Solve y′′ + 10y′ + 34y = 0 with initial conditions y(0) = 2, y′(0) = −7.
Solution:
The auxiliary equation λ2 + 10λ + 34 = (λ + 5)2 + 9 = 0 has complex roots −5 ± 3i so thegeneral solution is
y = e−5x (A cos 3x+B sin 3x) where A, B are constants.
Now y′ = −5e−5x(A cos 3x+B sin 3x) + e−5x(−3A sin 3x+ 3B cos 3x) so{y(0) = A = 2
y′(0) = −5A+ 3B = −7=⇒ A = 2 and B = 1
Hence the solution isy = e−5x(2 cos 3x+ sin 3x)
84. Solve y′′ + 2y′ + y = 0 with initial conditions y(0) = 1, y′(0) = 2.
Page 50
Solution:
The auxiliary equation λ2 + 2λ + 1 = (λ + 1)2 = 0 has equal roots −1,−1 so the generalsolution is
y = e−x(Ax+B) where A, B are constants.
Now y′ = −e−x(Ax+B) + e−xA so{y(0) = B = 1
y′(0) = −B + A = 2=⇒ A = 3 and B = 1
Hence the solution isy = e−x(3x+ 1)
85. Solve y′′ + 6y′ + 9y = 0 with initial conditions y(0) = 2, y′(0) = −5.
Solution:
The auxiliary equation λ2 + 3λ + 9 = (λ + 3)2 = 0 has equal roots −3,−3 so the generalsolution is
y = e−3x(Ax+B) where A, B are constants.
Now y′ = −3e−3x(Ax+B) + e−3xA so{y(0) = B = 2
y′(0) = −3B + A = −5=⇒ A = 1 and B = 2
Hence the solution isy = e−3x(x+ 2)
86. Solve 4y′′ − 4y′ + y = 0 with initial conditions y(0) = −3, y′(0) = −1/2.
Solution:
The auxiliary equation 4λ2 − 4λ + 1 = (2λ − 1)2 = 0 has equal roots 12, 12
so the generalsolution is
y = ex/2(Ax+B) where A, B are constants.
Now y′ = 12ex/2(Ax+B) + ex/2A so{
y(0) = B = −3
y′(0) = 12B + A = −1
2
=⇒ A = 1 and B = −3
Hence the solution isy = ex/2(x− 3)
87. Solve 4y′′ − 12y′ + 9y = 0 with initial conditions y(0) = 2, y′(0) = 6.
Page 51
Solution:
The auxiliary equation 4λ2 − 12λ + 9 = (2λ − 3)2 = 0 has equal roots 32, 32
so the generalsolution is
y = e3x/2(Ax+B) where A, B are constants.
Now y′ = 32e3x/2(Ax+B) + e3x/2A so{
y(0) = B = 2
y′(0) = 32B + A = 6
=⇒ A = 3 and B = 2
Hence the solution isy = e3x/2(3x+ 2)
88. Solve y′′ − 4y′ + 5y = 65 cos 2x, with y(0) = 0, y′(0) = 0.
Solution:
The auxiliary equation λ2 − 4λ + 5 = (λ − 2)2 + 1 = 0 has complex roots 2 ± i so thecomplementary function is
yc = e2x(A cosx+B sinx) where A, B are constants.
Now look for a particular solution of the form yp = a cos 2x+ b sin 2x. Then
y′′p − 4y′p + 5yp = (−4a cos 2x− 4b sin 2x)− 4(−2a sin 2x+ 2b cos 2x) + 5(a cos 2x+ b sin 2x)
= (a− 8b) cos 2x+ (−8a+ b) sin 2x
= 65 cos 2x.
Equating coefficients gives{a− 8b = 65
−8a+ b = 0=⇒ a = 1 and b = −8.
Thus the general solution is y = yc + yp, i.e.
y = e2x(A cosx+B sinx) + cos 2x− 8 sin 2x
Then
y′ = 2e2x(A cosx+B sinx) + e2x(−A sinx+B cosx)− 2 sin 2x− 16 cos 2x
so the initial conditions give{y(0) = A+ 1 = 0
y′(0) = 2A+B − 16 = 0=⇒ A = −1 and B = 18.
The required solution is
y = e2x (− cosx+ 18 sinx) + cos 2x− 8 sin 2x
89. Solve the following initial value problems.
Page 52
a) y′′ − 4y′ + 3y = 0, with y(0) = −1, y′(0) = 1,
b) y′′ + 4y′ + 5y = 0, with y(0) = 1, y′(0) = −3,
c) y′′ − 6y′ + 9y = 0, with y(0) = 2, y′(0) = 8,
d) y′′ − y′ − 2y = 10 sin x, with y(0) = 1, y′(0) = 0,
e) y′′ − y′ − 2y = 3e2x, with y(0) = 0, y′(0) = −2.
f) y′′ − 4y′ + 5y = 65 cos 2x, with y(0) = 0, y′(0) = 0.
g) y′′ + y′ − 6y = −6x− 11, with y(0) = 2, y′(0) = 6.
Solution:
(a) y = −2ex + e3x
(b) y = e−2x (cosx− sinx)
(c) y = 2e3x (1 + x)
(d) y = −e−x + e2x + cosx− 3 sinx
(e) y = e−x − e2x + xe2x
(f) y = e2x (− cosx+ 18 sinx) + cos 2x− 8 sin 2x
(g) y = −e−3x + e2x + x+ 2
90. Solve y′′ − 2y′ + 5y = 6 cos x− 2 sinx with y(0) = 2, y′(0) = 4.
Solution:
The auxiliary equation λ2 − 2λ + 5 = (λ − 1)2 + 4 = 0 has complex roots 1 ± 2i so thecomplementary function is
yc = ex(A cos 2x+B sin 2x) where A, B are constants.
Now look for a particular solution of the form yp = a cosx+ b sinx. Then
y′′p − 2y′p + 5yp = (−a cosx− b sinx)− 2(−a sinx+ b cosx) + 5(a cosx+ b sinx)
= (4a− 2b) cosx+ (2a+ 4b) sinx
= 6 cos x− 2 sinx.
Equating coefficients gives{4a− 2b = 6
2a+ 4b = −2=⇒ a = 1 and b = −1.
Thus the general solution is y = yc + yp, i.e.
y = ex(A cos 2x+B sin 2x) + cos x− sinx
Theny′ = ex(A cos 2x+B sin 2x) + ex(−2A sin 2x+ 2B cos 2x)− sinx− cosx
so the initial conditions give{y(0) = A+ 1 = 2
y′(0) = A+ 2B − 1 = 4=⇒ A = 1 and B = 2.
The required solution is y = ex (cos 2x+ 2 sin 2x) + cos x− sinx
Page 53
91. Solve y′′ − 2y′ + 5y = 2 sin 3x− 10 cos 3x with y(0) = 2, y′(0) = 2.
Solution:
The auxiliary equation λ2 − 2λ + 5 = (λ − 1)2 + 4 = 0 has complex roots 1 ± 2i so thecomplementary function is
yc = ex(A cos 2x+B sin 2x) where A, B are constants.
Now look for a particular solution of the form yp = a cos 3x+ b sin 3x. Then
y′′p − 2y′p + 5yp = (−9a cos 3x− 9b sin 3x)− 2(−3a sin 3x+ 3b cos 3x) + 5(a cos 3x+ b sin 3x)
= (−4a− 6b) cos 3x+ (6a− 4b) sin 3x
= −10 cos 3x+ 2 sin 3x.
Equating coefficients gives{−4a− 6b = −10
6a− 4b = 2=⇒ a = 1 and b = 1.
Thus the general solution is y = yc + yp, i.e.
y = ex(A cos 2x+B sin 2x) + cos 3x+ sin 3x
Then
y′ = ex(A cos 2x+B sin 2x) + ex(−2A sinx+ 2B cosx)− 3 sin 3x+ 3 cos 3x
so the initial conditions give{y(0) = A+ 1 = 2
y′(0) = A+ 2B + 3 = 2=⇒ A = 1 and B = −1.
The required solution is y = ex (cos 2x− sin 2x) + cos 3x+ sin 3x
92. Solve y′′ − 6y′ + 10y = 6 sin 2x+ 18 cos 2x with y(0) = 2, y′(0) = 3.
Solution:
The auxiliary equation λ2 − 6λ + 10 = (λ − 3)2 + 10 = 0 has complex roots 3 ± i so thecomplementary function is
yc = e3x(A cosx+B sinx) where A, B are constants.
Now look for a particular solution of the form yp = a cos 2x+ b sin 2x. Then
y′′p + 6y′p + 10yp = (−4a cos 2x− 4b sin 2x)− 6(−2a sin 2x+ 2b cos 2x) + 10(a cos 2x+ b sin 2x)
= (6a− 12b) cos 2x+ (12a+ 6b) sin 2x
= 18 cos 2x+ 6 sin 2x.
Equating coefficients gives{6a− 12b = 18
12a+ 6b = 6=⇒ a = 1 and b = −1.
Page 54
Thus the general solution is y = yc + yp, i.e.
y = e3x(A cosx+B sinx) + cos 2x− sin 2x
Then
y′ = 3e3x(A cosx+B sinx) + e3x(−A sinx+B cosx)− 2 sin 2x− 2 cos 2x
so the initial conditions give{y(0) = A+ 1 = 2
y′(0) = 3A+B − 2 = 3=⇒ A = 1 and B = 2.
The required solution is
y = e3x(cosx+ 2 sinx) + cos 2x− sin 2x.
93. Solve y′′ − y′ − 2y = 3e2x with y(0) = 0, y′(0) = −2.
Solution:
The auxiliary equation λ2−λ− 2 = (λ+ 1)(λ− 2) = 0 has roots −1, 2 so the complementaryfunction is
yc = Ae−x +Be2x where A, B are constants.
For a particular solution, notice ae2x is already a solution of the homogeneous equation so tryyp = axe2x. Then
y′′p − y′p − 2yp = (4ae2x + 4axe2x)− (ae2x + 2axe2x)− 2axe2x = 3e2x =⇒ a = 1
and so the general solution is y = yc + yp, i.e.
y = Ae−x +Be2x + xe2x where A, B are constants.
Theny′ = −Ae−x + 2Be2x + e2x + 2xe2x
so the initial conditions give{y(0) = A+B = 0
y′(0) = −A+ 2B + 1 = −2=⇒ A = 1 and B = −1.
The required solution isy = e−x − e2x + xe2x
94. Solve y′′ + 2y′ + 5y = 6 + 15x with y(0) = 1, y′(0) = −2.
Solution:
The auxiliary equation λ2 + 2λ + 5 = (λ + 1)2 + 4 = 0 has complex roots −1 ± 2i so thecomplementary function is
yc = e−x(A cos 2x+B sin 2x) where A, B are constants.
Page 55
Now look for a particular solution of the form yp = ax+ b. Then
y′′p + 2y′p + 5yp = 2a+ 5(ax+ b)
= 6 + 15x
Equating coefficients gives{2a+ 5b = 6
5a = 15=⇒ a = 3 and b = 0.
Thus the general solution is y = yc + yp, i.e.
y = e−x(A cos 2x+B sin 2x) + 3x
Theny′ = −e−x(A cos 2x+B sin 2x) + e−x(−2A sinx+ 2B cosx) + 3
so the initial conditions give{y(0) = A = 1
y′(0) = −A+ 2B + 3 = −2=⇒ A = 1 and B = −2.
The required solution isy = e−x(cos 2x− 2 sin 2x) + 3x
95. Solve y′′ + 2y′ + y = x2 + 4x+ 1 with y(0) = 0, y′(0) = 1.
Solution:
The auxiliary equation λ2 + 2λ + 1 = 0 has equal roots λ = −1,−1 so the complementaryfunction is
yc = e−x(Ax+B) where A, B are constants.
Now look for a particular solution of the form yp = ax2 + bx+ c. Then
y′′p + 2y′p + yp = (2a) + 2(2ax+ b) + (ax2 + bx+ c)
= ax2 + (4a+ b)x+ (2a+ 2b+ c)
= x2 + 4x+ 1.
Equating coefficients givesa = 1
4a+ b = 4
2a+ 2b+ c = 1
=⇒ a = 1, b = 0 and c = −1.
Thus the general solution is y = yc + yp, i.e.
y = e−x(Ax+B) + x2 − 1
Theny′ = −e−x(Ax+B) + Ae−x + 2x
Page 56
so the initial conditions give{y(0) = B − 1 = 0
y′(0) = −B + A = 1=⇒ A = 2 and B = 1.
The required solution isy = e−x(2x+ 1) + x2 − 1.
96. Solve y′′ + 2y′ + y = −2e−x, y(0) = 1, y′(0) = 1.
Solution:
The auxiliary equation λ2 + 2λ + 1 = 0 has equal roots λ = −1,−1 so the complementaryfunction is
yc = e−x(Ax+B) where A, B are constants.
Notice that both ae−x and axe−x are already solutions of the homogeneous equation so lookfor a particular solution of the form yp = ax2e−x. Then
y′′p + 2y′p + yp = (ax2e−x − 2axe−x − 2axe−x + 2ae−x) + 2(−ax2e−x + 2axe−x) + (ax2e−x)
= 2ae−x
= −2e−x.
Equating coefficients gives a = −1. Thus the general solution is y = yc + yp, i.e.
y = e−x(Ax+B)− x2e−x
Theny′ = −e−x(Ax+B) + Ae−x + x2e−x − 2xe−x
so the initial conditions give{y(0) = B = 1
y′(0) = −B + A = 1=⇒ A = 2 and B = 1.
The required solution isy = (1 + 2x− x2)e−x
97. Let x(t) be the displacement at time t of the mass in a critically damped oscillator withdamping constant c and mass m = 1. If x(0) = 0 and x′(0) = v0, show that the mass will cometo rest when x = 2v0/ce.
Solution:
The equation of the oscillator is generally given by
md2x
dt2+ c
dx
dt+ kx = 0
We have m = 1 and the critically damped case ζ =c
2√mk
= 1 corresponds to c2 = 4k so the
ODE is actuallyd2x
dt2+ c
dx
dt+c2
4y = 0
Page 57
This has auxiliary equation λ2 + cλ+c2
4=(λ+
c
2
)2= 0. Hence the general solution is
x = (At+B)e−ct/2
But x(0) = 0 so 0 = B. Also v0 = x′(0) = A. Thus the displacement is
x(t) = v0te−ct/2
We want to find when x′(t) = 0, i.e.
x′(t) = v0te−ct/2
(1− ct
2
)= 0 =⇒ t =
2
c
Hence the mass comes to rest at x(2/c) = 2v0/ce.
98. The differential equation for the current I(t) in an LCR circuit is
Ld2I
dt2+R
dI
dt+I
C=dV
dtV (t)
L
C
R
Find the steady state and transient currents in the given circuit in the following cases, assumingthat I(0) = I ′(0) = 0.
a) R=20 ohms, L=10 henrys, C=0.05 farads, V (t) = 50 sin t volts.
b) R=240 ohms, L=40 henrys, C = 10−3 farads, V (t) = 369 sin 10t volts.
c) R=20 ohms, L=5 henrys, C=0.01 farads, V (t) = 850 sin 4t volts.
Solution:
(a) The differential equation is
10I ′′ + 20I ′ + 20I = 50 cos t i.e. I ′′ + 2I ′ + 2I = 5 cos t
which has auxiliary equation λ2 + 2λ + 2 = (λ + 1)2 + 1 = 0 with roots −1 ± i. Thus thecomplementary function is
Ic(t) = e−t (A cos t+B sin t)
The Method of Undetermined Coefficients says that we should try for a particular solution ofthe form Ip(t) = a cos t+ b sin t. Then
I ′′p + 2I ′p + 2Ip = (−a cos t− b sin t) + 2(−a sin t+ b cos t) + 2(a cos t+ b sin t)
= (a+ 2b) cos t+ (−2a+ b) sin t
= 5 cos t
Equating coefficients gives{a+ 2b = 5
−2a+ b = 0=⇒ a = 1 and b = 2
Page 58
Hence the general solution is I(t) = e−t (A cos t+B sin t) + cos t+ 2 sin t.
Then, I ′(t) = −e−t (A cos t+B sin t) + e−t (−A sin t+B cos t) − sin t + 2 cos t so the initialconditions give {
I(0) = A+ 1 = 0
I ′(0) = B − A+ 2 = 0=⇒ A = −1 and B = −3
Hence the solution (i.e. the transient) is
I(t) = −e−t (cos t+ 3 sin t) + cos t+ 2 sin t
The steady-state current is the limiting form of this as t gets large, i.e. I(t) = cos t+ 2 sin t.
(b) I(t) = e−3t(
350
cos 4t+ 93400
sin 4t)− 3
50cos 10t− 3
40sin 10t
(c) I(t) = e−2t(10 cos 4t+ 5
2sin 4t
)− 10 cos 4t+ 5
2sin 4t
99. A cylindrical buoy 60 cms in diameter and weight m grams floats in water with its axisvertical. When depressed slightly and released, it is found that the period of oscillation is 2seconds. Archimedes’ principle shows that if x(t) is the length of the cylinder immersed attime t then x(t) satisfies the equation x′′+ax = g, where a = 900πg/m and g = 981. Calculatethe weight of the buoy and the depth of the bottom of the buoy below the waterline when thebuoy is in the equilibrium position.
Solution:
The corresponding homogeneous O.D.E. is x′′+ax = 0 which has auxiliary equation λ2+a = 0.This has roots complex roots λ = ±i
√a so the complementary function is
xc(t) = A cos√at+B sin
√at where A, B are constants.
where A, B are constants.
Now look for a solution of the given O.D.E. of the form x(t) = C. Substituting into theequation gives aC = g and so C = g/a and thus the general solution is
x(t) =g
a+ A cos
√at+B sin
√at
The period of oscillation is 2π/√a = 2 so a = π2. Hence
900πg
m= a = π2 =⇒ m =
900× 981
π' 281036 grams
Furthermore, at the equilibrium position,
x =g
a=
g
π2' 99.4 cm
Page 59
Linear Algebra
100.
Let A =
(1 32 −1
)B =
(2 13 1
)C =
5 −12 −34 2
D =
(−2 4 −32 1 2
)E =
3 −1 14 −2 12 −5 2
F =
4 −2 12 1 51 −1 2
Find the following matrices (if they exist):
a) A+B b) A+ C c) E + 2F d) AB e) BA
f) AC g) CA h) EF i) BE j) DF
Solution:
a) A+B =
(3 45 0
)b) A+ C doesn’t exist. c) E + 2F =
11 −3 38 0 114 −3 6
d) AB =
(11 41 1
)e) BA =
(4 55 8
)f) CA doesn’t exist. g) CA =
3 16−4 98 10
h) EF =
11 −8 013 −11 −40 −11 −4
i) BE doesn’t exist. j) DF =
(−3 11 212 −5 11
)
101. Use Gaussian Elimination to solve the following systems of equations:
a) 2x+ y + 3z = 1
4x+ 3y + 5z = 1
6x+ 5y + 5z = −3
b) 3x+ 2y + z = 3
2x+ y + z = 0
6x+ 2y + 4z = 6
c) x + y + z = 1
3w + 3y − 4z = 7
w + x+ y + 2z = 6
2w + 3x+ y + 3z = 6
Solution:
a) 2 1 3 14 3 5 16 5 5 −3
R2→R2−2R1−−−−−−−→R3→R3−3R1
2 1 3 10 1 −1 −10 2 −4 −6
R3→R3−2R2−−−−−−−→
2 1 3 10 1 −1 −10 0 −2 −4
Backward substitution gives:
2x+ y + 3z = 1
y − z = −1
− 2z = −4
=⇒
x = 1−y−3z
2= −3
y = −1 + z = 1
z = 2
b) 3 2 1 32 1 1 06 2 4 6
R1→R1−R2−−−−−−−→
1 1 0 32 1 1 06 2 4 6
R2→R2−2R1−−−−−−−→R3→R3−6R1
1 1 0 30 −1 1 −60 −4 −4 −12
Page 60
R3→R3−4R2−−−−−−−→
1 1 0 30 −1 1 −60 0 0 12
The last equation here says 0x+ 0y + 0z = 12 hence there are no solutions.
c) 0 1 1 1 13 0 3 −4 71 1 1 2 62 3 1 3 6
R1↔R3−−−−→R2↔R4
1 1 1 2 62 3 1 3 60 1 1 1 13 0 3 −4 7
R2→R2−2R1−−−−−−−→R4→R4−3R1
1 1 1 2 60 1 −1 −1 −60 1 1 1 10 −3 0 −10 −11
R3→R3−R2−−−−−−−→R4→R4+3R2
1 1 1 2 60 1 −1 −1 −60 0 2 2 70 0 −3 −13 −29
R3→R3+R4−−−−−−−→
1 1 1 2 60 1 −1 −1 −60 0 −1 −11 −220 0 −3 −13 −29
R4→R4−3R3−−−−−−−→
1 1 1 2 60 1 −1 −1 −60 0 −1 −11 −220 0 0 20 37
R3→−R3−−−−−−→R4→R4/20
1 1 1 2 60 1 −1 −1 −60 0 1 11 220 0 0 1 37
20
Backward substitution gives:
w + x+ y + 2z = 6
x− y − z = −6
y + 11z = 22
z = 3720
=⇒
w = 6− x− y − 2z = 63
20
x = −6 + y + z = −5020
y = 22− 11z = 3320
z = 3720
102. Find the determinants of the following matrices. (Hint: applying row/column operationsmay speed these up considerably.)
a) 2 2 3−2 2 11 3 3
b) 2 2 3
1 2 1−2 3 3
c) 3 3 −1−4 −3 2−2 −2 1
d)
a b c0 d e0 0 f
e)
1 2 3 32 3 1 31 1 2 3−1 2 3 −2
f)
3 2 1 32 1 1 31 1 2 3−1 2 3 −2
g)
1 2 1 1 3−2 1 −1 −3 12 −2 1 −1 −2−1 1 2 −3 1−3 2 1 2 1
h)
1 1 0 0−1 1 1 00 −1 1 10 0 −1 1
(Extra question : Can you guess then× n extension of this ?)
Page 61
Solution:
One could calculate these directly, using the usual (cumbersome) formula. Instead, we’ll applyrow/column operations to obtain a row/column with only one non-zero entry, thus reducingthe size of the determinant. There are of course many ways to do this.
a)
∣∣∣∣∣∣2 2 3−2 2 11 3 3
∣∣∣∣∣∣ =
R1→R1−2R3
R2→R2+2R3
=
∣∣∣∣∣∣0 −4 −30 8 71 3 3
∣∣∣∣∣∣ =
∣∣∣∣∣∣0 0 1−4 8 3−3 7 3
∣∣∣∣∣∣ =
∣∣∣∣−4 8−3 7
∣∣∣∣ = −28 + 24 = −4
b) ∣∣∣∣∣∣2 2 31 2 1−2 3 3
∣∣∣∣∣∣ =
∣∣∣∣∣∣0 −2 11 2 10 7 5
∣∣∣∣∣∣ =
∣∣∣∣∣∣0 1 0−2 2 71 1 5
∣∣∣∣∣∣ = −∣∣∣∣−2 7
1 5
∣∣∣∣ = −10− 7 = −17
c) ∣∣∣∣∣∣3 3 −1−4 −3 2−2 −2 1
∣∣∣∣∣∣ =
∣∣∣∣∣∣1 1 00 1 0−2 −2 1
∣∣∣∣∣∣ =
∣∣∣∣∣∣1 0 00 1 0−2 −2 1
∣∣∣∣∣∣ =
∣∣∣∣ 1 0−2 1
∣∣∣∣ = 1
d) ∣∣∣∣∣∣a b c0 d e0 0 f
∣∣∣∣∣∣ = a
∣∣∣∣d e0 f
∣∣∣∣ = adf
More generally, we can see the determinant of a triangular matrix is just the product of thediagonal elements.
e) ∣∣∣∣∣∣∣∣1 2 3 32 3 1 31 1 2 3−1 2 3 −2
∣∣∣∣∣∣∣∣C2→C2−2C1
C3→C3−3C1
=C4→C4−3C1
∣∣∣∣∣∣∣∣1 0 0 02 −1 −5 −31 −1 −1 0−1 4 6 1
∣∣∣∣∣∣∣∣ =
∣∣∣∣∣∣−1 −5 −3−1 −1 04 6 1
∣∣∣∣∣∣C2→C2−5C1
=C3→C3−3C1
∣∣∣∣∣∣−1 0 0−1 4 34 −14 −11
∣∣∣∣∣∣ = −∣∣∣∣ 4 3−14 −11
∣∣∣∣ = −(−44 + 42) = 2
f) ∣∣∣∣∣∣∣∣3 2 1 32 1 1 31 1 2 3−1 2 3 −2
∣∣∣∣∣∣∣∣R1→R1−R2
=
∣∣∣∣∣∣∣∣1 1 0 02 1 1 31 1 2 3−1 2 3 −2
∣∣∣∣∣∣∣∣C2→C2−C1
=
∣∣∣∣∣∣∣∣1 0 0 02 −1 1 31 0 2 3−1 3 3 −2
∣∣∣∣∣∣∣∣=
∣∣∣∣∣∣−1 1 30 2 33 3 −2
∣∣∣∣∣∣ R3→R3+3R1
=
∣∣∣∣∣∣−1 1 30 2 30 6 7
∣∣∣∣∣∣ = −∣∣∣∣2 36 7
∣∣∣∣ = −(14− 18) = 4
Page 62
g) ∣∣∣∣∣∣∣∣∣∣1 2 1 1 3−2 1 −1 −3 12 −2 1 −1 −2−1 1 2 −3 1−3 2 1 2 1
∣∣∣∣∣∣∣∣∣∣C2→C2−2C1
C3→C3−C1
=C4→C4−C1
C5→C5−3C1
∣∣∣∣∣∣∣∣∣∣1 0 0 0 0−2 5 1 −1 72 −6 −1 −3 −8−1 3 3 −2 4−3 8 4 5 10
∣∣∣∣∣∣∣∣∣∣=
∣∣∣∣∣∣∣∣5 1 −1 7−6 −1 −3 −83 3 −2 48 4 5 10
∣∣∣∣∣∣∣∣C1→C1−5C2
C3→C3+C2
=C4→C4−7C2
∣∣∣∣∣∣∣∣0 1 0 0−1 −1 −4 −1−12 3 1 −17−12 4 9 −18
∣∣∣∣∣∣∣∣C1↔C2
=−
∣∣∣∣∣∣∣∣1 0 0 0−1 −1 −4 −13 −12 1 −174 −12 9 −18
∣∣∣∣∣∣∣∣ = −
∣∣∣∣∣∣−1 −4 −1−12 1 −17−12 9 −18
∣∣∣∣∣∣C2→C2−4C1
=C3→C3−C1
−
∣∣∣∣∣∣−1 0 0−12 49 −5−12 57 −6
∣∣∣∣∣∣ =
∣∣∣∣49 −557 −6
∣∣∣∣ = −294 + 285 = −9
h)∣∣∣∣∣∣∣∣1 1 0 0−1 1 1 00 −1 1 10 0 −1 1
∣∣∣∣∣∣∣∣ =
∣∣∣∣∣∣1 1 0−1 1 10 −1 1
∣∣∣∣∣∣−∣∣∣∣∣∣−1 1 00 1 10 −1 1
∣∣∣∣∣∣ =
∣∣∣∣∣∣1 1 0−1 1 10 −1 1
∣∣∣∣∣∣+
∣∣∣∣ 1 1−1 1
∣∣∣∣=
{∣∣∣∣ 1 1−1 1
∣∣∣∣− ∣∣∣∣−1 10 1
∣∣∣∣}+
∣∣∣∣ 1 1−1 1
∣∣∣∣ = {(1 + 1)− (−1)}+ (1 + 1) = 3 + 2 = 5
If we let Fn be the corresponding n × n matrix then notice expanding along the top row asin first line above gives Fn = Fn−1 + Fn−2. Also F1 = 1 and F2 = 2. This recurrence relationdefines the Fibonacci sequence !
103. Use Gaussian Elimination to find the inverses of the following matrices:
a)A =
4 3 −61 1 −1−2 −2 3
b)A =
3 1 −1−4 1 2−2 0 1
c)A =
3 3 −1−4 −3 2−2 −2 1
d)
A =
7 −1 3−4 1 −28 0 3
e)A =
5 5 −2−4 −3 2−2 −2 1
Solution:
Note: for each of these, there are many possible choices for row operations.
a) 4 3 −6 1 0 01 1 −1 0 1 0−2 −2 3 0 0 1
R1↔R2−−−−→
1 1 −1 0 1 04 3 −6 1 0 0−2 −2 3 0 0 1
R2→R2−4R1−−−−−−−→R3→R3+2R1
1 1 −1 0 1 00 −1 −2 1 −4 00 0 1 0 2 1
R2→−R2−−−−−→
1 1 −1 0 1 00 1 2 −1 4 00 0 1 0 2 1
Page 63
R2→R2−2R3−−−−−−−→R1→R1+R3
1 1 0 0 3 10 1 0 −1 0 −20 0 1 0 2 1
R1→R1−R2−−−−−−−→
1 0 0 1 3 30 1 0 −1 0 −20 0 1 0 2 1
Hence the inverse is
A−1 =
1 3 3−1 0 −20 2 1
b) 3 1 −1 1 0 0
−4 1 2 0 1 0−2 0 1 0 0 1
R1→R1+R3−−−−−−−→
1 1 0 1 0 1−4 1 2 0 1 0−2 0 1 0 0 1
R2→R2+4R1−−−−−−−→R3→R3+2R1
1 1 0 1 0 10 5 2 4 1 40 2 1 2 0 3
R2→R2−2R3−−−−−−−→
1 1 0 1 0 10 1 0 0 1 −20 2 1 2 0 3
R3→R3−2R2−−−−−−−→
1 1 0 1 0 10 1 0 0 1 −20 0 1 2 −2 7
R1→R1−R2−−−−−−−→
1 0 0 1 −1 30 1 0 0 1 −20 0 1 2 −2 7
Hence the inverse is
A−1 =
1 −1 30 1 −22 −2 7
c) 3 3 −1 1 0 0
−4 −3 2 0 1 0−2 −2 1 0 0 1
R1→R1+R3−−−−−−−→
1 1 0 1 0 1−4 −3 2 0 1 0−2 −2 1 0 0 1
R2→R2+4R1−−−−−−−→R3→R3+2R1
1 1 0 1 0 10 1 2 4 1 40 0 1 2 0 3
R2→R2−2R3−−−−−−−→
1 1 0 1 0 10 1 0 0 1 −20 0 1 2 0 3
R1→R1−R2−−−−−−−→
1 0 0 1 −1 30 1 0 0 1 −20 0 1 2 0 3
Hence the inverse is
A−1 =
1 −1 30 1 −22 0 3
d) 7 −1 3 1 0 0
−4 1 −2 0 1 08 0 3 0 0 1
R1→R1+2R2−−−−−−−→R3→R3+2R2
−1 1 −1 1 2 0−4 1 −2 0 1 00 2 −1 0 2 1
R2→R2−4R1−−−−−−−→
−1 1 −1 1 2 00 −3 2 −4 −7 00 2 −1 0 2 1
R2→R2+2R3−−−−−−−→
−1 1 −1 1 2 00 1 0 −4 −3 −20 2 −1 0 2 1
Page 64
R1→R1−R2−−−−−−−→R3→R3−2R1
−1 0 −1 5 5 −20 1 0 −4 −3 −20 0 −1 8 8 −3
R1→R1−R2−−−−−−−→
−1 0 0 −3 −3 10 1 0 −4 −3 −20 0 −1 8 8 −3
R1→−R1−−−−−→R3→−R3
1 0 0 3 3 −10 1 0 −4 −3 20 0 1 −8 −8 3
Hence the inverse is
A−1 =
3 3 −1−4 −3 2−8 −8 3
e) 5 5 −2 1 0 0
−4 −3 2 0 1 0−2 −2 1 0 0 1
R1→R1+2R3−−−−−−−→R2→R2−2R3
1 1 0 1 0 20 1 0 0 1 −2−2 −2 1 0 0 1
R3→R3+2R1−−−−−−−→
1 1 0 1 0 20 1 0 0 1 −20 0 1 2 0 5
R1→R1−R2−−−−−−−→
1 0 0 1 −1 40 1 0 0 1 −20 0 1 2 0 5
Hence the inverse is
A−1 =
1 −1 40 1 −22 0 5
104. Find the elementary matrices E, F , G that reduce the matrix
A =
2 3 14 11 1−2 12 −5
to upper triangular form. Hence find the LU decomposition of A and use it solve Ax =
(72527
).
Solution:
We perform Gaussian elimination, keeping track of the elementary matrices:
A =
2 3 14 11 1−2 12 −5
R2→R2−2R1−−−−−−−→
2 3 10 5 −1−2 12 −5
= EA E =
1 0 0−2 1 00 0 1
R3→R3+R1−−−−−−−→
2 3 10 5 −10 15 −4
= FEA F =
1 0 00 1 01 0 1
R3→R3−3R2−−−−−−−→
2 3 10 5 −10 0 −1
= U = GFEA G =
1 0 00 1 00 −3 1
Page 65
Then
L = E−1F−1G−1 =
1 0 02 1 00 0 1
1 0 00 1 0−1 0 1
1 0 00 1 00 3 1
=
1 0 02 1 0−1 −3 1
Check:
A =
2 3 14 11 1−2 12 −5
= LU =
1 0 02 1 0−1 −3 1
2 3 10 5 −10 0 −1
We have to solve Ax = b =
(72527
), i.e. LUx = b. First solve Lu = b:
L =
1 0 02 1 0−1 −3 1
uvw
=
72527
by forward substitution:
u = 7
2u+ v = 25
−u− 3v + w = 27
=⇒
u = 7
v = 25− 2u = 11
w = 27 + u+ 3v = 1
Finally, solve Ux = u, i.e. 2 3 10 5 −10 0 −1
xyz
=
7111
by backward substitution:
2x+ 3y + z = 7
5y − z = 11
−z = 1
=⇒
x = 7−3y−z
2= 1
y = 11+z5
= 2
z = −1
105. Find the LU decomposition of the matrices
a)A =
2 0 14 1 1−2 3 −1
b)A =
−2 3 −14 1 12 0 1
c)A =
−1 2 −21 1 12 −1 1
d)
A =
1 2 3−3 −5 −132 7 −4
e)A =
−3 2 −2−9 11 −7−6 −1 −1
f)
A =
3 1 2 −26 1 6 −1−9 −4 −2 1015 6 12 −7
g)
A =
2 −1 3 −24 −4 7 −1−6 −1 −6 142 3 4 1
Page 66
h)
A =
3 −1 2 1−3 3 −4 219 −7 11 86 0 0 −7
i)
A =
2 1 3 −14 3 4 −1−2 0 −2 44 0 19 1
Solution:
Recall for these, row swaps are not allowed so we only use higher rows to fix lower ones.
a) Make A upper triangular:
A =
2 0 14 1 1−2 3 −1
R2→R2−2R1−−−−−−−→R3→R3+R1
2 0 10 1 −10 3 0
R3→R3−3R2−−−−−−−→
2 0 10 1 −10 0 3
so
L =
1 0 02 1 0−1 3 1
and U =
2 0 10 1 −10 0 3
b) Make A upper triangular:
A =
−2 3 −14 1 12 0 1
R2→R2+2R1−−−−−−−→R3→R3+R1
−2 3 −10 7 −10 3 0
R3→R3−3R2/7−−−−−−−−−→
−2 3 −10 7 −10 0 3
7
so
L =
1 0 0−2 1 0−1 3
71
and U =
−2 3 −10 7 −10 0 3
7
c) Make A upper triangular:
A =
−1 2 −21 1 12 −1 1
R2→R2+R1−−−−−−−→R3→R3+2R1
−1 2 −20 3 −10 3 −3
R3→R3−R2−−−−−−−→
−1 2 −20 3 −10 0 −2
so
L =
1 0 0−1 1 0−2 1 1
and U =
−1 2 −20 3 −10 0 −2
d) Make A upper triangular:
A =
1 2 3−3 −5 −132 7 −4
R2→R2+3R1−−−−−−−→R3→R3−2R1
1 2 30 1 −40 3 −10
R3→R3−3R2−−−−−−−→
1 2 30 1 −40 0 2
so
L =
1 0 0−3 1 02 3 1
and U =
1 2 30 1 −40 0 2
e) Make A upper triangular:
A =
−3 2 −2−9 11 −7−6 −1 −1
R2→R2−3R1−−−−−−−→R3→R3−2R1
−3 2 −20 5 −10 −5 3
R3→R3+R2−−−−−−−→
−3 2 −20 5 −10 0 2
Page 67
so
L =
1 0 03 1 02 −1 1
and U =
−3 2 −20 5 −10 0 2
f) Make A upper triangular:
A =
3 1 2 −26 1 6 −1−9 −4 −2 1015 6 12 −7
R2→R2−2R1
R3→R3+3R1−−−−−−−→R4→R4−5R1
3 1 2 −20 −1 2 30 −1 4 40 1 2 3
R3→R3−R2−−−−−−−→R4→R4+R2
3 1 2 −20 −1 2 30 0 2 10 0 4 6
R4→R4−2R3−−−−−−−→
3 1 2 −20 −1 2 30 0 2 10 0 0 4
so
L =
1 0 0 02 1 0 0−3 1 1 05 −1 2 1
and U =
3 1 2 −20 −1 2 30 0 2 10 0 0 4
g) Make A upper triangular:
A =
2 −1 3 −24 −4 7 −1−6 −1 −6 142 3 4 1
R2→R2−2R1
R3→R3+3R1−−−−−−−→R4→R4−R1
2 −1 3 −20 −2 1 30 −4 3 80 4 1 3
R3→R3−2R2−−−−−−−→R4→R4+2R2
2 −1 3 −20 −2 1 30 0 1 20 0 3 9
R4→R4−3R3−−−−−−−→
2 −1 3 −20 −2 1 30 0 1 20 0 0 3
so
L =
1 0 0 02 1 0 0−3 2 1 01 −2 3 1
and U =
2 −1 3 −20 −2 1 30 0 1 20 0 0 3
h) Make A upper triangular:
A =
3 −1 2 1−3 3 −4 219 −7 11 86 0 0 −7
R2→R2+R1
R3→R3−3R1−−−−−−−→R4→R4−2R1
3 −1 2 10 2 −2 220 −4 5 50 2 −4 −9
R3→R3+2R2−−−−−−−→R4→R4−R2
3 −1 2 10 2 −2 220 0 1 490 0 −2 −31
R4→R4+2R3−−−−−−−→
3 −1 2 10 2 −2 220 0 1 490 0 0 67
so
L =
1 0 0 0−1 1 0 03 −2 1 02 1 −2 1
and U =
3 −1 2 10 2 −2 220 0 1 490 0 0 67
Page 68
i) Make A upper triangular:
A =
2 1 3 −14 3 4 −1−2 0 −2 44 0 19 1
R2→R2−2R1
R3→R3+R1−−−−−−−→R4→R4−2R1
2 1 3 −10 1 −2 10 1 1 30 −2 13 3
R3→R3−R2−−−−−−−→R4→R4+2R2
2 1 3 −10 1 −2 10 0 3 20 0 9 5
R4→R4−3R3−−−−−−−→
2 1 3 −10 1 −2 10 0 3 20 0 0 −1
so
L =
1 0 0 02 1 0 0−1 1 1 02 −2 3 1
and U =
2 1 3 −10 1 −2 10 0 3 20 0 0 −1
106. Find the LU decomposition of the matrix
A =
2 1 3 −14 3 4 −1−2 0 −2 44 0 19 1
and hence solve Ax = b for the following vectors:
a)
b =
38−8−17
b)
b =
−1−2−8−26
c)
b =
34−414
d)
b =
712−822
Solution:
First make A upper triangular, using higher rows to fix lower ones:
A =
2 1 3 −14 3 4 −1−2 0 −2 44 0 19 1
R2→R2−2R1
R3→R3+R1−−−−−−−→R4→R4−2R1
2 1 3 −10 1 −2 10 1 1 30 −2 13 3
R3→R3−R2−−−−−−−→R4→R4+2R2
2 1 3 −10 1 −2 10 0 3 20 0 9 5
R4→R4−3R3−−−−−−−→
2 1 3 −10 1 −2 10 0 3 20 0 0 −1
so
L =
1 0 0 02 1 0 0−1 1 1 02 −2 3 1
and U =
2 1 3 −10 1 −2 10 0 3 20 0 0 −1
a) Now solve Lu = b, i.e.
1 0 0 02 1 0 0−1 1 1 02 −2 3 1
stuv
=
38−8−17
Page 69
by forward substitution:s = 3
2s+ t = 8
−s+ t+ u = −8
2s− 2t+ 3u+ v = −17
=⇒
s = 3
t = 8− 2s = 2
u = −8 + s− t = −7
v = −17− 2s+ 2t− 3u = 2
i.e. u =
32−72
and solve Ux = u, i.e.
2 1 3 −10 1 −2 10 0 3 20 0 0 −1
wxyz
=
32−72
by backward substitution:
2w + x+ 3y − z = 3
x− 2y + z = 2
3y + 2z = −7
−z = 2
=⇒
w = 3−x−3y+z
2= 1
x = 2 + 2y − z = 2
y = −7−2z3
= −1
z = −2
i.e. x =
12−1−2
Similarly for the next parts we have:
b)
u =
−10−93
and x =
−11−1−3
c)
u =
3−211
and x =
−111−1
d)
u =
7−211
and x =
111−1
107. Show that the following can be factorised as A = LU without doing the factorisation.
a)
A =
7 1 1 1 11 8 −2 1 1−2 1 −9 3 11 1 −1 −5 12 −3 1 −1 8
b)
A =
−17 1 −5 1 1
1 8 2 −3 112 1 29 −13 11 −10 −1 −50 222 13 1 −1 21
Page 70
Solution:
We just notice that each matrix is strictly diagonally dominant since
a) 7 > 1 + 1 + 1 + 1
8 > 1 + 2 + 1 + 1
9 > 2 + 1 + 3 + 1
5 > 1 + 1 + 1 + 1
8 > 2 + 3 + 1 + 1
b) 17 > 1 + 5 + 1 + 1
8 > 1 + 2 + 3 + 1
29 > 12 + 1 + 13 + 1
50 > 1 + 10 + 1 + 22
21 > 2 + 13 + 1 + 1
108. Determine whether or not the following matrices are positive definite:
a) 2 1 −1
1 2 0−1 0 3
b) 2 1 −1
1 2 −1−1 −1 3
c) 2 1 −1
1 2 −2−1 −2 1
d)
1 1 −11 2 2−1 2 3
e) 3 1 −1
1 2 2−1 2 3
f) 5 1 −1
1 2 2−1 2 3
g)
5 1 −1 01 2 2 0−1 2 3 10 0 1 2
h)
5 1 −1 01 2 2 0−1 2 3 10 0 1 10
Solution:
In each case, we check that the matrix is symmetric and that the principal minors are positive:
a) it’s clearly symmetric and
2 > 0,
∣∣∣∣2 11 2
∣∣∣∣ = 3 > 0 and
∣∣∣∣∣∣2 1 −11 2 0−1 0 3
∣∣∣∣∣∣ = 2
∣∣∣∣2 00 3
∣∣∣∣− ∣∣∣∣ 1 0−1 3
∣∣∣∣− ∣∣∣∣ 1 2−1 0
∣∣∣∣= 12− 3− 2 = 7 > 0
Hence this matrix is positive definite.
b) it’s clearly symmetric and
2 > 0,
∣∣∣∣2 11 2
∣∣∣∣ = 3 > 0 and
∣∣∣∣∣∣2 1 −11 2 −1−1 −1 3
∣∣∣∣∣∣ = 2
∣∣∣∣ 2 −1−1 3
∣∣∣∣− ∣∣∣∣ 1 −1−1 3
∣∣∣∣− ∣∣∣∣ 1 2−1 −1
∣∣∣∣= 10− 2− 1 = 7 > 0
Hence this matrix is positive definite.
c) it’s clearly symmetric and
2 > 0,
∣∣∣∣2 11 2
∣∣∣∣ = 3 > 0 and
∣∣∣∣∣∣2 1 −11 2 −2−1 −2 1
∣∣∣∣∣∣ = 2
∣∣∣∣ 2 −2−2 1
∣∣∣∣− ∣∣∣∣ 1 −2−1 1
∣∣∣∣− ∣∣∣∣ 1 2−1 −2
∣∣∣∣= −4 + 1− 0 = −3 < 0
Hence this matrix is not positive definite.
Page 71
109. Express the following in the form A = P TLU using the indicated row swaps:
a) by swapping R1 ↔ R2:
A =
0 2 1−2 3 −1−6 9 0
b) by swapping R1 ↔ R3:
A =
0 2 1−2 3 −1−6 9 0
c) by swapping R1 ↔ R2:
A =
0 2 31 −2 12 0 5
d) by swapping R2 ↔ R3:
A =
−1 2 3−2 2 53 −4 −5
Solution:
a) Swapping R1 ↔ R2 corresponds to multiplying by the permutation matrix
P =
0 1 01 0 00 0 1
and we have
PA =
−2 3 −10 2 1−6 9 0
R3→R3−3R1−−−−−−−→
−2 3 −10 2 10 0 3
So if we take
P =
0 1 01 0 00 0 1
, L =
1 0 00 1 03 0 1
, U =
−2 3 −10 2 10 0 3
then A = P TLU .
b) Swapping R1 ↔ R3 corresponds to multiplying by the permutation matrix
P1 =
0 0 10 1 01 0 0
and we have
P1A =
−6 9 0−2 3 −10 2 1
R2→R2−R1/3−−−−−−−−→
−6 9 00 0 −10 2 1
To get this into upper triangular form, we need another row swap R1 ↔ R3 which correspondsto
P2 =
1 0 00 0 10 1 0
Hence we swap R1 ↔ R3 then R1 ↔ R3 corresponding to
P = P2P1 =
0 0 11 0 00 1 0
Page 72
Then
PA =
−6 9 00 2 1−2 3 −1
R3→R3−R1/3−−−−−−−−→
−6 9 00 2 10 0 −1
So if we take
P =
0 0 11 0 00 1 0
, L =
1 0 00 1 013
0 1
, U =
−6 9 00 2 10 0 −1
then A = P TLU .
Remark: Notice a) and b) give slightly different decompositions of the same matrix.
c) Swapping R1 ↔ R2 corresponds to multiplying by the permutation matrix
P =
0 1 01 0 00 0 1
and we have
PA =
1 −2 10 2 32 0 5
R3→R3−2R1−−−−−−−→
1 −2 10 2 30 4 3
R3→R3−2R2−−−−−−−→
1 −2 10 2 30 0 −3
So if we take
P =
0 1 01 0 00 0 1
, L =
1 0 00 1 02 2 1
, U =
1 −2 10 2 30 0 −3
then A = P TLU .
d) Swapping R2 ↔ R3 corresponds to multiplying by the permutation matrix
P =
1 0 00 0 10 1 0
and we have
PA =
−1 2 33 −4 −5−2 2 5
R2→R2+3R1−−−−−−−→R3→R3−2R1
−1 2 30 2 40 −2 −1
R3→R3+R2−−−−−−−→
−1 2 30 2 40 0 3
So if we take
P =
1 0 00 0 10 1 0
, L =
1 0 0−3 1 02 −1 1
, U =
−1 2 30 2 40 0 3
then A = P TLU .
110. Determine whether or not the following subsets of R3 are (i) linearly independent sets
Page 73
and (ii) spanning sets:
a)S =
1−23
,
21−2
,
3−11
b)S =
1
23
,
21−2
,
3−11
c)
S =
1−11
,
201
,
02−1
d)S =
1
23
,
21−2
Solution:
a) Since we have three vectors in a 3-dimensional space, the set is a basis if and only if it islinearly independent if and only if it is a spanning set if and only if the matrix with S as it’scolumns 1 2 3
−2 1 −13 −2 1
has non-zero determinant. Now∣∣∣∣∣∣
1 2 3−2 1 −13 −2 1
∣∣∣∣∣∣ R2+2R1=R3−3R1
∣∣∣∣∣∣1 2 30 5 50 −8 −8
∣∣∣∣∣∣ R3+8R1/5=
∣∣∣∣∣∣1 2 30 5 50 0 0
∣∣∣∣∣∣ = 0
so the set S is neither linearly independent or spanning.
Alternatively, we can work directly with the definition: Suppose
λ1
1−23
+ λ2
21−2
+ λ3
3−11
=
000
We want to know if this has the unique solution λ1 = λ2 = λ3 = 0. Now it says
λ1 + 2λ2 + 3λ3 = 0
−2λ1 + λ2 − λ3 = 0
3λ1 − 2λ2 + λ3 = 0
=⇒
1 2 3−2 1 −13 −2 1
λ1λ2λ3
=
000
which we can solve either directly or by Gaussian elimination: 1 2 3 0
−2 1 −1 03 −2 1 0
R2→R2+2R1−−−−−−−→R3→R3−3R1
1 2 3 00 5 5 00 −8 −8 0
R2→R2/5−−−−−→
1 2 3 00 1 1 00 −8 −8 0
R3→R3+8R2−−−−−−−→
1 2 3 00 1 1 00 0 0 0
R1→R1−2R2−−−−−−−→
1 0 1 00 1 1 00 0 0 0
We see from this that λ1 = λ2 = −λ3 but that this value is arbitrary. For instance, takingλ1 = 1, λ2 = 1, λ3 = −1 leads to the non-trivial linear relationship 1
−23
+
21−2
− 3−11
=
000
Page 74
This shows that S is not linearly independent. It also shows that S doesn’t span R3 since wehave
Span(S) = Span
1−23
,
21−2
= 0
and two vectors can’t possibly span R3.
b) For three vectors in R3 we just need to check the determinant:∣∣∣∣∣∣1 2 32 1 −23 −1 1
∣∣∣∣∣∣ =
∣∣∣∣∣∣1 0 02 −3 −83 −7 −8
∣∣∣∣∣∣ =
∣∣∣∣−3 −8−7 −8
∣∣∣∣ = 24− 56 = −32 6= 0
Hence the set is a basis - it’s both linearly independent and spanning.
c) Again, for three vectors in R3 we just need to check the determinant:∣∣∣∣∣∣1 2 0−1 0 21 1 −1
∣∣∣∣∣∣ =
∣∣∣∣∣∣1 0 0−1 2 21 −1 −1
∣∣∣∣∣∣ = 0
Hence the set is neither linearly independent or spanning.
d) Firstly, two vectors can’t possibly span R3. Secondly, it is linearly independent since theonly way it could be dependent would be if one was a scalar multiple of the other.
111. Show that the following subsets are linearly independent and extend them to give a basis:
a)S =
1
1−1
,
12−2
⊆ R3b)
S =
2
1−1
,
−1−22
⊆ R3
c)
S =
1−1−12
,
201−2
,
12−24
⊆ R4
d)
S =
1−23−4
,
4−32−1
,
0−1−13
⊆ R4
Solution:
a) Suppose
λ1
11−1
+ λ2
12−2
=
000
Then
λ1 + λ2 = 0
λ1 + 2λ2 = 0
−λ1 − 2λ2 = 0
=⇒ λ1 = λ2 = 0
So the set is linearly independent. To extend it to a basis, we go through the standard basis,checking if they are in the span of S. If not, we add them in. First, suppose1
00
= λ
11−1
+ µ
12−2
Page 75
Then 1 = λ+ µ
0 = λ+ 2µ
0 = −λ− 2µ
which has a solution λ = 2 and µ = −1
giving 100
= 2
11−1
− 1
2−2
∈ Span(S)
Moving on to the next standard basis vector, suppose010
= λ
11−1
+ µ
12−2
Then
0 = λ+ µ
1 = λ+ 2µ
0 = −λ− 2µ
which has no solution.
Thus add this vector to S. Now 1
1−1
,
12−2
,
010
must be a basis as it consists of 3 linearly independent vectors in R3.
112. Find the eigenvalues and corresponding eigenspaces of the following matrices:
a)(
3 23 −2
)b)
(6 −43 −1
)c)
−1 −3 3−3 −1 3−3 −3 5
d)
−3 1 −20 −2 01 −1 0
e) 7 −5 10
0 2 0−5 5 −8
f) 5 6 −2−1 −2 3−1 −1 2
Solution:
a) First find eigenvalues:
det(A− λI) =
∣∣∣∣3− λ 23 −2− λ
∣∣∣∣ = (3− λ)(−2− λ)− 6
= λ2 − λ− 12 = (λ+ 3)(λ− 4)
so the eigenvalues are λ = −3, 4.
For λ = −3, solve (A+ 3I)v = 0:(6 2 03 1 0
)R1→R1−2R2−−−−−−−→
(0 0 03 1 0
)
Page 76
So 3x+ y = 0 and the corresponding eigenspace is
V−3 = Span
{(1−3
)}For λ = 4, solve (A− 4I)v = 0:(
−1 2 03 −6 0
)R2→R2+3R1−−−−−−−→
(−1 2 00 0 0
)So −x+ 2y = 0 and the corresponding eigenspace is
V4 = Span
{(21
)}b) First find eigenvalues:
det(A− λI) =
∣∣∣∣6− λ −43 −1− λ
∣∣∣∣ = (6− λ)(−1− λ) + 12
= λ2 − 5λ+ 6 = (λ− 2)(λ− 3)
so the eigenvalues are λ = 2, 3.
For λ = 2, solve (A− 2I)v = 0:(4 −4 03 −3 0
)R1→R1/4−−−−−−−→
R2→R2−3R2
(1 −1 00 0 0
)So x− y = 0 and the corresponding eigenspace is
V2 = Span
{(11
)}For λ = 3, solve (A− 3I)v = 0:(
3 −4 03 −4 0
)R2→R2−R1−−−−−−−→
(3 −4 00 0 0
)So 3x− 4y = 0 and the corresponding eigenspace is
V3 = Span
{(43
)}c) First find eigenvalues:
det(A− λI) =
∣∣∣∣∣∣−1− λ −3 3−3 −1− λ 3−3 −3 5− λ
∣∣∣∣∣∣ =
∣∣∣∣∣∣−1− λ −3 0−3 −1− λ 2− λ−3 −3 2− λ
∣∣∣∣∣∣=
∣∣∣∣∣∣−1− λ −3 0
0 2− λ 0−3 −3 2− λ
∣∣∣∣∣∣ = (1 + λ)(2− λ)2
so the eigenvalues are λ = −1, 2, 2.
Page 77
For λ = −1, solve (A+ I)v = 0: 0 −3 3 0−3 0 3 0−3 −3 6 0
R3→R3−R2−−−−−−−→
0 −3 3 0−3 0 3 00 −3 3 0
R3→R3−R1−−−−−−−→R2→−R2
0 −3 3 0−3 0 3 00 0 0 0
So x = y = z and we may take corresponding eigenspace
V−1 = Span
1
11
For the repeated eigenvalue λ = 2, solve (A− 2I)v = 0:−3 −3 3 0
−3 −3 3 0−3 −3 3 0
−→−1 −1 1 0
0 0 0 00 0 0 0
So we have just one equation −x − y + z = 0. This is a plane so we just want two vectorswhich span it. For instance, setting y = 1, z = 0 and y = 0, z = 1 leads to
V2 = Span
−1
10
,
101
d) First find eigenvalues:
det(A− λI) =
∣∣∣∣∣∣−3− λ 1 −2
0 −2− λ 01 −1 −λ
∣∣∣∣∣∣ = (−2− λ)
∣∣∣∣−3− λ −21 −λ
∣∣∣∣= −(λ+ 2)(λ2 + 3λ+ 2) = −(λ+ 2)2(λ+ 1)
so the eigenvalues are λ = −1,−2,−2.
For λ = −1, solve (A+ I)v = 0:−2 1 −2 00 −1 0 01 −1 1 0
R1→R1+R2−−−−−−−→R3→R3−R2
−2 0 −2 00 −1 0 01 0 1 0
R1→R1+2R3−−−−−−−→R2→−R2
0 0 0 00 1 0 01 0 1 0
So y = 0 and x+ z = 0 and we may take corresponding eigenspace
V−1 = Span
1
0−1
For the repeated eigenvalue λ = −2, solve (A+ 2I)v = 0:−1 1 −2 0
0 0 0 01 −1 2 0
R3→R3+R1−−−−−−−→
−1 1 −2 00 0 0 00 0 0 0
So we have just one equation −x + y − 2z = 0. This is a plane so we just want two vectorswhich span it. For instance, setting y = 1, z = 0 and y = 0, z = 1 leads to
V−2 = Span
1
10
,
−201
Page 78
e) First find eigenvalues:
det(A− λI) =
∣∣∣∣∣∣7− λ −5 10
0 2− λ 0−5 5 −8− λ
∣∣∣∣∣∣ = (2− λ)
∣∣∣∣7− λ 10−5 −8− λ
∣∣∣∣= (2− λ)(λ2 + λ− 6) = −(λ− 2)2(λ+ 3)
so the eigenvalues are λ = −3, 2, 2.
For λ = −3, solve (A+ 3I)v = 0:10 −5 10 00 5 0 0−5 5 −5 0
R1→R1+R2−−−−−−−→R3→R3−R2
10 0 10 00 5 0 0−5 0 −5 0
R1→R1+2R3−−−−−−−→R2→R2/5
0 0 0 00 1 0 01 0 1 0
So y = 0 and x+ z = 0 and we may take corresponding eigenspace
V−3 = Span
1
0−1
For the repeated eigenvalue λ = 2, solve (A+ 2I)v = 0: 5 −5 10 0
0 0 0 0−5 5 −10 0
R3→R3+R1−−−−−−−→R1→R1/5
1 −1 2 00 0 0 00 0 0 0
So we have just one equation x − y + 2z = 0. This is a plane so we just want two vectorswhich span it. For instance, setting y = 1, z = 0 and y = 0, z = 1 leads to
V−2 = Span
1
10
,
−201
f) First find eigenvalues:
det(A− λI) =
∣∣∣∣∣∣5− λ 6 −2−1 −2− λ 3−1 −1 2− λ
∣∣∣∣∣∣ =
∣∣∣∣∣∣5− λ 6 −2
0 −1− λ 1 + λ−1 −1 2− λ
∣∣∣∣∣∣= (1 + λ)
∣∣∣∣∣∣5− λ 6 −2
0 −1 1−1 −1 2− λ
∣∣∣∣∣∣ = (1 + λ)
∣∣∣∣∣∣5− λ 0 4
0 −1 1−1 −1 2− λ
∣∣∣∣∣∣= (1 + λ)(3− λ)2
so the eigenvalues are λ = −1, 3, 3.
For λ = −1, solve (A+ I)v = 0: 6 6 −2 0−1 −1 3 0−1 −1 3 0
R1→R1+6R2−−−−−−−→R3→R3−R2
0 0 18 0−1 −1 3 00 0 0 0
R1→R1/18−−−−−−−→R3→R2−3R1
0 0 1 0−1 −1 0 00 0 0 0
So z = 0 and x+ y = 0 and we may take corresponding eigenspace
V−1 = Span
1−10
Page 79
For λ = 3, solve (A− 3I)v = 0: 2 6 −2 0−1 −5 3 0−1 −1 −1 0
R1→R1+2R3−−−−−−−→R2→R2−R3
0 4 −4 00 −4 4 0−1 −1 −1 0
R1→R1−R2−−−−−−−→R3→R2−3R1
0 0 0 00 −4 4 0−1 −1 −1 0
R2→−R2/4−−−−−−→R3→−R3
0 0 0 00 1 −1 01 1 1 0
R3→R3−R2−−−−−−−→
0 0 0 00 1 −1 01 0 2 0
So y − z = 0 and x+ 2z = 0 and we may take corresponding eigenspace
V3 = Span
−2
11
113. For each of the following matrices A, find an invertible matrix A such that D = Y −1AYis diagonal and compute A10.
a)(
2 −32 −5
)b)
(5 6−2 −2
)c)
2 3 66 5 12−3 −3 −7
d)
−1 −2 −4−4 −3 −82 2 5
e) −2 −2 −5−7 −3 −114 2 7
f)−1 −3 3−3 −1 30 0 2
Solution:
a)det(A− λI) =
∣∣∣∣2− λ −32 −5− λ
∣∣∣∣ = (2− λ)(−5− λ) + 6
= λ2 + 3λ− 4 = (λ+ 4)(λ− 1)
so the eigenvalues are λ = −4, 1.
For λ = −4, solve (A+ 4I)v = 0:(6 −3 02 −1 0
)−→
(2 −1 00 0 0
)So 2x− y = 0 and a corresponding eigenvector is v = ( 1
2 ).
For λ = 1, solve (A− I)v = 0: (1 −3 02 −6 0
)−→
(1 −3 00 0 0
)So x− 2y = 0 and a corresponding eigenvector is v = ( 3
1 ).
Hence, Y −1AY = D, where
Y =
(1 32 1
)and D =
(−4 00 1
)
Page 80
Then
A10 = (Y DY −1)10 = Y D10Y −1 =
(1 32 1
)(410 00 1
)1
−5
(1 −3−2 1
)= −1
5
(1 32 1
)(410 −3 · 410
−2 1
)= −1
5
(410 − 6 −3 · 410 + 3
2 · 410 − 2 −6 · 410 + 1
)b) A has eigenvalues 1, 2 with corresponding eigenvectors ( 3
−2 ) and ( 2−1 ) so we may take
Y =
(3 2−2 −1
)and D =
(1 00 2
)and then
A10 = Y D10Y −1 =
(3 2−2 −1
)(1 00 210
)(−1 −22 3
)=
(−3 + 4 · 210 −6 + 6 · 210
2− 2 · 210 4− 3 · 210
)c) The eigenvalues are 2, −1, −1 with (choices of) corresponding eigenvectors forming thecolumns of
Y =
−1 −1 −2−2 1 01 0 1
and
Y −1AY = D =
2 0 00 −1 00 0 −1
Hence
A10 = Y D10Y −1 =
−1 −1 −2−2 1 01 0 1
210 0 00 1 00 0 1
−1 −1 −2−2 −1 −41 1 3
=
210 210 − 1 2 · 210 − 22 · 210 − 2 2 · 210 − 1 4 · 210 − 4−210 + 1 −210 + 1 −2 · 210 + 3
d) The eigenvalues are −1, 1, 1 with (choices of) corresponding eigenvectors forming thecolumns of
Y =
−1 −2 1−1 1 0−2 0 1
and
Y −1AY = D =
−1 0 00 1 00 0 1
Notice that D10 = I and so
A10 = Y D10Y −1 = Y Y −1 = I =
1 0 00 1 00 0 1
e) The eigenvalues are 2, 1, −1 with (choices of) corresponding eigenvectors forming thecolumns of
Y =
1 −1 −13 −1 −2−2 1 1
Page 81
and
Y −1AY = D =
2 0 00 1 00 0 −1
Hence
A10 = Y D10Y −1 =
1 −1 −13 −1 −2−2 1 1
210 0 00 1 00 0 1
−1 0 −1−1 1 1−1 −1 −2
=
−210 + 2 0 −210 + 1−3 · 210 + 3 1 4 · −3 · 210 + 32 · 210 − 2 0 2 · 210 − 1
f) The eigenvalues are 2, 2, −4 with (choices of) corresponding eigenvectors forming thecolumns of
Y =
1 0 10 1 11 1 0
and
Y −1AY = D =
2 0 00 2 00 0 −4
Hence you can now find A10 = Y D10Y −1.
114. a) Find a matrix B satisfying B3 = A where
A =
2 1 −11 2 0−1 0 3
b) Find a matrix B satisfying B5 = A where
A =
2 1 −11 2 −1−1 −1 3
Solution:
a) First diagonalise: Y −1AY = D where
Y =
(2 13 1
)and D =
(−8 00 27
)Then C3 = D where
C =
(−2 00 3
)So
B = Y CY −1 =
(2 13 1
)(−2 00 3
)(−1 13 −2
)=
(13 −1015 12
)satisfies
B3 =(Y CY −1
)3= Y C3Y −1 = Y DY −1 = A
Page 82
b) First diagonalise: Y −1AY = D where
Y =
(2 31 1
)and D =
(32 00 −1
)Then C5 = D where
C =
(2 00 −1
)So
B = Y CY −1 =
(2 31 1
)(2 00 −1
)(−1 31 −2
)=
(−7 −18−3 8
)satisfies
B5 =(Y CY −1
)3= Y C5Y −1 = Y DY −1 = A
115. Solve the following systems of differential equations:
a) x = −10x+ 18y
y = −6x+ 11y
b) x = 3x+ 4y
y = 3x+ 2y
and x(0) = 6, y(0) = 1
c) x = −x+ 2y
y = 2x− yand x(0) = 3, y(0) = 1
d) x = 2x− 2y − zy = 5x− 3y + z
z = −4x+ 2y − z
e) x = 5x+ 3z
y = 9x+ 2y + 9z
z = −6x− 4z
f) x = x+ 2z
y = y − zz = x+ y + z
and x(0) = y(0) = 1, z(0) = 4
Solution:
N.B. Remember for these that different choices of eigenvectors can lead to different but equiv-alent general solutions.
a) We are solving x = Ax where
A =
(−10 18−6 11
)Now
det(A− λI) =
∣∣∣∣−10 18−6 11
∣∣∣∣ = λ2 − λ− 2 = (λ+ 1)(λ− 2)
so the eigenvalues are λ = −1, 2.
For λ = −1, solve (A+ I)v = 0:(−9 18 0−6 12 0
)−→
(1 −2 00 0 0
)So x− 2y = 0 and a corresponding eigenvector is v = ( 2
1 ).
For λ = 2, solve (A− 2I)v = 0:(−12 18 0−6 9 0
)−→
(2 −3 00 0 0
)So x− 3y = 0 and a corresponding eigenvector is v = ( 3
2 ).
Page 83
Hence Y −1AY = D where
Y =
(2 31 2
)and D =
(−1 00 2
)
Now let u = ( uv ) satisfy Y u = x so that Y u = x = Ax = AY u and(uv
)= u = Y −1AY u = Du =
(−u2v
)Solving this: {
u = −uv = 2v
=⇒
{u = ae−t
v = be2t
for arbitrary constants a, b. Thus the general solution is x = Y u i.e.(xy
)=
(2 31 2
)(ae−t
be2t
)=
(2ae−t + 3be2t
ae−t + 2be2t
)
b) First diagonalise
A =
(3 43 2
)For instance, Y −1AY = D where
Y =
(4 −13 1
)and D =
(6 00 −1
)Then let u = ( uv ) satisfy Y u = x so that Y u = x = Ax = AY u and(
uv
)= u = Y −1AY u = Du =
(6u−v
)=⇒
{u = ae6t
v = be−t
Then x = Y u, i.e. (xy
)=
(4 −13 1
)(ae6t
be−t
)=
(4ae6t − be−t3ae6t + be−t
)The initial conditions determine a, b:{
x(0) = 4a− b = 6
y(0) = 3a+ b = 1=⇒
{a = 1
b = −2
Hence
x = 4e6t + 2e−t
y = 3e6t − 2e−t
c) The solution is
x = 2et + e−3t
y = 2et − e−3t
Page 84
d) We are solving x = Ax where
A =
−2 −2 −15 −3 11 −2 −1
Now
det(A− λI) =
∣∣∣∣∣∣−2− λ −2 −1
5 −3− λ 11 −2 −1− λ
∣∣∣∣∣∣ = −(λ+ 1)(λ+ 2)(λ− 1)
so the eigenvalues are λ = −1,−2, 1. The corresponding eigenvectors are given by the columnsof
Y =
−1 1 1−2 3 11 −2 −1
so that
Y −1AY = D =
−1 0 00 −2 00 0 1
If x = Y u then u = Du, i.e. uv
w
=
−1 0 00 −2 00 0 1
uvw
=
−u−2vw
=⇒
u = ae−t
v = be−2t
w = cet
Substituting into x = Y u gives
x = −ae−t + be−2t + cet
y = −2ae−t + 3be−2t + cet
z = ae−t − 2be−2t − cet
e) The general solution can be written as
x = −be2t + ce−t
y = ae2t + 3ce−t
z = be2t − 2ce−t
f) The solution is
x = −3et − 6e2t − 2
y = 3et − 3e2t + 1
z = 3e2t + 1
Page 85
Numerical Linear Algebra
116. Check that the following equations have the solution x = 1, y = −2.
529
229x+ y =
71
229298
129x+ y =
40
129
What happens if we change the RHS to
529
229x+ y =
70
229298
129x+ y =
41
129?
Find the solutions of the new equations and the determinant of the coefficient matrix.
Solution:
It’s easy to see x = 1, y = −2 solves the first set of equations. For the second set of equations,subtracting the second from the first gives(
529
229− 298
129
)x =
70
229− 41
129i.e. − 1
29541x = − 359
29541
leading to x = −359 and
y =41− 298× 359
129= −829
The very small change of the right-hand side has led to a very large change in the solutions.The matrix of coefficients has a very small determinant:∣∣∣∣∣529229
1298129
1
∣∣∣∣∣ =529
229− 298
129=
1
29541
Notice in calculating x and y, we had to divide by this very small number - this results in thelarge change.
117. Write out the iteration scheme for the Jacobi method for solving−4 1 1 01 −4 0 11 0 −4 10 1 1 −4
x1x2x3x4
=
−√
3/4√3/400
Will this scheme converge for any initial value of the iteration vector? Give a reason for youranswer.
Solution:
The equations are
−4x1 + x2 + x3 = −√
3/4
x1 − 4x2 + x4 =√
3/4
x1 − 4x3 + x4 = 0
x2 + x3 − 4x4 = 0
Page 86
which we rewrite as
x1 =−√
3/4− x2 − x3−4
x2 =
√3/4− x1 − x4−4
x3 =−x1 − x4−4
x4 =−x2 − x3−4
Applying the superscripts then gives the Jacobi iteration:
x(k+1)1 =
−√
3/4− x(k)2 − x(k)3
−4
x(k+1)2 =
√3/4− x(k)1 − x
(k)4
−4
x(k+1)3 =
−x(k)1 − x(k)4
−4
x(k+1)4 =
−x(k)2 − x(k)3
−4
The iteration will converge for any initial values since the matrix is s.d.d.
118. Rearrange the following system of equations so the the Gauss-Seidel iteration method willconverge for any choice of initial values. Explain why this is so.
x+ 3y = 1
2x− y = 3
For the new system, write out the iteration scheme for the Gauss-Seidel method and withinitial value (1,−1), find the iterates up to x(3), y(3); also sketch what happens up to x(2), y(2).
Solution:
By swapping the order of the equations,
2x− y = 3
x+ 3y = 1
the coefficient matrix is s.d.d so the Gauss-Seidel method will converge. The iteration schemeis
x(k+1) =3 + y(k)
2
y(k+1) =1− x(k+1)
3
Starting with x(0) = 1, y(1) = −1,
x(1) =3 + y(0)
2=
3− 1
2= 1
y(1) =1− x(1)
3=
1− 1
3= 0
Page 87
and
x(2) =3 + y(1)
1=
3 + 0
2=
3
2
y(2) =1− x(2)
1=
1− 32
3= −1
6
and
x(3) =3 + y(2)
1=
3− 16
2=
17
12
y(3) =1− x(3)
1=
1− 1712
3= − 5
24
119. Rearrange the following system into a form you know will converge under the Gauss-Seideliteration method for any choice of x(0), stating why. Write out the resulting Gauss-Seideliteration and calculate x(1) and x(2) given that x(0) = (1, 1, 1, 1)T , working to 4 significantfigures.
−x1 + 8x2 + x3 + 4x4 = 6
2x1 + 5x2 + 10x3 − x4 = 2
−x1 + x2 − x3 + 4x4 = 8
6x1 − x2 − x3 − x4 = 9
Solution:
Moving the last equation first gives an s.d.d. coefficient matrix6 −1 −1 −1−1 8 1 42 5 10 −1−1 1 −1 4
and in this order, the iteration will converge.
The Gauss-Seidel scheme is then
x(k+1)1 =
9 + x(k)2 + x
(k)3 + x
(k)4
6
x(k+1)2 =
6 + x(k+1)1 − x(k)3 − 4x
(k)4
8
x(k+1)3 =
2− 2x(k+1)1 − 5x
(k+1)2 + x
(k)4
10
x(k+1)4 =
8 + x(k+1)1 − x(k+1)
2 + x(k+1)3
4
Page 88
Starting with x(0) = (1, 1, 1, 1), we get
x(1)1 =
9 + x(0)2 + x
(0)3 + x
(0)4
6=
9 + 1 + 1 + 1
6= 2
x(1)2 =
6 + x(1)1 − x
(0)3 − 4x
(0)4
8=
6 + 2− 1− 4
8= 0.375
x(1)3 =
2− 2x(1)1 − 5x
(1)2 + x
(0)4
10=
2− 2× 2− 5× 0.375 + 1
10= −0.2875
x(1)4 =
8 + x(1)1 − x
(1)2 + x
(1)3
4=
8 + 2− 0.375− 0.2875
4= 2.334
and
x(2)1 =
9 + x(1)2 + x
(1)3 + x
(1)4
6=
9 + 0.375− 0.2875 + 2.334
6= 1.903
x(2)2 =
6 + x(2)1 − x
(1)3 − 4x
(1)4
8=
6 + 1.903 + 0.2875− 4× 2.334
8= −0.1432
x(2)3 =
2− 2x(2)1 − 5x
(2)2 + x
(1)4
10=
2− 2× 1.903 + 5× 0.1432 + 2.334
10= 0.1244
x(2)4 =
8 + x(2)1 − x
(2)2 + x
(2)3
4=
8 + 1.903 + 0.1432 + 0.1244
4= 2.542
120. Rearrange the following equation to a form where you know an iterative scheme converges,stating why you then know it converges. Write out the iteration equations both for the Jacobiand the Gauss-Seidel Methods. Working to 4 significant figures, determine (x(3), y(3), z(3))starting with (x(0), y(0), z(0)) = (1, 1, 1), both for the Jacobi and the Gauss-Seidel Methods. 6 1 −1
−1 1 71 5 1
xyz
=
3−17
0
Solution:
Swap the second and third rows to give
6x+ y − z = 3
x+ 5y + z = 0
−x+ y + 7z = −17
The coefficient matrix is now s.d.d. so both methods will converge. The iteration schemesare
Jacobi Gauss-Seidel
x(k+1) =3− y(k) + z(k)
6x(k+1) =
3− y(k) + z(k)
6
y(k+1) =−x(k) − z(k)
5y(k+1) =
−x(k+1) − z(k)
5
z(k+1) =−17 + x(k) − y(k)
7z(k+1) =
−17 + x(k+1) − y(k+1)
7
Page 89
Jacobik x(k) y(k) z(k)
0 1 1 11 0.500 -0.400 -2.4292 0.1618 0.3858 -2.3003 0.05233 0.4276 -2.4614 0.0185 0.4818 -2.4835 0.005833 0.4928 -2.4946 0.002167 0.4976 -2.4977 0.0008333 0.4990 -2.5008 0.0001667 0.4998 -2.5009 0.000 0.5000 -2.50010 0.000 0.5000 -2.500
Gauss-Seidelx(k) y(k) z(k)
1 1 10.500 -0.300 -2.3140.1643 0.430 -2.4670.01717 0.490 -2.4960.002333 0.4988 -2.5000.0001667 0.5000 -2.500
0.000 0.5000 -2.5000.000 0.5000 -2.5000.000 0.5000 -2.5000.000 0.5000 -2.5000.000 0.5000 -2.500
121. a) Determine whether the following matrix is positive definite.6 1 21 5 32 3 4
b) Rearrange the equations
6x+ y + 2z = −2
2x+ 3y + 4z = 5
x+ 5y + 3z = 7
so that the Gauss-Seidel iterations will converge for every choice of x(0), explaining whythis is so. Write down the resulting iteration and hence find x(1), x(2) given that x(0) =(1, 2, 1)T .
Solution:
a) It is positive definite since it’s symmetric and
6 > 0,
∣∣∣∣6 11 5
∣∣∣∣ = 30− 1 = 29 > 0
∣∣∣∣∣∣6 1 21 5 32 3 4
∣∣∣∣∣∣ = 6
∣∣∣∣5 33 4
∣∣∣∣− ∣∣∣∣1 32 4
∣∣∣∣+ 2
∣∣∣∣1 52 3
∣∣∣∣ = 66 + 2− 14 = 54 > 0
b) If we swap the second and third equations
6x+ y + 2z = −2
x+ 5y + 3z = 7
2x+ 3y + 4z = 5
Page 90
the coefficient matrix is positive definite from a) so the Gauss-Seidel method will converge forany starting values. The iteration scheme is
x(k+1) =−2− y(k) − 2z(k)
6
y(k+1) =7− x(k+1) − 3z(k)
5
z(k+1) =5− 2x(k+1) − 3y(k+1)
4
Starting with x(0) = 1, y(0) = 2, z(0) = 1, we get
x(1) =−2− y(0) − 2z(0)
6=−2− 2− 2× 1
6= −1
y(1) =7− x(1) − 3z(0)
5=
7 + 1− 3
5= 1
z(1) =5− 2x(1) − 3y(1)
4=
5 + 2× 1− 3× 1
4= 1
and similarly x(2) = −5
6, y(2) =
29
30, z(2) =
113
120.
122. Determine which of the following matrices A are (i) strictly diagonally dominant, (ii)positive definite.
a) A =
2 1 00 3 01 0 4
b) A =
2 1 00 3 21 2 4
c) A =
2 −1 0−1 4 20 2 2
What can you then say for the solution of the equation Ax = b by the LU decomposition(Gaussian elimination) or the Jacobi or Gauss-Seidel iteration techniques, when the matrix Ahas each of the forms (a), (b) or (c)?
Solution:
a) This is s.d.d since |2| > |1|+ |0|, |3| > |0|+ |2|, |4| > |1|+ |0|.It is not positive definite since it isn’t symmetric.
Since A is s.d.d., it does have an LU decomposition and the Jacobi and Gauss-Seidel methodswill both converge for any x(0).
a) This is s.d.d since |2| > |1|+ |0|, |3| > |0|+ |2|, |4| > |1|+ |2|.It is not positive definite since it isn’t symmetric.
Since A is s.d.d., it does have an LU decomposition and the Jacobi and Gauss-Seidel methodswill both converge for any x(0).
a) This is not s.d.d since in the third row, |2| ≤ |0|+ |2|.It’s symmetric and
2 > 0,
∣∣∣∣ 2 −1−1 4
∣∣∣∣ = 8− 1 = 7 > 0∣∣∣∣∣∣2 −1 0−1 4 20 2 2
∣∣∣∣∣∣ = 2
∣∣∣∣4 22 2
∣∣∣∣+
∣∣∣∣−1 20 2
∣∣∣∣ = 8− 2 = 6 > 0
Page 91
Since A is positive definite, it does have an LU decomposition and the Gauss-Seidel methodwill both converge for any x(0). (We can’t say about the Jacobi method.)
123. Consider Ax = b where
A =
2 −1 0 0−1 2 −1 00 −1 2 −10 0 −1 2
and b =
−423−1
Is A strictly diagonally dominant? Is A positive definite? Based on this evidence, what can youdeduce about Gaussian elimination or the Jacobi or Gauss-Seidel iteration techniques? Givereasons for your answer. Write down the iteration scheme. Working to 4 significant figures,calculate 3 iterates of the Gauss-Seidel scheme taking x(0) = (1, 1, 1, 1)T . Use your results toguess the exact solution and check that it is correct.
Solution:
A is not s.d.d. due to e.g. the second row. It’s symmetric and
2 > 0,
∣∣∣∣ 2 −1−1 2
∣∣∣∣ = 4− 3 = 7 > 0,
∣∣∣∣∣∣2 −1 0−1 2 −10 −1 2
∣∣∣∣∣∣ = 2(4− 1) + (−2− 0) = 4 > 0
∣∣∣∣∣∣∣∣2 −1 0 0−1 2 −1 00 −1 2 −10 0 −1 2
∣∣∣∣∣∣∣∣ = 2
∣∣∣∣∣∣2 −1 0−1 2 −10 −1 2
∣∣∣∣∣∣+
∣∣∣∣∣∣−1 −1 00 2 −10 −1 2
∣∣∣∣∣∣ = 8− (4− 1) = 5 > 0
Hence A is positive definite so the Gauss-Seidel method will converge.
The iteration scheme and a table of values is:
x(k+1)1 =
−4 + x(k)2
2
x(k+1)2 =
2 + x(k+1)1 + x
(k)3
2
x(k+1)3 =
3 + x(k+1)2 + x
(k)4
2
x(k+1)4 =
−1 + x(k+1)3
2
k x(k) y(k) z(k)
0 1 1 1 11 -1.5 0.75 2.375 0.68752 -1.625 1.375 2.531 0.76553 -1.312 1.610 2.688 0.8444 -1.195 1.746 2.795 0.89755 -1.127 1.834 2.866 0.9336 -1.083 1.892 2.912 0.9567 -1.054 1.929 2.942 0.9718 -1.036 1.953 2.962 0.9819 -1.024 1.969 2.975 0.987510 -1.016 1.980 2.984 0.99211 -1.010 1.987 2.990 0.995
After 6 or so iterates one could guess the iteration is converging to x = (−1, 2, 3, 1)T and asimple check shows that this is indeed the exact solution.
124. Find the optimum value of ω and hence use the SOR method to solve the equations
5x+ y = 4
x+ 5y − z = −5
−y + 5z = 6,
Page 92
working to 4 significant figures, starting with x(0) = (0, 0, 0)T and finding the first 4 iterates.Use your results to guess the exact solution.
Solution:
The matrix 5 1 01 5 −10 −1 5
is tridiagonal and symmetric. Also,
5 > 0,
∣∣∣∣5 11 5
∣∣∣∣ = 25− 1 = 24 > 0
∣∣∣∣∣∣5 1 01 5 −10 −1 5
∣∣∣∣∣∣ = 5
∣∣∣∣ 5 −1−1 5
∣∣∣∣+
∣∣∣∣1 −10 5
∣∣∣∣ = 5(25− 1)− (5− 0) = 115 > 0
so A is positive definite. To find the optimal ω, we need the spectral radius of Tj = D−1(L+U),where A = D − L− U .
Tj = D−1(L+ U) =
15
0 00 1
50
0 0 15
0 −1 0−1 0 10 1 0
=
0 −15
0−1
50 1
5
0 15
0
To find the eigenvalues of this, solve
det(Tj − λI) =
∣∣∣∣∣∣−λ −1
50
−15−λ 1
5
0 15−λ
∣∣∣∣∣∣ = −λ∣∣∣∣−λ 1
515−λ
∣∣∣∣+1
5
∣∣∣∣−15
15
0 −λ
∣∣∣∣= −λ
(λ2 − 1
25
)1
5(
(λ
5
)= −λ
(λ2 − 2
25
)= 0
Thus the eigenvalues are 0, ±√25
and the spectral radius ρ(Tj) =√25
. The optimal choice ofω is
ω =2
1 +√
1− ρ(Tj)2=
2
1 +√
1− 225
= 1.021
to 4 significant figures.
The SOR method
x(k+1) = (1− ω)x(k) + ωD−1(b + Lx(k+1) + Ux(k)
)becomes
x(k+1) = −0.021x(k) + 1.021
(4− y(k)
5
)y(k+1) = −0.021y(k) + 1.021
(−5− x(k+1) + z(k)
5
)z(k+1) = −0.021z(k) + 1.021
(6 + y(k+1)
5
)
Page 93
In particular, starting with x(0) = 0, y(0) = 0, z(0) = 0, we get
x(1) = −0.021x(0) + 1.021
(4− y(0)
5
)= 0 + 1.021
(4
5
)= 0.8168
y(1) = −0.021y(0) + 1.021
(−5− x(1) + z(0)
5
)= 0 + 1.021
(−5− 0.8168
5
)= −1.188
z(1) = −0.021z(0) + 1.021
(6 + y(1)
5
)= 0 + 1.021
(6− 1.188
5
)= 0.9826
The iteration converges quickly to the exact solution x = 1, y = −1, z = 1 :
k x(k) y(k) z(k)
0 0 0 01 0.8168 -1.188 0.98262 1.042 -1.008 0.99843 1.001 -1.001 1.0004 1.000 -1.000 1.0005 1.000 -1.000 1.000
Page 94