Mathematics for Engineers and Scientists (MATH1551)
Partial Differentiation
1. Calculate ∂f /∂x and ∂f /∂y when f (x, y) is given by:
p
a) x2 + y 2 sin(xy),
b) (x + y)/(x − y),
c)
e) xy ,
f) log(x2 + y 2 ),
g) xy + x3 cos(xy),
x2 + y 2 ,
d)
p
−1
x2 + y 2
,
h) xy/(x + y).
Solution:
(a) ∂f /∂x = 2x + y 3 cos(xy)
∂f /∂y = 2y sin(xy) + xy 2 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
−1
(c) ∂f /∂x = x (x2 + y 2 ) 2
−1
∂f /∂y = y (x2 + y 2 ) 2
−3
(d) ∂f /∂x = −x (x2 + y 2 ) 2
−3
∂f /∂y = −y (x2 + y 2 ) 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 + y 2 )
∂f /∂y = 2y/ (x2 + y 2 )
(g) ∂f /∂x = y + 3x2 cos(xy) − x3 y 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 variables
x, y and z:
a) xy 3 − yz 2 ,
b) z x−y
,
c) xy z,
d) x cos(yz).
x+y
Solution:
(a)
(b)
∂f /∂x = y 3, ∂f /∂y = 3xy 2 − z 2 , ∂f /∂z = −2yz.
x−y
1
∂f /∂x = z x+y
− (x+y)
= 2yz(x + y)−2 .
2
(c)
(d)
∂f /∂y = −2xz(x + y)−2 (by symmetry).
∂f /∂z = (x − y)/(x + y).
∂f /∂x = yxy−1 z, ∂f /∂y = zxy log x, ∂f /∂z = xy .
∂f /∂x = cos(yz), ∂f /∂y = −xz sin(yz), ∂f /∂z = −xy sin(yz).
3. Calculate ∂f /∂x, ∂f /∂y, ∂ 2 f /∂x∂y and ∂ 2 f /∂y∂x when f (x, y) is given by
a) x2 y 3 + ex + log y,
b) x2 cos y + x2 + cos y,
d) tan−1 (y/x),
e) (x2 + y 2 )−1/2 .
1
c) x tan (y 2 ),
Solution:
(a) ∂f /∂x = 2xy 3 + ex , ∂f /∂y = 3x2 y 2 + y1 , ∂ 2 f /∂x∂y = 6xy 2 = ∂ 2 f /∂y∂x.
(b) ∂f /∂x = 2x cos y + 2x, ∂f /∂y = −x2 sin y − sin y, ∂ 2 f /∂x∂y = −2x sin y = ∂ 2 f /∂y∂x.
(c) ∂f /∂x = tan (y 2 ), ∂f /∂y = 2xy sec2 y 2 ,
∂ 2f
∂ ∂f
∂
=
=
2xy sec2 y 2 = 2y sec2 y 2
∂x∂y
∂x ∂y
∂x
∂ 2f
∂ ∂f
∂
=
=
tan y 2 = 2y sec2 y 2
∂y∂x
∂y ∂x
∂y
2 −1
−1
(d) ∂f /∂x = −yx−2 1 + xy
= −y (x2 + y 2 ) ,
−1
−1
y 2
−1
∂f /∂y = x
1+ x
= x (x2 + y 2 ) ,
∂ 2 f /∂x∂y = (x2 + y 2 )
−2
−2
((x2 + y 2 ) (−1) + 2y 2 ) = (y 2 − x2 ) (x2 + y 2 )
−3
− 23
(e) ∂f /∂x = −x (x2 + y 2 ) 2 , ∂f /∂y = −y (x2 + y 2 )
−5
∂ 2 f /∂x∂y = 3xy (x2 + y 2 ) 2 = ∂ 2 f /∂y∂x.
4. Let v(r, t) = tn e−r
2 /4t
= ∂ 2 f /∂y∂x.
,
. Find a value of the constant n such that v satisfies the equation
∂v
1 ∂
2 ∂v
= 2
r
.
∂t
r ∂r
∂r
Solution:
First note that
∂v
2
= ntn−1 + tn r2 (2t)−2 e−r /4t ,
∂t
∂v
1
2
= − rtn−1 e−r /4t .
∂r
2
Hence
∂
∂r
∂
1 3 n−1 −r2 /4t
2 ∂v
r
=
− r t e
∂r
∂r
2
3
1
2
2
= − r2 tn−1 e−r /4t + r4 tn−2 e−r /4t
4 2
3
1
2
= − r2 tn−1 + r4 tn−2 e−r /4t
2
4
So we need n = − 23 .
5. Let f (x, y) = u(x, y)eax+by , where u(x, y) is a function for which ∂ 2 u/∂x∂y = 0. Find values
of a and b such that
∂ 2f
∂f
∂f
−
−
+ f = 0.
∂x∂y ∂x ∂y
Page 2
Solution:
First note that, using the product rule
∂u
∂f
=
+ au eax+by ,
∂x
∂x
∂f
∂u
=
+ bu eax+by ,
∂y
∂y
2
∂ 2f
∂ u
∂u
∂u
=
+a
+b
+ abu eax+by .
∂x∂y
∂x∂y
∂y
∂x
∂ 2u
= 0, we get
So, using
∂x∂y
∂ 2f
∂f
∂f
−
−
+f =
∂x∂y ∂x ∂y
∂u
∂u
(a − 1)
+ (b − 1)
+ (ab − a − b + 1)u eax+by
∂y
∂x
Hence a = b = 1 does the trick.
6. The two-dimensional Laplace equation is ∂ 2 f /∂x2 + ∂ 2 f /∂y 2 = 0. Find all solutions of the
form ax3 + bx2 y + cxy 2 + dy 3 , with a, b, c and d constant.
Solution:
If f (x, y) = ax3 + bx2 y + cxy 2 + dy 3 , then
∂f
= bx2 + 2cxy + 3dy 2 ,
∂y
∂ 2f
= 2cx + 6dy
∂y 2
∂f
= 3ax2 + 2bxy + cy 2 ,
∂x
∂ 2f
= 6ax + 2by,
∂x2
and so
∂ 2f
∂ 2f
+
= (6a + 2c)x + (2b + 6d)y.
∂x2
∂y 2
Notice that this is true for all x and y. Hence we need 6a + 2c = 0, 2b + 6d = 0 which gives
c = −3a, b = −3d. The most general solution of the required form is
f (x, y) = ax3 − 3dx2 y − 3axy 2 + dy 3 .
7. For the following functions, find df /dt by (i) using the chain rule, and (ii) substituting for
x, y (and z in (c)) to find f (t) explicitly and then differentiating with respect to t:
(a) f (x, y) = x2 + y 2 and x(t) = cos t, y(t) = sin t.
(b) f (x, y) = x2 − y 2 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
∂f dx ∂f dy
df
=
+
dt
∂x dt
∂y dt
= −2x sin t + 2y cos t = 0.
(ii) Now f (t) = cos2 t + sin2 t = 1, so
df
= −2 sin t cos t + 2 cos t sin t = 0.
dt
(b) (i) We have
df
∂f dx ∂f dy
=
+
dt
∂x dt
∂y 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
= −4 sin2 t + 4 cos2 t = 4 cos 2t.
dt
(c) (i) We have
df
∂f dx ∂f dy ∂f dz
=
+
+
dt
∂x dt
∂y dt
∂z dt
2
2
= − cos t sin t + sin t cos t + (x + y)z −2 t−2 = 1.
z
z
(ii) Now f (t) = t cos2 t + t sin2 t = t, so
df
= 1.
dt
—————-Q8—————————————————————
p
8. The temperature at a point (x, y, z) in space is given by T (x, y, z) = λ x2 + y 2 + z 2 , where
λ is a constant. Use the chain rule to find the rate of change of temperature with respect to t
along the helix r(t) = (cos t) i + (sin t) j + t k.
Solution:
dT
∂T dx ∂T dy ∂T dz
=
+
+
dt
∂x dt
∂y dt
∂z dt
1
−
= λ x2 + y 2 + z 2 2 (−x sin t + y cos t + z)
− 1
= λt 1 + t2 2
9. Let f (x, y, z) = x2 e2y cos 3z. Find the value of df /dt at the point (1, log 2, 0) on the curve
x = cos t, y = log(t + 2), z = t.
Page 4
Solution:
Using the chain rule,
∂f dx ∂f dy ∂f dz
df
=
+
+
dt
∂x dt
∂y dt
∂z dt
2y
= 2xe cos 3z(− sin t) + 2x2 e2y cos 3z (t + 2)−1 − 3x2 e2y sin 3z.
df When t = 0, we have x = 1, y = log 2, z = 0, and so
= 2 × 4 × 2−1 = 4.
dt t=0
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 /∂s
and ∂f /∂t in terms of ∂f /∂x, ∂f /∂y, ∂f /∂z, s and t.
Solution:
Applying the chain rule, we get
and
∂f
∂f ∂x ∂f ∂y ∂f ∂z
=
+
+
∂s
∂x ∂s ∂y ∂s ∂z ∂s
∂f
∂f
∂f
= 2s
+ 2s
+ 2t
∂x
∂y
∂z
∂f
∂f ∂x ∂f ∂y ∂f ∂z
=
+
+
∂t
∂x ∂t
∂y ∂t
∂z ∂t
∂f
∂f
∂f
= 2t
− 2t
+ 2s .
∂x
∂y
∂z
11. Repeat the previous question but with x = s + t, y = s − t, z = st.
Solution:
∂f
∂f
∂f
∂f
=
+
+t
∂s
∂x ∂y
∂z
and
∂f
∂f
∂f
∂f
=
−
+s .
∂t
∂x ∂y
∂z
12. If f (x, y, z) is a function of x, y and z, and if x = s3 + t2 , y = s2 − t3 , z = s2 t3 , find ∂f /∂s
and ∂f /∂t in terms of ∂f /∂x, ∂f /∂y, ∂f /∂z, s and t.
Solution:
Applying the chain rule, we get
and
∂f
∂f ∂x ∂f ∂y ∂f ∂z
=
+
+
∂s
∂x ∂s ∂y ∂s ∂z ∂s
∂f
∂f
∂f
= 3s2
+ 2s
+ 2st3
∂x
∂y
∂z
∂f
∂f ∂x ∂f ∂y ∂f ∂z
=
+
+
∂t
∂x ∂t
∂y ∂t
∂z ∂t
∂f
∂f
∂f
= 2t
− 3t2
+ 3s2 t2 .
∂x
∂y
∂z
Page 5
13. Repeat the previous question but with x = s + sin t, y = cos s − t, z = s cos t.
Solution:
∂f
∂f
∂f
∂f
=
− sin s
+ cos t
∂s
∂x
∂y
∂z
∂f
∂f
∂f
∂f
= cos t
−
+ s sin t .
∂t
∂x ∂y
∂z
and
14. Let f (x, y) = xesin y . If x = sin (u2 + v 2 ) and y = u2 + v 2 , write down the appropriate
∂f
∂f
form of the chain rule to express
and
in terms of ∂f /∂x, ∂f /∂y, ∂x/∂u, ∂x/∂v, ∂y/∂u,
∂u
∂v
∂f
and ∂y/∂v. To check your result, calculate
from your chain rule and verify that it agrees
∂u
∂f
with the result of making the substitution to find f (u, v) explicitly, followed by calculating
∂u
directly.
Solution:
∂f
∂f ∂x ∂f ∂y
=
+
∂u
∂x ∂u ∂y ∂u
∂f
∂f ∂x ∂f ∂y
=
+
.
∂v
∂x ∂v
∂y ∂v
and
So checking:
∂f
= esin y 2u cos u2 + v 2 + x(cos y)2uesin y 2u
∂u
2
2
= 2uesin(u +v ) cos u2 + v 2 1 + sin u2 + v 2
Making the substitutions, we get
2
2
f (u, v) = sin u2 + v 2 esin(u +v )
∂f
2
2
= esin(u +v ) 2u cos u2 + v 2 + sin u2 + v 2 2u cos u2 + v 2
and
∂u
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
∂f
∂f
=x
+y ,
∂u
∂x
∂y
and
∂ 2f
∂f
−
= xy
∂u∂v ∂v
∂f
∂f
∂f
=y
+x ,
∂v
∂x
∂y
∂ 2f
∂ 2f
+
∂x2
∂y 2
+ (x2 + y 2 )
∂ 2f
.
∂x∂y
Solution:
First note that
∂x
= eu cosh v = x,
∂u
∂x
= eu sinh v = y,
∂v
∂y
= eu sinh v = y,
∂u
Using the chain rule we obtain
∂f
∂f ∂x ∂f ∂y
∂f
∂f
=
+
=x
+y
∂u
∂x ∂u ∂y ∂u
∂x
∂y
∂f
∂f ∂x ∂f ∂y
∂f
∂f
=
+
=y
+x .
∂v
∂x ∂v
∂y ∂v
∂x
∂y
Page 6
∂y
= eu cosh v = x.
∂v
Note that we have not used any special property of f , so these formulae hold for any function
of x and y. In particular, we can replace f with ∂f /∂x or ∂f /∂y to get
∂ ∂f
∂ 2f
∂ ∂f
∂ 2f
∂ 2f
∂ 2f
=x 2 +y
,
=x
+y 2
∂u ∂x
∂x
∂x∂y
∂u ∂y
∂x∂y
∂y
Hence, using the above formulae and the product rule,
∂ 2f
∂ ∂f
∂
∂f
∂f
=
=
y
+x
∂u∂v
∂u ∂v
∂u
∂x
∂y
∂ ∂f
∂x ∂f
∂ ∂f
∂y ∂f
+y
+
+x
=
∂u ∂x
∂u ∂x
∂u ∂y
∂u ∂y
2
2
∂ f
∂f
∂ 2f
∂ 2f
∂f
∂ f
+y x 2 +y
+x
+x x
+y 2
=y
∂x
∂x
∂x∂y
∂y
∂y∂x
∂y
2
2
2
2
∂f
∂ f
∂f
∂ f
∂ f
∂ f
=y
+ xy 2 + y 2
+x
+ x2
+ xy 2
∂x
∂x
∂x∂y
∂y
∂y∂x
∂y
So
∂ 2f
∂f
−
= xy
∂u∂v ∂v
∂ 2f
∂ 2f
+
∂x2
∂y 2
+ (x2 + y 2 )
∂ 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
2
∂ 2f
∂ f
∂ 2f
∂ 2f
2u
+ 2 =e
+ 2 .
∂u2
∂v
∂x2
∂y
Solution:
By the chain rule,
∂f ∂x ∂f ∂y
∂f
∂f
∂f
=
+
= eu cos v
+ eu sin v
∂u
∂x ∂u ∂y ∂u
∂x
∂y
∂f
∂f ∂x ∂f ∂y
∂f
∂f
=
+
= −eu sin v
+ eu cos v
∂v
∂x ∂v
∂y ∂v
∂x
∂y
Replace f by
Replace f by
Replace f by
∂f
in (1) to get
∂x
∂ ∂f
∂ 2f
∂ 2f
= eu cos v 2 + eu sin v
∂u ∂x
∂x
∂y∂x
∂f
in (1) to get
∂y
∂ ∂f
∂ 2f
∂ 2f
= eu cos v
+ eu sin v 2
∂u ∂y
∂x∂y
∂y
∂f
in (2) to get
∂x
∂ ∂f
∂ 2f
∂ 2f
= −eu sin v 2 + eu cos v
∂v ∂x
∂x
∂y∂x
Page 7
(1)
(2)
(3)
(4)
(5)
Replace f by
∂f
in (2) to get
∂y
∂ 2f
∂ ∂f
∂ 2f
= −eu sin v
+ eu cos v 2
∂v ∂y
∂x∂y
∂y
(6)
Differentiate (1) with respect to u and use (3) and (4) to get
∂ 2f
∂ ∂f
∂f
∂ ∂f
∂f
u
u
u
u
+ e cos v
+ e sin v
+ e sin v
= e cos v
∂u2
∂x
∂u ∂x
∂y
∂u ∂y
2
2
∂ f
∂f
∂ 2f
∂ 2f
∂f
∂ f
u
u
u
u
u
u
+ e cos v 2 + e sin v
+ e sin v
+ e cos v
+ e sin v 2
= e cos v
∂x
∂x
∂y∂x
∂y
∂x∂y
∂y
Differentiate (2) with respect to v and use (5) and (6) to get
∂ ∂f
∂f
∂ ∂f
∂f
∂ 2f
u
u
u
u
− e sin v
− e sin v
+ e cos v
= −e cos v
∂v 2
∂x
∂v ∂x
∂y
∂v ∂y
2
2
∂ f
∂f
∂ f
− eu sin v −eu sin v 2 + eu cos v
= −eu cos v
∂x
∂x
∂x∂y
2
∂f
∂ f
∂ 2f
u
u
u
u
− e sin v
+ e cos v −e sin v
+ e cos v 2
∂y
∂x∂y
∂y
So when we add, most of the terms cancel and we get
∂ 2 f 2u
∂ 2f
∂ 2f
∂ 2 f 2u
2
2u
2
2
2u
2
+
=
e
cos
v
+
e
sin
v
+
e
cos
v
+
e
sin
v
∂u2
∂v 2
∂x2
∂y 2
2
2
∂ f
∂ f
= e2u
+
∂x2
∂y 2
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 /∂u
and ∂f /∂v in terms of ∂f /∂x and ∂f /∂y, and prove that
2
∂ 2f
∂ 2f
∂ f
∂ 2f
2u
− 2 =e
− 2 .
∂u2
∂v
∂x2
∂y
Solution:
By the chain rule,
∂f
∂f ∂x ∂f ∂y
∂f
∂f
=
+
= eu cosh v
+ eu sinh v
∂u
∂x ∂u ∂y ∂u
∂x
∂y
∂f
∂f ∂x ∂f ∂y
∂f
∂f
=
+
= eu sinh v
+ eu cosh v
∂v
∂x ∂v
∂y ∂v
∂x
∂y
Replace f by
∂f
in (1) to get
∂x
∂ ∂f
∂ 2f
∂ 2f
= eu cosh v 2 + eu sinh v
∂u ∂x
∂x
∂y∂x
Page 8
(1)
(2)
(3)
Replace f by
Replace f by
Replace f by
∂f
in (1) to get
∂y
∂ 2f
∂ ∂f
∂ 2f
= eu cosh v
+ eu sinh v 2
∂u ∂y
∂x∂y
∂y
∂f
in (2) to get
∂x
∂ ∂f
∂ 2f
∂ 2f
= eu sinh v 2 + eu cosh v
∂v ∂x
∂x
∂y∂x
∂f
in (2) to get
∂y
∂ ∂f
∂ 2f
∂ 2f
= eu sinh v
+ eu cosh v 2
∂v ∂y
∂x∂y
∂y
(4)
(5)
(6)
Differentiate (1) with respect to u and use (3) and (4) to get
∂f
∂ ∂f
∂f
∂ ∂f
∂ 2f
u
u
u
u
= e cosh v
+ e cosh v
+ e sinh v
+ e sinh v
∂u2
∂x
∂u ∂x
∂y
∂u ∂y
2
2
∂f
∂ f
∂ f
= eu cosh v
+ eu cosh v 2 + eu sinh v
∂x
∂x
∂y∂x
2
∂f
∂ f
∂ 2f
u
u
u
+ e sinh v
+ e cosh v
+ e sinh v 2
∂y
∂x∂y
∂y
Differentiate (2) with respect to v and use (5) and (6) to get
∂f
∂ ∂f
∂ ∂f
∂ 2f
∂f
u
u
u
u
= e cosh v
+ e sinh v
+ e cosh v
+ e sinh v
∂v 2
∂x
∂v ∂x
∂y
∂v ∂y
2
2
∂f
∂ f
∂ f
= eu cosh v
+ eu sinh v eu sinh v 2 + eu cosh v
∂x
∂x
∂x∂y
2
∂f
∂ f
∂ 2f
u
u
u
u
+ e cosh v e sinh v
+ e cosh v 2
e sinh v
∂y
∂x∂y
∂y
So when we subtract, most of the terms cancel and we get
∂ 2f
∂ 2f
∂ 2 f 2u
∂ 2f
2
2
2u
−
=
e
cosh
v
−
e
sinh
v
+ 2 −e2u cosh2 v + e2u sinh2 v
2
2
2
∂u
∂v
∂x
∂y
2
2
∂ f
∂ f
= e2u
− 2
2
∂x
∂y
18. Let f (r) be a function of r and assume that r =
p
x2 + y 2 . Prove that
∂ 2f
∂ 2f
d2 f
1 df
+
=
+
.
∂x2
∂y 2
dr2
r dr
Page 9
Solution:
First note that
∂r
x
x
=p
= .
∂x
r
x2 + y 2
By the chain rule,
∂f
df ∂r
df x
=
=
∂x
dr ∂x
dr
r
2
∂ f
∂ df x
=
2
∂x
∂x dr r
d2 f ∂r x df 1
x ∂r
= 2
+
−
dr ∂x r dr r r2 ∂x
d2 f x2 df 1 x2
− 3
= 2 2 +
dr r
dr r
r
2
2
2
dfx
df r − x2
= 2 2 +
dr r
dr
r3
d2 f x2 df y 2
= 2 2 +
dr r
dr r3
By symmetry,
∂ 2f
d2 f y 2 df
=
+
∂y 2
dr2 r2 dr
and so
∂ 2f
d2 f
∂ 2f
+
=
∂x2
∂y 2
dr2
x2 + y 2
r2
df
+
dr
x2
r3
x2 + y 2
r3
=
1 df
d2 f
+
.
2
dr
r dr
19. Write Laplace’s equation
∂ 2f
∂ 2f
+
=0
∂x2
∂y 2
in terms of polar coordinates (r, θ) where x = r cos θ, y = r sin θ.
Solution:
We use the chain rule:
∂f ∂x ∂f ∂y
∂f
∂f
∂f
=
+
=
cos θ +
sin θ
∂r
∂x ∂r
∂y ∂θ
∂x
∂y
∂f
∂f ∂x ∂f ∂y
∂f
∂f
=
+
= − r sin θ +
r cos θ
∂θ
∂x ∂θ
∂y ∂θ
∂x
∂y
Hence
∂ ∂f
∂ ∂f
∂ ∂f
∂ 2f
∂ 2f
=
cos θ +
sin θ =
cos
θ
+
sin θ
∂r ∂x
∂x ∂x
∂y ∂x
∂x2
∂y∂x
∂ ∂f
∂ 2f
∂ 2f
= − 2 r sin θ +
r cos θ
∂θ ∂x
∂x
∂y∂x
∂ ∂f
∂ ∂f
∂ 2f
∂ 2f
∂ ∂f
=
cos θ +
sin θ =
cos θ + 2 sin θ
∂r ∂y
∂x ∂y
∂y ∂y
∂x∂y
∂y
2
2
∂ ∂f
∂ f
∂ f
=−
r sin θ + 2 r cos θ
∂θ ∂y
∂x∂y
∂y
Page 10
Thus
∂ 2f
∂f
∂ ∂f
∂ ∂f
∂ ∂f
cos θ +
sin θ =
cos θ +
sin θ
=
∂r2
∂r ∂x
∂y
∂r ∂x
∂r ∂y
∂ 2f
∂ 2f
∂ 2f
∂ 2f
2
=
sin θ cos θ +
cos θ sin θ + 2 sin2 θ
cos θ +
2
∂x
∂y∂x
∂x∂y
∂y
2
2
2
∂ f
∂ f
∂ f
cos θ sin θ + 2 sin2 θ
cos2 θ + 2
=
2
∂x
∂x∂y
∂y
and
∂ 2f
∂f
∂f
∂
− r sin θ +
r cos θ
=
∂θ2
∂θ
∂x
∂y
∂f
∂ ∂f
∂f
∂ ∂f
r sin θ −
r cos θ +
r cos θ −
r sin θ
=−
∂θ ∂x
∂x
∂θ ∂y
∂y
2
∂ f
∂f
∂ 2f
∂ 2f
∂ 2f
∂f
= − − 2 r sin θ +
r cos θ r sin θ −
r cos θ + −
r sin θ + 2 r cos θ r cos θ −
rs
∂x
∂y∂x
∂x
∂x∂y
∂y
∂y
∂ 2f 2 2
∂ 2f 2
∂ 2f 2
∂f
∂f
2
=
r
cos
θ
+
r
sin
θ
−
2
r cos θ sin θ
r
sin
θ
−
r
cos
θ
−
∂x2
∂x
∂y 2
∂y
∂y∂x
Moreover
∂ 2f
∂ ∂f
∂f
=
cos θ +
sin θ
∂θ∂r
∂θ ∂x
∂y
∂ ∂f
∂ ∂f
∂f
∂f
sin θ +
cos θ
=
cos θ −
sin θ +
∂θ ∂x
∂x
∂θ ∂y
∂y
2
∂ f
∂ 2f
∂f
∂ 2f
∂ 2f
∂f
= − 2 r sin θ +
r cos θ cos θ −
sin θ + −
r sin θ + 2 r cos θ sin θ +
cos θ
∂x
∂y∂x
∂x
∂x∂y
∂y
∂y
∂ 2f
∂ 2f
∂f
∂ 2f
∂f
= − 2 r sin θ cos θ −
sin θ +
r cos2 θ − sin2 θ + 2 r cos θ sin θ +
cos θ
∂x
∂x
∂x∂y
∂y
∂y
So
2
f
∂ 2f
r
+
= r2
2
2
∂r
∂θ
2∂
∂ 2f
∂ 2f
∂ 2f
2
2
cos θ + 2
cos θ sin θ + 2 sin θ +
∂x2
∂x∂y
∂y
2
2
∂ f
∂f
∂ f
∂f
∂ 2f 2
+ 2 r2 sin2 θ −
r cos θ + 2 r2 cos2 θ −
r sin θ − 2
r cos θ sin θ
∂x
∂x
∂y
∂y
∂y∂x
∂ 2f
∂ 2f
∂f
∂f
= r2 2 + r2 2 −
r cos θ −
r sin θ
∂x
∂y
∂x
∂y
∂ 2f
∂ 2f
∂f
= r2 2 + r2 2 − r
∂x
∂y
∂r
and hence
∂ 2f
1 ∂ 2f
1 ∂f
∂ 2f
∂ 2f
+
+
=
+
∂r2
r2 ∂θ2
r ∂r
∂x2
∂y 2
and we can write Laplace’s equation as
r2
∂ 2f
∂ 2f
∂f
+
+r
= 0.
2
2
∂r
∂θ
∂r
Page 11
20. Show that r cos θ is a solution of Laplace’s equation.
Solution:
Let f = r cos θ; then
∂ 2f
=0
∂r2
∂ 2f
= −r cos θ
∂θ2
∂f
= cos θ
∂r
∂f
= −r sin θ
∂θ
Thus
r2
∂ 2f
∂ 2f
∂f
= 0 − r cos θ + r cos θ = 0
+
+r
2
2
∂r
∂θ
∂r
as required.
21. Show that cos θ is not a solution of Laplace’s equation.
Solution:
Let f = cos θ; then
∂ 2f
=0
∂r2
∂ 2f
= − cos θ
∂θ2
∂f
=0
∂r
∂f
= − sin θ
∂θ
Thus
r2
∂ 2f
∂f
∂ 2f
+
+r
= 0 − r cos θ + 0 6= 0
2
2
∂r
∂θ
∂r
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
= 2ar cos2 θ + 2br sin2 θ + 2cr cos θ sin θ
∂r
∂ 2f
= 2a cos2 θ + 2b sin2 θ + 2c cos θ sin θ
∂r2
∂f
= −2ar2 cos θ sin θ + 2br2 sin θ cos θ − cr2 sin2 θ + cr2 cos2 θ
∂θ
= 2 (b − a) r2 cos θ sin θ + cr2 cos2 θ − sin2 θ
∂ 2f
= 2 (b − a) r2 cos2 θ − sin2 θ − 4cr2 cos θ sin θ
2
∂θ
Page 12
Thus writing Laplace’s equation as
∂ 2f
1 ∂ 2f
1 ∂f
=0
+
+
2
2
2
∂r
r ∂θ
r ∂r
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 + 2y 2 + 3z 2 at (1, 1, 0) in the direction
i − j + 2k.
Solution:
We have ∇f = (2x, 4y, 6z) so ∇f (1, 1, 0) = (2, 4, 0). Hence the required directional derivative
is
2
(1, −1, 2)
= −√ .
(2, 4, 0) • √
1+1+4
6
24. Find the gradient vectors for the following functions:
a) f (x, y) = ex cos y,
b) f (x, y, z) = log(x2 + 2y 2 − 3z 2 ).
Solution:
(a)
∇f =
∂f ∂f
,
∂x ∂y
= (ex cos y, −ex sin y)
(b)
∂f ∂f ∂f
,
,
∇f =
∂x ∂y ∂z
2x
4y
−6z
=
,
,
x2 + 2y 2 − 3z 2 x2 + 2y 2 − 3z 2 x2 + 2y 2 − 3z 2
√
25. A function f (x, y) has at the point (1, 2) a directional derivative +2 in direction i and − 2
in 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
√
(1, 1)
(a, b) • √
=− 2
1+1
=⇒
2 + b = −2
=⇒
b = −4
(3, 4)
= −2.
Thus ∇f (1, 2) = (2, −4) and the required directional derivative is (2, −4) • √
9 + 16
26. Find the directional derivative of f (x, y, z) = x + y 2 + xz 2 at (1, 2, −1) in the direction
i + j − 3k.
Solution:
We have ∇f = (1 + z 2 , 2y, 2xz) so ∇f (1, 2, −1) = (2, 4, −2). Hence the required directional
derivative is
(1, 1, −3)
12
(2, 4, −2) • √
=√
1+1+9
11
Page 14
27. Find the directional derivative of f (x, y, z) = x3 yz − x2 + z 2 at (2, −1, 1) in the direction
2i + j + 2k.
Solution:
We have ∇f = (3x2 yz − 2x, x3 z, x3 y + 2z) so ∇f (2, −1, 1) = (−16, 8, −6). Hence the required
directional derivative is
−36
(2, −1, 1)
= √ = −12
(−16, 8, −6) • √
4+1+4
3
28. Find the directional derivative of f (x, y, z) = x + y 2 + z 3 + x3 y 2 z at (1, −1, −2) in the
direction i + 2j − 3k.
Solution:
We have ∇f = (1 + 3x2 y 2 z, 2y + 2x3 yz, 3z 2 + x3 y 2 ) so ∇f (1, −1, −2) = (−5, 2, 13). Hence the
required directional derivative is
−40
(1, 2, −3)
=√
(−5, 2, 13) • √
1+4+9
14
√
29. A function f (x, y, z) has, at the point (1, −1, 2), a directional derivative − 2 in direction
i + k, √12 in 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
√
(1, 0, 1)
(a, b, c) • √
=− 2
1+0+1
(0, 1, 1)
1
(a, b, c) • √
=√
0+1+1
2
(1, 1, 1)
(a, b, c) • √
=0
1+1+1
=⇒
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, 3)
−8
(−1, 2, −1) • √
=√
1+4+9
14
√
30. A function f (x, y, z) has, at the point (1, 1, 1) a directional derivative 3 in direction k, 2 3
in direction i + j + k and √12 in 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
(0, 0, 1)
(a, b, c) • √
=3
0+0+1
√
(1, 1, 1)
(a, b, c) • √
=2 3
1+1+1
(1, −1, 0)
1
(a, b, c) • √
=√
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
(1, −1, 1)
4
(2, 1, 3) • √
=√
1+1+1
3
31. Let f (x, y, z) = axy 2 + byz + cz 2 x3 . Find values of the constants a, b and c such that at
the point (1, 2, −1) the directional derivative of f takes its maximum value in the direction of
the positive z-axis and that value is 64.
Solution:
We have ∇f = (ay 2 + 3cz 2 x2 , 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 parallel
to 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 the
tangent plane there is
ax + cy + bz = a2 + 2bc
Page 16
We also find the normal line at (a, b, c) has equation
y−b
z−c
x−a
=
=
a
c
b
For the tangent plane to be parallel to the given plane we need (a, c, b) = λ(4, 1, −7). Substituting 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) is
x−2
y−1
z+1
=
=
2
−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 . Find
the 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 the
surface 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
y+1
z
=
= .
2
3
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 λ = − 97 correspond to the point p and the other point of intersection
5 30 2
− ,− ,
9
9 9
respectively.
34. Find a unit normal to the surface 2x3 z + x2 y 2 + xyz − 4 = 0 at the point (2, 1, 0).
Solution:
Let f = 2x3 z + x2 y 2 + xyz − 4; then ∇f = (6x2 z + 2xy 2 + yz, 2x2 y + xz, 2x3 + xy) and so
∇f (2, 1, 0) = (4, 8, 18) is normal to the surface. Thus the unit normal is
√
1
(2, 4, 9).
101
35. (Harder). Find the equations of the tangent plane and the normal line to the surface
xy + yz + zx = 0 at the point (a, b, c). Let P be a point on the surface and suppose that the
normal 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 from
O 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
2
2
2
2
2
2
λ a + b + c + 2λ a + b + c = 0
Page 18
Assuming (a, b, c) is no the origin, this gives λ(λ + 2) = 0. Thus the normal meets S again
when λ = −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 second
intersection 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.
p
36. Find a vector v in terms of x, y and z which is normal to the surface z = x2 + y 2 +
(x2 + y 2 )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:
p
Let f = x2 + y 2 + (x2 + y 2 )3/2 − z. Then
−1/2
1/2
−1/2
1/2
v = ∇f = x x2 + y 2
+ 3x x2 + y 2
, y x2 + y 2
+ 3y x2 + y 2
, −1
is normal to the surface. Also,
cos θ =
v · (0, 0, 1)
|v|
−1
+
+
+
+
+ y 2 (x2 + y 2 )−1 + 9y 2 (x2 + y 2 ) + 6y 2 + 1
−1
1
=
−→ −
as (x, y, z) → (0, 0, 0)
2
2
2
2
2
2 + 9x + y ) + 6(x + y )
2
=
x2 (x2
y 2 )−1
9x2 (x2
y2)
6x2
37. Find div u where u = (cos x, cos y, cos z). Hence find div u at
π π π
, ,
4 3 2
.
Solution:
∂ ∂ ∂
div u = ∇ • u =
, ,
• (cos x, cos y, cos z)
∂x ∂y ∂z
∂
∂
∂
=
cos x +
cos y +
cos z
∂x
∂y
∂z
= − sin x − sin y − sin z
Hence div u
π π π
, ,
4 3 2
= − √12 −
√
3
2
− 1.
38. Find curl u where u = (cos x, cos y, cos z). Hence find curl u at
Page 19
π π π
, ,
4 3 2
.
Solution:
i
j
k
∂
∂
∂ curl u = ∇ × u = ∂y
∂z ∂x
cos x cos y cos z ∂
∂
∂
∂
=
cos z −
cos y i −
cos z −
cos x j
∂y
∂z
∂x
∂z
∂
∂
+
cos y −
cos x k
∂x
∂y
= 0i + 0j + 0k = 0
Hence curl u π4 , π3 , π2 = 0.
39. Find div u where u = (cos y, cos z, cos x). Hence find div u at
π π π
, ,
4 3 2
.
Solution:
∂ ∂ ∂
div u = ∇ • u =
, ,
• (cos y, cos z, cos x)
∂x ∂y ∂z
∂
∂
∂
=
cos y +
cos z +
cos x
∂x
∂y
∂z
=0+0+0=0
Hence div u π4 , π3 , π2 = 0.
40. Find curl u where u = (cos y, cos z, cos x). Hence find curl u at
π π π
, ,
4 3 2
.
Solution:
i
j
k
∂
∂
∂ curl u = ∇ × u = ∂y
∂z ∂x
cos y cos z cos x
∂
∂
∂
∂
=
cos x −
cos z i −
cos x −
cos y j
∂y
∂z
∂x
∂z
∂
∂
+
cos z −
cos y k
∂x
∂y
= (sin z)i + (sin x)j + (sin yk
Hence curl u
π π π
, ,
4 3 2
=i+
√1 j
2
√
+
3
k.
2
41. Find div u where u = (x2 + y 2 + z 2 , yz + zx + xy, x2 y 2 z 2 ). Hence find div u at (1, 2, −1).
Page 20
Solution:
∂ ∂ ∂
, ,
• x2 + y 2 + z 2 , yz + zx + xy, x2 y 2 z 2
div u = ∇ • u =
∂x ∂y ∂z
∂ 2
∂
∂
=
(x + y 2 + z 2 ) +
(yz + zx + xy) + (x2 y 2 z 2 )
∂x
∂y
∂z
2 2
= 2x + z + x + 2x y z
= 3x + z + 2x2 y 2 z
Hence div u(1, 2, −1) = 3 − 1 − 8 = −6.
42. Find curl u where u = (x2 + y 2 + z 2 , yz + zx + xy, x2 y 2 z 2 ). Hence find curl u at (1, 2, −1).
Solution:
i
j
k
∂
∂
∂ curl u = ∇ × u = ∂y
∂z 2 ∂x2
2
2
x + y + z yz + zx + xy x y 2 z 2 ∂
∂
∂
∂
2 2 2
2 2 2
2
2
2
=
xy z −
(yz + zx + xy) i −
xy z −
x +y +z
j
∂y
∂z
∂x
∂z
∂
∂
2
2
2
+
(yz + zx + xy) −
x +y +z
k
∂x
∂y
= 2x2 yz 2 − y − x i − 2xy 2 z 2 − 2z j + (z + y − 2y) k
= 2x2 yz 2 − y − x i + 2z − 2xy 2 z 2 j + (z − y) k
Hence curl u(1, 2, −1) = i − 10j − 3k.
43. Find div u where u = (xy 2 − z cos2 x, x2 sin y, xyz). Hence find div u at
π π
, , −1
4 4
.
Solution:
∂ ∂ ∂
div u = ∇ • u =
, ,
• xy 2 − z cos2 x, x2 sin y, xyz
∂x ∂y ∂z
∂
∂
∂
xy 2 − z cos2 x +
x2 sin y +
(xyz)
=
∂x
∂y
∂z
= y 2 + 2z sin x cos x + x2 cos y + xy
Hence div u
π π
, , −1
4 4
=
π2
16
−1+
2
π√
16 2
+
π2
16
=
√
2+ 2 2
π
32
− 1.
44. Find curl u where u = (xy 2 − z cos2 x, x2 sin y, xyz). Hence find curl u at
Solution:
Page 21
π π
, , −1
4 4
.
i
j
k ∂
∂
∂ curl u = ∇ × u = ∂y
∂z 2 ∂x 2
xy − z cos x x2 sin y xyz ∂
∂
∂
∂
2
2
2
=
(xyz) −
x sin y i −
(xyz) −
xy − z cos x j
∂y
∂z
∂x
∂z
∂
∂
2
2
2
x sin y −
xy − z cos x k
+
∂x
∂y
= (xz) i − yz + cos2 x j + (2x sin y − 2xy) k
Hence curl u
π π
, , −1
4 4
= − π4 i +
π
4
−
1
2
j+
π
√
2 2
−
π2
8
k.
45. Find div u where u = (sin x, sin y, sin z). Hence find div u at
π π π
, ,
4 3 2
.
Solution:
∂ ∂ ∂
, ,
• (sin x, sin y, sin z)
div u = ∇ • u =
∂x ∂y ∂z
∂
∂
∂
sin x +
sin y +
sin z
=
∂x
∂y
∂z
= cos x + cos y + cos z
Hence div u π4 , π3 , π2 = √12 + 12 .
46. Find curl u where u = (sin x, sin y, sin z). Hence find curl u at
π π π
, ,
4 3 2
.
Solution:
i
j
k
∂
∂
∂ curl u = ∇ × u = ∂y
∂z ∂x
sin x sin y sin z ∂
∂
∂
∂
=
sin z −
sin y i −
sin z −
sin x j
∂y
∂z
∂x
∂z
∂
∂
+
sin y −
sin x k
∂x
∂y
= 0i + 0j + 0k = 0
Hence curl u π4 , π3 , π2 = 0.
47. Find div u where u = (z sin x, x sin y, y sin z). Hence find div u at
Solution:
Page 22
π π π
, ,
4 3 2
.
∂ ∂ ∂
, ,
• (z sin x, x sin y, y sin z)
div u = ∇ • u =
∂x ∂y ∂z
∂
∂
∂
=
(z sin x) +
(x sin y) +
(y sin z)
∂x
∂y
∂z
= z cos x + x cos y + y cos z
π
Hence div u π4 , π3 , π2 = 2√
+ π8 .
2
48. Find curl u where u = (z sin x, x sin y, y sin z). Hence find curl u at
π π π
, ,
4 3 2
.
Solution:
i
j
∂
∂
curl u = ∇ × u = ∂y
∂x
z sin x x sin y
∂
=
(y sin z) −
∂y
+
k ∂ ∂z y sin z ∂
∂
∂
(x sin y) i −
(y sin z) −
(z sin x) j
∂z
∂x
∂z
∂
∂
(x sin y) −
(z sin x) k
∂x
∂y
= (sin z)i + (sin x)j + (sin y)k
Hence curl u
π π π
, ,
4 3 2
=i+
√1 j
2
√
+
3
k.
2
49. Find div u where u = (y sin x, z sin y, x sin z). Hence find div u at
π π π
, ,
4 3 2
.
Solution:
∂ ∂ ∂
div u = ∇ • u =
, ,
• (y sin x, z sin y, x sin z)
∂x ∂y ∂z
∂
∂
∂
(y sin x) +
(z sin y) +
(x sin z)
=
∂x
∂y
∂z
= y cos x + z cos y + x cos z
π
+ π4 .
Hence div u π4 , π3 , π2 = 3√
2
50. Find curl u where u = (y sin x, z sin y, x sin z). Hence find curl u at
Solution:
Page 23
π π π
, ,
4 3 2
.
i
j
∂
∂
curl u = ∇ × u = ∂y
∂x
y sin x z sin y
∂
=
(x sin z) −
∂y
+
k ∂ ∂z x sin z ∂
∂
∂
(z sin y) i −
(x sin z) −
(y sin x) j
∂z
∂x
∂z
∂
∂
(z sin y) −
(y sin x) k
∂x
∂y
= (− sin y)i + (− sin z)j + (− sin x)k
Hence curl u
π π π
, ,
4 3 2
√
=−
3
i
2
−j−
√1 k.
2
51. Find div u where u = (xy sin z, yz sin x, zx sin y). Hence find div u at
π π π
, ,
4 3 2
.
Solution:
∂ ∂ ∂
div u = ∇ • u =
, ,
• (y sin x, z sin y, x sin z)
∂x ∂y ∂z
∂
∂
∂
=
(xy sin z) +
(yz sin x) +
(zx sin y)
∂x
∂y
∂z
= y sin z + z sin x + x sin y
Hence div u
π π π
, ,
4 3 2
=
π
3
+
π
√
2 2
+
√
π 3
.
8
52. Find curl u where u = (xy sin z, yz sin x, zx sin y). Hence find curl u at
π π π
, ,
4 3 2
.
Solution:
i
j
k
∂
∂
∂
curl u = ∇ × u = ∂y
∂z ∂x
xy sin z yz sin x zx sin y ∂
∂
∂
∂
=
(zx sin y) −
(yz sin x) i −
(zx sin y) −
(xy sin z) j
∂y
∂z
∂x
∂z
∂
∂
+
(yz sin x) −
(xy sin z) k
∂x
∂y
= (zx cos y − y sin x)i + (xy cos z − z sin y)j + (yz cos x − x sin z)k
2
√
2
π 3
π
π√
π
Hence curl u π4 , π3 , π2 = π16 − 3√
i
−
j
+
−
k.
4
4
2
6 2
53. Find all the critical points of the following functions and classify each as a local maximum,
minimum or saddle point.
a) x2 + y 4 − 2x − 4y 2 + 5
b) 2x3 − 9x2 y + 12xy 2 − 60y,
c) (x2 + y 2 )2 − 8(x2 − y 2 ),
d) x2 y 2 − x2 − y 2 ,
Page 24
e) y 2 + xy + x2 + 4y − 4x + 5.
Solution:
We will use the notation fx = ∂f /∂x, fxx = ∂ 2 f /∂x2 , etc.
(a) We have
fx = 2x − 2 = 0 and fy = 4y 3 − 8y = 0
⇐⇒ x = 1 and y(y 2 − 2) = 0
√
⇐⇒ x = 1 and y = 0, ± 2
√
√
So the critical points are (1, 0), (1, 2) and (1, − 2). Also,
fxx = 2,
fyy = 12y 2 − 8
and
fxy = 0.
Hence
2
• at (1, 0), fxx fyy − fxy
= −16 < 0 so this is a saddle point,
√
2
= 32 > 0 and fxx = 2 > 0 so this is a local minimum,
• at (1, 2), fxx fyy − fxy
√
2
• at (1, − 2), fxx fyy − fxy
= 32 > 0 and fxx = 2 > 0 so this is a local minimum.
(b) We have
fx = 6x2 − 18xy + 12y 2 = 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 = −5y 2 + 20 = 0 so y = ±2.
√
When x = 2y, we have 3x2 − 8xy + 20 = −4y 2 + 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
2
= (−12)(48) − 122 < 0 so this is a saddle point,
• at (2, 2), fxx fyy − fxy
2
= (12)(−48) − (−12)2 < 0 so this is a saddle point,
• at (−2, −2), fxx fyy − fxy
√ √
√
√
√
√
2
• at (2 5, 5), fxx fyy − fxy
= (−12 5)(48 5) − (−12 5)2 > 0 and fxx = 6 5 > 0 so
this is a local minimum,
√
√
√
√
√
√
2
• at (−2 5, − 5), fxx fyy − fxy
= (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 + y 2 ) − 16x = 0 and fy = 4y(x2 + y 2 ) + 16y = 0
⇐⇒ x(x2 + y 2 − 4) = 0 and y(x2 + y 2 + 4) = 0
⇐⇒ x(x2 + y 2 − 4) = 0 and y = 0
(as x2 + y 2 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 + 4y 2 − 16,
fyy = 4x2 + 12y 2 + 16
Hence
Page 25
and
fxy = 8xy.
2
= (−16)(16) < 0 so this is a saddle point,
• at (0, 0), fxx fyy − fxy
2
• at (2, 0), fxx fyy − fxy
= (32)(32) > 0 and fxx = 32 > 0 so this is a local minimum.
2
= (32)(32) > 0 and fxx = 32 > 0 so this is a local minimum.
• at (−2, 0), fxx fyy − fxy
(d) We have
fx = 2xy 2 − 2x = 0 and fy = 2x2 y − 2y = 0
⇐⇒ x(y 2 − 1) = 0 and y(x2 − 1) = 0
⇐⇒ x = y = 0 or x2 = y 2 = 1
So the critical points are (0, 0), (1, 1), (−1, −1), (1, −1) and (−1, 1). Also,
fxx = 2y 2 − 2,
fyy = 2x2 − 2
and
fxy = 4xy.
Hence
2
= (−2)(−2) > 0 and fxx = −2 < 0 so this is a local maximum.
• at (0, 0), fxx fyy − fxy
2
= −16 < 0 so these are saddle points.
• at all the other critical points, fxx fyy − fxy
(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
2
so at (4, −4), fxx fyy − fxy
= (2)(2) − 1 > 0 and fxx = 2 > 0 so this is a local minimum.
54. Find all the critical points of f (x, y) = y 2 + sin x and classify each as a local maximum,
minimum or saddle point.
Solution:
We have
fx = cos x = 0 and fy = 2y = 0
⇐⇒ x = n + 21 π and y = 0
for any integer n so the critical points are n + 12 π, 0 . Also,
fxx = − sin x,
and since sin n +
1
2
fyy = 2
and
fxy = 0
π = (−1)n ,
2
• for n even, fxx fyy − fxy
= −2(−1)n = −2 < 0 so in this case,
point,
n+
1
2
π, 0 is a saddle
2
• for n odd, fxx fyy − fxy
= −2(−1)n = 2 > 0 and fxx = (−1)n = 1 < 0 so in this case,
1
n + 2 π, 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 + 12 π
for any integer n so the critical points are 0, n + 12 π . Also,
fxx = 2,
and since sin n +
1
2
fyy = sin y
and
fxy = 0
π = (−1)n ,
2
= 2(−1)n = −2 < 0 so in this case, 0, n +
• for n odd, fxx fyy − fxy
point,
1
2
π is a saddle
2
• for n even, fxx fyy −fxy
= 2(−1)n = 2 > 0 and fxx = 2 > 0 so in this case, 0, n +
is a local minimum.
1
2
π
56. Find all the critical points of f (x, y) = cos x sin y and classify each as a local maximum,
minimum or saddle point.
Solution:
We have
fx = − sin x sin y = 0 ⇐⇒ sin x = 0 or sin y = 0
⇐⇒ x = mπ or y = nπ
where m and n are integers. Similarly,
fy = cos x cos y = 0 ⇐⇒ cos x = 0 or cos y = 0
⇐⇒ x = m + 21 π or y = n + 12 π
Combining these, we find the critical points are
mπ, n + 12 π
and
m+
1
2
π, nπ
for integers m and n. Also,
fxx = − cos x sin y,
fyy = − cos x sin y
and
fxy = − sin x cos y
and so
• at mπ, n +
1
2
π , we have
sin x = 0,
cos x = (−1)m ,
sin y = (−1)n ,
cos y = 0
2
so fxx fyy − fxy
= 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 + 12 π, nπ ,
sin x = (−1)m ,
cos x = 0,
sin y = 0,
cos y = (−1)n
2
so fxx fyy − fxy
= −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 = cos x sin y = 0 ⇐⇒ cos x = 0 or sin y = 0
⇐⇒ x = m + 21 π or y = nπ
where m and n are integers. Similarly,
fy = sin x cos y = 0 ⇐⇒ sin x = 0 or cos y = 0
1
2
⇐⇒ x = mπ or y = n +
π
Combining these, we find the critical points are
(mπ, nπ)
and
m+
1
2
π, n +
1
2
and
fxy = cos x cos y
for integers m and n. Also,
fxx = − sin x sin y,
fyy = − sin x sin y
and so
• at (mπ, nπ), we have
sin x = 0,
cos x = (−1)m ,
sin y = 0,
cos y = (−1)n
2
so fxx fyy − fxy
= −1 < 0 so this is a saddle point for all m, n.
• at m + 12 π, n + 12 π ,
sin x = (−1)m ,
cos x = 0,
sin y = (−1)n ,
cos y = 0
2
so fxx fyy − fxy
= 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 point
with coordinates (x, y) is h(x, y) = 125y 2 − 100x2 + 50xy + 400 metres above sea level. Find
the direction and rate of fastest ascent when at the point with coordinates (2, 1) and walking
at one km per hour. Also find the directions in which one can traverse the slope, i.e. walk
horizontally.
Solution:
We have ∇h(x, y) = (−200 x + 50 y, 250 y + 50 x) and so
∇h(2, 1) = (−350, 350)
The rate of change of h(x,
in the direction of this vector and is equal to it’s
y) is maximum
√
1
1
length, i.e. in direction − √2 , √2 and at rate 350 2.
Page 28
To see this explicitly, suppose we move in direction (cos θ, sin θ) from the point (2, 1). Then
the 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 points
when f 0 (θ) = 350 sin θ + 350 cos θ = 0, i.e. tan θ = −1 so θ = − π4 , 3π
. In these directions,
4
√
f (θ) = ±350 2.
Similarly, to find which directions are horizontal on the surface, we want f (θ) = 0. This
happens precisely tan θ = 0 and so when θ = π4 , 5π
.
4
Page 29
First Order Ordinary Differential Equations
59. Solve each of the following separable equations:
dy
y
= ,
dx
x
dy
5x + 7
d)
=
,
dx
3y + 2
dy
= y − xy,
g) x
dx
dy
= x3 y 3 ,
dx
dy
3y + 2
e)
=
,
dx
5x + 7
dy
h)
= 1 + x + y + xy.
dx
a)
dy
= 1 + y2,
dx
dy
1 + y2
f)
=
,
dx
1 + x2
b)
c)
Solution:
Each time, separate the variables then integrate, being careful with the integrating constants:
(a)
Z
1
dy =
y
Z
1
dx
x
=⇒
log y = log x + log C
=⇒
y = Cx
where C is a constant.
(b)
Z
1
dy =
y3
Z
3
x dx
=⇒
1
x4
− 2 =
+C
2y
4
r
y=±
=⇒
−2
x4 + 4C
where C is a constant.
(c)
Z
1
dy =
1 + y2
Z
dx
=⇒
tan−1 y = x + C
=⇒
y = tan (x + C)
where C is a constant.
(d)
Z
Z
3 2
5
y + 2y = x2 + 7x + C
2
2
where C is a constant. We could further solve this as a quadratic in y to get
√
−2 ± 4 + 5x2 + 14x + 2C
y=
3
3y + 2 dy =
5x + 7 dx
=⇒
(e)
Z
1
dy =
3y + 2
Z
1
dx
5x + 7
=⇒
1
1
log(3y + 2) = log(5x + 7) + C
3
5
3y + 2 = (5x + 7)3/5 e3C
=⇒
y=
=⇒
D(5x + 7)3/5 − 2
3
where D is a constant.
(f)
Z
1
dy =
1 + y2
Z
1
dx
1 + x2
=⇒
tan−1 y = tan−1 x+C
where C is a constant.
Page 30
=⇒
y = tan tan−1 x + C
(g)
Z
1
dy =
y
Z
1−x
dx
x
log y = log x − x + C
=⇒
y = xeC−x
1
log (1 + y) = x + x2 + C
2
=⇒
y = eC xx+x
=⇒
where C is a constant.
(h)
Z
1
dy =
1+y
Z
1 + x dx
=⇒
2 /2
−1
where C is a constant.
60. A hemispherical bowl of radius 2 metres is filled with water which gradually leaks away
through a circular hole of radius 1 millimetre in the bottom of the bowl. Torricelli’s law shows
that if h(t) is the depth in cms of water above the hole after t seconds, then h(t) satisfies the
differential equation
1000h(400 − h)
p
dh
= −6 2gh,
dt
where g = 981.
Calculate the time the bowl takes to empty.
Solution:
Separating variables, we have
Z
Z
=⇒
1000h(400 − h)
√
dh = −
6 2gh
5 1/2
4 × 10 h
3 3/2
− 10 h
Z
dt
p Z
dh = −6 2g
dt
p
8
2
× 105 h3/2 − 103 × h5/2 = −6 2g t + C
3
5
The initial condition is h(0) = 200, which gives
√
√
√
8
8 2
56 2 × 108
8
8
C = × 10 × 2 2 − 10 ×
=
3
5
15
=⇒
√
The bowl is empty when h = 0 which happens at time t0 satisfying 0 = −6 2g t0 + C, i.e.
√
28 × 108
56 2 × 108 1
√ =
t0 =
' 1.987 × 106 seconds ' 23 days
15
45g
6 2g
61. (Separable variables) Solve the following equations:
a) (x2 + 1)y
dy
= 1 where y(0) = −3.
dx
dy
= 3x2 e−y where y(−1) = 0.
dx
dy
c)
= sec y where y(0) = 0.
dx
dy
d)
= y 2 sin x where y(π) = −1/5.
dx
b)
Page 31
Solution:
(a)
Z
Z
1
1 2
dx
=⇒
y = tan−1 x + C
+1
2
√
9
From the given condition we get C = , so y = ± 2 tan−1 x + 9. Furthermore, since y(0) is
2
negative we must have the negative square root i.e.
p
y = − 2 tan−1 x + 9
y dy =
x2
(b)
Z
Z
y
3x2 dx
e dy =
e y = x3 + C
=⇒
From the given condition we get C = 2, so y = log (x3 + 2).
(c)
Z
Z
cos y dy =
dx
=⇒
sin y = x + C
From the given condition we get C = 0, so y = sin−1 x.
(d)
Z
Z
1
− = − cos x + C
y
1
From the given condition we get C = −6, so y =
.
cos x + 6
1
dy =
y2
sin x dx
=⇒
62. A wet porous substance in the open air loses its moisture at a rate proportional to the
moisture content. If a sheet hung in the wind loses half its moisture during the first hour, when
will 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 0 = −ky, so separating variables
gives
Z
Z
1
dy = − k dt
=⇒
log |y| = −kt + C
=⇒
y = eC−kt
y
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−t eC
We now want t such that y(0) = 100y(t), i.e. eC = 100 × 2−t eC . Thus the required time is
t=
log 100
' 6.64
log 2
63. Solve the following homogeneous equations:
dy
y y 2
a)
= +
,
dx
x
x
dy
b) 2
=
dx
Page 32
x+y
x
2
,
c)
dy
y 2 − x2
=
,
dx
xy
d)
dy
y 2 − 2xy
= 2
.
dx
x − 2xy
Solution:
(a) Put y = xu, so that
dy
dx
= x du
+ u. Then the equation says
dx
x
du
+ u = u + u2
dx
This is now separable and
Z
Z
1
1
dx
du =
2
u
x
=⇒
−
=⇒
x
du
= u2
dx
1
= log |x| + C
u
Hence
y=
=⇒
u=
−1
log |x| + C
−x
log |x| + C
where C is a constant.
(b) Put y = xu, so that
dy
dx
2x
= x du
+ u. Then the equation says
dx
du
+ 2u = (1 + u)2
dx
This is now separable and
Z
Z
2
1
du =
dx
=⇒
2
1+u
x
−1
2 tan
=⇒
2x
du
= 1 + u2
dx
u = log |x| + C
Hence
y = x tan
log |x| + C
2
=⇒
u = tan
log |x| + C
2
where C is a constant.
(c) Put y = xu, so that
dy
dx
= x du
+ u. Then the equation says
dx
dy
y x
= −
dx
x y
=⇒
This is now separable and
Z
Z
1
u du = −
dx
=⇒
x
x
du
1
+u=u−
dx
u
=⇒
1 2
u = − log |x| + C
2
=⇒
x
du
1
=−
dx
u
u=±
p
2C − 2 log |x|
Hence
p
y = ±x 2C − 2 log |x|
where C is a constant.
(d) Put y = xu, so that
dy
dx
2
y
y
dy
2 − 2x
= x
dx
1 − 2 xy
=⇒
x
= x du
+ u. Then the equation says
dx
du
u2 − 2u
+u =
dx
1 − 2u
=⇒
Page 33
x
du
u2 − 2u − u + 2u2
3 (u2 − u)
=
=
dx
1 − 2u
1 − 2u
This is now separable and
Z
Z
−3
2u − 1
du =
dx
2
u −u
x
=⇒
log |u2 − u| = −3 log |x| + C
=⇒
|u2 − u| = |x−3 |eC
=⇒
x3 u2 − x3 u + D = 0 for some D = ±eC
√
√
x3 ± x6 − 4Dx3
1 ± 1 − 4Dx−3
u=
=
3
2x
2
√
−3
x ± x 1 − 4Dx
y=
2
=⇒
=⇒
where D is an arbitrary constant (positive or negative).
64. Solve the following linear equations:
dy y
+ = x2 ,
dx x
dy
c)
+ 2y = ex ,
dx
dy
+ y cot x = 2 cos x,
dx
dy
d) x
= y + x3 .
dx
a)
b)
Solution:
(a) The integrating factor is
I=e
R
1
x
dx
= elog x = x
and multiplying the equation by this gives
dy
d
(xy) = x + y = x3
dx
dx
Integrating gives the general solution
1
xy = x4 + C
4
1
C
y = x3 +
4
x
=⇒
(b) The integrating factor is
I=e
R
cot x dx
= elog sin x = sin x
and multiplying the equation by this gives
d
dy
(y sin x) = sin x + cos xy = 2 cos x sin x
dx
dx
Integrating gives the general solution
y sin x = sin2 x + C
=⇒
y = sin x + C csc x
(c) The integrating factor is
R
I=e
2 dx
= e2x
and multiplying the equation by this gives
dy
d 2x e y = e2x
+ 2e2x y = e3x
dx
dx
Page 34
Integrating gives the general solution
1
e2x y = e3x + C
3
1
y = ex + Ce−2x
3
=⇒
(d) In standard form this is
dy
1
− y = x2
dx x
The integrating factor is
R
I=e
− x1 dx
= e− log x =
1
x
and multiplying the equation by this gives
d 1
1 dy
1
y =
− 2y = x
dx x
x dx x
Integrating gives the general solution
1
1
y = x2 + C
x
2
1
y = x3 + Cx
2
=⇒
65. Solve the following linear equations:
a) y 0 − y tan x = sec x where y(0) = 1,
b) xy 0 + y − ex = 0 where y(2) = 1.
Solution:
(a) The integrating factor is
I=e
R
− tan x dx
= e− log sec x = cos x
and multiplying the equation by this gives
d
dy
(y cos x) = cos x − y sin x = 1
dx
dx
Integrating gives the general solution y cos x = x + C. The initial conditions give 1 = C, so
y = (x + 1) sec x
(b) In standard form this is
dy 1
ex
+ y=
dx x
x
The integrating factor is
R
I=e
1
x
dx
=x
and multiplying the equation by this gives
d
dy
(xy) = x + y = ex
dx
dx
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 =
Page 35
ex + 2 − e2
.
x
66. The circuit below is a condenser consisting of a voltage source V volts, a capacitor C farads
and resistors R and S ohms.
V
C
R
S
The charge Q(t) at time t in the circuit is known to satisfy
RSC
dQ
+ (R + S)Q = SCV.
dt
If R = 5 ohms, S = 10 ohms, C = 10−3 farads and V = 30 volts, calculate Q(t) if Q(0) = 0
coulombs.
Solution:
Substituting for R, S, C, E we obtain
dQ
+ 300Q = 6
dt
R
This is linear with integrating factor is e
300 dt
= e300t and
d
dQ
Qe300t = e300t
+ 300e300t Q = 6e300t
dt
dt
Integrating gives
1
6 300t
e
+k
=⇒
Q=
+ ke−300t
300
50
1
1
The initial condition Q(0) = 0 = 50
+ k gives k = − 50
and so
Qe300t =
Q(t) =
1 − e−300t
50
67. Write down differential equations governing the current flow in the LR electrical circuits
illustrated below and solve the two equations.
L
a)
L
b)
V (t) = V0
V (t) = V0 sin(ωt)
R
R
Also, find the current at time t in circuit (a) if R = 1 ohm, L = 10 henrys, V0 = 6 volts, and
the current at time t = 0 is 6 amperes.
Page 36
Solution:
The differential equation is
L
dI
+ RI = V
dt
which is linear with integrating factor is e
R
R
L
dt
= eRt/L . We have
d Rt/L dI R
V
e
I = eRt/L + eRt/L I = eRt/L
dt
dt
L
L
(a) In this case, integrating gives
Z
V0 Rt/L
V0
Rt/L
e
I=
e
dt = eRt/L + k
L
R
=⇒
I=
V0
+ ke−Rt/L
R
Notice this is a constant plus an exponentially decaying term. The initial conditions
give 6 = 6 + k and so k = 0 and I = V0 /R is constant.
(b) This time, integrating gives
e
Rt/L
Z
V0 Rt/L
e
sin ωt dt
L
V0 eRt/L
R
=
sin ωt − ω cos ωt + k
2
2
L R
L
+
ω
2
L
I=
Rt
V0 e L (R sin ωt − ωL sin ωt)
+k
=
R2 + ω 2 L2
and so
V0
(R sin ωt − ωL sin ωt) + ke−Rt/L
2
2
+ω L
Notice this is a sinusoidal term plus an exponentially decaying term.
I=
R2
We have used here the standard integral
Z
Z
1
at
eat eibt − e−ibt dt
e sin bt dt =
2i
Z
1
=
e(a+ib)t − e(a−ib)t dt
2i
e(a−ib)t
1 e(a+ib)t
=
−
2i (a + ib) (a − ib)
eat
eibt
e−ibt
=
−
2i (a + ib) (a − ib)
eat
=
eibt (a − ib) − e−ibt (a + ib)
2
2
2i (a + b )
eat
=
a eibt − e−ibt − ib eibt + e−ibt
2
2
2i (a + b )
eat
= 2
[a sin bt − b cos bt]
a + b2
68. Solve the following Bernoulli equations:
a) y 0 + (y/x) = xy 2 sin x,
b) 2xy 0 = 10x3 y 5 + y,
Page 37
2
c) xy − y 0 = y 3 e−x .
Solution:
The standard form of a Bernoulli equation is
dy
+ f (x)y = g(x)y n
dx
and the method is to substitute u = y 1−n to obtain a linear equation.
1
du
1 dy
(a) Set u = so that
= − 2 . The equation becomes
y
dx
y dx
−y 2
du y
+ = xy 2 sin x
dx x
du 1
− u = −x sin x
dx x
=⇒
1
R
This is first order linear with integrating factor e − x dx = x1 . Thus
d 1
1 du
1
u
u =
− 2 u = − sin x
= cos x + C
=⇒
dx x
x dx x
x
1
1
=⇒
y= =
u
x(cos x + C)
(b) Set u =
1
du
4 dy
so that
= − 5 . The equation becomes
4
y
dx
y dx
−
2xy 5 du
= 10x3 y 5 + y
4 dx
du 2u
+
= −20x2
dx
x
=⇒
R
This is first order linear with integrating factor is e
d
du
x2 u = x2
+ 2xu = −20x4
dx
dx
2
x
= x2 . Thus
ux2 = −4x5 + C
=⇒
C − 4x5
x2
1
x1/2
y = 1/4 =
u
(C − 4x5 )1/4
=⇒
u=
=⇒
(c) Set u =
dx
1
du
2 dy
so that
= − 3 . The equation becomes
2
y
dx
y dx
y 3 du
2
+ xy = y 3 e−x
2 dx
du
2
+ 2xu = 2e−x
dx
=⇒
R
This is first order linear with integrating factor e
d x2 2 du
2
e u = ex
+ 2xex u = 2
dx
dx
2x dx
2
= ex . Thus
2
=⇒
ex u = 2x + C
=⇒
u = e−x (2x + C)
=⇒
Page 38
2
y=
1
u1/2
2
ex /2
=
(2x + C)1/2
69. Check that the following O.D.E. is exact and solve it.
dy
x3 + 2y
+ 3x2 y + 1 = 0.
dx
Solution:
In the standard form Q
dy
+ P = 0, we have
dx
Q(x, y) = x3 + 2y
We check that
P (x, y) = 3x2 y + 1
and
∂Q
= 3x2
∂x
∂P
= 3x2
∂y
=
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = 3x2 y + 1
∂x
∂f
= Q = x3 + 2y
∂y
and
Integrating the first of these with respect to x gives
f (x, y) = x3 y + x + g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
= x3 + g 0 (y) = x3 + 2y
∂y
g 0 (y) = 2y
=⇒
so take g(y) = y 2
Hence
f (x, y) = x3 y + x + y 2
and the solutions of the original O.D.E. are found by setting f (x, y) to be constant, i.e.
√
−x3 ± x6 − 4Ax
2
3
y +x y+x=A
=⇒
y=
2
70. Check that the following O.D.E. is exact and solve it.
dy
2y x4 + 1
+ 4x3 y 2 − 2x − 1 = 0.
dx
Solution:
In the standard form Q
dy
+ P = 0, we have
dx
Q(x, y) = 2x4 y + 2y
We check that
P (x, y) = 4x3 y 2 − 2x − 1
and
∂Q
= 8x3 y
∂x
=
∂P
= 8x3 y
∂y
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = 4x3 y 2 − 2x − 1
∂x
and
Page 39
∂f
= Q = 2x4 y + 2y
∂y
Integrating the first of these with respect to x gives
f (x, y) = x4 y 2 − x2 − x + g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
= 2x4 y + g 0 (y) = 2x4 y + 2y
∂y
g 0 (y) = 2y
=⇒
so take g(y) = y 2
Hence
f (x, y) = x4 y 2 − x2 − x + y 2
and the solutions of the original O.D.E. are found by setting f (x, y) to be constant, i.e.
r
x2 + x + A
4
2
2
(x + 1)y − x − x = A
=⇒
y=±
x4 + 1
71. Check that the following O.D.E. is exact and solve it.
x3 cos y
dy
+ 3x2 sin y + 1 = 0.
dx
Solution:
In the standard form Q
dy
+ P = 0, we have
dx
Q(x, y) = x3 cos y
We check that
P (x, y) = 3x2 sin y + 1
and
∂Q
= 3x2 cos y
∂x
=
∂P
= 3x2 cos y
∂y
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = 3x2 sin y + 1
∂x
and
∂f
= Q = x3 cos y
∂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
= x3 cos y + g 0 (y) = x3 cos y
∂y
=⇒
g 0 (y) = 0 so take g(y) = 0
Hence
f (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.
A−x
3
−1
x sin y + x = A
=⇒
y = sin
x3
Page 40
72. Check that the following O.D.E. is exact and solve it.
dy
x2 sec2 y + 1
+ 2x tan y − sin x = 0.
dx
Solution:
In the standard form Q
dy
+ P = 0, we have
dx
Q(x, y) = x2 sec2 y + 1
We check that
P (x, y) = 2x tan y − sin x
and
∂Q
= 2x sec2 y
∂x
∂P
= 2x sec2 y
∂y
=
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = 2x tan y − sin x
∂x
∂f
= Q = x2 sec2 y + 1
∂y
and
Integrating the first of these with respect to x gives
f (x, y) = x2 tan y + cos x + g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
= x2 sec2 y + g 0 (y) = x2 sec2 y + 1
∂y
=⇒
g 0 (y) = 1 so take g(y) = y
Hence
f (x, y) = x2 tan y + cos x + 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 + cos x + y = A
73. Determine if the following differential equations are exact and solve those which are:
a) (1 + x3 )y 0 + 3x2 y + 1 = 0, b) y + (1 + y)y 0 = 0,
d) (5y − 2x)y 0 = x + 2y,
e) (2y + y 0 )e2x + 1 = 0.
c) (2y + y 0 )e2x = 0,
Solution:
(a) In the standard form Q
dy
+ P = 0, we have
dx
Q(x, y) = 1 + x3
We check that
∂Q
= 3x2
∂x
and
=
P (x, y) = 3x2 y + 1
∂P
= 3x2
∂y
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = 3x2 y + 1
∂x
and
Page 41
∂f
= Q = 1 + x3
∂y
Integrating the first of these with respect to x gives
f (x, y) = x3 y + x + g(y)
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
= x3 + g 0 (y) = 1 + x3
∂y
g 0 (y) = 1 so take g(y) = y
=⇒
Hence
f (x, y) = x3 y + x + y
and the solutions of the original O.D.E. are found by setting f (x, y) to be constant, i.e.
A−x
1 + x3
x3 y + x + y = A
=⇒
y=
Q(x, y) = 1 + y
and
P (x, y) = y
(b) Now
We check that
∂Q
=0
∂x
∂P
=1
∂y
6=
so the ODE is not exact.
(c) Now
Q(x, y) = e2x
We check that
and
∂Q
= 2e2x
∂x
P (x, y) = 2ye2x
∂P
= 2e2x
∂y
=
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = 2ye2x
∂x
∂f
= Q = e2x
∂y
and
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
= e2x + g 0 (y) = 1 + x3
∂y
=⇒
g 0 (y) = 0 so take g(y) = 0
Hence
f (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
=⇒
Q(x, y) = 5y − 2x
and
∂Q
= −2
∂x
=
y = Ae−2x
(d) Now
We check that
Page 42
P (x, y) = −2y − x
∂P
= −2
∂y
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = −2y − x
∂x
∂f
= Q = 5y − 2x
∂y
and
Integrating the first of these with respect to x gives
1
f (x, y) = −2xy − x2 + g(y)
2
where g(y) is the “constant” of integration. Differentiating with respect to y gives
∂f
= −2x + g 0 (y) = 5y − 2x
∂y
=⇒
g 0 (y) = 5y
5
so take g(y) = y 2
2
Hence
1
5
f (x, y) = −2xy − x2 + y 2
2
2
and the solutions of the original O.D.E. are found by setting f (x, y) to be constant, i.e.
√
2x ± 9x2 + 10A
1 2 5 2
=⇒
y=
−2xy − x + y = A
2
2
5
(e) Now
Q(x, y) = e2x
We check that
P (x, y) = 2ye2x + 1
and
∂Q
= 2e2x
∂x
∂P
= 2e2x
∂y
=
so the ODE is exact. To solve, we need to find f (x, y) such that
∂f
= P = 2ye2x + 1
∂x
and
∂f
= Q = e2x
∂y
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
= e2x + g 0 (y) = e2x
∂y
=⇒
g 0 (y) = 0 so take g(y) = 0
Hence
f (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 0 = (ex y)2 − y,
c) 2y 0 =
y y2
+ ,
x x2
b) y 0 = y 2 − 5y + 6,
d) y 0 =
Page 43
1 + sin y
,
cos y
e) x2 y 0 = y(x + y), given that y(1) = −1,
f) y 0 e−x cos x − ye−x sin x = x, given that y(0) = 0,
g) x(x − 1)y 0 + y = x2 e−x .
Solution:
(a) The equation can be rewritten
dy
+ y = e2x y 2
dx
dy
du
= −y −2
and the
which is a Bernoulli equation. Make the substitution u = y −1 so that
dx
dx
equation becomes
du
− u = −e2x
dx
R
This is linear with integrating factor e −1 dx = e−x and
d −x du
e u = e−x
− e−x u = −ex
dx
dx
Integrating gives
e−x u = A − ex
=⇒
y = u−1 =
1
Ae−x
−1
(b) This is separable and integrating gives
Z
Z
Z
dy
dy
=
dx =⇒
=x+C
2
y − 5y + 6
(y − 2)(y − 3)
Z
1
1
−
dy = x + C
=⇒
y−3 y−2
=⇒ log(y − 3) − log(y − 2) = x + C
y−3
=⇒
= ex+C
y−2
3 − 2ex+C
=⇒ y =
1 − ex+C
dy
du
= x + u. Then
dx
dx
du
du
=⇒
2x
= u2 − u
2x + 2u = u + u2
dx
dx
(c) This is homogeneous so put y = xu and
This is separable and
Z
Z
Z
1
1
1
1
2
=
dx =⇒ 2
− du = log x + C
2
u −u
x
u−1 u
=⇒ 2 log(u − 1) − 2 log u = log x + C
2
1
=⇒ 1 −
= eC x
u
√
1
=⇒ 1 − = ±eC/2 x = Dx for arbitrary D
u
1
√
=⇒ u =
1−D x
x
√
=⇒ y =
1−D x
Page 44
(d) This is separable:
Z
cos y
dy =
1 + sin y
Z
dx =⇒ log (1 + sin y) = x + C
=⇒ y = sin−1 ex+C − 1
where C is a constant.
dy
du
= x + u. Then
dx
dx
du
du
+ u = u + u2
=⇒
= u2
dx
dx
(e) This is homogeneous so put y = xu and
This is separable and
Z
1
=
u2
Z
1
= log |x| + C
u
1
=⇒ u = −
log |x| + C
x
=⇒ y = −
log |x| + C
x
The given conditions imply −1 = − C1 , so C = 1 and y = −
.
log |x| + 1
dx =⇒ −
(f) This is linear and in standard form is
dy
xex
− y tan x =
dx
cos x
The integrating factor is e
R
− tan x dx
= e− log sec x = cos x. Thus we have
dy
d
(y cos x) = cos x − y sin x = xex
dx
dx
Integrating gives the general solution
Z
Z
x
x
y cos x = xe dx = xe − ex dx = xex − ex + C
The initial conditions give 0 = −1 + C so
y=
xex − ex + 1
cos x
(g) This can be rewritten as
dy
y
xe−x
+
=
dx x(x − 1)
x−1
R
1
which is linear with integrating factor I = e x(x−1) dx . Now
Z
Z
1
1
1
x−1
dx =
− dx = log(x − 1) − log x = log
x(x − 1)
x−1 x
x
so I =
x−1
. Multiplying the ODE by this gives
x
d x−1
x − 1 dy
1
y =
− 2 y = e−x
dx
x
x dx x
Integrating gives
x−1
y = −e−x + C
x
=⇒
Page 45
y=
x(C − e−x )
x−1
Second Order Linear O.D.E.s
75. Find the general solution of each of the following.
a) y 00 + 2y 0 − 15y = 0,
b) 2y 00 + 3y 0 − 2y = 0,
c) y 00 − 6y 0 + 25y = 0
d) y 00 + 6y 0 + 9y = 0,
e) y 00 + y 0 − 2y = 2e−x ,
f) y 00 + y 0 − 2y = ex ,
g) y 00 + y 0 − 6y = 52 cos 2x,
h) 2y 00 + 3y 0 − 2y = sin x,
i) y 00 + y = 2 sin x,
j) y 00 − 2y 0 + 2y = ex cos x.
Solution:
(a) The auxiliary equation λ2 + 2λ − 15 = (λ + 5)(λ − 3) = 0 has roots 3, −5 so the general
solution 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 is
y = 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 solution
is
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 complementary
function is
yc = Aex + Be−2x
where A, B are constants.
For a particular solution, try yp = ae−x . Then
yp00 + yp0 − 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 complementary
function 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 try
yp = axex . Then
yp00 + yp0 − 2yp = (2aex + axex ) + (aex + axex ) − 2axex = ex
=⇒
and so the general solution is y = yc + yp , i.e.
1
y = Aex + Be−2x + xe−x
3
where A, B are constants.
Page 46
a=
1
3
(g) The auxiliary equation λ2 +λ−6 = (λ−2)(λ+3) = 0 has roots 2, −3 so the complementary
function is
yc = y = Ae2x + Be−3x
where A, B are constants.
For a particular solution, try yp = a cos 2x + b sin 2x. Then
yp00 + yp0 − 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
=⇒
=⇒ a = −5 and b = 1
−2a − 10b = 0
and so the general solution is y = yc + yp , i.e.
y = Ae2x + Be−3x − 5 cos 2x + sin x
where A, B are constants.
(h) The auxiliary equation 2λ2 + 3λ − 2 = (2λ − 1)(λ + 2) = 0 has roots
complementary function is
yc = Aex/2 + Be−2x
1
, −2
2
so the
where A, B are constants.
For a particular solution, try yp = a cos x + b sin x. Then
2yp00 + 3yp0 − 2yp = 2(−a cos x − b sin x) + 3(−a sin x + b cos x) − 2(a cos x + b sin x)
= −4a + 3b cos 2x + (−3a − 4b) sin 2x = sin x
(
−4a + 3b = 0
3
4
=⇒
=⇒ a = −
and b = −
25
25
−3a − 4b = 1
and so the general solution is y = yc + yp , i.e.
y = Aex/2 + Be−2x −
3
4
cos x −
sin x
25
25
where A, B are constants.
(i) The auxiliary equation λ2 + 1 = 0 has roots ±i so the complementary function is
yc = A cos x + B sin x
where A, B are constants.
For a particular solution, notice a cos x + b sin x is already a solution of the homogeneous
equation so try yp = ax cos x + bx sin x. Then
yp00 + yp = (−ax cos x − bx sin x + 2b cos x − 2a sin x) + (ax cos x + bx sin x)
= 2b cos x − 2a sin x = 2 sin x
=⇒ a = −1 and b = 0
and so the general solution is y = yc + yp , i.e.
y = A cos x + B sin x − x cos x
where A, B are constants.
(j) The auxiliary equation λ2 − 2λ + 2 = 0 has complex roots 1 ± i so the complementary
function is
yc = ex (A cos x + B sin x)
where A, B are constants.
Page 47
For a particular solution, notice aex cos x + bex sin x is already a solution of the homogeneous
equation so try yp = axex cos x + bxex sin x. Then
yp00 − 2yp0 + 2yp = (2bx cos x − 2ax sin x + (2a + 2b) cos x + (2b − 2a) sin x)
− 2 ((a + b)xex cos x + (b − a)xex sin x + aex cos x + bex sin x)
+ 2(axex cos x + bxex sin x)
= 2bex cos x − 2aex sin x = ex cos x
1
=⇒ a = 0 and b =
2
and so the general solution is y = yc + yp , i.e.
1
y = ex (A cos x + B sin x) + xex sin x
2
where A, B are constants.
76. Solve 3y 00 + 5y 0 − 2y = 0 with initial conditions y(0) = 4, y 0 (0) = −1.
Solution:
The auxiliary equation 3λ2 + 5λ − 2 = (3λ − 1)(λ + 2) = 0 has roots 13 , −2 so the general
solution is
y = Aex/3 + Be−2x
where A, B are constants.
Now fit the initial conditions:
(
y(0) = A + B = 4
y 0 (0) = 13 A − 2B = −1
=⇒
A = 3 and B = 1
Hence the solution is
y = 3ex/3 + e−2x
77. Solve 2y 00 + 5y 0 + 2y = 0 with initial conditions y(0) = 4, y 0 (0) = −1/2.
Solution:
The auxiliary equation 2λ2 + 5λ + 2 = (2λ + 1)(λ + 2) = 0 has roots − 12 , −2 so the general
solution is
y = Ae−x/2 + Be−2x
where A, B are constants.
Now fit the initial conditions:
(
y(0) = A + B = 4
y 0 (0) = − 12 A − 2B = − 12
=⇒
A = 5 and B = −1
Hence the solution is
y = 5e−x/2 − e−2x
78. Solve 3y 00 − 8y 0 − 3y = 0 with initial conditions y(0) = 2, y 0 (0) = −4.
Page 48
Solution:
The auxiliary equation 3λ2 − 8λ − 3 = (3λ + 1)(λ − 3) = 0 has roots − 13 , 3 so the general
solution is
y = Ae−x/3 + Be3x
where A, B are constants.
Now fit the initial conditions:
(
y(0) = A + B = 2
y 0 (0) = − 31 A + 3B = −4
A = 3 and B = −1
=⇒
Hence the solution is
y = 3e−x/3 − e3x
79. Solve 3y 00 + 11y 0 − 4y = 0 with initial conditions y(0) = −1, y 0 (0) = −9.
Solution:
The auxiliary equation 3λ2 + 11λ − 4 = (3λ − 1)(λ + 5) = 0 has roots 13 , −4 so the general
solution is
y = Aex/3 + Be−4x
where A, B are constants.
Now fit the initial conditions:
(
y(0) = A + B = 1
y 0 (0) = 13 A − 4B = −9
=⇒
A = −3 and B = 2
Hence the solution is
y = −3ex/3 + 2e−4x
80. Solve y 00 + 2y 0 + 5y = 0 with initial conditions y(0) = 1, y 0 (0) = −3.
Solution:
The auxiliary equation λ2 + 2λ + 5 = (λ + 1)2 + 4 = 0 has complex roots −1 ± 2i so the general
solution is
y = e−x (A cos 2x + B sin 2x)
where A, B are constants.
Now y 0 = −e−x (A cos 2x + B sin 2x) + e−x (−2A sin 2x + 2B cos 2x) so
(
y(0) = A = 1
=⇒
A = 1 and B = −1
y 0 (0) = −A + 2B = −3
Hence the solution is
y = e−x (cos 2x − sin 2x)
81. Solve y 00 − 4y 0 + 29y = 0 with initial conditions y(0) = 2, y 0 (0) = −1.
Solution:
Page 49
The auxiliary equation λ2 − 4λ + 29 = (λ − 2)2 + 25 = 0 has complex roots 2 ± 5i so the
general solution is
y = e2x (A cos 5x + B sin 5x)
where A, B are constants.
Now y 0 = 2e2x (A cos 5x + B sin 5x) + e2x (−5A sin 2x + 5B cos 2x) so
(
y(0) = A = 2
=⇒
A = 2 and B = −1
y 0 (0) = 2A + 5B = −1
Hence the solution is
y = e2x (2 cos 5x − sin 5x)
82. Solve y 00 − 4y 0 + 13y = 0 with initial conditions y(0) = 1, y 0 (0) = 8.
Solution:
The auxiliary equation λ2 − 4λ + 13 = (λ − 2)2 + 9 = 0 has complex roots 2 ± 3i so the general
solution is
y = e2x (A cos 3x + B sin 3x)
where A, B are constants.
Now y 0 = 2e2x (A cos 3x + B sin 3x) + e2x (−3A sin 2x + 3B cos 3x) so
(
y(0) = A = 1
=⇒
A = 1 and B = 2
y 0 (0) = 2A + 3B = 8
Hence the solution is
y = e2x (cos 3x + 2 sin 3x)
83. Solve y 00 + 10y 0 + 34y = 0 with initial conditions y(0) = 2, y 0 (0) = −7.
Solution:
The auxiliary equation λ2 + 10λ + 34 = (λ + 5)2 + 9 = 0 has complex roots −5 ± 3i so the
general solution is
y = e−5x (A cos 3x + B sin 3x)
where A, B are constants.
Now y 0 = −5e−5x (A cos 3x + B sin 3x) + e−5x (−3A sin 3x + 3B cos 3x) so
(
y(0) = A = 2
=⇒
A = 2 and B = 1
y 0 (0) = −5A + 3B = −7
Hence the solution is
y = e−5x (2 cos 3x + sin 3x)
84. Solve y 00 + 2y 0 + y = 0 with initial conditions y(0) = 1, y 0 (0) = 2.
Page 50
Solution:
The auxiliary equation λ2 + 2λ + 1 = (λ + 1)2 = 0 has equal roots −1, −1 so the general
solution is
y = e−x (Ax + B)
where A, B are constants.
Now y 0 = −e−x (Ax + B) + e−x A so
(
y(0) = B = 1
y 0 (0) = −B + A = 2
=⇒
A = 3 and B = 1
Hence the solution is
y = e−x (3x + 1)
85. Solve y 00 + 6y 0 + 9y = 0 with initial conditions y(0) = 2, y 0 (0) = −5.
Solution:
The auxiliary equation λ2 + 3λ + 9 = (λ + 3)2 = 0 has equal roots −3, −3 so the general
solution is
y = e−3x (Ax + B)
where A, B are constants.
Now y 0 = −3e−3x (Ax + B) + e−3x A so
(
y(0) = B = 2
y 0 (0) = −3B + A = −5
=⇒
A = 1 and B = 2
Hence the solution is
y = e−3x (x + 2)
86. Solve 4y 00 − 4y 0 + y = 0 with initial conditions y(0) = −3, y 0 (0) = −1/2.
Solution:
The auxiliary equation 4λ2 − 4λ + 1 = (2λ − 1)2 = 0 has equal roots 21 , 21 so the general
solution is
y = ex/2 (Ax + B)
where A, B are constants.
Now y 0 = 12 ex/2 (Ax + B) + ex/2 A so
(
y(0) = B = −3
y 0 (0) = 12 B + A = − 21
=⇒
A = 1 and B = −3
Hence the solution is
y = ex/2 (x − 3)
87. Solve 4y 00 − 12y 0 + 9y = 0 with initial conditions y(0) = 2, y 0 (0) = 6.
Page 51
Solution:
The auxiliary equation 4λ2 − 12λ + 9 = (2λ − 3)2 = 0 has equal roots 32 , 23 so the general
solution is
y = e3x/2 (Ax + B)
where A, B are constants.
Now y 0 = 32 e3x/2 (Ax + B) + e3x/2 A so
(
y(0) = B = 2
y 0 (0) = 23 B + A = 6
=⇒
A = 3 and B = 2
Hence the solution is
y = e3x/2 (3x + 2)
88. Solve y 00 − 4y 0 + 5y = 65 cos 2x, with y(0) = 0, y 0 (0) = 0.
Solution:
The auxiliary equation λ2 − 4λ + 5 = (λ − 2)2 + 1 = 0 has complex roots 2 ± i so the
complementary function is
yc = e2x (A cos x + B sin x) where A, B are constants.
Now look for a particular solution of the form yp = a cos 2x + b sin 2x. Then
yp00 − 4yp0 + 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 cos x + B sin x) + cos 2x − 8 sin 2x
Then
y 0 = 2e2x (A cos x + B sin x) + e2x (−A sin x + B cos x) − 2 sin 2x − 16 cos 2x
so the initial conditions give
(
y(0) = A + 1 = 0
y 0 (0) = 2A + B − 16 = 0
=⇒
A = −1 and B = 18.
The required solution is
y = e2x (− cos x + 18 sin x) + cos 2x − 8 sin 2x
89. Solve the following initial value problems.
Page 52
a)
b)
c)
d)
e)
f)
g)
y 00 − 4y 0 + 3y = 0, with y(0) = −1, y 0 (0) = 1,
y 00 + 4y 0 + 5y = 0, with y(0) = 1, y 0 (0) = −3,
y 00 − 6y 0 + 9y = 0, with y(0) = 2, y 0 (0) = 8,
y 00 − y 0 − 2y = 10 sin x, with y(0) = 1, y 0 (0) = 0,
y 00 − y 0 − 2y = 3e2x , with y(0) = 0, y 0 (0) = −2.
y 00 − 4y 0 + 5y = 65 cos 2x, with y(0) = 0, y 0 (0) = 0.
y 00 + y 0 − 6y = −6x − 11, with y(0) = 2, y 0 (0) = 6.
Solution:
(a) y = −2ex + e3x
(b) y = e−2x (cos x − sin x)
(c) y = 2e3x (1 + x)
(d) y = −e−x + e2x + cos x − 3 sin x
(e) y = e−x − e2x + xe2x
(f) y = e2x (− cos x + 18 sin x) + cos 2x − 8 sin 2x
(g) y = −e−3x + e2x + x + 2
90. Solve y 00 − 2y 0 + 5y = 6 cos x − 2 sin x with y(0) = 2, y 0 (0) = 4.
Solution:
The auxiliary equation λ2 − 2λ + 5 = (λ − 1)2 + 4 = 0 has complex roots 1 ± 2i so the
complementary 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 x + b sin x. Then
yp00 − 2yp0 + 5yp = (−a cos x − b sin x) − 2(−a sin x + b cos x) + 5(a cos x + b sin x)
= (4a − 2b) cos x + (2a + 4b) sin x
= 6 cos x − 2 sin x.
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 − sin x
Then
y 0 = ex (A cos 2x + B sin 2x) + ex (−2A sin 2x + 2B cos 2x) − sin x − cos x
so the initial conditions give
(
y(0) = A + 1 = 2
y 0 (0) = A + 2B − 1 = 4
=⇒
A = 1 and B = 2.
The required solution is y = ex (cos 2x + 2 sin 2x) + cos x − sin x
Page 53
91. Solve y 00 − 2y 0 + 5y = 2 sin 3x − 10 cos 3x with y(0) = 2, y 0 (0) = 2.
Solution:
The auxiliary equation λ2 − 2λ + 5 = (λ − 1)2 + 4 = 0 has complex roots 1 ± 2i so the
complementary 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
yp00 − 2yp0 + 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 0 = ex (A cos 2x + B sin 2x) + ex (−2A sin x + 2B cos x) − 3 sin 3x + 3 cos 3x
so the initial conditions give
(
y(0) = A + 1 = 2
y 0 (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 00 − 6y 0 + 10y = 6 sin 2x + 18 cos 2x with y(0) = 2, y 0 (0) = 3.
Solution:
The auxiliary equation λ2 − 6λ + 10 = (λ − 3)2 + 10 = 0 has complex roots 3 ± i so the
complementary function is
yc = e3x (A cos x + B sin x) where A, B are constants.
Now look for a particular solution of the form yp = a cos 2x + b sin 2x. Then
yp00 + 6yp0 + 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
=⇒
Page 54
a = 1 and b = −1.
Thus the general solution is y = yc + yp , i.e.
y = e3x (A cos x + B sin x) + cos 2x − sin 2x
Then
y 0 = 3e3x (A cos x + B sin x) + e3x (−A sin x + B cos x) − 2 sin 2x − 2 cos 2x
so the initial conditions give
(
y(0) = A + 1 = 2
y 0 (0) = 3A + B − 2 = 3
=⇒
A = 1 and B = 2.
The required solution is
y = e3x (cos x + 2 sin x) + cos 2x − sin 2x.
93. Solve y 00 − y 0 − 2y = 3e2x with y(0) = 0, y 0 (0) = −2.
Solution:
The auxiliary equation λ2 − λ − 2 = (λ + 1)(λ − 2) = 0 has roots −1, 2 so the complementary
function 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 try
yp = axe2x . Then
yp00 − yp0 − 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.
Then
y 0 = −Ae−x + 2Be2x + e2x + 2xe2x
so the initial conditions give
(
y(0) = A + B = 0
y 0 (0) = −A + 2B + 1 = −2
=⇒
A = 1 and B = −1.
The required solution is
y = e−x − e2x + xe2x
94. Solve y 00 + 2y 0 + 5y = 6 + 15x with y(0) = 1, y 0 (0) = −2.
Solution:
The auxiliary equation λ2 + 2λ + 5 = (λ + 1)2 + 4 = 0 has complex roots −1 ± 2i so the
complementary 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
yp00 + 2yp0 + 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
Then
y 0 = −e−x (A cos 2x + B sin 2x) + e−x (−2A sin x + 2B cos x) + 3
so the initial conditions give
(
y(0) = A = 1
y 0 (0) = −A + 2B + 3 = −2
=⇒
A = 1 and B = −2.
The required solution is
y = e−x (cos 2x − 2 sin 2x) + 3x
95. Solve y 00 + 2y 0 + y = x2 + 4x + 1 with y(0) = 0, y 0 (0) = 1.
Solution:
The auxiliary equation λ2 + 2λ + 1 = 0 has equal roots λ = −1, −1 so the complementary
function 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
yp00 + 2yp0 + yp = (2a) + 2(2ax + b) + (ax2 + bx + c)
= ax2 + (4a + b)x + (2a + 2b + c)
= x2 + 4x + 1.
Equating coefficients gives
a = 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
Then
y 0 = −e−x (Ax + B) + Ae−x + 2x
Page 56
so the initial conditions give
(
y(0) = B − 1 = 0
y 0 (0) = −B + A = 1
=⇒
A = 2 and B = 1.
The required solution is
y = e−x (2x + 1) + x2 − 1.
96. Solve y 00 + 2y 0 + y = −2e−x , y(0) = 1, y 0 (0) = 1.
Solution:
The auxiliary equation λ2 + 2λ + 1 = 0 has equal roots λ = −1, −1 so the complementary
function 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 look
for a particular solution of the form yp = ax2 e−x . Then
yp00 + 2yp0 + yp = (ax2 e−x − 2axe−x − 2axe−x + 2ae−x ) + 2(−ax2 e−x + 2axe−x ) + (ax2 e−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) − x2 e−x
Then
y 0 = −e−x (Ax + B) + Ae−x + x2 e−x − 2xe−x
so the initial conditions give
(
y(0) = B = 1
y 0 (0) = −B + A = 1
=⇒
A = 2 and B = 1.
The required solution is
y = (1 + 2x − x2 )e−x
97. Let x(t) be the displacement at time t of the mass in a critically damped oscillator with
damping constant c and mass m = 1. If x(0) = 0 and x0 (0) = v0 , show that the mass will come
to rest when x = 2v0 /ce.
Solution:
The equation of the oscillator is generally given by
d2 x
dx
+ c + kx = 0
2
dt
dt
c
We have m = 1 and the critically damped case ζ = √
= 1 corresponds to c2 = 4k so the
2 mk
ODE is actually
d2 x
dx c2
+
c
+ y=0
dt2
dt
4
m
Page 57
This has auxiliary equation λ2 + cλ +
c2 c 2
= λ+
= 0. Hence the general solution is
4
2
x = (At + B)e−ct/2
But x(0) = 0 so 0 = B. Also v0 = x0 (0) = A. Thus the displacement is
x(t) = v0 te−ct/2
We want to find when x0 (t) = 0, i.e.
0
−ct/2
x (t) = v0 te
ct
1−
=0
2
=⇒
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
L
d2 I
dI
I
dV
L 2 +R + =
dt
dt C
dt
V (t)
C
R
Find the steady state and transient currents in the given circuit in the following cases, assuming
that I(0) = I 0 (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 00 + 20I 0 + 20I = 50 cos t i.e. I 00 + 2I 0 + 2I = 5 cos t
which has auxiliary equation λ2 + 2λ + 2 = (λ + 1)2 + 1 = 0 with roots −1 ± i. Thus the
complementary 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 of
the form Ip (t) = a cos t + b sin t. Then
Ip00 + 2Ip0 + 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
=⇒
Page 58
a = 1 and b = 2
Hence the general solution is I(t) = e−t (A cos t + B sin t) + cos t + 2 sin t.
Then, I 0 (t) = −e−t (A cos t + B sin t) + e−t (−A sin t + B cos t) − sin t + 2 cos t so the initial
conditions give
(
I(0) = A + 1 = 0
=⇒
A = −1 and B = −3
I 0 (0) = B − A + 2 = 0
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.
3
3
93
3
(b) I(t) = e−3t 50
cos 4t + 400
sin 4t − 50
cos 10t − 40
sin 10t
(c) I(t) = e−2t 10 cos 4t + 25 sin 4t − 10 cos 4t + 52 sin 4t
99. A cylindrical buoy 60 cms in diameter and weight m grams floats in water with its axis
vertical. When depressed slightly and released, it is found that the period of oscillation is 2
seconds. Archimedes’ principle shows that if x(t) is the length of the cylinder immersed at
time t then x(t) satisfies the equation x00 + ax = g, where a = 900πg/m and g = 981. Calculate
the weight of the buoy and the depth of the bottom of the buoy below the waterline when the
buoy is in the equilibrium position.
Solution:
00
2
The corresponding homogeneous O.D.E.
√ is x +ax = 0 which has auxiliary equation λ +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 the
equation gives aC = g and so C = g/a and thus the general solution is
x(t) =
√
√
g
+ A cos at + B sin at
a
√
The period of oscillation is 2π/ a = 2 so a = π 2 . Hence
900πg
= a = π2
m
=⇒
m=
900 × 981
' 281036 grams
π
Furthermore, at the equilibrium position,
x=
g
g
= 2 ' 99.4 cm
a
π
Page 59
Linear Algebra
100.
1 3
A=
2 −1
Let
D=
2 1
3 1
3 −1 1
E = 4 −2 1
2 −5 2
−2 4 −3
2 1 2
B=
5
C= 2
4
4
F = 2
1
−1
−3
2
−2 1
1 5
−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)
3 4
A+B =
5 0
d)
AB =
11 4
1 1
e)
11 −3
b) A + C doesn’t exist.
c) E + 2F = 8 0
4 −3
3
4 5
f) CA doesn’t exist. g) CA = −4
BA =
5 8
8
11 −8 0
h) EF = 13 −11 −4
0 −11 −4
i) BE doesn’t exist.
j)
DF =
3
11
6
16
9
10
−3 11 2
12 −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
3w
+ 3y − 4z
w + x + y + 2z
2w + 3x + y + 3z
Solution:
a)
2 1 3 1
1
1
2 1 3
2 1 3
R2 →R2 −2R1
R3 →R3 −2R2
4 3 5 1 −
−−−−−−→ 0 1 −1 −1 −−
−−−−−→ 0 1 −1 −1
R3 →R3 −3R1
6 5 5 −3
0 2 −4 −6
0 0 −2 −4
Backward substitution gives:
2x + y + 3z
y− z
− 2z
=1
= −1
= −4
=⇒
1−y−3z
x = 2 = −3
y = −1 + z = 1
z =2
b)
3 2 1 3
3
1 1 0 3
1 1
0
R1 →R1 −R2
R2 →R2 −2R1
2 1 1 0 −
−−−−−−→ 2 1 1 0 −−
−−−−−→ 0 −1 1 −6
R3 →R3 −6R1
6 2 4 6
6 2 4 6
0 −4 −4 −12
Page 60
=1
=7
=6
=6
1 1 0 3
R3 →R3 −4R2
−−
−−−−−→ 0 −1 1 −6
0 0 0 12
The last equation here says 0x + 0y + 0z = 12 hence there are no solutions.
c)
0
3
1
2
1
0
1
3
1
1 1 1
3 −4 7
2
R1 ↔R3
−
−−−→
1 2 6 R2 ↔R4 0
1 3 6
3
1
3
1
0
1 2
1 3
1 1
3 −4
6
1 1
1
2
6
6
0 1 −1 −1 −6
R2 →R2 −2R1
−
−−−−−−→
1 R4 →R4 −3R1
0 1
1
1
1
0 −3 0 −10 −11
7
1 1
2
1
6
1 −1 −1 −6 R3 →R3 +R4 0
−−−−−−−→
7
0 2
2
0
0 −3 −13 −29
0
6
1 1 1
2
1
−1 −6 R3 →−R3 0
R4 →R4 −3R3 0 1 −1
−−
−−−−−→
−−−−−−→
0 0 −1 −11 −22 R4 →R4 /20 0
37
0 0 0
20
0
1
R →R −R2 0
−−3−−−3−−→
R4 →R4 +3R2 0
0
Backward substitution gives:
w + x + y + 2z
x−y−z
y + 11z
z
=6
= −6
= 22
= 37
20
w
x
y
z
=⇒
1 1
2
6
1 −1 −1 −6
0 −1 −11 −22
0 −3 −13 −29
6
1 1
2
1 −1 −1 −6
0 1 11 22
37
0 0
1
20
63
= 6 − x − y − 2z = 20
= −6 + y + z = − 50
20
33
= 22 − 11z = 20
= 37
20
102. Find the determinants of the following matrices. (Hint: applying row/column operations
may speed these up considerably.)
3
3 −1
2 2 3
2 2 3
c)
b)
a)
1 2 1
−4 −3 2
−2 2 1
1 3 3
−2 −2 1
−2 3 3
a b c
d)
e)
f)
1 2 3 3
3 2 1 3
0 d e
2 3 1 3
2 1 1 3
1 1 2 3
1 1 2 3
0 0 f
−1 2 3 −2
−1 2 3 −2
g)
1
2
1
1
3
−2 1 −1 −3 1
2 −2 1 −1 −2
−1 1
2 −3 1
−3 2
1
2
1
h)
1
1
0
−1 1
1
0 −1 1
0
0 −1
0
0
1
1
(Extra question : Can you guess the
n × n extension of this ?)
Page 61
Solution:
One could calculate these directly, using the usual (cumbersome) formula. Instead, we’ll apply
row/column operations to obtain a row/column with only one non-zero entry, thus reducing
the size of the determinant. There are of course many ways to do this.
a)
2 2 3
−2 2 1 =
1 3 3
R1 →R1 −2R3
R2 →R2 +2R3
=
0 −4 −3 0 0 1 −4 8
0 8
= −28 + 24 = −4
7 = −4 8 3 = −3 7
1 3
3
−3 7 3
b)
2 2 3 0 −2 1 0 1 0
−2 7
1 2 1 = 1 2 1 = −2 2 7 = − 1 5 = −10 − 7 = −17
−2 3 3 0 7 5 1 1 5
c)
3
3 −1 1
1 0 1
0 0 1
0
−4 −3 2 = 0
= 0
=
1
0
1
0
−2 1 = 1
−2 −2 1 −2 −2 1 −2 −2 1
d)
a b c 0 d e = a d e = adf
0 f 0 0 f More generally, we can see the determinant of a triangular matrix is just the product of the
diagonal elements.
e)
1
2
1
−1
2
3
1
2
3 3 1 3 2 3 3 −2
3
2
1
−1
2
1
1
2
1 3 1 3 2 3 3 −2
1
0
0
0 −1 −5 −3
−1 −5 −3
C3 →C3 −3C1 2
= −1 −1 0 =
1 −1 −1 0 4
6
1
C4 →C4 −3C1 −1
4
6
1
0
0 C2 →C2 −5C1 −1
4
3
−1 4
= −(−44 + 42) = 2
=
3 = − −14 −11
C3 →C3 −3C1 4
−14 −11
C2 →C2 −2C1
f)
1
R1 →R1 −R2 2
1
=
−1
−1 1 3 = 0 2 3 3 3 −2
1
1
1
2
0 0 1 3 2 3 3 −2
R3 →R3 +3R1
=
C2 →C2 −C1
=
1
0
0
0
2 −1 1 3 1
0
2
3
−1 3 3 −2
−1 1 3
0 2 3 = − 2 3 = −(14 − 18) = 4
6 7 0 6 7
Page 62
g)
1
0
0
0
0 2
1
1
3 C2 →C2 −2C1 1
−2 1 −1 −3 1 C3 →C3 −C1 −2 5
1 −1 7 2 −6 −1 −3 −8 =
2 −2 1 −1 −2
=
−1 1
−1 3
C
→C
−C
4
4
1
3
−2
4
2
−3
1
−3 2
4
5 10 1
2
1 C5 →C5 −3C1 −3 8
1
1
0
0 0
0
0
C1 →C1 −5C2 0
−1 −4 −1 C1 ↔C2
−1 −1 −4 −1 C3 →C3 +C2 −1
−
−12 3
=
=
1 −17
3 −12 1 −17
4 −12 9 −18
C4 →C4 −7C2 −12
4
9 −18
−1 0 0 C2 →C2 −4C1
49 −5
=
− −12 49 −5 = 57
−6
−12 57 −6
C3 →C3 −C1
5
1
−1
7
−6 −1 −3 −8
3
3 −2 4 8
4
5 10 −1 −4 −1 = − −12 1 −17
−12 9 −18
= −294 + 285 = −9
h)
1
1
0
−1 1
1
0 −1 1
0
0 −1
0 1
1
0 = −1 1
1 0 −1
1
1 1 −1
−
= −1 1 0
0 −1 1 0 1
1 0 1 1
1 − 0
1 1 = −1 1 1 + −1 1
1
0 −1 1 0 −1 1
1 1
1
= {(1 + 1) − (−1)} + (1 + 1) = 3 + 2 = 5
+
1
−1 1
If we let Fn be the corresponding n × n matrix then notice expanding along the top row as
in first line above gives Fn = Fn−1 + Fn−2 . Also F1 = 1 and F2 = 2. This recurrence relation
defines the Fibonacci sequence !
103. Use Gaussian Elimination to find the inverses of the following matrices:
3
3 −1
3 1 −1
4
3 −6
c)
a)
b)
1 −1
A= 1
A = −4 1 2
A = −4 −3 2
−2 −2 3
−2 0 1
−2 −2 1
7 −1 3
A = −4 1 −2
8
0
3
d)
e)
5
5 −2
A = −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 0
1
1 −1 0 1 0
R ↔R2
1
4
1 −1 0 1 0 −−1−−→
3 −6 1 0 0
−2 −2 3 0 0 1
−2 −2 3 0 0 1
1 1 −1 0 1 0
1 1 −1 0 1 0
R2 →R2 −4R1
R →−R2
0 1 2 −1 4 0
−−
−−−−−→ 0 −1 −2 1 −4 0 −−2−−−→
R3 →R3 +2R1
0 0
1 0 2 1
0 0 1
0 2 1
Page 63
1 1 0 0 3 1
1 0 0 1 3 3
R →R −R2
R2 →R2 −2R3
0 1 0 −1 0 −2
−−
−−−−−→ 0 1 0 −1 0 −2 −−1−−−1−−→
R1 →R1 +R3
0 0 1 0 2 1
0 0 1 0 2 1
Hence the inverse is
A−1
1 3 3
= −1 0 −2
0 2 1
b)
3 1 −1 1 0
−4 1 2 0 1
−2 0 1 0 0
1 1
R2 →R2 +4R1
−−−−−−−→ 0 5
R3 →R3 +2R1
0 2
1 1 0
R3 →R3 −2R2
−−−−−−−→ 0 1 0
0 0 1
0
1 1 0 1 0 1
R →R +R3
−4 1 2 0 1 0
0 −−1−−−1−−→
1
−2 0 1 0 0 1
0 1 0 1
1 1 0 1
R2 →R2 −2R3
2 4 1 4 −−−−−−−→ 0 1 0 0
1 2 0 3
0 2 1 2
1 0
1
1 0 0 1
R1 →R1 −R2
0 1 −2 −−−−−−−→ 0 1 0 0
2 −2 7
0 0 1 2
Hence the inverse is
A−1
0 1
1 −2
0 3
−1 3
1 −2
−2 7
1 −1 3
= 0 1 −2
2 −2 7
c)
0
1
1 0 1
R1 →R1 +R3
0 −−−−−−−→ −4 −3 2 0
1
−2 −2 1 0
1 1
0 1 0 1
R2 →R2 −2R3
2 4 1 4 −−−−−−−→ 0 1
1 2 0 3
0 0
1 0 0 1 −1 3
R →R −R2
0 1 0 0 1 −2
−−1−−−1−−→
0 0 1 2 0
3
3
3 −1 1 0
−4 −3 2 0 1
−2 −2 1 0 0
1 1
R2 →R2 +4R1
−−−−−−−→ 0 1
R3 →R3 +2R1
0 0
Hence the inverse is
A−1
0 1
1 0
0 1
0 1 0 1
0 0 1 −2
1 2 0 3
1 −1 3
= 0 1 −2
2 0
3
d)
7 −1 3 1 0 0
−1 1 −1 1 2 0
R1 →R1 +2R2
−4 1 −2 0 1 0 −
−−−−−−→ −4 1 −2 0 1 0
R3 →R3 +2R2
8
0
3 0 0 1
0 2 −1 0 2 1
2 0
2
0
−1 1 −1 1
−1 1 −1 1
R2 →R2 −4R1
R2 →R2 +2R3
−−
−−−−−→ 0 −3 2 −4 −7 0 −−
−−−−−→ 0 1 0 −4 −3 −2
0
2 −1 0
2 1
0 2 −1 0
2
1
Page 64
5 −2
−1 0 −1 5
−1 0 0 −3 −3 1
R1 →R1 −R2
R →R −R2
0 1 0 −4 −3 −2 −
−−−−−−→ 0 1 0 −4 −3 −2
−−1−−−1−−→
R3 →R3 −2R1
8 −3
8 −3
0 0 −1 8
0 0 −1 8
3 −1
1 0 0 3
R →−R1
0 1 0 −4 −3 2
−−1−−−→
R3 →−R3
0 0 1 −8 −8 3
Hence the inverse is
A−1
3
3 −1
= −4 −3 2
−8 −8 3
e)
1
1 0 1 0 2
5
5 −2 1 0 0
R1 →R1 +2R3
−4 −3 2 0 1 0 −
1 0 0 1 −2
−−−−−−→ 0
R2 →R2 −2R3
−2 −2 1 0 0 1
−2 −2 1 0 0 1
1 0 0 1 −1 4
1 1 0 1 0 2
R →R −R2
R3 →R3 +2R1
0 1 0 0 1 −2
−−
−−−−−→ 0 1 0 0 1 −2 −−1−−−1−−→
5
0 0 1 2 0 5
0 0 1 2 0
Hence the inverse is
A−1
1 −1 4
= 0 1 −2
2 0
5
104. Find the elementary matrices E, F , G that reduce the matrix
2 3 1
A = 4 11 1
−2 12 −5
to upper triangular form. Hence find the LU decomposition of A and use it solve Ax =
7
25
27
Solution:
We perform Gaussian elimination, keeping track of the elementary matrices:
2 3 1
2 3 1
1 0 0
R2 →R2 −2R1
A = 4 11 1 −−
−−−−−→ 0 5 −1 = EA
E = −2 1 0
−2 12 −5
−2 12 −5
0 0 1
2 3 1
1 0 0
R →R +R1
0 5 −1 = F EA
−−3−−−3−−→
F = 0 1 0
0 15 −4
1 0 1
2 3 1
1 0 0
R3 →R3 −3R2
−−
−−−−−→ 0 5 −1 = U = GF EA
G = 0 1 0
0 0 −1
0 −3 1
Page 65
.
Then
L = E −1 F −1 G−1
Check:
1 0 0
1 0 0
1 0 0
1
0 0
1 0
= 2 1 0 0 1 0 0 1 0 = 2
0 0 1
−1 0 1
0 3 1
−1 −3 1
2 3 1
1
0 0
2 3 1
1 0 0 5 −1
A = 4 11 1 = LU = 2
−2 12 −5
−1 −3 1
0 0 −1
7
We have to solve Ax = b = 25 , i.e. LU x = b. First solve Lu = b:
27
1
0 0
u
7
1 0 v = 25
L= 2
−1 −3 1
w
27
by forward substitution:
u
2u + v
−u − 3v + w
=7
= 25
= 27
u
v
w
=⇒
=7
= 25 − 2u = 11
= 27 + u + 3v = 1
Finally, solve U x = u, i.e.
2 3 1
x
7
0 5 −1 y = 11
0 0 −1
z
1
by backward substitution:
2x + 3y + z
5y − z
−z
105. Find the LU
a)
2
4
A=
−2
d)
f)
=7
= 11
=1
=⇒
7−3y−z
x = 2 = 1
y = 11+z
=2
5
z = −1
decomposition of the matrices
b)
−2 3 −1
0 1
1 1
A= 4 1 1
3 −1
2 0 1
1
2
3
A = −3 −5 −13
2
7 −4
3
1
2 −2
6
1
6 −1
A=
−9 −4 −2 10
15 6 12 −7
e)
g)
Page 66
−1 2 −2
1
1
A= 1
2 −1 1
c)
−3 2 −2
A = −9 11 −7
−6 −1 −1
2 −1 3 −2
4 −4 7 −1
A=
−6 −1 −6 14
2
3
4
1
h)
i)
3 −1 2
1
−3 3 −4 21
A=
9 −7 11 8
6
0
0 −7
2
4
A=
−2
4
1 3 −1
3 4 −1
0 −2 4
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:
2 0 1
2 0 1
2 0 1
R2 →R2 −2R1
R3 →R3 −3R2
A = 4 1 1 −−
−−−−−→ 0 1 −1 −−
−−−−−→ 0 1 −1
R3 →R3 +R1
−2 3 −1
0 3 0
0 0 3
so
1 0 0
L = 2 1 0
−1 3 1
and
2 0 1
U = 0 1 −1
0 0 3
b) Make A upper triangular:
−2 3 −1
−2 3 −1
−2 3 −1
R3 →R3 −3R2 /7
R2 →R2 +2R1
A = 4 1 1 −−
−−−−−→ 0 7 −1 −−−−−−−−−→ 0 7 −1
R3 →R3 +R1
2 0 1
0 3 0
0 0 73
so
1 0 0
L = −2 1 0
−1 37 1
−2 3 −1
U = 0 7 −1
0 0 37
and
c) Make A upper triangular:
−1 2 −2
−1 2 −2
−1 2 −2
R →R +R1
R3 →R3 −R2
0 3 −1 −
1
1 −−2−−−2−−→
A= 1
−−−−−−→ 0 3 −1
R3 →R3 +2R1
2 −1 1
0 3 −3
0 0 −2
so
1 0 0
L = −1 1 0
−2 1 1
and
−1 2 −2
U = 0 3 −1
0 0 −2
d) Make A upper triangular:
1
2
3
1 2 3
1 2 3
R2 →R2 +3R1
R3 →R3 −3R2
A = −3 −5 −13 −−
−−−−−→ 0 1 −4 −−
−−−−−→ 0 1 −4
R3 →R3 −2R1
2
7 −4
0 3 −10
0 0 2
so
1 0 0
L = −3 1 0
2 3 1
and
1 2 3
U = 0 1 −4
0 0 2
e) Make A upper triangular:
−3 2 −2
−3 2 −2
−3 2 −2
R2 →R2 −3R1
R →R +R2
0 5 −1
5 −1 −−3−−−3−−→
A = −9 11 −7 −−
−−−−−→ 0
R3 →R3 −2R1
−6 −1 −1
0 −5 3
0 0 2
Page 67
so
1 0 0
L = 3 1 0
2 −1 1
and
−3 2 −2
U = 0 5 −1
0 0 2
f) Make A upper triangular:
3
1
2 −2 R2 →R2 −2R1
3 1 2 −2
3
6
1
6 −1 R3 →R3 +3R1 0 −1 2 3 R3 →R3 −R2 0
A=
−−−−−−→
−−−−−−−→
−9 −4 −2 10 −
4 R4 →R4 +R2 0
R4 →R4 −5R1 0 −1 4
15 6 12 −7
0 1 2 3
0
3 1 2 −2
0 −1 2 3
R4 →R4 −2R3
−−
−−−−−→
0 0 2 1
0 0 0 4
so
1
0 0 0
3 1 2 −2
2
0 −1 2 3
1 0 0
L=
and
U =
−3 1 1 0
0 0 2 1
5 −1 2 1
0 0 0 4
g) Make A upper triangular:
2 −1 3 −2 R2 →R2 −2R1
2
4 −4 7 −1 R3 →R3 +3R1 0
A=
−−−−→
−6 −1 −6 14 −R−4−
→R4 −R1 0
2
3
4
1
0
so
h) Make A
3
−3
A=
9
6
so
1
−1
0
0
2 −2
2 3
2 1
4 6
3 −2
2 −1 3 −2
1 3
R3 →R3 −2R2
−
0 −2 1 3
−
−
−
−
−
−
→
3 8 R4 →R4 +2R2 0 0 1 2
1 3
0 0 3 9
2 −1 3 −2
0
−2 1 3
R4 →R4 −3R3
−−
−−−−−→
0 0 1 2
0 0 0 3
1
0 0 0
2 −1 3 −2
2
0 −2 1 3
1 0 0
L=
and
U
=
−3 2 1 0
0 0 1 2
1 −2 3 1
0 0 0 3
−1
−2
−4
4
upper triangular:
−1 2
1
3 −1 2
1
3 −1 2
1
R2 →R2 +R1
R3 →R3 +2R2 0 2 −2 22
3 −4 21
R3 →R3 −3R1
−
0 2 −2 22 −
−
−
−
−
−
−
→
−−−−−−→
−7 11 8 R4 →R4 −2R1 0 −4 5
5 R4 →R4 −R2 0 0
1
49
0 2 −4 −9
0 0 −2 −31
0
0 −7
3 −1 2 1
0 2 −2 22
R4 →R4 +2R3
−−
−−−−−→
0 0
1 49
0 0
0 67
1
0
0 0
3 −1 2 1
−1 1
0 2 −2 22
0 0
L=
and
U =
3 −2 1 0
0 0
1 49
2
1 −2 1
0 0
0 67
Page 68
i) Make A upper triangular:
2 1 3 −1 R2 →R2 −2R1
2 1
3 −1
2
4 3 4 −1 R3 →R3 +R1 0 1 −2 1 R3 →R3 −R2 0
−−−−−−→
−−−−−−−→
A=
−2 0 −2 4 −
1
1
3 R4 →R4 +2R2 0
R4 →R4 −2R1 0
4 0 19 1
0 −2 13 3
0
2
R4 →R4 −3R3 0
−−
−−−−−→
0
0
so
1
0
2
1
L=
−1 1
2 −2
0
0
1
3
0
0
0
1
1 3 −1
1 −2 1
0 3
2
0 9
5
1 3 −1
1 −2 1
0 3
2
0 0 −1
and
2
0
U =
0
0
1 3 −1
1 −2 1
0 3
2
0 0 −1
106. Find the LU decomposition of the matrix
2 1 3 −1
4 3 4 −1
A=
−2 0 −2 4
4 0 19 1
and hence solve Ax = b for the following vectors:
3
−1
a)
b)
c)
8
−2
b=
b=
−8
−8
−17
−26
3
4
b=
−4
14
d)
7
12
b=
−8
22
Solution:
First make A
2
4
A=
−2
4
so
upper triangular, using higher rows to fix lower ones:
1 3 −1 R2 →R2 −2R1
2 1
3 −1
2
3 4 −1
0
1
−2
1
→R3 +R1
→R3 −R2 0
−R−3−
−R−3−
−−−−→
−−−−→
0 −2 4
0 1
1
3
R4 →R4 −2R1
R4 →R4 +2R2 0
0 19 1
0 −2 13 3
0
2 1 3 −1
1
R4 →R4 −3R3 0 1 −2
−−
−−−−−→
0 0 3
2
0 0 0 −1
1
0 0 0
2 1 3 −1
2
0 1 −2 1
1 0 0
L=
and
U =
0 0 3
−1 1 1 0
2
2 −2 3 1
0 0 0 −1
a) Now solve Lu = b, i.e.
1
0
2
1
−1 1
2 −2
0
0
1
3
0
s
3
0
t = 8
0
u
−8
1
v
−17
Page 69
1 3 −1
1 −2 1
0 3
2
0 9
5
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
3
2
i.e. u =
−7
2
and solve U x = u, i.e.
2
0
0
0
1 3 −1
w
3
x 2
1 −2 1
=
0 3
2 y −7
0 0 −1
z
2
by backward substitution:
2w + x + 3y − z = 3
x − 2y + z
=2
3y + 2z
= −7
−z
=2
=⇒
=1
w = 3−x−3y+z
2
x = 2 + 2y − z = 2
= −1
y = −7−2z
3
z = −2
1
2
i.e. x =
−1
−2
Similarly for the next parts we have:
b)
−1
0
u=
−9
3
and
−1
1
x=
−1
−3
c)
3
−2
u=
1
1
and
−1
1
x=
1
−1
d)
7
−2
u=
1
1
and
1
1
x=
1
−1
107. Show that the following can be factorised as A = LU without doing the factorisation.
a)
7
1
1
1 1
1
8 −2 1 1
A = −2 1 −9 3 1
1
1 −1 −5 1
2 −3 1 −1 8
b)
Page 70
−17 1 −5 1
1
1
8
2 −3 1
1
29 −13 1
A=
12
1 −10 −1 −50 22
2
13
1 −1 21
Solution:
We just notice that each matrix is strictly diagonally dominant since
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
a)
108. Determine
2
a)
1
−1
1
d)
1
−1
g)
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
whether or not the following matrices are positive definite:
1 −1
2
1 −1
2
1 −1
b)
c)
1
1
2 0
2 −1
2 −2
0 3
−1 −1 3
−1 −2 1
1 −1
3
1
−1
5
1
−1
e)
f)
1 2 2
1 2 2
2 2
2 3
−1 2 3
−1 2 3
5 1 −1 0
5 1 −1 0
h)
1 2 2 0
1 2 2 0
−1 2 3 1
−1 2 3 1
0 0 1 2
0 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 1 1 2 = 3 > 0
and
2 1 −1
1 2 0 = 2 2 0 − 1 0 − 1 2 0 3 −1 3 −1 0
−1 0 3 = 12 − 3 − 2 = 7 > 0
Hence this matrix is positive definite.
b) it’s clearly symmetric and
2 > 0,
2 1 1 2 = 3 > 0
and
2
1 −1
2 −1 1 −1 1
2
1
= 2
−
−
2
−1
−1 3 −1 3 −1 −1
−1 −1 3 = 10 − 2 − 1 = 7 > 0
Hence this matrix is positive definite.
c) it’s clearly symmetric and
2 > 0,
2 1 1 2 = 3 > 0
and
2
1
−1
2 −2 1 −2 1
2
1
= 2
−
−
2
−2
−2 1 −1 1 −1 −2
−1 −2 1 = −4 + 1 − 0 = −3 < 0
Hence this matrix is not positive definite.
Page 71
109. Express the following in the form A = P T LU using the indicated row swaps:
a) by swapping R1 ↔ R2 :
0 2 1
A = −2 3 −1
−6 9 0
b) by swapping R1 ↔ R3 :
0 2 1
A = −2 3 −1
−6 9 0
c) by swapping R1 ↔ R2 :
0 2 3
A = 1 −2 1
2 0 5
d) by swapping R2 ↔ R3 :
−1 2
3
5
A = −2 2
3 −4 −5
Solution:
a) Swapping R1 ↔ R2 corresponds to multiplying
0 1
P = 1 0
0 0
and we have
by the permutation matrix
0
0
1
−2 3 −1
−2 3 −1
R3 →R3 −3R1
P A = 0 2 1 −−
−−−−−→ 0 2 1
−6 9 0
0 0 3
So if we take
0 1 0
P = 1 0 0 ,
0 0 1
1 0 0
L = 0 1 0 ,
3 0 1
−2 3 −1
U = 0 2 1
0 0 3
then A = P T LU .
b) Swapping R1 ↔ R3 corresponds to multiplying
0 0
P1 = 0 1
1 0
and we have
by the permutation matrix
1
0
0
−6 9 0
−6 9 0
R2 →R2 −R1 /3
P1 A = −2 3 −1 −−−−−−−−→ 0 0 −1
0 2 1
0 2 1
To get this into upper triangular form, we need another row swap R1 ↔ R3 which corresponds
to
1 0 0
P2 = 0 0 1
0 1 0
Hence we swap R1 ↔ R3 then R1 ↔ R3 corresponding
0 0
P = P2 P 1 = 1 0
0 1
Page 72
to
1
0
0
Then
−6 9 0
−6 9 0
R3 →R3 −R1 /3
P A = 0 2 1 −−−−−−−−→ 0 2 1
−2 3 −1
0 0 −1
So if we take
0 0 1
P = 1 0 0 ,
0 1 0
1 0 0
L = 0 1 0 ,
1
0 1
3
−6 9 0
U = 0 2 1
0 0 −1
then A = P T LU .
Remark: Notice a) and b) give slightly different decompositions of the same matrix.
c) Swapping R1 ↔ R2 corresponds to multiplying
0 1
P = 1 0
0 0
by the permutation matrix
0
0
1
and we have
1 −2 1
1 −2 1
1 −2 1
R3 →R3 −2R1
R3 →R3 −2R2
3
P A = 0 2 3 −−
−−−−−→ 0 2 3 −−
−−−−−→ 0 2
2 0 5
0 4 3
0 0 −3
So if we take
0 1 0
P = 1 0 0 ,
0 0 1
1 0 0
L = 0 1 0 ,
2 2 1
1 −2 1
3
U = 0 2
0 0 −3
then A = P T LU .
d) Swapping R2 ↔ R3 corresponds to multiplying
1 0
P = 0 0
0 1
by the permutation matrix
0
1
0
and we have
−1 2
3
−1 2 3
−1 2
3
R2 →R2 +3R1
R →R +R2
0 2 4
2
4 −−3−−−3−−→
P A = 3 −4 −5 −−
−−−−−→ 0
R3 →R3 −2R1
−2 2
5
0 −2 −1
0 0 3
So if we take
1 0 0
P = 0 0 1 ,
0 1 0
1
0 0
L = −3 1 0 ,
2 −1 1
−1 2 3
U = 0 2 4
0 0 3
then A = P T LU .
110. Determine whether or not the following subsets of R3 are (i) linearly independent sets
Page 73
and (ii) spanning sets:
2
3
1
a)
−2 , 1 , −1
S=
3
−2
1
2
0
1
c)
−1 , 0 , 2
S=
1
1
−1
2
3
1
2 , 1 , −1
S=
3
−2
1
2
1
2 , 1
S=
3
−2
b)
d)
Solution:
a) Since we have three vectors in a 3-dimensional space, the set is a basis if and only if it is
linearly independent if and only if it is a spanning set if and only if the matrix with S as it’s
columns
1
2
3
−2 1 −1
3 −2 1
has non-zero determinant. Now
1
2
3 −2 1 −1 R2 +2R
= 1
R3 −3R
1
3 −2 1 1 2
3 0 5
5 0 −8 −8
R3 +8R1 /5
=
1 2 3
0 5 5 = 0
0 0 0
so the set S is neither linearly independent or spanning.
Alternatively, we can work directly with the definition: Suppose
1
2
3
0
λ1 −2 + λ2 1 + λ3 −1 = 0
3
−2
1
0
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
λ1
0
−2 1 −1 λ2 = 0
0
3 −2 1
λ3
=⇒
which we can solve either directly or by Gaussian elimination:
1 2
3 0
1 2
3 0
1
2
3 0
R2 →R2 /5
R2 →R2 +2R1
−2 1 −1 0 −
5 0 −−−−−→ 0 1
1 0
−−−−−−→ 0 5
R3 →R3 −3R1
3 −2 1 0
0 −8 −8 0
0 −8 −8 0
1 2 3 0
1 0 1 0
R3 →R3 +8R2
R1 →R1 −2R2
−−
−−−−−→ 0 1 1 0 −−
−−−−−→ 0 1 1 0
0 0 0 0
0 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
2
3
0
−2 + 1 − −1 = 0
3
−2
1
0
Page 74
This shows that S is not linearly independent. It also shows that S doesn’t span R3 since we
have
2
1
−2 , 1 = 0
Span(S) = Span
3
−2
and two vectors can’t possibly span R3 .
b) For three vectors in
1 2
2 1
3 −1
R3 we just need to check the determinant:
3 1 0
0 −3
−8
= 24 − 56 = −32 6= 0
−2 = 2 −3 −8 = −7 −8
1
3 −7 −8
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
1 2 0 1
0
−1 0 2 = −1 2
1 1 −1 1 −1
the determinant:
0 2 = 0
−1
Hence the set is neither linearly independent or spanning.
d) Firstly, two vectors can’t possibly span R3 . Secondly, it is linearly independent since the
only 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:
1
−1
1
2
a)
b)
3
1 , 2
1 , −2 ⊆ R3
S=
⊆R
S=
−1
−2
−1
2
c)
1
2
1
−1 0 2
S = , , ⊆ R4
−1
1
−2
2
−2
4
d)
1
4
0
−2 −3 −1
S = , , ⊆ R4
3
2
−1
−4
−1
3
Solution:
a) Suppose
1
1
0
λ1 1 + λ2 2
= 0
−1
−2
0
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, suppose
1
1
1
0 = λ 1 + µ 2
0
−1
−2
Page 75
Then
1 = λ + µ
0 = λ + 2µ
0 = −λ − 2µ
which has a solution λ = 2 and µ = −1
giving
1
1
1
0 = 2 1 − 2 ∈ Span(S)
0
−1
−2
Moving on to the next standard basis vector, suppose
0
1
1
1 = λ 1 + µ 2
0
−1
−2
Then
0 = λ + µ
1 = λ + 2µ
0 = −λ − 2µ
which has no solution.
Thus add this vector to S. Now
1
0
1
1 , 2 , 1
−1
−2
0
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:
3 2
6 −4
−1 −3
a)
b)
c)
3 −2
3 −1
−3 −1
−3 −3
−3 1 −2
7 −5 10
5
6
d)
e)
f)
0 −2 0
0
2
0
−1 −2
1 −1 0
−5 5 −8
−1 −1
Solution:
a) First find eigenvalues:
3 − λ
2
= (3 − λ)(−2 − λ) − 6
det(A − λI) = 3
−2 − λ
= λ2 − λ − 12 = (λ + 3)(λ − 4)
so the eigenvalues are λ = −3, 4.
For λ = −3, solve (A + 3I)v = 0:
6 2 0 R1 →R1 −2R2 0 0 0
−−−−−−−→
3 1 0
3 1 0
Page 76
3
3
5
−2
3
2
So 3x + y = 0 and the corresponding eigenspace is
1
V−3 = Span
−3
For λ = 4, solve (A − 4I)v = 0:
−1 2 0 R2 →R2 +3R1 −1 2 0
−−−−−−−→
3 −6 0
0 0 0
So −x + 2y = 0 and the corresponding eigenspace is
2
V4 = Span
1
b) First find eigenvalues:
6 − λ
−4
= (6 − λ)(−1 − λ) + 12
det(A − λI) = 3
−1 − λ
= λ2 − 5λ + 6 = (λ − 2)(λ − 3)
so the eigenvalues are λ = 2, 3.
For λ = 2, solve (A − 2I)v = 0:
R1 →R1 /4
1 −1 0
4 −4 0
−−−−−−−→
3 −3 0 R2 →R2 −3R2 0 0 0
So x − y = 0 and the corresponding eigenspace is
1
V2 = Span
1
For λ = 3, solve (A − 3I)v = 0:
3 −4 0 R2 →R2 −R1 3 −4 0
−−−−−−−→
3 −4 0
0 0 0
So 3x − 4y = 0 and the corresponding eigenspace is
4
V3 = Span
3
c) First find eigenvalues:
−1 − λ
−1 − λ
−3
3
−3
0
−1 − λ
3 = −3
−1 − λ 2 − λ
det(A − λI) = −3
−3
−3
5 − λ −3
−3
2 − λ
−1 − λ −3
0 2−λ
0 = (1 + λ)(2 − λ)2
= 0
−3
−3 2 − λ
so the eigenvalues are λ = −1, 2, 2.
Page 77
For λ = −1, solve
0 −3
−3 0
−3 −3
(A + I)v = 0:
3 0
0 −3 3 0
0 −3 3 0
R →R −R2
R3 →R3 −R1
−3 0 3 0 −
3 0 −−3−−−3−−→
−−−−−−→ −3 0 3 0
R2 →−R2
6 0
0 −3 3 0
0
0 0 0
So x = y = z and we may take corresponding eigenspace
1
V−1 = Span 1
1
For the repeated eigenvalue λ = 2, solve (A − 2I)v = 0:
−3 −3 3 0
−1 −1 1 0
−3 −3 3 0 −→ 0
0 0 0
−3 −3 3 0
0
0 0 0
So we have just one equation −x − y + z = 0. This is a plane so we just want two vectors
which span it. For instance, setting y = 1, z = 0 and y = 0, z = 1 leads to
1
−1
1 , 0
V2 = Span
0
1
d) First find eigenvalues:
−3 − λ
1
−2
−3 − λ −2 −2 − λ 0 = (−2 − λ) det(A − λI) = 0
1
−λ
1
−1
−λ
= −(λ + 2)(λ2 + 3λ + 2) = −(λ + 2)2 (λ + 1)
so the eigenvalues are λ = −1, −2, −2.
For λ = −1, solve (A + I)v = 0:
−2 1 −2 0
−2 0 −2 0
0 0 0 0
R1 →R1 +R2
R1 →R1 +2R3
0 −1 0 0 −
−−−−−−→ 0 −1 0 0 −−
−−−−−→ 0 1 0 0
R3 →R3 −R2
R2 →−R2
1 −1 1 0
1
0
1 0
1 0 1 0
So y = 0 and x + z = 0 and we may take corresponding eigenspace
1
V−1 = Span 0
−1
For the repeated eigenvalue
−1
0
1
λ = −2, solve (A + 2I)v = 0:
1 −2 0
−1 1 −2 0
R →R +R1
0 0 0 0
0
0 0 −−3−−−3−−→
−1 2 0
0 0 0 0
So we have just one equation −x + y − 2z = 0. This is a plane so we just want two vectors
which span it. For instance, setting y = 1, z = 0 and y = 0, z = 1 leads to
−2
1
1 , 0
V−2 = Span
0
1
Page 78
e) First find eigenvalues:
7 − λ −5
10
7 − λ
10 2−λ
0 = (2 − λ) det(A − λI) = 0
−5 −8 − λ
−5
5
−8 − λ
= (2 − λ)(λ2 + λ − 6) = −(λ − 2)2 (λ + 3)
so the eigenvalues are λ = −3, 2, 2.
For λ = −3, solve (A + 3I)v = 0:
10 0 10 0
0 0 0 0
10 −5 10 0
R →R +R2
R1 →R1 +2R3
0 5 0 0 −
0
5
0 0 −−1−−−1−−→
−−−−−−→ 0 1 0 0
R3 →R3 −R2
R2 →R2 /5
−5 5 −5 0
−5 0 −5 0
1 0 1 0
So y = 0 and x + z = 0 and we may take corresponding eigenspace
1
V−3 = Span 0
−1
For the repeated eigenvalue
5
0
−5
λ = 2, solve (A + 2I)v = 0:
−5 10 0
1 −1 2 0
R →R +R1
0 0 0 0
0
0 0 −−3−−−3−−→
R1 →R1 /5
5 −10 0
0 0 0 0
So we have just one equation x − y + 2z = 0. This is a plane so we just want two vectors
which span it. For instance, setting y = 1, z = 0 and y = 0, z = 1 leads to
−2
1
1 , 0
V−2 = Span
0
1
f) First find eigenvalues:
5 − λ
5 − λ
6
−2
6
−2
3 = 0
−1 − λ 1 + λ
det(A − λI) = −1 −2 − λ
−1
−1
2 − λ −1
−1
2 − λ
5 − λ 6
5 − λ 0
−2
4
−1
1 = (1 + λ) 0
−1
1 = (1 + λ) 0
−1 −1 2 − λ
−1 −1 2 − λ
= (1 + λ)(3 − λ)2
so the eigenvalues are λ = −1, 3, 3.
For λ = −1, solve (A + I)v = 0:
0
0 18 0
0
0 1 0
6
6 −2 0
R1 →R1 /18
R1 →R1 +6R2
−1 −1 3 0 −
−−−−−−→ −1 −1 3 0 −−−−−−−→ −1 −1 0 0
R3 →R3 −R2
R3 →R2 −3R1
−1 −1 3 0
0
0 0 0
0
0 0 0
So z = 0 and x + y = 0 and we may take corresponding eigenspace
1
V−1 = Span −1
0
Page 79
For λ = 3, solve (A − 3I)v = 0:
2
6 −2 0
0
R1 →R1 +2R3
−1 −5 3 0 −
0
−−−−−−→
R2 →R2 −R3
−1 −1 −1 0
−1
0 0 0
R2 →−R2 /4
−−−−−−→ 0 1 −1
R3 →−R3
1 1 1
4 −4 0
0
0
0 0
R →R −R2
0 −4 4 0
−4 4 0 −−1−−−1−−→
R3 →R2 −3R1
−1 −1 0
−1 −1 −1 0
0 0 0 0
0
R →R −R2
0 1 −1 0
0 −−3−−−3−−→
0
1 0 2 0
So y − z = 0 and x + 2z = 0 and we may take corresponding eigenspace
−2
V3 = Span 1
1
113. For each of the following matrices A, find an invertible matrix A such that D
is diagonal and compute A10 .
2 −3
5
6
2
3
a)
b)
c)
6
2 −5
−2 −2
5
−3 −3
−1 −3
−1 −2 −4
f)
e)
d)
−2 −2 −5
−3 −1
−4 −3 −8
−7 −3 −11
0
0
2
2
5
4
2
7
Solution:
a)
2 − λ
−3
= (2 − λ)(−5 − λ) + 6
det(A − λI) = 2
−5 − λ
= λ2 + 3λ − 4 = (λ + 4)(λ − 1)
so the eigenvalues are λ = −4, 1.
For λ = −4, solve (A + 4I)v = 0:
2 −1 0
6 −3 0
−→
2 −1 0
0 0 0
So 2x − y = 0 and a corresponding eigenvector is v = ( 12 ).
For λ = 1, solve (A − I)v = 0:
1 −3 0
1 −3 0
−→
2 −6 0
0 0 0
So x − 2y = 0 and a corresponding eigenvector is v = ( 31 ).
Hence, Y −1 AY = D, where
1 3
Y =
2 1
and
Page 80
−4 0
D=
0 1
= Y −1 AY
6
12
−7
3
3
2
Then
10
A
10 1 3
4
0 1
1 −3
= (Y DY ) = Y D Y =
2 1
0 1 −5 −2 1
10
1
1 1 3
4
−3 · 410
410 − 6 −3 · 410 + 3
=−
=−
−2
1
5 2 1
5 2 · 410 − 2 −6 · 410 + 1
−1 10
10
−1
3
2
b) A has eigenvalues 1, 2 with corresponding eigenvectors ( −2
) and ( −1
) so we may take
3
2
1 0
Y =
and
D=
−2 −1
0 2
and then
10
A
10
=YD Y
−1
=
3
2
1 0
−1 −2
−3 + 4 · 210 −6 + 6 · 210
=
−2 −1
0 210
2
3
2 − 2 · 210
4 − 3 · 210
c) The eigenvalues are 2, −1, −1 with (choices of) corresponding eigenvectors forming the
columns of
−1 −1 −2
0
Y = −2 1
1
0
1
and
2 0
0
Y −1 AY = D = 0 −1 0
0 0 −1
Hence
A10
10
−1 −1 −2
2
0 0
−1 −1 −2
0 0 1 0 −2 −1 −4
= Y D10 Y −1 = −2 1
1
0
1
0 0 1
1
1
3
210
210 − 1
2 · 210 − 2
= 2 · 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)
columns of
−1 −2
Y = −1 1
−2 0
and
corresponding eigenvectors forming the
1
0
1
−1 0 0
Y −1 AY = D = 0 1 0
0 0 1
Notice that D10 = I and so
A10 = Y D10 Y −1 = Y Y −1
1 0 0
= I = 0 1 0
0 0 1
e) The eigenvalues are 2, 1, −1 with (choices of)
columns of
1 −1
3 −1
Y =
−2 1
Page 81
corresponding eigenvectors forming the
−1
−2
1
and
2 0 0
Y −1 AY = D = 0 1 0
0 0 −1
Hence
A10
10
1 −1 −1
2
0 0
−1 0 −1
1
= Y D10 Y −1 = 3 −1 −2 0 1 0 −1 1
−2 1
1
0 0 1
−1 −1 −2
10
10
−2 + 2 0
−2 + 1
10
= −3 · 2 + 3 1 4 · −3 · 210 + 3
2 · 210 − 2 0
2 · 210 − 1
f) The eigenvalues are 2, 2, −4 with (choices
columns of
1
Y = 0
1
and
of) corresponding eigenvectors forming the
0 1
1 1
1 0
2 0 0
Y −1 AY = D = 0 2 0
0 0 −4
Hence you can now find A10 = Y D10 Y −1 .
114.
a) Find a matrix B satisfying B 3 = A where
2 1 −1
A= 1 2 0
−1 0 3
b) Find a matrix B satisfying B 5 = A where
2
1 −1
2 −1
A= 1
−1 −1 3
Solution:
a) First diagonalise: Y −1 AY = D where
2 1
Y =
3 1
Then C 3 = D where
and
D=
−8 0
0 27
−2 0
C=
0 3
So
B = Y CY
−1
=
2 1
3 1
−2 0
−1 1
13 −10
=
0 3
3 −2
15 12
satisfies
B 3 = Y CY −1
3
= Y C 3 Y −1 = Y DY −1 = A
Page 82
b) First diagonalise: Y −1 AY = D where
2 3
Y =
1 1
Then C 5 = D where
and
D=
32 0
0 −1
2 0
C=
0 −1
So
B = Y CY
−1
=
2 3
1 1
2 0
−1 3
−7 −18
=
0 −1
1 −2
−3 8
satisfies
B 5 = Y CY −1
3
= Y C 5 Y −1 = Y DY −1 = A
115. Solve the following systems of differential equations:
a)
ẋ = −10x + 18y
ẏ = −6x + 11y
d)
ẋ = 2x − 2y − z
ẏ = 5x − 3y + z
ż = −4x + 2y − z
b) ẋ = 3x + 4y
ẏ = 3x + 2y
and x(0) = 6, y(0) = 1
e)
ẋ = 5x + 3z
ẏ = 9x + 2y + 9z
ż = −6x − 4z
c) ẋ = −x + 2y
ẏ = 2x − y
and x(0) = 3, y(0) = 1
f) ẋ = x + 2z
ẏ = y − z
ż = 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 equivalent general solutions.
a) We are solving ẋ = Ax where
−10 18
A=
−6 11
Now
−10 18
= λ2 − λ − 2 = (λ + 1)(λ − 2)
det(A − λI) = −6 11
so the eigenvalues are λ = −1, 2.
For λ = −1, solve (A + I)v = 0:
−9 18 0
1 −2 0
−→
−6 12 0
0 0 0
So x − 2y = 0 and a corresponding eigenvector is v = ( 21 ).
For λ = 2, solve (A − 2I)v = 0:
2 −3 0
−12 18 0
−→
−6 9 0
0 0 0
So x − 3y = 0 and a corresponding eigenvector is v = ( 32 ).
Page 83
Hence Y −1 AY = D where
Y =
2 3
1 2
−1 0
D=
0 2
and
Now let u = ( uv ) satisfy Y u = x so that Y u̇ = ẋ = Ax = AY u and
u̇
−u
−1
= u̇ = Y AY u = Du =
v̇
2v
Solving this:
(
u̇ = −u
v̇ = 2v
(
u = ae−t
v = be2t
=⇒
for arbitrary constants a, b. Thus the general solution is x = Y u i.e.
−t −t
2ae + 3be2t
x
2 3
ae
=
=
ae−t + 2be2t
be2t
y
1 2
b) First diagonalise
3 4
A=
3 2
For instance, Y −1 AY = D where
4 −1
Y =
3 1
6 0
D=
0 −1
and
Then let u = ( uv ) satisfy Y u = x so that Y u̇ = ẋ = Ax = AY u and
(
u = ae6t
u̇
6u
−1
= u̇ = Y AY u = Du =
=⇒
v̇
−v
v = be−t
Then x = Y u, i.e.
6t 6t
x
4 −1
ae
4ae − be−t
=
=
be−t
3ae6t + be−t
y
3 1
The initial conditions determine a, b:
(
x(0) = 4a − b = 6
y(0) = 3a + b = 1
=⇒
Hence
x = 4e6t + 2e−t
y = 3e6t − 2e−t
c) The solution is
x = 2et + e−3t
y = 2et − e−3t
Page 84
(
a=1
b = −2
d) We are solving ẋ = Ax where
−2 −2 −1
A = 5 −3 1
1 −2 −1
Now
−2 − λ
−2
−1
−3 − λ
1 = −(λ + 1)(λ + 2)(λ − 1)
det(A − λI) = 5
1
−2
−1 − λ
so the eigenvalues are λ = −1, −2, 1. The corresponding eigenvectors are given by the columns
of
−1 1
1
1
Y = −2 3
1 −2 −1
so that
−1 0 0
Y −1 AY = D = 0 −2 0
0
0 1
If x = Y u then u̇ = Du, i.e.
u̇
−1 0 0
u
−u
v̇ = 0 −2 0 v = −2v
ẇ
0
0 1
w
w
=⇒
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
−t
u = ae
v = be−2t
w = cet
Numerical Linear Algebra
116. Check that the following equations have the solution x = 1, y = −2.
529
71
x+y =
229
229
298
40
x+y =
129
129
What happens if we change the RHS to
529
70
x+y =
229
229
298
41
x+y =
?
129
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
70
41
1
359
529 298
−
−
i.e.
−
x=−
x=
229 129
229 129
29541
29541
leading to x = −359 and
41 − 298 × 359
= −829
129
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:
529 1 529 298
1
229 −
=
298 =
129 1 229 129
29541
y=
Notice in calculating x and y, we had to divide by this very small number - this results in the
large change.
117. Write out the iteration scheme
−4 1
1 −4
1
0
0
1
for the Jacobi method for solving
√
1
0
x1
−√ 3/4
0
1 x2 3/4
=
−4 1 x3 0
1 −4
x4
0
Will this scheme converge for any initial value of the iteration vector? Give a reason for your
answer.
Solution:
The equations are
√
= − 3/4
√
x1 − 4x2
+ x4 = 3/4
x1
− 4x3 + x4 = 0
x2 + x3 − 4x4 = 0
−4x1 + x2 + x3
Page 86
which we rewrite as
x1 =
x2 =
x3 =
x4 =
√
− 3/4 − x2 − x3
−4
√
3/4 − x1 − x4
−4
−x1 − x4
−4
−x2 − x3
−4
Applying the superscripts then gives the Jacobi iteration:
√
(k)
(k)
− 3/4 − x2 − x3
(k+1)
x1
=
−4
√
(k)
(k)
3/4 − x1 − x4
(k+1)
x2
=
−4
(k)
(k)
−x1 − x4
(k+1)
x3
=
−4
(k)
(k)
−x2 − x3
(k+1)
x4
=
−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 will
converge 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 with
initial 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 scheme
is
3 + y (k)
2
1 − x(k+1)
=
3
x(k+1) =
y (k+1)
Starting with x(0) = 1, y (1) = −1,
3 + y (0)
3−1
=
=1
2
2
1 − x(1)
1−1
=
=
=0
3
3
x(1) =
y (1)
Page 87
and
x
(2)
y (2)
3 + y (1)
3+0
3
=
=
=
1
2
2
1 − 32
1
1 − x(2)
=
=−
=
1
3
6
and
x
(3)
y (3)
3 − 16
3 + y (2)
17
=
=
=
1
2
12
1 − 17
5
1 − x(3)
12
=
=−
=
1
3
24
119. Rearrange the following system into a form you know will converge under the Gauss-Seidel
iteration method for any choice of x(0) , stating why. Write out the resulting Gauss-Seidel
iteration and calculate x(1) and x(2) given that x(0) = (1, 1, 1, 1)T , working to 4 significant
figures.
−x1 + 8x2 + x3 + 4x4
2x1 + 5x2 + 10x3 − x4
−x1 + x2 − x3 + 4x4
6x1 − x2 − x3 − x4
=6
=2
=8
=9
Solution:
Moving the last equation first gives an s.d.d. coefficient matrix
6 −1 −1 −1
−1 8
1
4
2
5 10 −1
−1 1 −1 4
and in this order, the iteration will converge.
The Gauss-Seidel scheme is then
(k)
(k+1)
x1
=
(k+1)
=
(k+1)
=
(k+1)
=
x2
x3
x4
(k)
(k)
9 + x2 + x3 + x4
6
(k+1)
(k)
(k)
6 + x1
− x3 − 4x4
8
(k+1)
(k+1)
(k)
2 − 2x1
− 5x2
+ x4
10
(k+1)
(k+1)
(k+1)
8 + x1
− x2
+ x3
4
Page 88
Starting with x(0) = (1, 1, 1, 1), we get
(0)
(1)
(0)
(0)
9 + x2 + x3 + x4
9+1+1+1
=
=2
6
6
(1)
(0)
(0)
6+2−1−4
6 + x1 − x3 − 4x4
=
= 0.375
=
8
8
(1)
(1)
(0)
2 − 2x1 − 5x2 + x4
2 − 2 × 2 − 5 × 0.375 + 1
=
=
= −0.2875
10
10
(1)
(1)
(1)
8 + x1 − x2 + x3
8 + 2 − 0.375 − 0.2875
=
=
= 2.334
4
4
x1 =
(1)
x2
(1)
x3
(1)
x4
and
(1)
(2)
(1)
(1)
9 + x2 + x3 + x4
9 + 0.375 − 0.2875 + 2.334
=
= 1.903
6
6
(2)
(1)
(1)
6 + x1 − x3 − 4x4
6 + 1.903 + 0.2875 − 4 × 2.334
=
=
= −0.1432
8
8
(2)
(2)
(1)
2 − 2x1 − 5x2 + x4
2 − 2 × 1.903 + 5 × 0.1432 + 2.334
=
=
= 0.1244
10
10
(2)
(2)
(2)
8 + x 1 − x2 + x3
8 + 1.903 + 0.1432 + 0.1244
=
=
= 2.542
4
4
x1 =
(2)
x2
(2)
x3
(2)
x4
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 Jacobi
and 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
x
3
−1 1 7 y = −17
1 5 1
z
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 schemes
are
Jacobi
Gauss-Seidel
3 − y (k) + z (k)
6
(k)
−x − z (k)
=
5
−17 + x(k) − y (k)
=
7
3 − y (k) + z (k)
6
(k+1)
−x
− z (k)
=
5
−17 + x(k+1) − y (k+1)
=
7
x(k+1) =
x(k+1) =
y (k+1)
y (k+1)
z (k+1)
z (k+1)
Page 89
Jacobi
k
x
y (k)
0
1
1
1
0.500
-0.400
2
0.1618
0.3858
3
0.05233 0.4276
4
0.0185
0.4818
5 0.005833 0.4928
6 0.002167 0.4976
7 0.0008333 0.4990
8 0.0001667 0.4998
9
0.000
0.5000
10
0.000
0.5000
(k)
121.
z
(k)
1
-2.429
-2.300
-2.461
-2.483
-2.494
-2.497
-2.500
-2.500
-2.500
-2.500
a) Determine whether the following matrix
6 1
1 5
2 3
Gauss-Seidel
x
y (k)
1
1
0.500
-0.300
0.1643
0.430
0.01717
0.490
0.002333 0.4988
0.0001667 0.5000
0.000
0.5000
0.000
0.5000
0.000
0.5000
0.000
0.5000
0.000
0.5000
(k)
z (k)
1
-2.314
-2.467
-2.496
-2.500
-2.500
-2.500
-2.500
-2.500
-2.500
-2.500
is positive definite.
2
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 why
this 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 1 6 > 0,
1 5 = 30 − 1 = 29 > 0
6 1 2
5 3 1 3 1 5 1 5 3 = 6 3 4 − 2 4 + 2 2 3 = 66 + 2 − 14 = 54 > 0
2 3 4
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 for
any starting values. The iteration scheme is
−2 − y (k) − 2z (k)
6
(k+1)
7−x
− 3z (k)
=
5
5 − 2x(k+1) − 3y (k+1)
=
4
x(k+1) =
y (k+1)
z (k+1)
Starting with x(0) = 1, y (0) = 2, z (0) = 1, we get
−2 − y (0) − 2z (0)
−2 − 2 − 2 × 1
=
= −1
6
6
7+1−3
7 − x(1) − 3z (0)
=
=1
=
5
5
5 − 2x(1) − 3y (1)
5+2×1−3×1
=
=
=1
4
4
x(1) =
y (1)
z (1)
5
29
113
and similarly x(2) = − , y (2) = , z (2) =
.
6
30
120
122. Determine which of the following matrices A are (i) strictly diagonally dominant, (ii)
positive definite.
2 1 0
2 1 0
2 −1 0
a) A = 0 3 0
b) A = 0 3 2
c) A = −1 4 2
1 0 4
1 2 4
0
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 A
has 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 methods
will 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 methods
will 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 −1
2 > 0,
−1 4 = 8 − 1 = 7 > 0
2 −1 0
4 2 −1 2
−1 4 2 = 2 2 2 + 0 2 = 8 − 2 = 6 > 0
0
2 2
Page 91
Since A is positive definite, it does have an LU decomposition and the Gauss-Seidel method
will both converge for any x(0) . (We can’t say about the Jacobi method.)
123. Consider Ax = b where
2 −1 0
0
−1 2 −1 0
A=
0 −1 2 −1
0
0 −1 2
and
−4
2
b=
3
−1
Is A strictly diagonally dominant? Is A positive definite? Based on this evidence, what can you
deduce about Gaussian elimination or the Jacobi or Gauss-Seidel iteration techniques? Give
reasons 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 to
guess 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 −1 0 2 −1
= 4 − 3 = 7 > 0,
−1 2 −1 = 2(4 − 1) + (−2 − 0) = 4 > 0
2 > 0,
−1 2 0 −1 2 2 −1 0
0
2 −1 0 −1 −1 0 −1 2 −1 0 2 −1 = 8 − (4 − 1) = 5 > 0
0 −1 2 −1 = 2 −1 2 −1 + 0
0 −1 2 0 −1 2 0
0 −1 2 Hence A is positive definite so the Gauss-Seidel method will converge.
The iteration scheme and a table of values is:
(k+1)
x1
(k+1)
x2
(k+1)
x3
(k+1)
x4
k
0
1
2
3
4
5
6
7
8
9
10
11
(k)
x2
−4 +
2
(k)
(k+1)
2 + x1
+ x3
=
2
(k+1)
(k)
3 + x2
+ x4
=
2
(k+1)
−1 + x3
=
2
=
x(k)
1
-1.5
-1.625
-1.312
-1.195
-1.127
-1.083
-1.054
-1.036
-1.024
-1.016
-1.010
y (k)
1
0.75
1.375
1.610
1.746
1.834
1.892
1.929
1.953
1.969
1.980
1.987
z (k)
1
2.375
2.531
2.688
2.795
2.866
2.912
2.942
2.962
2.975
2.984
2.990
1
0.6875
0.7655
0.844
0.8975
0.933
0.956
0.971
0.981
0.9875
0.992
0.995
After 6 or so iterates one could guess the iteration is converging to x = (−1, 2, 3, 1)T and a
simple 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
0
1 5 −1
0 −1 5
is tridiagonal and symmetric. Also,
5 > 0,
5 1 1 5 = 25 − 1 = 24 > 0
5 1
0 1 5 −1 = 5 5 −1 + 1 −1 = 5(25 − 1) − (5 − 0) = 115 > 0
−1 5 0 5 0 −1 5 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 .
1
1
0
−
0
−1
0
0
0
0
5
5
Tj = D−1 (L + U ) = 0 15 0 −1 0 1 = − 15 0 51
1
0
1 0
0 0 51
0
0
5
To find the eigenvalues of this, solve
−λ − 1 0 5
1
−λ 1 1 − 1 1 1 5
5
5
det(Tj − λI) = − 5 −λ 5 = −λ 1
+ −λ
0
−λ
5
1
5
0
−λ
5
1 1 λ
2
2
2
(
= −λ λ −
= −λ λ −
=0
25 5 5
25
√
√
Thus the eigenvalues are 0, ± 52 and the spectral radius ρ(Tj ) = 52 . The optimal choice of
ω is
2
2
p
q
ω=
=
= 1.021
1 + 1 − ρ(Tj )2
1+ 1− 2
25
to 4 significant figures.
The SOR method
x(k+1) = (1 − ω)x(k) + ωD−1 b + Lx(k+1) + U x(k)
becomes
x
(k+1)
y (k+1)
z (k+1)
4 − y (k)
= −0.021x + 1.021
5
−5 − x(k+1) + z (k)
(k)
= −0.021y + 1.021
5
(k+1)
6+y
(k)
= −0.021z + 1.021
5
(k)
Page 93
In particular, starting with x(0) = 0, y (0) = 0, z (0) = 0, we get
4
4 − y (0)
(1)
(0)
= 0 + 1.021
= 0.8168
x = −0.021x + 1.021
5
5
−5 − x(1) + z (0)
−5 − 0.8168
(1)
(0)
y = −0.021y + 1.021
= 0 + 1.021
= −1.188
5
5
6 − 1.188
6 + y (1)
(1)
(0)
= 0 + 1.021
= 0.9826
z = −0.021z + 1.021
5
5
The iteration converges quickly to the exact solution x = 1, y = −1, z = 1 :
k
x(k)
y (k)
z (k)
0
0
0
0
1 0.8168 -1.188 0.9826
2 1.042 -1.008 0.9984
3 1.001 -1.001 1.000
4 1.000 -1.000 1.000
5 1.000 -1.000 1.000
Page 94
© Copyright 2026 Paperzz