KEMBAR78
Solution | PDF | Nonlinear System | Differential Equations
0% found this document useful (0 votes)
7 views594 pages

Solution

The document contains a solution manual for differential equations, organized into sections with various problems and their corresponding solutions. Each problem is categorized by order and linearity, with detailed integration steps provided for solving the equations. The manual serves as a resource for understanding the methods of solving different types of differential equations.

Uploaded by

Kamy MK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views594 pages

Solution

The document contains a solution manual for differential equations, organized into sections with various problems and their corresponding solutions. Each problem is categorized by order and linearity, with detailed integration steps provided for solving the equations. The manual serves as a resource for understanding the methods of solving different types of differential equations.

Uploaded by

Kamy MK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 594

Solution Manual

Section 1.1

1. first-order, linear 2. first-order, nonlinear


3. first-order, nonlinear 4. third-order, linear
5. second-order, linear 6. first-order, nonlinear
7. third-order, nonlinear 8. second-order, linear
9. second-order, nonlinear 10. first-order, nonlinear
11. first-order, nonlinear 12. second-order, nonlinear
13. first-order, nonlinear 14. third-order, linear
15. second-order, nonlinear 16. third-order, nonlinear

Section 1.2

1. Because the differential equation can be rewritten e−y dy = x dx, integra-


tion immediately gives −e−y = 12 x2 − C, or y = − ln(C − x2 /2).

2. Separating variables, we have that dx/(1 + x2 ) = dy/(1 + y 2 ). Integrating


this equation, we find that tan−1 (x)−tan−1 (y) = tan(C), or (x−y)/(1+xy) =
C.

3. Because the differential equation can be rewritten ln(x)dx/x = y dy, inte-


gration immediately gives 12 ln2 (x) + C = 21 y 2 , or y 2 (x) − ln2 (x) = 2C.

4. Because the differential equation can be rewritten y 2 dy = (x + x3 ) dx,


integration immediately gives y 3 (x)/3 = x2 /2 + x4 /4 + C.

5. Because the differential equation can be rewritten y dy/(2+y 2 ) = x dx/(1+


x2 ), integration immediately gives 12 ln(2 + y 2 ) = 12 ln(1 + x2 ) + 12 ln(C), or
2 + y 2 (x) = C(1 + x2 ).

6. Because the differential equation can be rewritten dy/y 1/3 = x1/3 dx,
3/2
integration immediately gives 32 y 2/3 = 34 x4/3 + 23 C, or y(x) = 21 x4/3 + C .

1
2 Advanced Engineering Mathematics with MATLAB

7. Because the differential equation can be rewritten e−y dy = ex dx, integra-


tion immediately gives −e−y = ex − C, or y(x) = − ln(C − ex ).

8. Because the differential equation can be rewritten dy/(y 2 + 1) = (x3 +


5) dx, integration immediately gives tan−1 (y) = 41 x4 + 5x + C, or y(x) =
tan 14 x4 + 5x + C .

9. Because the differential equation can be rewritten y 2 dy/(b − ay 3 ) = dt,


y
integration immediately gives ln[b − ay 3 ] y0 = −3at, or (ay 3 − b)/(ay03 − b) =
e−3at .

10. Because the differential equation can be written du/u = dx/x2 , integra-
tion immediately gives u = Ce−1/x or y(x) = x + Ce−1/x .

11. From the hydrostatic equation and ideal gas law, dp/p = −g dz/(RT ).
Substituting for T (z),
dp g
=− dz.
p R(T0 − Γz)
Integrating from 0 to z,
     g/(RΓ)
p(z) g T0 − Γz p(z) T0 − Γz
ln = ln , or = .
p0 RΓ T0 p0 T0

12. For 0 < z < H, we simply use the previous problem. At z = H, the
pressure is
 g/(RΓ)
T0 − ΓH
p(H) = p0 .
T0
Then we follow the example in the text for an isothermal atmosphere for
z ≥ H.

13. Separating variables, we find that

dV dV R dV dt
2
= − =− .
V + RV /S V S(1 + RV /S) RC

Integration yields
 
V t
ln =− + ln(C).
1 + RV /S RC

Upon applying the initial conditions,

V0 RV0 /S
V (t) = e−t/(RC) + e−t/(RC) V (t).
1 + RV0 /S 1 + RV0 /S
Worked Solutions 3

Solving for V (t), we obtain

SV0 e−t/(RC)
V (t) =  .
S + RV0 1 − e−t/(RC)

14. From the definition of γ, we can write the differential equation

A dT
+ T 4 = γ4,
B dt
or  
B dT 1 dT dT
dt = − 4 = −
A T − γ4 2γ 2 T 2 + γ 2 T 2 − γ2
 
1 2γ dT dT dT
= 3 − + .
4γ T 2 + γ 2 T −γ T +γ
The final answer follows from direction integration.

15. Separating the variables yields

dN d[ln(K/N )]
= b dt, or = −b dt.
N ln(K/N ) ln(K/N )

Integration leads to

ln [ln(K/N )] − ln {ln[K/N (0)]} = −bt

or
ln {ln(K/N )/ ln[K/N (0)]} = −bt
or
ln(K/N ) = ln[K/N (0)]e−bt
or 
ln[N/N (0)] = ln[K/N (0)] 1 − e−bt
or  
N (t) = N (0) exp ln[K/N (0)] 1 − e−bt .

16. Separating the variables yields

dI β dI
− = −α dz.
I α 1 + βI/α

Integration leads to
 
I(z) 1 + βI(0)/α
ln = −αz,
1 + βI(z)/α I(0)
4 Advanced Engineering Mathematics with MATLAB

or
I(z) I(0) αI(0)e−αz
= e−αz , or I(z) = .
1 + βI(z)/α 1 + βI(0)/α α + βI(0) [1 − e−αz ]

17. Separating the variables yields

d[X]
= k dt
([A]0 − [X]) ([B]0 − [X]) ([C]0 − [X])
d[X]
([A]0 − [B]0 ) ([A]0 − [C]0 ) ([A]0 − [X])
d[X]
+
([B]0 − [A]0 ) ([B]0 − [C]0 ) ([B]0 − [X])
d[X]
+ = k dt
([C]0 − [A]0 ) ([C]0 − [B]0 ) ([C]0 − [X])

Integration yields
 
1 [A]0
ln
([A]0 − [B]0 ) ([A]0 − [C]0 ) [A] − [X]
 0 
1 [B]0
+ ln
([B]0 − [A]0 ) ([B]0 − [C]0 ) [B] − [X]
 0 
1 [C]0
+ ln = kt.
([C]0 − [A]0 ) ([C]0 − [B]0 ) [C]0 − [X]

18. Separation of variables yields

d[X]
= (k1 + k2 ) dt.
α − [X]

Integrating both sides,

ln(α − [X]) − ln(α − [X]0 ) = −(k1 + k2 )t.

Because [X]0 = 0,
h i
α − [X] = αe−(k1 +k2 )t , or [X] = α 1 − e−(k1 +k2 )t .

Section 1.3

1. Because M (x, y) = −y and N (x, y) = x + y, we have that M (tx, ty) =


−ty = tM (x, y), and N (tx, ty) = tx + ty = tN (x, y). Therefore, the differen-
tial equation is homogeneous.
Worked Solutions 5

Let y = ux. Substituting into the differential equation, (ux + x)(u dx +


x du) = ux dx, or −u2 x dx = (1 + u)x2 du, or
 
dx 1 1
− = + du.
x u u2

Integrating this last equation,


1 x
− ln |x| = ln(u) − − C, or ln |y| − = C.
u y

2. Because M (x, y) = y − x and N (x, y) = x + y, we have that M (tx, ty) =


ty − tx = tM (x, y), and N (tx, ty) = tx + ty = tN (x, y). Therefore, the
differential equation is homogeneous.
Let y = ux. Substituting into the differential equation, (u − 1)x dx + (u +
1)x(u dx + x du) = 0, or

dx u+1
(u2 + 2u − 1) dx = −(u + 1)x du, or − = 2 du.
x u + 2u − 1
Integrating this last equation,
 
2 2 y2 y
− ln |x| = 1
2 ln |u +2u−1|+C, or x + 2 − 1 = y 2 +2xy −x2 = C.
x2 x

3. Because M (x, y) = x2 + y 2 and N (x, y) = 2xy, we have that M (tx, ty) =


t2 x2 + t2 y 2 = t2 (x2 + y 2 ) = t2 M (x, y), and N (tx, ty) = 2t2 xy = t2 N (x, y).
Therefore, the differential equation is homogeneous.
Let y = ux. Substituting into the differential equation,

2x(ux)(u dx + x du) + (x2 + x2 u2 ) dx = 0

or
dx 2u
2xu du + (1 + 3u2 ) dx = 0, or =− du.
x 1 + 3u2
Integrating this last equation,

ln |x| = − 13 ln(1 + 3u2 ) + ln(C1 ).

Inverting the logarithms,

|x|(1 + 3y 2 /x2 )1/3 = C1 , or |x|(x2 + 3y 2 ) = C.

4. Because M (x, y) = y(y − x) and N (x, y) = x(x + y), we have that


M (tx, ty) = ty(ty − tx) = t2 M (x, y), and N (tx, ty) = tx(tx + ty) = t2 N (x, y).
Therefore, the differential equation is homogeneous.
6 Advanced Engineering Mathematics with MATLAB

Let y = ux. Substituting into the differential equation,

x2 u(u − 1) dx + x2 (u + 1)(u dx + x du) = 0

or
dx u+1
2u2 dx + (u + 1)x du = 0, or 2 = − 2 du.
x u
Integrating this last equation,

1 x x
ln |x|2 = − ln |u| + + C, or ln |ux2 | = C − , or ln |xy| = C − .
u2 y y

5. Because M (x, y) = y + 2 xy and N (x, y) = −x, we have that M (tx, ty) =
p √
ty + 2 t2 xy = ty + 2t xy = tM (x, y), and N (tx, ty) = −tx = tN (x, y).
Therefore, the differential equation is homogeneous.
Let y = ux. Substituting into the differential equation,

√ du dx
x(u dx + x du) = (xu + 2x u ) dx, or √ = .
2 u x

Integrating this last equation,


2
u1/2 = ln |x| + C, or y = x (ln |x| + C) .
p
6. Because M (x, y) = x2 + y 2 − y and N (x, y) = x, we have that M (tx, ty)
p p
= t2 x2 + t2 y 2 − ty = t x2 + y 2 − y = tM (x, y), and N (tx, ty) = tx =
tN (x, y). Therefore, the differential equation is homogeneous.
Let y = ux. Substituting into the differential equation,
p 
x2 + x2 u2 − ux dx + x(x du + u dx) = 0,

or p dx du
x 1 + u2 dx + x2 du = 0, or = −√ .
x 1 + u2
Integrating this last equation,
 p 
− ln(x) = − ln u + 1 + u2 − ln(C).

Inverting the logarithms,


p p
ux + u2 x2 + x2 = C, or y+ x2 + y 2 = C.

7. Because M (x, y) = sec(y/x) + y/x and N (x, y) = −1, we have that


M (tx, ty) = sec[(ty)/(tx)] + (ty)/(tx) = sec(y/x) + y/x = M (x, y), and
Worked Solutions 7

N (tx, ty) = −1 = N (x, y). Therefore, the differential equation is homoge-


neous.
Let y = ux. Substituting into the differential equation,

dx
u dx + x du = [sec(u) + u] dx, or cos(u) du = .
x
Integrating and substituting for u, the final answer is

sin(y/x) − ln |x| = C.

8. Because M (x, y) = ey/x + y/x and N (x, y) = −1, we have that M (tx, ty) =
e(ty)/(tx) + (ty)/(tx) = ey/x + y/x = M (x, y), and N (tx, ty) = −1 = N (x, y).
Therefore, the differential equation is homogeneous.
Let y = ux. Substituting into the differential equation,

dx
u dx + x du = (eu + u) dx, or e−u du = .
x
Integrating and substituting for u, the final answer is

y(x) = −x ln (C − ln |x|) .

Section 1.4

1. Since M (x, y) = y 2 − x2 , and N (x, y) = 2xy,

∂M ∂N
= 2y = .
∂y ∂x

The exactness criteria is satisfied.


Now, since
∂u
= y 2 − x2 ,
∂x
then u(x, y) = xy 2 − 31 x3 + f (y). To find f (y), we use

∂u
= 2xy + f ′ (y) = 2xy.
∂y

Therefore, f ′ (y) = 0, and u(x, y) = xy 2 − 13 x3 = C.

2. Since M (x, y) = y − x, and N (x, y) = x + y,

∂M ∂N
=1= .
∂y ∂x
8 Advanced Engineering Mathematics with MATLAB

The exactness criteria is satisfied.


Now, since
∂u
= y − x,
∂x
then u(x, y) = xy − 21 x2 + f (y). To find f (y), we use

∂u
= x + f ′ (y) = x + y.
∂y

Therefore, f ′ (y) = y, and u(x, y) = xy + 12 y 2 − 21 x2 = C.

3. Since M (x, y) = y 2 − 1, and N (x, y) = 2xy − sin(y),


∂M ∂N
= 2y = .
∂y ∂x
The exactness criteria is satisfied.
Now, since
∂u
= y 2 − 1,
∂x
then u(x, y) = xy 2 − x + f (y). To find f (y), we use
∂u
= 2xy + f ′ (y) = 2xy − sin(y).
∂y

Therefore, f ′ (y) = − sin(y), and u(x, y) = xy 2 − x + cos(y) = C.

4. Since M (x, y) = sin(y) − 2xy + x2 , and N (x, y) = x cos(y) − x2 ,


∂M ∂N
= cos(y) − 2x = .
∂y ∂x
The exactness criteria is satisfied.
Now, since
∂u
= sin(y) − 2xy + x2 ,
∂x
then u(x, y) = x sin(y) − x2 y + 13 x3 + f (y). To find f (y), we use

∂u
= x cos(y) − x2 + f ′ (y) = x cos(y) − x2 .
∂y

Therefore, f ′ (y) = 0, and u(x, y) = x sin(y) − x2 y + 31 x3 = C.

5. Since M (x, y) = −y/x2 , and N (x, y) = 1/x + 1/y,


∂M 1 ∂N
=− 2 = .
∂y x ∂x
Worked Solutions 9

The exactness criteria is satisfied.


Now, since
∂u y
= − 2,
∂x x
then u(x, y) = y/x + f (y). To find f (y), we use

∂u 1 1 1
= + f ′ (y) = + .
∂y x x y

Therefore, f ′ (y) = 1/y, and u(x, y) = y/x + ln(y) = C.

6. Since M (x, y) = 3x2 − 6xy, and N (x, y) = −3x2 − 2y,

∂M ∂N
= −6x = .
∂y ∂x
The exactness criteria is satisfied.
Now, since
∂u
= 3x2 − 6xy,
∂x
then u(x, y) = x3 − 3x2 y + f (y). To find f (y), we use

∂u
= −3x2 + f ′ (y) = −3x2 − 2y.
∂y

Therefore, f ′ (y) = −2y, and u(x, y) = x3 − 3x2 y − y 2 = C.

7. Since M (x, y) = y sin(xy), and N (x, y) = x sin(xy),

∂M ∂N
= sin(xy) + xy cos(xy) = .
∂y ∂x
The exactness criteria is satisfied.
Now, since
∂u
= y sin(xy),
∂x
then u(x, y) = − cos(xy) + f (y). To find f (y), we use

∂u
= x sin(xy) + f ′ (y) = x sin(xy).
∂y

Therefore, f ′ (y) = 0, and u(x, y) = − cos(xy) = C.

8. Since M (x, y) = 2xy 2 + 3x2 , and N (x, y) = 2x2 y,

∂M ∂N
= 4xy = .
∂y ∂x
10 Advanced Engineering Mathematics with MATLAB

The exactness criteria is satisfied.


Now, since
∂u
= 2xy 2 + 3x2 ,
∂x
then u(x, y) = x2 y 2 + x3 + f (y). To find f (y), we use

∂u
= 2x2 y + f ′ (y) = 2x2 y.
∂y

Therefore, f ′ (y) = 0, and u(x, y) = x2 y 2 + x3 = C.

9. Since M (x, y) = 2xy 3 + 5x4 y, and N (x, y) = 3x2 y 2 + x5 + 1,

∂M ∂N
= 6xy 2 + 5x4 = .
∂y ∂x

The exactness criteria is satisfied.


Now, since
∂u
= 2xy 3 + 5x4 y,
∂x
then u(x, y) = x2 y 3 + x5 y + f (y). To find f (y), we use

∂u
= 3x2 y 2 + x5 + f ′ (y) = 3x2 y 2 + x5 + 1.
∂y

Therefore, f ′ (y) = 1, and u(x, y) = x2 y 3 + x5 y + y = C.

10. Since M (x, y) = x3 + y/x, and N (x, y) = y 2 + ln(x),

∂M 1 ∂N
= = .
∂y x ∂x

The exactness criteria is satisfied.


Now, since
∂u y
= x3 + ,
∂x x
then u(x, y) = 41 x4 + y ln(x) + f (y). To find f (y), we use

∂u
= ln(x) + f ′ (y) = y 2 + ln(x).
∂y

Therefore, f ′ (y) = y 2 , and u(x, y) = 41 x4 + y ln(x) + 31 y 3 = C.

11. [x + e−y + x ln(y)] dy + [y ln(y) + ex ] dx = 0


Worked Solutions 11

Since M (x, y) = y ln(y) + ex , and N (x, y) = x + e−y + x ln(y),

∂M ∂N
= 1 + ln(y) = .
∂y ∂x

The exactness criteria is satisfied.


Now, since
∂u
= y ln(y) + ex ,
∂x
then u(x, y) = xy ln(y) + ex + f (y). To find f (y), we use

∂u
= x[ln(y) + 1] + f ′ (y) = x + e−y + x ln(y).
∂y

Therefore, f ′ (y) = e−y , and u(x, y) = xy ln(y) + ex − e−y = C.

12. Since M (x, y) = cos(4y 2 ), and N (x, y) = −8xy sin(4y 2 ),

∂M ∂N
= −8y sin(4y 2 ) = .
∂y ∂x

The exactness criteria is satisfied.


Now, since
∂u
= cos(4y 2 ),
∂x
then u(x, y) = x cos(4y 2 ) + f (y). To find f (y), we use

∂u
= −8xy sin(4y 2 ) + f ′ (y) = −8xy sin(4y 2 ).
∂y

Therefore, f ′ (y) = 0, and u(x, y) = x cos(4y 2 ) = C.

13. Since M (x, y) = sin2 (x + y), and N (x, y) = − cos2 (x + y),

∂M ∂N
= 2 sin(x + y) cos(x + y) = .
∂y ∂x

The exactness criteria is satisfied.


Now, since

∂u
= sin2 (x + y) = 1
2 [1 − cos(2x + 2y)] ,
∂x
then u(x, y) = x/2 − sin(2x + 2y)/4 + f (y). To find f (y), we use

∂u
= − 21 cos(2x + 2y) + f ′ (y) = − cos2 (x + y) = − 12 [1 + cos(2x + 2y)] .
∂y
12 Advanced Engineering Mathematics with MATLAB

Therefore, f ′ (y) = − 12 , and u(x, y) = y − x + 1


2 sin(2x + 2y) = C.

14. After multiplying by the integrating factor,

y a+1 ya
M (x, y) = α , and N (x, y) = (x − y) .
(1 − y)a+1 (1 − y)a+2

Checking the exactness criteria,

∂M ya ∂N
= = .
∂y (1 − y)a+2 ∂x

The exactness criteria is satisfied.


Now, since
∂u y a+1
=α ,
∂x (1 − y)a+1
y a+1
u(x, y) = αx + f (y) = C.
(1 − y)a+1
To find f (y), we use

∂u ya ya
=x a+2
+ f ′ (y) = (x − y) .
∂y (1 − y) (1 − y)a+2

Therefore,
y a+1
f ′ (y) = − .
(1 − y)a+2
Integrating, we find that
Z y
ξ a+1
f (y) = − dξ.
0 (1 − ξ)a+2

and the final answer is


Z y
y a+1 ξ a+1
u(x, y) = αx − dξ = C.
(1 − y)a+1 0 (1 − ξ)a+2

Section 1.5

1. Since P (x) = 1, µ(x) = ex . Multiplying the differential equation by the


integrating, we have that ex y ′ + ex y = e2x , or d (ex y) /dx = e2x or ex y =
1 2x
2e + C, or y = 21 ex + Ce−x . This general solution applies to any x on the
interval (−∞, ∞).
Worked Solutions 13
2
2. Since P (x) = 2x, µ(x) = ex . Multiplying the differential
 2equation
 by the
x2 ′ x2 x2 2
integrating factor, we have that e y + 2xe y = xe , d e y /dx = xex ,
x

2 2 2
or ex y = 12 ex + C, or y = 1
2 + Ce−x . This general solution applies to any
x on the interval (−∞, ∞).

3. Since the canonical form of the differential equation is y ′ + y/x = 1/x2 ,


P (x) = 1/x, and µ(x) = x. Multiplying the canonical differential equation by
the integrating factor, we have that xy ′ + y = x−1 , or d (xy) /dx = x−1 , or
xy = ln(x) + C, or y = ln(x)/x + Cx−1 . This general solution applies to any
x as long as x 6= 0.

4. Since the canonical form of the differential equation is y ′ −2y/x = x, P (x) =


−2/x, and µ(x) = x−2 . Multiplying the canonical differential equation by the
integrating factor, we have that x−2 y ′ − 2x−3 y = x−1 , d (y/x) /dx = 1/x, or
y/x2 = ln(x) + C, or y = 2x ln(x) + Cx2 . This general solution applies to any
x on the interval (−∞, ∞).

5. Directly from the differential equation, we have that P (x) = −3/x, and
µ(x) = x−3 . Multiplying the differential equation
 by the integrating factor,
we have that x−3 y ′ − 3x−4 y = 2x−1 , d y/x3 = 2/x, or y/x3 = 2 ln(x) + C,
or y = 2x3 ln(x) + Cx3 . This general solution applies to any x on the interval
(−∞, ∞).

6. Since P (x) = 2, µ(x) = e2x . Multiplying the differential equation  by


the integrating, we have that e2x y ′ + 2e2x y = 2e2x sin(x), or d e2x y /dx =
2e2x sin(2x), or e2x y = 25 e2x [2 sin(x) − cos(x)]+C, or y = 54 sin(x)− 25 cos(x)+
Ce−2x . This general solution applies to any x on the interval (−∞, ∞).

7. Since the differential equation is already in canonical form, we imme-


diately have P (x) = 2 cos(2x), and µ(x) = exp[sin(2x)]. Multiplying the
differential equation by the integrating
 sin(2x)  factor, we have that esin(2x) dy/dx +
sin(2x)
2 cos(2x)e y = 0, d e y /dx = 0, or esin(2x) y = C. This general
solution applies to any x on the interval nπ + ϕ < 2x < (n + 1)π + ϕ, where
ϕ is any real and n is any integer.

8. Dividing through by x, we immediately have P (x) = 1/x, and µ(x) = x.


Multiplying the differential equation by the integrating factor, we have that
xdy/dx + y = ln(x), or d(xy)/dx = ln(x), or xy = C + x ln(x) − x, or
y = C/x + ln(x) − 1. This general solution applies to any x on the interval
(0, ∞).

9. Since the differential equation is already in canonical form, we immediately


have P (x) = 3, and µ(x) = e3x . Multiplying the differential equation by the
integrating factor, we have that e3x dy/dx + 3e3x y = 4e3x , or d e3x y /dx =
14 Advanced Engineering Mathematics with MATLAB
 
4e3x , or e3x y(x) − y(0) = 34 e3x − 1 , or e3x y(x) − 5 = 43 e3x − 1 , or y(x) =
4 11 −3x
3+ 3 e . This particular solution applies to any x on the interval (−∞, ∞).

10. Since the differential equation is already in canonical form, we immediately


have P (x) = −1, and µ(x) = e−x . Multiplying the differential equation by the
integrating factor, we have that e−x dy/dx − e−x y = 1/x, or d (e−x y) /dx =
1/x, or e−x y(x) − e−e y(e) = ln(x) − ln(e), or y(x) = ex [ln(x) − 1].

11. By inspection, we immediately have that d [sin(x)y] /dx = 1, or sin(x)y =


x + C, or y(x) = (x + C)/ sin(x).

12. Since the canonical form of the differential equation is

dy 2 sin(x) tan(x)
+ y= ,
dx 1 − cos(x) 1 − cos(x)

P (x) = 2 sin(x)/[1 − cos(x)], and µ(x) = [1 − cos(x)]2 . Multiplying the canon-


ical differential equation by the integrating factor, we have that
dy
[1 − cos(x)]2 + 2 sin(x)[1 − cos(x)]y = tan(x)[1 − cos(x)]
dx
d 
[1 − cos(x)]2 y = tan(x) − sin(x)
dx
[1 − cos(x)]2 y = − ln | cos(x)| + cos(x) + C.

This general solution applies to any x on the interval nπ+ϕ < x < (n+1)π+ϕ,
where ϕ is any real and n is any integer.

13. Since the differential equation is already in canonical form, P (x) =


a tan(x) + b sec(x), and

[sec(x) + tan(x)]b
µ(x) = .
cosa (x)

Multiplying by the integrating factor, we have that


 
d [sec(x) + tan(x)]b sec(x)[sec(x) + tan(x)]b
y(x) = c .
dx cosa (x) cosa (x)

Integrating both sides of this equation,


Z x
[sec(x) + tan(x)]b [sec(ξ) + tan(ξ)]b
y(x) − y(0) = c dξ
cosa (x) 0 cosa+1 (ξ)
or
Z x
cosa (x) y(0) c cosa (x) [sec(ξ) + tan(ξ)]b
y(x) = + dξ.
[sec(x) + tan(x)]b [sec(x) + tan(x)]b 0 cosa+1 (ξ)
Worked Solutions 15

14. Writing the differential equation in canonical form, we have


 
dy 1 1
+ 1+ y= .
dx x x

Therefore,
Z x   
1
µ(x) = exp 1+ dξ = exp[x + ln(x)] = xex .
ξ

Multiplying the differential equation by the integrating factor, we find

dy
xex + (x + 1)ex y = ex
dx
d
[xex y] = ex
dx
xex y = ex + C
1
y = + Ce−x .
x

15. Since the differential equation is already in canonical form, P (x) = 2a,
and µ(x) = e2ax . Multiplying by the integrating factor, we have that

d  2ax  x sin(2ωx) 2ax


e y(x) = e2ax − e .
dx 2 4ω
Integrating both sides of this equation,
Z x Z x
2ax 2aξ 1
e y(x) − y(0) = 2 1
ξe dξ − sin(2ωξ)e2aξ dξ
0 4ω 0
or
x x
e2aξ e2aξ
e2ax y(x) = (2aξ − 1) − [a sin(2ωξ) − ω cos(2ωξ)] .
8a2 0 8ω(a2 + ω 2 ) 0

Solving for y(x),

2ax − 1 ω 2 e−2ax a sin(2ωx) − ω cos(2ωx)


y(x) = 2
+ 2 2 − .
8a 8a (a + ω 2 ) 8ω(a2 + ω 2 )

16. Since the differential equation is already in canonical form, P (x) = 2k/x3 ,
and µ(x) = exp(−k/x2 ). Multiplying by the integrating factor, we have that
 
d h −k/x2 i x + 1 −k/x2
e y(x) = ln e .
dx x
16 Advanced Engineering Mathematics with MATLAB

Integrating both sides of this equation,


Z x    
−k/x2 −k ξ+1 k
e y(x) − e y(1) = ln exp − 2 dξ.
1 ξ ξ

Because y(1) = 0,
 Z x    
k ξ+1 k
y(x) = exp 2 ln exp − 2 dξ.
x 1 ξ ξ

17. Substituting in the variable p(x) = y 2 (x), we have that

dp 2 2
− p=− , p(1) = 0.
dx kx k

Then, multiplying through with the integrating factor, we find that

dp 2 2
x−2/k − x−2/k−1 p = − x−2/k
dx k k
d h −2/k i 2
x p = − x−2/k .
dx k

If k 6= 2, an integration yields

2/k 2
x−2/k p(x) = − x1−2/k + C, or y 2 (x) = − x + Cx2/k .
1 − 2/k k−2

Applying the initial condition, the final answer is

2  
y 2 (x) = x − x2/k ,
2−k

provided k 6= 2. If k = 2, then we have that

p(x)
= − ln(x) + C.
x

Applying the initial condition, C = 0 and the final answer is

y 2 (x) = x ln(1/x).

18. We must solve

dx
− (1 − N )rx = S, x(0) = 1.
dt
Worked Solutions 17

Multiplying both side of the equation by e−(1−N )rt , we have

d h −(1−N )rt i
e x(t) = Se−(1−N )rt .
dt
Integrating both sides of this equation from 0 to t, we obtain

S h i
e−(1−N )rt x(t) − 1 = 1 − e−(1−N )rt .
(1 − N )r

Solving x(t), we find that

S h i
x(t) = e(1−N )rt + e(1−N )rt − 1 .
(1 − N )r

19. From separation of variables,

d[A]
= −k1 dt.
[A]

Integration yields
[A] = [A]0 e−k1 t .
Substituting [A] into the equation for [B],

d[B]
+ k2 [B] = k1 [A]0 e−k1 t .
dt
Multiplying by the integrating factor, we have that

d k2 t 
e [B] = k1 [A]0 e(k2 −k1 )t .
dt
Integrating this equation, we find that

k1 [A]0 h (k2 −k1 )t i


ek2 t [B] − [B]0 = e −1 .
k2 − k1

Because [B]0 = 0, we find that

k1 [A]0  −k1 t 
[B] = e − e−k2 t .
k2 − k1

Finally, substituting for [B] into the [C] equation,

d[C] k1 k2 [A]0  −k1 t 


= e − e−k2 t .
dt k2 − k1
18 Advanced Engineering Mathematics with MATLAB

Integrating this equation,

k2 [A]0  k1 [A]0 
[C] − [C]0 = 1 − e−k1 t − 1 − e−k2 t
k2 − k1 k2 − k1
or  
k1 e−k2 t − k2 e−k1 t
[C] = [A]0 1 + .
k2 − k1
since [C]0 = 0.

20. The differential equation is

dI
L + RI = E0 cos2 (ωt), I(0) = 0.
dt

Multiplying the integrating factor, we can rewrite this differential equation

d h Rt/L i E
0 Rt/L
e I(t) = e cos2 (ωt).
dt L

Integrating both sides of the differential equation,


Z t
Rt/L E0
e I(t) − I(0) = eRτ /L cos2 (ωτ ) dτ.
L 0

1
Using the fact that I(0) = 0 and replacing cos2 (ωt) with 2 [1 + cos(2ωt)], we
have that
Z th i
Rt/L E0
e I(t) = eRτ /L + eRτ /L cos(2ωτ ) dτ,
2L 0

or
 
Rt/L E0 eRτ /L − 1 E0 eRτ /L [R cos(2ωτ ) + 2ωL sin(2ωτ )] − R
e I(t) = + .
2R 2R2 + 8ω 2 L2

Solving for I(t),


   
E0 1 − e−Rτ /L E0 R cos(2ωτ ) − e−Rt/L + 2ωL sin(2ωτ )
I(t) = + .
2R 2R2 + 8ω 2 L2

21. Because n = 2, z = y −1 and the linear ordinary differential equation is

dz z 1 dz z d z 1
− = 1, or − 2 = = .
dx x x dx x dx x x
Worked Solutions 19

Integrating this equation yields

z(x) = Cx + x ln(x).

Therefore, the solution to the nonlinear differential equation is

1
y(x) = .
Cx + x ln(x)

22. Because n = 2, z = y −1 and the linear ordinary differential equation is

dz z 1 dz d 1
+ = − 2, or x +z = (xz) = − .
dx x x dx dx x
Integrating this equation yields

z(x) = [C − ln(x)]/x.

Therefore, the solution to the nonlinear differential equation is


x
y(x) = .
C − ln(x)

23. Because n = 21 , z = y 1/2 and the linear ordinary differential equation is

dz 2z x 1 dz 2z d z  1
− = , or − = = .
dx x 2 x2 dx x3 dx x2 2x
Integrating this equation yields

z(x) = Cx2 + 21 x2 ln(x).

Therefore, the solution to the nonlinear differential equation is


 2
y(x) = Cx2 + 21 x2 ln(x) .

24. Because n = 2, z = y −1 and the linear ordinary differential equation is

dz z 1 dz z d z
− = x, or − 2 = = 1.
dx x x dx x dx x
Integrating this equation yields

z(x) = Cx + x2 .
20 Advanced Engineering Mathematics with MATLAB

Therefore, the solution to the nonlinear differential equation is

1
y(x) = .
Cx + x2

25. Because n = −1, z = y 2 and the linear ordinary differential equation is

dz z 1 dz z d z 1
− = −1, or − 2 = =− .
dx x x dx x dx x x
Integrating this equation yields

z(x) = Cx − x ln(x).

Therefore, the solution to the nonlinear differential equation is


1/2
y(x) = [Cx − x ln(x)] .

26. Because n = 3, z = y −2 and the linear ordinary differential equation is

dz 2z
− = −1
dx x
or
1 dz 2z d z  1
2
− 3 = = − 2.
x dx x dx x2 x
Integrating this equation yields

z(x) = Cx2 + x.

Therefore, the solution to the nonlinear differential equation is


 −1/2
y(x) = Cx2 + x .

Section 1.6

5. The equilibrium points for this differential equation are x = 0, 21 , and 1.


The right side is negative for 0 < x < 21 and positive for 12 < x < 1. Thus,
the equilibrium point x = 21 is unstable while the equilibrium points at x = 0
and 1 are stable.

6. The equilibrium points are x = ±1, and x = ±2. For x < −2, −1 < x < 1,
and x > 2, x′ > 0. For −2 < x < −1 and 1 < x < 2, x′ < 0. Therefore, the
equilibrium points at x = −2 and x = 1 are stable while x = −1 and x = 2
are unstable.
Worked Solutions 21

7. There is only one equilibrium point, x = 0. For x < 0, x′ > 0 while for
x > 0, x′ < 0. Therefore, this equilibrium point is stable.

8. The equilibrium points are x = ±2, and x = 0. For x < −2 and 0 < x < 2,
x′ > 0. For −2 < x < 0 and x > 2, x′ < 0. Therefore, the equilibrium point
x = 0 is unstable while the points x = ±2 are stable.

Section 1.7

1. Because the differential equation can be written x′ − x = t, we have that

d −t 
e x = −te−t .
dt

Integration yields x(t) = Cet + t + 1. Applying the initial condition, we find


that C = 1. Therefore, the final answer is x(t) = et + t + 1.
2
2. Because the differential equation can be written dx/x = t dt, x(t) = Cet /2 .
Applying the initial condition, C = 1. Therefore, the final solution is x(t) =
2
et /2 .

3. Because the differential equation can be written dx/x2 = dt/(t + 1), in-
tegration yields 1/x = C − ln(t + 1). Applying the initial condition, C = 1.
Therefore, the final answer is x(t) = [1 − ln(t + 1)]−1 .

4. Because the differential equation can be written x′ − x = e−t , we have that

d −t 
e x = e−2t .
dt

Integration yields x(t) = Cet − 12 e−t . Applying the initial condition,


 we find
that C = e−2 /2. Therefore, the final answer is x(t) = 21 et−2 − e−t .

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Differential-Integral Equation
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% initialize parameters
clear; beta = 0.4; deltat = 0.01; K = 1000;

% vary value of b

for n = 1:4

b = 0.2 * (n-1);
22 Advanced Engineering Mathematics with MATLAB

% take the first time step

x(1) = 0; t(1) = 0; t(2) = deltat;


x(2) = x(1) + deltat - b * deltat * sign(x(1)) * abs(x(1))^beta;
sum = x(1) + x(2);

% take the remaining time steps

for k = 2:K
t(k) = t(k-1) + deltat;
x(k) = x(k-1) + deltat ...
- b * deltat * sign(x(k-1)) * abs(x(k-1))^beta ...
- deltat * deltat * sum;
sum = sum + x(k);
end

% plot the results

subplot(2,2,n), plot(t,x); xlabel(’time’,’Fontsize’,20);


ylabel(’x(t)’,’Fontsize’,20); legend([’B = ’,num2str(b)])

end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 2.0

1. Since the second solution is y2 (x) = u(x), y2′ (x) = u′ (x) and y2′′ (x) = u′′ (x).
Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that xu′′ + 2u′ = 0. Therefore,

u′′ (x) 2

=− , u′ (x) = Cx−2 .
u (x) x

Thus, u(x) = A/x, and the second solution is y2 (x) = A/x.

2. Since the second solution is y2 (x) = u(x)ex ,

y2′ (x) = u′ (x)ex + u(x)ex , and y2′′ (x) = u′′ (x)ex + 2u′ (x)ex + u(x)ex .

Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that u′′ + 3u′ = 0. Therefore,

u′′ (x)
= −3, u′ (x) = Ce−3x .
u′ (x)
Worked Solutions 23

Thus, u(x) = Ae−3x , and the second solution is y2 (x) = Ae−2x .

3. Since the second solution is y2 (x) = xu(x),

y2′ (x) = xu′ (x) + u(x), and y2′′ (x) = xu′′ (x) + 2u′ (x).

Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that xu′′ + 6u′ = 0. Therefore,

u′′ (x) 6
=− , u′ (x) = Cx−6 .
u′ (x) x

Thus, u(x) = Ax−5 , and the second solution is y2 (x) = Ax−4 .

4. Since the second solution is y2 (x) = ex u(x),

y2′ (x) = ex u(x) + ex u′ (x), and y2′′ (x) = ex u(x) + 2ex u′ (x) + ex u′′ (x).

Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that xu′′ + (x − 1)u′ = 0. Therefore,

u′′ (x) 1

= − 1, u′ (x) = −Axe−x .
u (x) x

Thus, u(x) = A(x + 1)e−x , and the second solution is y2 (x) = A(x + 1).

5. Since the second solution is y2 (x) = (x − 1)u(x),

y2′ (x) = (x − 1)u′ (x) + u(x), and y2′′ (x) = (x − 1)u′′ (x) + 2u′ (x).

Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that x(2 − x)(x − 1)u′′ + 2u′ = 0. Therefore,

u′′ (x) 2 1 1 2
= = + − ,
u′ (x) x(x − 2)(x − 1) x x−2 x−1

and  
x(x − 2) 1
u′ (x) = A = A 1 − .
(x − 1)2 (x − 1)2
Thus, u(x) = Ax+A/(x−1), and the second solution is y2 (x) = A(x2 −x+1).

6. Since the second solution is y2 (x) = u(x) sin3 (x),

y2′ (x) = 3 sin2 (x) cos(x)u(x) + sin3 (x)u′ (x),


24 Advanced Engineering Mathematics with MATLAB

and
y2′′ (x) = 6 sin(x) cos2 (x)u(x) − 3 sin3 (x)u(x)
+ 6 sin2 (x) cos(x)u′ (x) + sin3 (x)u′′ (x).
Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that

sin(x) cos(x)u′′ + [6 cos2 (x) + sin2 (x)]u′ = 0.

Therefore,

u′′ (x) A cos(x)


= −6 cot(x) − tan(x), u′ (x) = − .
u′ (x) 5 sin6 (x)

Thus, u(x) = A/ sin5 (x), and the second solution is y2 (x) = A/ sin2 (x).

7. Since the second solution is y2 (x) = u(x) cos(x)/ x,

sin(x) cos(x) cos(x)


y2′ (x) = − √ u(x) − √ u(x) + √ u′ (x)
x 2x x x

and
cos(x) 3 cos(x) sin(x)
y2′′ (x) = − √ u(x) + √ u(x) + √ u(x)
x 4x2 x x x
cos(x) 2 sin(x) ′ cos(x)
− √ u′ (x) − √ u (x) + √ u′′ (x).
x x x x
Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that cos(x)u′′ − 2 sin(x)u′ = 0. Therefore,

u′′ (x) 2 sin(x)


= , u′ (x) = A sec2 (x).
u′ (x) cos(x)

Thus, u(x) = A tan(x), and the second solution is y2 (x) = A sin(x)/ x.
2
8. Since the second solution is y2 (x) = u(x)e−bx /2

2 2
y2′ (x) = −bxe−bx /2
u(x) + e−bx /2 ′
u (x),

and
2 2 2
y2′′ (x) = (b2 x2 − b)e−bx /2
u(x) − 2bxe−bx /2 ′
u (x) + u′′ (x)e−bx /2
.

Consequently, substituting these values of y2 (x), y2′ (x), and y2′′ (x) into the
differential equation, we find that u′′ + (a − 2bx)u′ = 0. Therefore,

u′′ (x)
= 2bx − a.
u′ (x)
Worked Solutions 25
Rx 2
Thus, u(x) = ebξ −aξ
dξ, and the second solution is
Z x
2 2
y2 (x) = e−bx /2 ebξ −aξ dξ.

9. Letting v = y ′ , we can rewrite the differential equation y(dv/dy) = v 2 .


Assuming v 6= 0, we can integrate this equation to give v = C1 y. Therefore,
dy/dx = C1 y. Integrating this, we obtain the final answer y(x) = C2 eC1 x .

10. Letting v = y ′ , we can rewrite the differential equation dv/dy = 2y.


Assuming v 6= 0, we can integrate this equation to give v = y 2 + C1 . Because
v(1) = 1, C1 = 0 and dy/dx = y 2 . Integrating this equation, 1/y = C2 − x.
Again, using the initial conditions, y(x) = 1/(1 − x).

11. Letting v = y ′ , we can rewrite the differential equation yv(dv/dy) =


v + v 2 . Assuming v 6= 0, we can integrate this equation to give 1 + v =
C1 y. Substituting
 for v, dy/dx = C1 y − 1. Integrating this equation, y =
1 + C2 eC1 x /C1 .

12. Letting v = y ′ , we can rewrite the differential equation 2yv(dv/dy) =


1 + v 2 . Assuming v 6= 0, we can √integrate this equation to give 1 + v 2 =
C1 y. Substituting  v, dy/dx = C1 y − 1. Integrating this equation, y =
for
1 + (C1 x + C2 )2 /4 /C1 .

13. Letting v = y ′ , we can rewrite the differential equation v(dv/dy) = e2y


with v(0) = 1. We can integrate this equation and find v = ey . Substituting
for v, dy/dx = ey . Integrating this equation, e−y = C − x, or y = − ln |1 − x|.

14. We begin by integrating once and using the initial conditions, y ′′ = 32 y 2 .


Letting v = y ′ , we can rewrite this differential equation v(dv/dy) = 32 y 2 .
Integrating this equation, we have v = y 3/2 . Substituting for v, dy/dx = y 3/2 .
Integrating this equation, y = 4/(2 − x)2 = 4/(x − 2)2 .

15. If we define z = 1/v, the Bernoulli equation becomes z ′ + z/x = − 21 . Its


solution is z = −A2 /x−x/4. Therefore, y ′ = v = −4x/(x2 +4A2 ). Integration
yields the final answer y(x) = B − 2 ln(x2 + 4A2 ).

16. First we compute


 Z x   Z x 
′ ′ 1 a1 (ξ) a1 1 a1 (ξ)
y (x) = u (x) exp − dξ − u(x) exp − dξ ,
2 a2 (ξ) 2a2 2 a2 (ξ)
and
 Z     Z 
1 x a1 (ξ) 1 d a1 1 x a1 (ξ)
y ′′ (x) = u′′ (x) exp − dξ − u(x) exp − dξ
2 a2 (ξ) 2 dx a2 2 a2 (ξ)
 Z x  2
 Z x 
a1 1 a1 (ξ) a 1 a1 (ξ)
− u′ (x) exp − dξ + 12 u(x) exp − dξ .
a2 2 a2 (ξ) 4a2 2 a2 (ξ)
26 Advanced Engineering Mathematics with MATLAB

Substituting y(x), y ′ (x), and y ′′ (x) into the original ordinary differential equa-
tion yields the final answer.

Section 2.1

1. The characteristic equation is m2 +6m+5 = (m+1)(m+5) = 0. Therefore,


the general solution is y(x) = C1 e−x + C2 e−5x .

2. The characteristic equation is m2 − 6m + 10 = (m − 3 + i)(m − 3 − i) = 0.


Therefore, the general solution is y(x) = C1 e3x cos(x) + C2 e3x sin(x).

3. The characteristic equation is m2 − 2m + 1 = (m − 1)2 = 0. Therefore, the


general solution is y(x) = C1 ex + C2 xex .

4. The characteristic equation is m2 −3m+2 = (m−1)(m−2) = 0. Therefore,


the general solution is y(x) = C1 e2x + C2 ex .

5. The characteristic equation is m2 − 4m + 8 = (m − 2)2 + 4 = 0. Therefore,


the general solution is y(x) = C1 e2x cos(2x) + C2 e2x sin(2x).

6. The characteristic equation is m2 + 6m + 9 = (m + 3)2 = 0. Therefore, the


general solution is y(x) = C1 e−3x + C2 xe−3x .

7. The characteristic equation is m2 + 6m − 40 = (m + 10)(m − 4) = 0.


Therefore, the general solution is y(x) = C1 e−10x + C2 e4x .

8. The characteristic equation is m2 + 4m + 5 = (m + 2)2 + 1 = 0. Therefore,


the general solution is y(x) = C1 e−2x cos(x) + C2 e−2x sin(x).

9. The characteristic equation is m2 + 8m + 25 = (m + 4)2 + 9 = 0. Therefore,


the general solution is y(x) = e−4x [C1 cos(3x) + C2 sin(3x)].

10. The characteristic equation is 4m2 − 12m + 9 = (2m − 3)2 = 0. Therefore,


the general solution is y(x) = e3x/2 (C1 + C2 x).

11. The characteristic equation is m2 + 8m + 16 = (m + 4)2 = 0. Therefore,


the general solution is y(x) = C1 e−4x + C2 xe−4x .

12. The characteristic equation is m3 + 4m2 = m2 (m + 4) = 0. Therefore,


the general solution is y(x) = C1 + C2 x + C3 e−4x .

13. The characteristic equation is m4 + 4m2 = m2 (m2 + 4) = 0. Therefore,


the general solution is y(x) = C1 + C2 x + C3 cos(2x) + C4 sin(2x).

14. The characteristic equation is m4 + 2m3 + m2 = m2 (m + 1)2 = 0. There-


fore, the general solution is y(x) = C1 + C2 x + C3 e−x + C4 xe−x .
Worked Solutions 27
√ √
15. The characteristic equation is m3 +8 = (m−2)(m+1+ 3)(m+1− 3) =
0. Therefore, the general solution is
√ √
y(x) = C1 e2x + C2 e−x cos( 3 x) + C3 e−x sin( 3 x).

16. The characteristic equation is m4 − 3m3 + 3m2 − m = m(m − 1)3 = 0.


Therefore, the general solution is y(x) = C1 + (C2 + C3 x + C4 x2 )ex .

17. Taking the derivative of the integro-differential equation,


Z t
d2 y A A
= 2 e−(t−x)/τ y(x) dx − y(t),
dt2 2τ −∞ 2τ
or
d2 y 1 dy A
2
+ + y(t) = 0.
dt τ dt 2τ
Try the solution y(t) = Ce−λt/2 . Then
" 2 #
λ2 λ A 1 1 2A 1
− + = λ− + − 2 = 0.
4 2τ 2τ 4 τ τ τ

The roots to this equation are λ± = (1± 1 − 2Aτ )/τ . Therefore, the general
solution is
n h√ i h √ io
y(t) = e−t/(2τ ) A exp t 1 − 2Aτ /(2τ ) + B exp −t 1 − 2Aτ /(2τ ) .

Section 2.2

1. The homogeneous solution to the equation is x(t) = A cos(5t) + B sin(5t).


Immediately, we have that x(0) = A = 10. Because x′ (0) = 5B = −10, then
B = −2. Therefore, x(t) = 10 cos(5t)
√ − 2 sin(5t).
√ If we√write the solution
x(t) = C sin(5t + ϕ), then C = 100 + 4 = 104 = 2 26. On the other
hand, ϕ = tan−1 (10/ − 2) = tan−1 (−5) = 1.7682. Our choice of angle is
dictated√by A = C sin(ϕ) and B = C cos(ϕ). Therefore the final answer is
x(t) = 2 26 sin(5t + 1.7682).

2. The solution in this case is x(t) = A cos(3t/2+ϕ), and x′ (t) = −3A sin(3t/2
+ϕ)/2. Using the initial conditions,√x(0) = A cos(ϕ) = 2π, and x′ (0) =
−3A sin(ϕ)/2 = 3π. Therefore, A = 2 2 π, and ϕ = −π/4.

3. The solution in this case is x(t) = A cos(πt + ϕ), and x′ (t) = −Aπ sin(πt +

ϕ). Using
√ the initial conditions, x(0) = A cos(ϕ) = 1, and x (0) = −πA sin(ϕ)
/2 = 3π. Therefore, A = 2, and ϕ = −π/3.
28 Advanced Engineering Mathematics with MATLAB

4. The differential equation for this problem is 4x′′ + 100x = 0, where x(t)
is the displacement (given in m) and t is time (measured in seconds). The
auxiliary equation is then m2 + 25 = 0 or m = ±5i. Therefore, the general
solution is x(t) = A cos(5t) + B sin(5t). Since x(0) = 0, A = 0. Next,
x′ (t) = 5B cos(5t). Because x′ (0) = 5B = 5, B = 1. The final solution is
x(t) = 5 cos(5t).

5. From the information provided by the original weight, we have that M g =


kL. Therefore, the differential equation is m d2 x/dt2 = −M gx/L. Let ω 2 =
M g/mL. Then the problem can be written x′′ + ω 2 x = 0, x(0) = s0 , x′ (0) =
v0 . The general solution is x(t) = A cos(ωt) + B sin(ωt). From the x(0) initial
condition, A = s0 . From the x′ (0) initial condition, ωB = v0 . Therefore,
the final answer is x(t) = s0 cos(ωt) + v0 sin(ωt)/ω, and v(t) = v0 cos(ωt) −
ωs0 sin(ωt).

6. If x(t) denotes the distance from the origin,√the differential


√ equation is
′′ t k/m −t k/m
mx − kx = 0. Its general solution is x(t) = Ae + Be , where k
is the constant of proportionality.
Because x(0) = a, we have that x(0) = a = A + B. Next, we compute
x′ (t) or
√  √ √  √
x′ (t) = k A et k/m − B e−t k/m / m.
√ √ √ √
Therefore, x′ (0) = a k = k(A − B)/ m, or A − B = a m. Solving for A
and B, the final solution is
ah √ √ √ √ i
x(t) = (1 + m )et k/m + (1 − m )e−t k/m .
2

Section 2.3

1. The differential equation is 12 x′′ + 3x′ + 4x = 0, which has the characteristic


polynomial m2 + 6m + 8 = (m + 4)(m + 2) = 0. The general solution is
x(t) = Ae−2t +Be−4t . Because x(0) = A+B = 2, and x′ (0) = −2A−4B = 0,
A = −2B or B = −2 and A = 4. Therefore, the final answer is x(t) =
4e−2t − 2e−4t .

2. The differential equation is x′′ + 10x′ + 125x = 0, which has the char-
acteristic polynomial m2 + 10m + 125 = (m + 5)2 + 100 = 0. The gen-
eral solution is x(t) = e−5t [A cos(10t) + B sin(10t)]. Because x(0) = A =
3 and x′ (0) = −5A + 10B = 25 or B = 4, the final answer is x(t) =
e−5t [3 cos(10t) + 4 sin(10t)].

3. The differential equation is 4x′′ + 20x′ + 169x = 0, which has the character-
2
istic polynomial 4m2 + 20m + 169 = m + 21 + 36 = 0. The general solution
Worked Solutions 29

is x(t) = e−5t/2 [A cos(6t) + B sin(6t)]. Because x(0) = A = 4 and 6B = 16 +


10 = 26 or B = 13/3, the final answer is x(t) = e−5t/2 4 cos(6t) + 13
3 sin(6t) .

4. The amplitude of the oscillations√decays by 50% by the time t = ln(2)/λ.


The period of one oscillation is 2π/ ω 2 − λ2 . Therefore, the minimum num-
ber of oscillations beforepthe amplitude decays 50% is the first integer equal
to or greater than ln(2) 1 − (λ/ω)2 /(2πλ/ω).

5. The characteristic polynomial is m2 + cm + 4 = 0. The roots are equal


when c = 4 when m = −2.
2
6. The characteristic polynomial is m2 + 14 cm+ 94 = m + 81 c + 49 − 64
1 2
c = 0.
Therefore, we are overdamped when c > 12, underdamped when c < 12, and
critically damped when c = 12.

7. For an overdamped system, x(t) = C1 er1 t +C2 er2 t , r1,2 = (−c± c2 − 4km)
/(2m) with c2 > 4km.
Let us find the value of t at which x(t) = 0. This occurs when (r1 − r2 )t −
ln(−C2 /C1 ). If C2 /C1 > 0, there is no solution. If C2 /C1 < 0, there is only
one solution if r1 > r2 . If r1 < r2 , there is no crossing.

Section 2.4

′′ ′
1. To find the homogeneous solution, we solve yH + 4yH + 3yH = 0. Its
−3x −x
solution is yH (x) = Ae + Be . For the particular solution, we guess
yp (x) = Cx + D, so that yp (x) = C, and yp′′ (x) = 0. Substitution into the
differential equation yields 4C + 3Cx + 3D = x + 1, and C = 31 and D = − 91 .
The general solution is therefore y(x) = Ae−3x + Be−x + 31 x − 91 .

′′
2. To find the homogeneous solution, we solve yH − yH = 0. Its solution is
yH (x) = Ae + Be . For the particular solution, we guess yp (x) = Cxex +
x −x

De−2x , yielding yp′ (x) = Cex + Cxex − 2De−2x , and yp′′ (x) = 2Cex + Cxex +
4De−2x . Substitution into the differential equation gives 2Cex + 3De−2x =
ex − 2e−2x , or C = 21 and D = − 32 . The general solution is therefore y(x) =
Aex + Be−x + 12 xex − 32 e−2x .

′′ ′
3. To find the homogeneous solution, we solve yH + 2yH + 2yH = 0. Its
−x
solution is yH (x) = e [A cos(x) + B sin(x)]. For the particular solution, we
guess yp (x) = Cx2 + Dx + E, yielding yp′ (x) = 2Cx + D, and yp′′ (x) = 2C.
Substitution into the differential equation gives 2C + 4Cx + 2D + 2Cx2 +
2Dx + 2E = 2x2 + 2x + 4, or C = 1, D = −1 and E = 2. The general solution
is therefore y(x) = e−x [A cos(x) + B sin(x)] + x2 − x + 2.

′′ ′
4. To find the homogeneous solution, we solve yH + yH = 0. Its solution is
yH (x) = A+Be . For the particular solution, we guess yp (x) = Cx3 +Dx2 +
−x
30 Advanced Engineering Mathematics with MATLAB

Ex, yielding yp′ (x) = 3Cx2 +2Dx+E and yp′′ (x) = 6Cx+2D. Substitution into
the differential equation gives 6Cx+2D+3Cx2 +2Dx+E = x2 +2x, or C = 31
and D = E = 0. The general solution is therefore y(x) = Ax + Be−x + 31 x3 .

′′ ′
5. To find the homogeneous solution, we solve yH + 2yH = 0. Its solution
−2x
is yH (x) = A + Be . For the particular solution, we guess yp (x) = Cx2 +
Dx + Exe−2x , yielding yp′ (x) = 2Cx + D + Ee−2x − 2Exe−2x , and yp′′ (x) =
2C + 4Exe−2x − 4Ee−2x . Substitution into the differential equation gives
4Cx + 2C + 2D + 2Ee−2x = 2x + 5 − e−2x , or C = 12 , D = 2, and E = 21 . The
general solution is therefore y(x) = A + Be−2x + 21 x2 + 2x + 12 e−2x .

′′ ′
6. To find the homogeneous solution, we solve yH −4yH +4yH = 0. Its solution
2x 2x
is yH (x) = Ae + Bxe . For the particular solution, we guess yp (x) =
Cx3 e2x + Dx2 e2x , yielding yp′ (x) = 3Cx2 e2x + 2Cx3 e2x + 2Dxe2x + 2Dx2 e2x ,
and yp′′ (x) = 6Cxe2x + 12Cx2 e2x + 4Cx3 e2x + 2De2x + 8Dxe2x + 4Dx2 e2x .
Substitution into the differential equation gives 6Cxe2x + 2De2x = xe2x + e2x ,
or C = 16 and  D = 21 . The general solution is therefore y(x) = Ae2x +Bxe2x +
1 2 1 3 2x
2x + 6x e .

′′ ′
7. To find the homogeneous solution, we solve yH + 4yH + 4yH = 0. Its
−2x
solution is yH (x) = (A + Bx)e . For the particular solution, we guess
yp (x) = Cex + Dxex , yielding yp′ (x) = Cex + Dex + Dxex , and yp′′ (x) =
Cex + 2Dex + Dxex . Substitution into the differential equation gives (9C +
2
6D)ex + 9Dxex = xex , or C = − 27 and D = 19 . The general solution is
−2x 1 2
therefore y(x) = (A + Bx)e + 9 x − 27 ex .

′′
8. To find the homogeneous solution, we solve yH − 4yH = 0. Its solu-
tion is yH (x) = A cosh(2x) + B sinh(2x). For the particular solution, we
guess yp (x) = Cx cosh(2x) + Dx sinh(2x), yielding yp′ (x) = C cosh(2x) +
D sinh(2x) + 2Cx sinh(2x) + 2Dx cosh(2x), and yp′′ (x) = 4C sinh(2x) + 4D
cosh(2x) + 4Cx cosh(2x) + 4Dx sinh(2x). Substitution into the differential
equation gives yp′′ − 4yp = 4C sinh(2x) + 4D cosh(2x) = 4 sinh(2x), or D = 0
and C = 1. The general solution is therefore y(x) = A cosh(2x)+B sinh(2x)+
x cosh(2x).

′′
9. To find the homogeneous solution, we solve yH + 9yH = 0. Its solution is
yH (x) = A cos(3x) + B sin(3x). For the particular solution, we guess yp (x) =
Cx2 cos(3x) + Dx2 sin(3x) + Ex cos(3x) + F x sin(3x), yielding yp′ (x) = (2Cx +
3Dx2 + E + 3F x) cos(3x) + (2Dx − 3Cx2 + F − 3Ex) sin(3x), and yp′′ (x) =
(2C − 9Cx2 − 9Ex + 12Dx + 6F ) cos(3x) + (2D − 9Dx2 − 12Cx − 6E −
9F x) sin(3x). Substitution into the differential equation gives yp′′ +9yp = (2C+
12Dx + 6F ) cos(3x) + (2D − 12Cx − 6E) sin(3x) = x cos(3x), or 2C + 6F = 0,
2D − 6E = 0, −12C = 0, and 12D = 1. The general solution is therefore
1 2 1
y(x) = A cos(3x) + B sin(3x) + 12 x sin(3x) + 36 x cos(3x).
Worked Solutions 31

′′
10. To find the homogeneous solution, we solve yH + yH = 0. Its solution is
yH (x) = A cos(x) + B sin(x). For the particular solution, we guess yp (x) =
Cx2 cos(x)+Dx2 sin(x)+Ex cos(x)+F x sin(x), yielding yp′ (x) = (2Cx+Dx2 +
E + F x) cos(x) + (2Dx − Cx2 + F − Ex) sin(x), and yp′′ (x) = (2C − Cx2 −
Ex + 4Dx + 2F ) cos(x) + (2D − Dx2 − 4Cx − 2E − F x) sin(x). Substitution
into the differential equation gives yp′′ + 9yp = (2C + 4Dx + 2F ) cos(x) + (2D −
4Cx − 2E) sin(x) = sin(x) + x cos(x), or 2C + 2F = 0, 2D − 2E = 1, −4C = 0,
and
 24D = 1. The general  solution is therefore y(x) = A cos(x) + B sin(x) +
1
4 x sin(x) − x cos(x) .

11. Using the method of undetermined coefficients, the homogeneous differ-


′′
ential equation is yH + 2ayH = 0. Its solution is yH (x) = A + Be−2ax . For the
particular solution, we guess yp (x) = Cx + D sin(2ωx) + E cos(2ωx), yielding
yp′ (x) = C + 2ωD cos(2ωx) − 2ωE sin(2ωx), and yp′′ (x) = −4ω 2 D sin(2ωx) −
4ω 2 E cos(2ωx). The trick here is to recognize that the differential equation
can be rewritten as y ′′ + 2ay = 12 [1 − cos(2ωx)]. The form of the par-
ticular solution follows directly. Substitution
 into the differential
 equation
gives yp′′ + 2ayp′ = 2aC − 4 aωE + ω 2 D sin(2ωx) + 4 aωD − ω 2 E cos(2ωx).
Matching up terms, we find that

1 a 1
C= , aE = −ωD, D=− and E= .
4a 8ω(ω 2 + a2 ) 8(ω 2 + a2 )

Therefore, the general solution is

x ω cos(2ωx) − a sin(2ωx)
y(x) = A + Be−2ax + + .
4a 8ω(a2 + ω 2 )

To find A and B, we use the initial conditions:

1 1 a
y(0) = A + B + = 0, and y ′ (0) = −2aB + − = 0.
8(a2 + ω 2 ) 4a 4(a2 + ω 2 )

Solving for A and B, A = −1/(8a2 ) and B = ω 2 /[8a2 (a2 + ω 2 )]. Therefore,


the complete solution is

2ax − 1 ω 2 e−2ax a sin(2ωx) − ω cos(2ωx)


y(x) = + − .
8a2 8a2 (a2 + ω 2 ) 8ω(a2 + ω 2 )

Turning to the integration technique, we begin by noting that


Z x Z x Z x
′′ ′ 1
y dξ + 2a y dξ = 2 [1 − cos(2ωξ)] dξ,
0 0 0

or
x sin(2ax)
y ′ (x) − y ′ (0) + 2a[y(x) − y(0)] = − .
2 4a
32 Advanced Engineering Mathematics with MATLAB

Substituting the initial conditions yields

x sin(2ax)
y ′ + 2ay = − .
2 4a

Since this differential equation is already in canonical form, P (x) = 2a, and
µ(x) = e2ax . Multiplying by the integrating factor, we have that

d  2ax  x sin(2ωx) 2ax


e y(x) = e2ax − e .
dx 2 4ω

Integrating both sides of this equation,


Z x Z x
2ax 2aξ 1
e y(x) − y(0) = 1
2 ξe dξ − sin(2ωξ)e2aξ dξ
0 4ω 0

or
x x
e2aξ e2aξ
e2ax y(x) = (2aξ − 1) − [a sin(2ωξ) − ω cos(2ωξ)] .
8a2 0 8ω(a2 + ω 2 ) 0

Solving for y(x),

2ax − 1 ω 2 e−2ax a sin(2ωx) − ω cos(2ωx)


y(x) = + − .
8a2 8a2 (a2 + ω 2 ) 8ω(a2 + ω 2 )

Section 2.5

1. Because the characteristic polynomial is m2 + 6m + 18 = (m + 3)2 + 9 = 0,


the homogeneous solution is yH (t) = e−3t [A cos(3t) + B sin(3t)]. Therefore,
resonance will occur when γ = 3.

2. Because the characteristic polynomial is m2 + 2m + 2 = (m + 1)2 + 1 = 0,


the homogeneous solution is xH (t) = e−t [A cos(t) + B sin(t)]. For the par-
ticular solution we guess xp (t) = C cos(2t) + D sin(2t) along with x′p (t) =
−2C sin(2t) + 2D cos(2t), and x′′p (t) = −4C cos(2t) − 4D sin(2t). Substitu-
tion into the differential equation yields two linear equations for C and D:
−2C + 4D = 0, −2D − 4C = 10, or C = −2 and D = −1. Therefore, the
general solution is x(t) = e−t [A cos(t) + B sin(t)] − 2 cos(2t) − sin(2t) along
with x′ (t) = −e−t [A cos(t) + B sin(t)]+e−t [−A sin(t) + B cos(t)]+4 sin(2t)−
2 cos(2t). Substituting the initial conditions, x′ (0) = −A + B − 2 = 0, x(0) =
A − 2 = x0 . Solving these equations and substituting back into the general
solution yields the final answer x(t) = e−t [(2 + x0 ) cos(t) + (4 + x0 ) sin(t)] −
2 cos(2t) − sin(2t).
Worked Solutions 33

3. If x is taken as positive in the downward directions,

d2 x X
m = forces = mg − kx,
dt2
or
d2 x
m + kx = mg.
dt2
Because the system is initially at rest and the coordinate system is chosen so
that x(0) = 0, x(0) = x′ (0) = 0.
The general solution to this differential equation is x(t) = A cos(ωt) +
B sin(ωt) + mg/k, where ω 2 = k/m. Since x′ (0) = 0, B = 0. Because
x(0) = 0, A = −mg/k. Therfore, x(t) = mg[1 − cos(ωt)]/k.

4. Starting with the differential equation


Z
dI 1
L + I dt = E0 [1 − cos(ωt)],
dt C
we take its derivative with respect to time and obtain

d2 I I
L 2
+ = ωE0 sin(ωt).
dt C
The general solution is

ωE0 sin(ωt)
I(t) = A sin(ω1 t + θ) − ,
Lω 2 − 1/C

where ω1 = 1/ LC. The initial condition I(0) = 0 yields θ = 0. On the
other hand, the initial condition I ′ (0) = 0 gives A = ω1 ω 2 E0 /(Lω 2 − 1/C).
Therefore, the final solution is

ω 1 ω 2 E0 ωE0 sin(ωt)
I(t) = sin(ω1 t) − .
Lω 2 − 1/C Lω 2 − 1/C

5. Because the characteristic polynomial is mp2 +cp+k = 0 or [p+c/(2m)]2 +


ω02 = 0, ω02 = k/m − c2 /(4m2 ), the homogeneous solution is xH (t) = e−ct/(2m)
[A cos(ω0 t) + B sin(ω0 t)]. The particular solution is xp (t) = C sin(ωt − ϕ) =
C cos(ϕ) sin(ωt) − C sin(ϕ) cos(ωt), along with x′p (t) = Cω cos(ϕ) cos(ωt) +
Cω sin(ϕ) sin(ωt), and x′′p (t) = −Cω 2 cos(ϕ) sin(ωt) + Cω 2 sin(ϕ) cos(ωt).
Substituting into the differential equation, we obtain the following system of
linear equations: cωC sin(ϕ)+(k −mω 2 )C cos(ϕ) = F0 , and cωC cos(ϕ)−(k −
mω 2 )C sin(ϕ) = 0. The second equation immediately yields the relationship
tan(ϕ) = cω/(k − mω 2 ). Solving for C, we find that
p
C = F0 / c2 ω 2 + (k − mω 2 )2 .
34 Advanced Engineering Mathematics with MATLAB

Therefore, the general solution is

F0 sin(ωt − ϕ)
x(t) = e−ct/(2m) [A cos(ω0 t) + B sin(ω0 t)] + p .
c2 ω 2 + (k − mω 2 )2

2 2
6.
 The characteristic polynomial 2is m + Rm/L + 1/(LC) = [m + R/(2L)] +
1/(LC) − R /(4L ) = 0. If ω = 1/(LC) − R2 /(4L2 ) > 0, then Q(t) =
2 2

e−Rt/(2L) [A cos(ωt) + B sin(ωt)]. As t → ∞, Q(t) → 0.


If ω 2 = 0, then Q(t) = e−Rt/(2L) (A + Bt). Again, as t → ∞, Q(t) → 0.
Finally, if ω 2 < 0, then Q(t) = Ae[Γ−R/(2L)]t + Be[−Γ−R/(2L)]t , where Γ2 =
−ω 2 and Γ > 0. Because Γ < R/(2L), Q(t) → 0 as t → ∞.

Section 2.6

′′
1. First we find the homogeneous solution to the differential equation yH −
′ x 3x
4yH + 3yH = 0. Its solution is yH (x) = Ae + Be . According to variation of
parameters, the particular solution is of the form yp (x) = u1 (x)ex + u2 (x)e3x .
Substitution into the differential equation yields the following system of equa-
tions ex u′1 (x) + e3x u′2 (x) = 0 and ex u′1 (x) + 3e3x u′2 (x) = e−x . Solving for
u′1 (x) and u′2 (x), u′1 (x) = − 12 e−2x or u1 (x) = 14 e−2x , and u′2 (x) = 21 e−4x or
u2 (x) = − 81 e−4x . The general solution is y(x) = Aex + Be3x + u1 (x)ex +
u2 (x)e3x = Aex + Be3x + 18 e−x .

′′
2. First we find the homogeneous solution to the differential equation yH −
′ 2x −x
yH − 2yH = 0. Its solution is yH (x) = Ae + Be . According to variation of
parameters, the particular solution is of the form yp (x) = u1 (x)e2x +u2 (x)e−x .
Substitution into the differential equation yields the following system of equa-
tions e2x u′1 (x) + e−x u′2 (x) = 0 and 2e2x u′1 (x) − e−x u′2 (x) = x. Solving
for u′1 (x) and u′2 (x), u′1 (x) = 13 xe−2x or u1 (x) = − 121
(2x + 1)e−2x , and
′ 1 x 1 x
u2 (x) = − 3 xe or u2 (x) = − 3 (x − 1)e . The general solution is y(x) =
Ae2x + Be−x + u1 (x)e2x + u2 (x)e−x = Aex + Be3x − 21 x + 14 .

′′
3. First we find the homogeneous solution to the differential equation yH −
2x −2x
4yH = 0. Its solution is yH (x) = Ae + Be . According to variation of pa-
rameters, the particular solution is of the form yp (x) = u1 (x)e2x + u2 (x)e−2x .
Substitution into the differential equation yields the following system of equa-
tions e2x u′1 (x) + e−2x u′2 (x) = 0 and 2e2x u′1 (x) − 2e−2x u′2 (x) = xex . Solv-
ing for u′1 (x) and u′2 (x), u′1 (x) = 14 xe−x or u1 (x) = − 41 (x + 1)e−x , and
u′2 (x) = − 14 xe3x or u2 (x) = − 36
1
(3x − 1)e3x . The general solution is y(x) =
2x −2x
Ae + Be + u1 (x)e + u2 (x)e−2x = Ae2x + Be−2x − (3x + 2)ex /9.
2x

′′
4. First we find the homogeneous solution to the differential equation yH +

9yH = 0. Its solution is yH (x) = A cos(3x)+B sin(3x). According to variation
Worked Solutions 35

of parameters, the particular solution is of the form yp (x) = u1 (x) cos(3x) +


u2 (x) sin(3x). Substitution into the differential equation yields the following
system of equations cos(3x)u′1 (x) + sin(3x)u′2 (x) = 0 and −3 sin(3x)u′1 (x) +
3 cos(3x)u′2 (x) = 2 sec(3x). Solving for u′1 (x) and u′2 (x), u′2 (x) = 32 or u2 (x) =
2x/3. Then u′1 (x) = − 32 cos(3x)
sin(3x)
or u1 (x) = 29 ln | cos(3x)|. The final answer is
y(x) = A cos(3x) + B sin(3x) + 92 ln | cos(3x)| cos(3x) + 32 x sin(3x).
′′
5. First we find the homogeneous solution to the differential equation yH +
′ −2x −2x
4yH + 4yH = 0. Its solution is yH (x) = Ae + Bxe . According
to variation of parameters, the particular solution is of the form yp (x) =
u1 (x)e−2x + u2 (x)xe−2x . Substitution into the differential equation yields the
following system of equations e−2x u′1 (x)+xe−2x u′2 (x) = 0 and −2e−2x u′1 (x)+
(1 − 2x)e−2x u′2 (x) = xe−2x . Solving for u′1 (x) and u′2 (x), u′1 (x) = −x2 , or
u1 (x) = − 31 x3 , and u′2 (x) = x or u2 (x) = 12 x2 . The general solution is
y(x) = (A + Bx)e−2x + u1 (x)e−2x + u2 (x)xe−2x = (A + Bx)e−2x + 16 x3 e−2x .
′′
6. First we find the homogeneous solution to the differential equation yH +
′ ′ −2ax
2ayH = 0. Its solution is yH (x) = A + Bxe . According to variation of
parameters, the particular solution is of the form yp (x) = u1 (x) + u2 (x)e−2ax .
Substitution into the differential equation yields the following system of equa-
tions u′1 (x) + e−2ax u′2 (x) = 0, and −2ae−2ax u′2 = sin2 (ωx). Solving for u′1 (x)
and u′2 (x),
e2ax
u′2 (x) = − [1 − cos(2ωx)] ,
4a
or
e2ax e2ax
u2 (x) = − 2 + [a cos(2ωx) + ω sin(2ωx)] .
8a 8a(a2 + ω 2 )
Then
1 − cos(2ωx) x sin(2ωx)
u′1 (x) = , or u1 (x) = − .
4a 4a 4aω
Therefore,

x sin(2ωx) 1 a cos(2ωx) + ω sin(2ωx)


y(x) = A′ + Bxe−2ax + − − 2+
4a 8aω 8a 8a(a2 + ω 2 )
x a sin(2ωx) − ω cos(2ωx)
= A + Bxe−2ax + − .
4a 8ω(a2 + ω 2 )

′′
7. First we find the homogeneous solution to the differential equation yH −
′ 2x 2x
4yH + 4yH = 0. Its solution is yH (x) = Ae + Bxe . According to varia-
tion of parameters, the particular solution is of the form yp (x) = u1 (x)e2x +
u2 (x)xe2x . Substitution into the differential equation yields the following sys-
tem of equations e2x u′1 (x)+xe2x u′2 (x) = 0, and 2e2x u′1 (x)+(2x+1)e2x u′2 (x) =
36 Advanced Engineering Mathematics with MATLAB

(x + 1)e2x . Solving for u′1 (x) and u′2 (x), u′1 (x) = −x − x2 or u1 (x) =
− 21 x2 − 13 x3 , and u′2 (x) = 1 + x or u2 (x) = x + 21 x2 . The general solution
 is
y(x) = Ae2x +Bxe2x +u1 (x)e2x +u2 (x)xe2x = Ae2x +Bxe2x + 21 x2 + 16 x3 e2x .
′′
8. First we find the homogeneous solution to the differential equation yH −
x −x
4yH = 0. Its solution is yH (x) = Ae + Be . According to variation
of parameters, the particular solution is of the form yp (x) = u1 (x)ex +
u2 (x)e−x . Substitution into the differential equation yields the following
system of equations ex u′1 (x) + e−x u′2 (x) = 0, and ex u′1 (x) − e−x u′2 (x) =
sin2 (x). Solving for u′1 (x) and u′2 (x), u′1 (x) = 12 e−x sin2 (x), or u1 (x) =
− 10 e [2 + sin(x) + 2 cos(x)], and u′2 (x) = − 21 ex sin2 (x), or u2 (x) = − 10
1 −x 1 x
e
x −x x
[2 + sin(x) − 2 cos(x)]. The general
 solution
 is y(x) = Ae +Be +u 1 (x)e +
u2 (x)e−x = Aex + Be−x − 51 2 + sin2 (x) .
′′
9. First we find the homogeneous solution to the differential equation yH −

2yH + yH = 0. Its solution is yH (x) = Aex + Cxex . According to variation of
parameters, the particular solution is of the form yp (x) = u1 (x)ex + u2 (x)xex .
Substitution into the differential equation yields the following system of equa-
tions ex u′1 (x) + xex u′2 (x) = 0 and ex u′1 (x) + (ex + xex )u′2 (x) = ex /x. Solving
for u′1 (x) and u′2 (x), u′1 (x) = −1, or u1 (x) = −x, and u′2 (x) = 1/x, or u2 (x) =
ln(x). The general solution is y(x) = Aex + Cxex + u1 (x)ex + u2 (x)xex =
Aex + Bxex + x ln(x)ex .
′′
10. First we find the homogeneous solution to the differential equation yH +
yH = 0. Its solution is yH (x) = A cos(x) + B sin(x). According to variation of
parameters, the particular solution is of the form yp (x) = u1 (x) cos(x) +
u2 (x) sin(x). Substitution into the differential equation yields the follow-
ing system of equations cos(x)u′1 (x) + sin(x)u′2 (x) = 0, and − sin(x)u′1 (x) +
cos(x)u′2 (x) = tan(x). Solving for u′1 (x) and u′2 (x), u′1 (x) = − sin2 (x)/ cos(x),
or u1 (x) = − ln|sec(x) + tan(x)| + sin(x), and u′2 (x) = sin(x), or u2 (x) =
− cos(x). The general solution is

y(x) = A cos(x) + B sin(x) + u1 (x) cos(x) + u2 (x) sin(x)


1 + sin(x)
= A cos(x) + B sin(x) − ln cos(x)
cos(x)
1 − sin(x)
= A cos(x) + B sin(x) + ln cos(x).
cos(x)

Section 2.7

1. The auxiliary equation is m(m−1)+m−1 = (m−1)(m+1) = 0. Therefore,


y(x) = C1 x + C2 x−1 .

2. The auxiliary equation is m(m − 1) + 2m − 2 = (m − 1)(m + 2) = 0.


Therefore, y(x) = C1 x + C2 x−2 .
Worked Solutions 37

3. The auxiliary equation is m(m − 1) − 2 = (m − 2)(m + 1) = 0. Therefore,


y(x) = C1 x2 + C2 x−1 .

4. The auxiliary equation is m(m − 1) − m + 1 = (m − 1)2 = 0. Therefore,


y(x) = C1 x + C2 x ln(x).

5. The auxiliary equation is m(m − 1) + 3m + 1 = (m + 1)2 = 0. Therefore,


y(x) = C1 x−1 + C2 x−1 ln(x).

6. The auxiliary equation is m(m − 1) − 3m + 4 = (m − 2)2 = 0. Therefore,


y(x) = C1 x2 + C2 x2 ln(x).

7. The auxiliary equation is m(m − 1) − m + 5 = (m − 1)2 + 4 = 0 so that


m = −1 ± 2i. Therefore, y(x) = C1 x cos[2 ln(x)] + C2 x sin[ln(x)].

8. The auxiliary equation is 4m(m − 1) + 8m + 5 = (2m + 1)2 + 4 = 0 so that


m = − 21 ± i. Therefore, y(x) = C1 x−1/2 cos[ln(x)] + C2 x−1/2 sin[ln(x)].

9. The auxiliary equation is m(m − 1) + m + 1 = m2 + 1 = 0 so that m = ±i.


Therefore, y(x) = C1 cos[ln(x)] + C2 sin[ln(x)].

10. The auxiliary equation is m(m − 1) − 3m + 13 = (m − 2)2 + 9 = 0 so that


m = 2 ± 3i. Therefore, y(x) = C1 x2 cos[3 ln(x)] + C2 x2 sin[3 ln(x)].

11. The auxiliary equation is m(m − 1)(m − 2) − 2m(m − 1) − 2m + 8 =


m3 − 5m2 + 2m + 8 = (m − 2)(m − 4)(m + 1) = 0. Therefore, y(x) =
C1 x2 + C2 x4 + C3 x−1 .

12. Let t = ln(x) and y(x) = Y (t), then Y ′′ − 3Y ′ − 4Y = et . The homoge-


neous solution is YH (t) = Ae4t + Be−t . From the method of undetermined
coefficients, Yp (t) = − 16 et . Transforming back, y(x) = Ax4 + B/x − x/6.

Section 2.8

1. The solution to the differential equation is x(t) = C1 et + C2 e2t . Therefore,


any point on the phase diagram except for x = v = 0 has a trajectory off to
infinity.

2. Multiplying the differential equation by x′ and setting v = x′ on the left


side, vv ′ = x3 x′ − xx′ . Integration yields 21 v 2 − 14 x4 + 21 x2 = C. If C = 0,
x = v = 0 and we have a equilibrium point where the energy is at a minimum.
If C = 41 , we have another equilibrium point corresponding to x = ±1 and
v = 0. Note that C ≤ 14 .

3. The curves on the phase diagram are given by v = 2x + C. The equilib-


rium points are v = 0 for all x. Therefore the entire abscissa contain all of
38 Advanced Engineering Mathematics with MATLAB

the equilibra. Any displacement from this equilibrium moves off to infinity.
Therefore, the equilibrium is unstable.

4. The curves on the phase diagram are given by v 2 + sgn(x)x2 = C. The


equilibrium points are v = 0 and v ′ = −sgn(x)x = 0. Therefore, the point
(0, 0) is the equibrium point. Any displacement from this equilibrium moves
off to infinity. Therefore, the equilbrium is unstable.

5. The curves on the phase diagram are given by v 2 − x = C if |x| > 2 and
v = C if |x| < 2. The equilibrium points are v = 0 and |x| < 2. Therefore,
there are infinite number of equilibrium points, all located along the x-axis
for |x| < 2. Any displacement from these equilbria moves off to infinity and
all of the equilibria are unstable.

Section 2.9

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Pendulum Problem
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% initialize parameters

clear; b = 0.22; g = 9.8; k = 0.02; L = 1; omega 0 sq = g/L;


omega sq = omega 0 sq - b*b/4; omega = sqrt(omega sq);
delta t = 0.005; t = [0:delta t:50]; % set up the time
theta(1) = 10*pi/180; thetap(1) = 0; % initial conditions

% time step to find position and velocity


% of the pendulum at later times

for i = 1:length(t)-1
theta g = theta(i) + delta t*thetap(i);
thetap g = thetap(i) - b*delta t*thetap(i) ...
- omega 0 sq*delta t*theta(i);
avg 1 = (theta(i) + theta g) / 2;
avg 2 = (thetap(i) + thetap g) / 2;
theta(i+1) = theta(i) + delta t*avg 2;
thetap(i+1) = thetap(i) - b*delta t*avg 2 ...
- omega 0 sq*delta t*avg 1;
if ((abs(theta(i)) < delta t/2) & (thetap(i) > 0))
thetap(i+1) = thetap(i+1) + k; end % impulse forcing
end
Worked Solutions 39

% plot the results

plot(theta,thetap,’k’); xlabel(’\theta’,’FontSize’,25);
ylabel(’\theta^\prime’,’FontSize’,25)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 3.1

1.  
4 5
A+B = =B+A
3 4

2.     
3 4 1 1 2 3
A−B = − =
1 2 2 2 −1 0
     
1 1 3 4 −2 −3
B−A= − =
2 2 1 2 1 0

3.      
9 12 2 2 7 10
3A − 2B = − =
3 6 4 4 −1 2
       
6 8 1 1 5 7 15 21
3(2A − B) = 3 − =3 =
2 4 2 2 0 2 0 6

4.      
3 1 1 2 1 1
AT = , BT = , (B T )T =
4 2 1 2 2 2

5. T  
4 5T 4 3
(A + B) = =
3 4 5 4
     
3 1 1 2 4 3
AT + B T = + =
4 2 1 2 5 4

6.      
1 1 1 2 2 3
B + BT = + =
2 1 2 2 3 4
     
1 1 1 2 0 −1
B − BT = − =
2 2 1 2 1 0
40 Advanced Engineering Mathematics with MATLAB

7. 
   
3 4 1 1 11 11
AB = =
1 2 2 2 5 5
    
3 1 1 1 5 5
AT B = =
4 2 2 2 8 8
    
1 1 3 4 4 6
BA = =
2 2 1 2 8 12
    
1 2 3 4 5 8
BT A = =
1 2 1 2 5 8

8.    

2 3 4 3 4 13 20
A = =
1 2 1 2 5 8
    
1 1 1 1 3 3
B2 = =
2 2 2 2 6 6

9.     
T 1 1 1 2 2 4
BB = =
2 2 1 2 4 8
    
T 1 2 1 1 5 5
B B= =
1 2 2 2 5 5

10.
       
2 13 20 9 12 1 0 5 8
A − 3A + I = − + =
5 8 3 6 0 1 2 3

11.      
3 59 92 6 8 65 100
A + 2A = + =
23 36 2 4 25 40

12.
       
4 2 269 420 52 80 2 0 219 340
A − 4A + 2I = − + =
105 164 20 32 0 2 85 134

 
  11 8
27 11  8
13. yes 14. no 15. yes 4
2 5
5 3
Worked Solutions 41
 
10 24 54
16. yes 17. no
3 7 16

18.
       
4 4 3 3 7 7 1 1
4A + 3A =  4 8 + 3 6 =  7 14  = 7  1 2  = 7A.
12 4 9 3 21 7 3 1

19.  
   
2 2 10 10 1 1
5(2A) = 5  2 4  =  10 20  = 10  1 2  = 10A.
6 2 30 10 3 1

20.  
 T 1 1
1 1 3
(AT )T = = 1 2 = A
1 2 1
3 1

21.      
3 −1 1 1 4 0
(A + B) + C = + =
7 1 1 1 8 2
     
2 1 2 −1 4 0
A + (B + C) = + =
3 1 5 1 8 2

22.    
6 −4 1 1 2 2
(AB)C = =
7 −6 1 1 1 1
    
2 1 −1 −1 2 2
A(BC) = =
3 1 4 4 1 1

23.     
2
2 −1 1 9 −1
A(B + C) = =
3
5 1 1 11 −2
     
6 −4 3 3 9 −1
AB + AC = + =
7 −6 4 4 11 −2

24.    
3 −1 1 1 2 2
(A + B)C = =
7 1 1 1 8 8
     
3 3 −1 −1 2 2
AC + BC = + =
4 4 4 4 8 8
42 Advanced Engineering Mathematics with MATLAB

25.     
3 −1 2 1 1 0
=
−5 2 5 3 0 1

26.     
0 1 0 0 1 0 1 0 0
1 0 01 0 0 = 0 1 0
0 0 1 0 0 1 0 0 1

27.     
1 −2 x1 5
=
3 1 x2 1

28.     
2 1 4 x1 2
 4 2 5   x2  =  6 
6 −3 5 x3 2

29.     
0 1 2 3 x1 2
3 0 −4 −4   x2   5 
   =  
1 1 1 1 x3 −3
2 −3 1 −3 x4 7

Section 3.2

1.
3 5
= −3 + 10 = 7
−2 −1

2.
5 −1
= 20 − 8 = 12
−8 4

3.
3 1 2 0 −11 −13
−11 −13
2 4 5 = 0 −4 −5 = = 55 − 54 = 1
−4 −5
1 4 5 1 4 5

4.
4 3 0 4 3 0
4 3
3 2 2 = 3 2 2 = −2 = 50
11 2
5 −2 −4 11 2 0
Worked Solutions 43

5.
1 3 2 −5 0 −7
−5 −7
4 1 1 = 2 0 −2 = − = −24
2 −2
2 1 3 2 1 3

6.
2 −1 2 2 −1 2
7 9 7 9
1 3 3 = 7 0 9 = = = −7
7 8 0 −1
5 1 6 7 0 8

7.
2 0 0 1 2 0 0 1
0 1 0
0 1 0 0 0 1 0 0
= =− 1 6 1
1 6 1 0 1 6 1 0
−5 1 −2
1 1 −2 3 −5 1 −2 0
1 1
= =3
−5 −2

8.
2 1 2 1 2 1 2 1
−1 −2 −2
3 0 2 2 −1 −2 −2 0
= = − −3 1 −3
−1 2 −1 1 −3 1 −3 0
−5 1 1
−3 2 3 1 −5 1 1 0
−1 0 0
7 3
= − −3 7 3 = = 44
11 11
−5 11 11

9.

1 1 1 1 1 1 1 1
a b c d 0 b−a c−a d−a
=
a2 b2 c2 d2 0 b(b − a) c(c − a) d(d − a)
a3 b3 c3 d 3
0 b2 (b − a) c2 (c − a) d2 (d − a)
1 1 1
= (b − a)(c − a)(d − a) b c d
b2 c 2 d 2
1 1 1
= (b − a)(c − a)(d − a) 0 c−b d−b
0 c(c − b) d(d − b)
1 1
= (b − a)(c − a)(d − a)(c − b)(d − b)
c d
= (b − a)(c − a)(d − a)(c − b)(d − b)(d − c)
44 Advanced Engineering Mathematics with MATLAB

10.
a b+c 1 a b+c 1
b−a a−b
b a+c 1 = b−a a−b 0 =
c−a a−c
c a+b 1 c−a a−c 0
b−a b−a
=− =0
c−a c−a

11. Expand the determinant using the cofactor expansion along the row or
column that contains the zeros. Regardless of the value of the minors, the
sum will equal zero.

12. We form AT from A by rewriting the rows of A as columns of AT . Then the


cofactor expansion of |AT | by any row is identical with the cofactor expansion
by |A| by the corresponding column.

Section 3.3

1.
    
1 2 x1 3 1 2 3 2 1 3
= , = −5, = −9, = −3
3 1 x2 6 3 1 6 1 3 6

Therefore, x1 = 95 , x2 = 35 .

2.
    
2 1 x1 −3 2 1 −3 1 2 −3
= , = −3, = 2, =5
1 −1 x2 1 1 −1 1 −1 1 1

Therefore,
x1 = − 23 , x2 = − 53 .

3.     
1 2 −2 x1 4 1 2 −2
 2 1 1   x2  =  −2  , 2 1 1 = −6
−1 1 −1 x3 2 −1 1 −1
4 2 −2 1 4 −2 1 2 4
−2 1 1 = 0, 2 −2 1 = 0, 2 1 −2 = 12
2 1 −1 −1 2 −1 −1 1 2
Therefore, x1 = 0, x2 = 0, x3 = −2.

4.     
2 3 −1 x1 −1 2 3 −1
 −1 −2 1   x2  =  5  , −1 −2 1 =4
3 −1 0 x3 −2 3 −1 0
Worked Solutions 45

−1 3 −1 2 −1 −1 2 3 −1
5 −2 1 = 2, −1 5 1 = 14, −1 −2 5 = 50
−2 −1 0 3 −2 0 3 −1 −2
Therefore,
x1 = 21 , x2 = 72 , x3 = 25
2 .

Section 3.4

1.
        
2 1 x1 4 2 1 4 2 1 4
= ⇒ B= =
5 −2 x2 1 5 −2 1 0 1 2

Therefore, x2 = 2, x1 = 1.

2.
        
1 1 x1 0 1 1 0 1 1 0
= ⇒ B= =
3 −4 x2 1 3 −4 1 0 −7 1

Therefore,
x2 = − 17 , x1 = 71 .

3.     
−1 1 2 x1 0
 3 4 1   x2  =  0 
−1 1 2 x3 0
   
−1 1 2 0 −1 1 2 0
B= 3 4 1 0 =  0 1 1 0
−1 1 2 0 0 0 0 0
Therefore, x3 = α, x2 = −α, x1 = α.

4.     
6 14 x1 2
1 −4   x2  =  3 
2
−2 5 3 x3 8
     
4 6 1 2 4 6 1 2 4 6 1 2
B=2 1 −4 3  =  0 4 9 −4  =  0 4 9 −4 
3 −2 5 8 0 −7 22 7 0 0 1 0
Therefore,
x3 = 0, x2 = −1, x1 = 2.
46 Advanced Engineering Mathematics with MATLAB

5.     
31 −2 x1 −3
 1
−1 2   x2  =  −1 
−43 −6 x3 4
   
1 −1 2 −1 1 −1 2 −1
B= 3 1 −2 −3  =  0 1 −2 0 
−4 3 −6 4 0 1 −2 0
   
1 −1 2 −1 1 0 0 −1
=  0 1 −2 0  =  0 1 −2 0 
0 0 0 0 0 0 0 0
Therefore, x3 = α, x2 = 2α, x1 = −1.

6.     
1
−3 7 x1 2
 2
4 −3   x2  =  −1 
−3
7 2 x3 3
   
1 −3 7 2 1 −3 7 2
B= 2 4 −3 −1  =  0 10 −17 −5 
−3 7 2 3 0 −2 23 9
 
1 −3 7 2
=  0 2 −23 −9 
0 0 49 20
Therefore,
x3 = 0.408163, x2 = 0.193875, x1 = −0.275516.

7.     
1 −1 3 x1 5
2 −4 7   x2  =  7 
4 −9 2 x3 −15
   
1 −1 3 5 1 −1 3 5
B=2 −4 7 7  =  0 1 2 7 
4 −9 2 −15 0 −2 1 −3
   
1 −1 3 5 1 0 0 1
=0 1 2 7 =0 1 2 7 
0 0 5 11 0 0 5 11
Therefore, x3 = 2.2, x2 = 2.6, x1 = 1.

8.     
1 1 1 1 x1 −1
 2 −1 3 0   x2   1 
   =  
0 2 0 3 x3 15
−1 2 0 1 x4 −2
Worked Solutions 47
   
1 1 1 1 −1 1 1 1 1 −1
 2 −1 3 0 1  0 −3 1 −2 3 
B= = 
0 2 0 3 15 0 2 0 3 15
−1 2 0 1 −2 0 3 1 2 −3
   
1 1 1 1 −1 1 1 1 1 −1
 0 −1 1 1 18   0 −1 1 1 18 
= = 
0 0 −2 5 51 0 0 2 0 0
0 0 2 0 0 0 0 0 5 51
Therefore,
x4 = 10.2, x3 = 0, x2 = −7.8, x1 = −3.4

9.
    
−3 5 1 0 −1 6 1 1 −1 6 1 1
= =
2 1 0 1 2 1 0 1 0 13 2 3
   
−13 0 1 −5 1 0 −1/13 5/13
= =
0 13 2 3 0 1 2/13 3/13
Therefore,  
−1/13 5/13
A−1 = .
2/13 3/13

10.
     
3 −1 1 0 3 −1 1 0 1 0 2 1
= =
−5 2 0 1 −2 1 1 1 −2 1 1 1
 
1 0 2 1
=
0 1 5 3
Therefore,  
2 1
A−1 = .
5 3

11.
   
19 2 −9 1 0 0 −1 −3 1 1 5 0
 −4 −1 2 0 1 0  =  0 −1 0 0 1 −2 
−2 0 1 0 0 1 −2 0 1 0 0 1
 
−1 −3 1 1 5 0
=  0 −1 0 0 1 −2 
0 6 −1 −2 −10 1
 
−1 0 1 1 2 6
=  0 −1 0 0 1 −2 
0 0 −1 −2 −4 −11
 
1 0 0 1 2 5
=0 1 0 0 −1 2 
0 0 1 2 4 11
48 Advanced Engineering Mathematics with MATLAB

Therefore,  
1 2 5
A−1 =  0 −1 2 .
2 4 11

12.    
1 2 5 1 0 0 1 2 5 1 0 0
 0 −1 2 0 1 0 =  0 −1 2 0 1 0
2 4 11 0 0 1 0 0 1 −2 0 1
 
1 0 9 1 2 0
=0 −1 2 0 1 0 
0 0 1 −2 0 1
 
1 0 0 19 2 −9
=0 1 0 −4 −1 2 
0 0 1 −2 0 1
Therefore,  
19 2 −9
A−1 =  −4 −1 2  .
−2 0 1

13. Yes, because A2 (A−1 )2 = A(AA−1 )A−1 = AA−1 = I.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Finite Fourier Series
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; M = 41; N = 20;

% set up t and f (t)


for m = 1:M
t(m) = -pi + (2*m-1)*pi/M;
if (t(m) <= 0) f(m) = 0; else; f(m) = t(m); end
end

AA = zeros(M,2*N+1); % initialize array of coefficients

for m = 1:M % set up the An and Bn coefficients


AA(m,1) = 0.5;
b (m) = f(m); % set up right side of matrix equations
for n = 1:N
AA(m,n+1) = cos(n*t(m));
Worked Solutions 49

AA(m,n+N+1) = sin(n*t(m));
end
end

% solve the set of linear equations


x = linsolve(AA,transpose(b));

n = 0; [ n pi/2 x(1) ] % print out A0

for n = 1:N
a exact = ((-1)∧n-1) / (pi*n*n);
[n a exact x(n+1)] % print out An
end

for n = 1:N
b exact = -(-1)∧n / n;
[n b exact x(n+N+1)]
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Fredholm Integral Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; a = 0; b = 1; n = 20; h = (b-a)/n;
D = zeros(n+1); K = zeros(n+1); I = eye(n+1);

% Intiailze the matrix D

D(1,1) = h/3; D(n+1,n+1) = h/3;

for i = 1:n-1
if (mod(i,2) == 0)
D(i+1,i+1) = 2*h/3;
else
D(i+1,i+1) = 4*h/3;
end; end

% For each example, ....


for iselect = 1:6

% load in the exact solution and f (x)

for i = 0:n
xx = i*h; x(i+1) = xx;
50 Advanced Engineering Mathematics with MATLAB

if (iselect == 1)
exact(i+1) = xx*xx; f(i+1) = 0.9*xx*xx; end
if (iselect == 2)
exact(i+1) = exp(xx); f(i+1) = xx+(1-xx)*exp(xx); end
if (iselect == 3)
exact(i+1) = exp(xx); f(i+1) = 2*exp(xx)/3; end
if (iselect == 4)
exact(i+1) = exp(2*xx); f(i+1) = exp(2*xx+1/3); end
if (iselect == 5)
exact(i+1) = 1; f(i+1) = exp(xx)-xx; end
if (iselect == 6)
exact(i+1) = xx; f(i+1) = 5*xx/6; end
end

% and the kernel

for i = 1:n+1
xx = x(i);
for j = 1:n+1
tt = x(j);
if (iselect == 1) K(i,j) = 0.5*xx*xx*tt*tt; end
if (iselect == 2) K(i,j) = xx*xx*exp(tt*(xx-1)); end
if (iselect == 3) K(i,j) = exp(xx-tt)/3; end
if (iselect == 4) K(i,j) = -exp(2*xx-5*tt/3)/3; end
if (iselect == 5) K(i,j) = -xx*(exp(xx*tt)-1); end
if (iselect == 6) K(i,j) = 0.5*xx*tt; end
end; end

B = I - K*D;

% find the solution to the integral equation

u = mldivide(B,f’);

% compute the error


for i = 2:n+1
xplot(i-1) = x(i);
if (iselect == 1)
diff1(i-1) = abs((u(i) - exact(i))/exact(i)); end
if (iselect == 2)
diff2(i-1) = abs((u(i) - exact(i))/exact(i)); end
if (iselect == 3)
diff3(i-1) = abs((u(i) - exact(i))/exact(i)); end
if (iselect == 4)
diff4(i-1) = abs((u(i) - exact(i))/exact(i)); end
Worked Solutions 51

if (iselect == 5)
diff5(i-1) = abs((u(i) - exact(i))/exact(i)); end
if (iselect == 6)
diff6(i-1) = abs((u(i) - exact(i))/exact(i)); end
end

end

% plot the errors


semilogy(xplot,diff1,’ko-’,xplot,diff2,’r+-’,xplot,diff4,...
’gs-’,xplot,diff5,’m*-’,’LineWidth’,2,’MarkerSize’,5)
xlabel(’x’,’FontSize’,20)
ylabel(’|relative error|’,’FontSize’,20)
legend(’(a)’,’(b)’,’(d)’,’(e)’)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for LU Decompostion
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for a 3 × 3 matrix, read the matrix A and right side b
clear; n = 3;
A = [3 -1 2; 1 2 3; 2 -2 -1]; b = transpose([12 11 2]);

% preform the LU decomposition


[L,U] = lu(A)

% the solution simply by finding the inverse of A


x = inv(A)*b

% now use the LU algorithm to find the solution

b prime(1) = b(1)/L(1,1);

for i = 2:n
total = b(i);
for k = 1:i-1
total = total - L(i,k)*b prime(k);
end
b prime(i) = total / L(i,i);
end

y(n) = b prime(n) / U(n,n);

for j = n-1:-1:1
52 Advanced Engineering Mathematics with MATLAB

total = b prime(j);
for k = j+1:n
total = total - U(j,k)*y(k);
end

y(j) = total / U(j,j);

end

% now find the solution


y

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for QR Decompostion
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for a 3 × 3 matrix, read the matrix A and right side b

clear; n = 3;
A = [3 -1 2; 1 2 3; 2 -2 -1]; b = transpose([12 11 2]);

% compute the matrices Q and R

[Q,R] = qr(A);

% find the answer by simply computing the inverse of A

x = inv(A)*b

% now use the matrices Q and R to find x

y = Q’*b;
x(n) = y(n)/R(n,n);

for j = n-1:-1:1
total = y(j);
for k = j+1:n
total = total - R(j,k)*x(k);
end
x(j) = total / R(j,j);
end

% write out the results


Worked Solutions 53

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 3.5

1.

3−λ 2
|A − λI| = = (3 − λ)(−2 − λ) − 6 = (λ − 4)(λ + 3) = 0.
3 −2 − λ

For λ = 4,
(3 − λ)x1 + 2x2 = −x1 + 2x2 = 0

and
3x1 − (2 + λ)x2 = 3x1 − 6x2 = 0.

Therefore,
 
2
x1 = 2x2 and x0 = α .
1

For λ = −3,
(3 − λ)x1 + 2x2 = 6x1 + 2x2 = 0

and
3x1 − (2 + λ)x2 = 3x1 + x2 = 0.

Therefore,
 
1
3x1 = −x2 and x0 = β .
−3

2.
3−λ −1
|A − λI| = = (3 − λ)(1 − λ) + 1 = (λ − 2)2 = 0.
1 1−λ

For λ = 2,
(3 − λ)x1 − x2 = x1 − x2 = 0

and
x1 + (1 − λ)x2 = x1 − x2 = 0.

Therefore,
 
1
x1 = x2 and x0 = α .
1
54 Advanced Engineering Mathematics with MATLAB

3.
2−λ −3 1 2 − λ −3 1
|A − λI| = 1 −2 − λ 1 = (λ − 1) 0 −1 1
1 −3 2−λ 1 −3 2−λ
2−λ −2 1 −2
= −(λ − 1) = (λ − 1)λ
1 −1 − λ 1 −1 − λ
= −(λ − 1)2 λ = 0.

For λ = 1,
(2 − λ)x1 − 3x2 + x3 = x1 − 3x2 + x3 = 0,
x1 − (2 + λ)x2 + x3 = x1 − 3x2 + x3 = 0
and
x1 − 3x2 + (2 − λ)x3 = x1 − 3x2 + x3 = 0.
Therefore,
   
−1 3
x1 − 3x2 + x3 = 0 and x0 = α  0  + β  1  .
1 0

For λ = 0,
(2 − λ)x1 − 3x2 + x3 = 2x1 − 3x2 + x3 = 0,
x1 − (2 + λ)x2 + x3 = x1 − 2x2 + x3 = 0
and
x1 − 3x2 + (2 − λ)x3 = x1 − 3x2 + 2x3 = 0.
Therefore,  
1
x1 = x2 = x3 and x0 = γ  1  .
1

4.
−λ 1 0
|A − λI| = 0 −λ 1 = −λ3 = 0.
0 0 −λ
For λ = 0,

−λx1 + x2 = x2 = 0 and − λx2 + x3 = x3 = 0.

Therefore,  
1
x2 = x3 = 0 and x0 = α  0  .
0
Worked Solutions 55

5.
1−λ 1 1
|A − λI| = 0 2−λ 1 = (1 − λ)2 (2 − λ) = 0.
0 0 1−λ
For λ = 1,
(1 − λ)x1 + x2 + x3 = x2 + x3 = 0,
(2 − λ)x2 + x3 = x2 + x3 = 0
and
(1 − λ)x3 = 0 · x3 = 0.
Therefore,    
1 0
x2 = −x3 and x0 = α  0  + β  1  .
0 −1
For λ = 2,
(1 − λ)x1 + x2 + x3 = −x1 + x2 + x3 = 0,
(2 − λ)x2 + x3 = x3 = 0
and
(1 − λ)x3 = −x3 = 0.
Therefore,  
1
x1 = x2 and x0 = γ  1  .
0

6.
1−λ 2 1
3−λ 1
|A − λI| = 0 3−λ 1 = (1 − λ)
5 −1 − λ
0 5 −1 − λ
= (1 − λ)(λ − 4)(λ + 2) = 0.
For λ = 1,
(1 − λ)x1 + 2x2 + x3 = 2x2 + x3 = 0,
(3 − λ)x2 + x3 = 2x2 + x3 = 0
and
5x2 − (1 + λ)x3 = 5x2 − 2x3 = 0.
Therefore,  
1
x2 = x3 = 0 and x0 = α  0  .
0
56 Advanced Engineering Mathematics with MATLAB

For λ = 4,
(1 − λ)x1 + 2x2 + x3 = −3x1 + 2x2 + x3 = 0,

(3 − λ)x2 + x3 = −x2 + x3 = 0

and
5x2 − (1 + λ)x3 = 5x2 − 5x3 = 0.

Therefore,  
1
x1 = x2 = x3 and x0 = β  1  .
1
For λ = −2,
(1 − λ)x1 + 2x2 + x3 = 3x1 + 2x2 + x3 = 0,

(3 − λ)x2 + x3 = 5x2 + x3 = 0

and
5x2 − (1 + λ)x3 = 5x2 + x3 = 0.

Therefore,  
1
5x1 = 5x2 = −x3 and x0 = γ  1  .
−5

7.
4 − λ −5 1 4 − λ −5 5−λ
|A − λI| = 1 −λ −1 = 1 −λ 0
0 1 −1 − λ 0 1 −1 − λ
4 − λ −6 6 4−λ 0 6
= 1 −λ 0 = 1 −λ 0
0 1 −1 − λ 0 −λ −1 − λ
4−λ 0 6 4−λ 0 6
= −λ 1 1 0 = −λ 1 1 0
0 1 −1 − λ −1 0 −1 − λ
4−λ 6
= −λ = −λ(λ − 2)(λ − 1)
−1 −1 − λ
For λ = 0,
(4 − λ)x1 − 5x2 + x3 = 4x1 − 5x2 + x3 = 0,

x1 − λx2 − x3 = x1 − x3 = 0

and
x2 − (λ + 1)x3 = x2 − x3 = 0.
Worked Solutions 57

Therefore,  
1
x1 = x2 = x3 and x0 = α  1  .
1
For λ = 1,
(4 − λ)x1 − 5x2 + x3 = 3x1 − 5x2 + x3 = 0,
x1 − λx2 − x3 = x1 − x2 − x3 = 0
and
x2 − (λ + 1)x3 = x2 − 2x3 = 0.
Therefore,  
3
x1 = 3x3 , x2 = 2x3 and x0 = β  2  .
1
For λ = 2,
(4 − λ)x1 − 5x2 + x3 = 2x1 − 5x2 + x3 = 0,
x1 − λx2 − x3 = x1 − 2x2 − x3 = 0
and
x2 − (λ + 1)x3 = x2 − 3x3 = 0.
Therefore,  
7
x1 = 7x3 , x2 = 3x3 and x0 = γ  3  .
1

8.

−2 − λ 0 1 −2 − λ 0 1
|A − λI| = 3 −λ −1 = 1 − λ −λ 0
0 1 1−λ 0 1 1−λ
−2 − λ 0 1 −2 − λ 0 1
= 1−λ 1−λ 1 − λ = (1 − λ) 1 1 1
0 1 1−λ 0 1 1−λ
−2 − λ 0 1
−2 − λ 1
= (1 − λ) 0 1 0 = (1 − λ)
−1 −λ
−1 1 −λ
= (λ + 1)2 (1 − λ)

For λ = 1,
(−2 − λ)x1 + x3 = −3x1 + x3 = 0,
3x1 − λx2 − x3 = 3x1 − x2 − x3 = 0
58 Advanced Engineering Mathematics with MATLAB

and
x2 + (1 − λ)x3 = x2 = 0.
Therefore,  
1
3x1 = x3 , x2 = 0 and x0 = α  0  .
3
For λ = −1,
(−2 − λ)x1 + x3 = −x1 + x3 = 0,
3x1 − λx2 − x3 = 3x1 + x2 − x3 = 0
and
x2 + (1 − λ)x3 = x2 + 2x3 = 0.
Therefore,  
1
x1 = x3 , x2 = −2x3 and x0 = β  −2  .
1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Sturm-Liouville Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% choose the number of eigenvalues that you want

clear
N = 5; deltax = pi / (N+1); h = 1 / deltax;
x = [0 deltax:deltax:pi-deltax pi];

% zero out the A array

A = zeros(N,N);

% compute the principal diagonal

for i = 1:N
A(i,i) = 2 * h * h;
end

% compute the upper diagonal

for i = 1:N-1
A(i,i+1) = - h * h;
Worked Solutions 59

end

% compute the lower diagonal

for i = 2:N
A(i,i-1) = - h* h;
end

% compute the eigenvalues and eigenvectors

[eigenvector,eigenvalue] = eig(A);

% print out the eigenfunctions

for n = 1:N
u = eigenvector(1:N,n);
eigenfunction = [0 u’ 0];
eigenexact = sqrt(2/pi) * sin(n*x);
diff1 = 0; diff2 = 0; total = 0;
for i = 1:N
total = total + eigenfunction(i)*eigenfunction(i);
diff1 = diff1 + (eigenfunction(i)-eigenexact(i))^2;
diff2 = diff2 + (eigenfunction(i)+eigenexact(i))^2;
end
eigenfunction = eigenfunction/sqrt(total*deltax);
if (diff1 > diff2) eigenfunction = - eigenfunction; end

subplot(N/2,2,n), plot(x,eigenfunction,x,eigenexact)
axis([0 pi -1 1])
xlabel(’x’,’Fontsize’,20)
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Singular Decomposition Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear

% Generate some points around a line

format long
intercept = -10; slope = 3; npts = 50; noise = 80;
xs = 10 + rand(npts, 1) * 90;
60 Advanced Engineering Mathematics with MATLAB

ys = slope * xs + intercept + rand(npts, 1) * noise;

% Fit these points to a line using singular value decompostion

A = [xs, ones(npts,1)];
M = transpose(A)*A;
x = inv(M)*transpose(A)*ys;
% Get the coefficients a, b, c in ax + by + c = 0
m = x(1); c = x(2);
% Compute slope m and intercept i for y = mx + i
slope est = m; intercept est = c;
% Plot fitted line on top of old data
ys est = slope est * xs + intercept est;

% plot the results

plot(xs,ys,’b.’,xs,ys est,’k-’,’LineWidth’,2,’MarkerSize’,20);
xlabel(’x’,’FontSize’,20); ylabel(’y’,’FontSize’,20);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 3.6

1. In matrix notation,
   
′ 1 2 x1
x = x, where x= .
2 1 x2

Assuming x = x0 eλt ,
   
1 2 1 0
−λ x0 = 0.
2 1 0 1

Solving the eigenvalue problem,

1−λ 2
|A − λI| = = (1 − λ)2 − 4 = 0.
2 1−λ

Thus, the eigenvalues are λ1,2 = −1, 3. For λ1 = −1,

(1 − λ)x1 + 2x2 = 2x1 + 2x2 = 0

and
2x1 + (1 − λ)x2 = 2x1 + 2x2 = 0.
Worked Solutions 61
 
1
Thus, the eigenvector is . For λ2 = 3,
−1

(1 − λ)x1 + 2x2 = −2x1 + 2x2 = 0

and
2x1 + (1 − λ)x2 = 2x1 − 2x2 = 0.
 
1
Thus, the eigenvector is . Therefore, the general solution is
1
   
1 −t 1
x = c1 e + c2 e3t .
−1 1

2. In matrix notation,
   
′ 1 −4 x1
x = x, where x= .
3 −6 x2

Assuming x = x0 eλt ,
   
1 −4 1 0
−λ x0 = 0.
3 −6 0 1

Solving the eigenvalue problems,

1−λ −4
|A − λI| = = (λ + 3)(λ + 2) = 0.
3 −6 − λ

Thus, the eigenvalues are λ1,2 = −3, −2. For λ1 = −3,

(1 − λ)x1 − 4x2 = 4x1 − 4x2 = 0

and
3x1 − (6 + λ)x2 = 3x1 − 3x2 = 0.
 
1
Thus, the eigenvector is . For λ2 = −2,
1

(1 − λ)x1 − 4x2 = 3x1 − 4x2 = 0

and
3x1 − (6 + λ)x2 = 3x1 − 4x2 = 0.
 
4
Thus, the eigenvector is . Therefore, the general solution is
3
   
1 4
x = c1 e−3t + c2 e−2t .
1 3
62 Advanced Engineering Mathematics with MATLAB

3. In matrix notation,
   
′ 1 1 x1
x = x, where x= .
4 1 x2

Assuming x = x0 eλt ,
   
1 1 1 0
−λ x0 = 0.
4 1 0 1

Solving the eigenvalue problem,

1−λ 1
|A − λI| = = (λ − 3)(λ + 1) = 0.
4 1−λ

Thus, the eigenvalues are λ1,2 = −1, 3. For λ1 = −1,

(1 − λ)x1 + x2 = 2x1 + x2 = 0

and
4x1 + (1 − λ)x2 = 4x1 + 2x2 = 0.
 
1
Thus, the eigenvector is . For λ2 = 3,
−2

(1 − λ)x1 + x2 = −2x1 + x2 = 0

and
4x1 + (1 − λ)x2 = 4x1 − 2x2 = 0.
 
1
Thus, the eigenvector is . Therefore, the general solution is
2
   
1 1
x = c1 e3t + c2 e−t .
2 −2

4. In matrix notation,
   
′ 1 5 x1
x = x, where x= .
−2 −6 x2

Assuming x = x0 eλt ,
   
1 5 1 0
−λ x0 = 0.
−2 −6 0 1
Worked Solutions 63

Solving the eigenvalue problems,

1−λ 5
|A − λI| = = (λ + 4)(λ + 1) = 0.
−2 −6 − λ

Thus, the eigenvalues are λ1,2 = −4, −1. For λ1 = −4,

(1 − λ)x1 + 5x2 = 5x1 + 5x2 = 0

and
−2x1 − (6 + λ)x2 = −2x1 − 2x2 = 0.
 
1
Thus, the eigenvector is . For λ2 = −1,
−1

(1 − λ)x1 + 5x2 = 2x1 + 5x2 = 0

and
−2x1 − (6 + λ)x2 = −2x1 − 5x2 = 0.
 
5
Thus, the eigenvector is . Therefore, the general solution is
−2
   
1 −4t 5
x = c1 e + c2 e−t .
−1 −2

5. In matrix notation,
   
′ −3/2 −2 x1
x = x, where x= .
2 5/2 x2

Assuming x = x0 eλt ,
   
−3/2 −2 1 0
−λ x0 = 0.
2 5/2 0 1

Solving the eigenvalue problem,

−3/2 − λ −2
|A − λI| = = (λ − 1/2)2 = 0.
2 5/2 − λ

Thus, the eigenvalues are λ1,2 = 1/2. For λ1 = 1/2,

(−3/2 − λ)x1 − 2x2 = −2x1 − 2x2 = 0

and
2x1 + (5/2 − λ)x2 = 2x1 + 2x2 = 0.
64 Advanced Engineering Mathematics with MATLAB
 
1
Thus, the only eigenvector is . Because of the repeated eigenvalue and
−1
the fact that we have only one eigenvector, we guess for the second solution:
   
a + bt a/2 + bt/2 + b
x= et/2 and x′ = et/2 .
c + dt c/2 + dt/2 + d

Substitution into the matrix equation yields

a/2 + b = −3a/2 − 2c, b/2 = −3b/2 − 2d,

c/2 + d = 2a + 5c/2 and d/2 = 2b + 5d/2;


or 2a + 2c = −b and b = −d. If we choose b = 1 and a = 0, the general
solution is    
1 t
x = c1 et/2 + c2 et/2 .
−1 −1/2 − t

6. In matrix notation,
   
′ −3 −2 x1
x = x, where x= .
2 1 x2

Assuming x = x0 eλt ,
   
−3 −2 1 0
−λ x0 = 0.
2 1 0 1

Solving the eigenvalue problems,

−3 − λ −2
|A − λI| = = (λ + 1)2 = 0.
2 1−λ

Thus, the eigenvalues are λ1,2 = −1. For λ1 = −1,

(−3 − λ)x1 − 2x2 = −2x1 − 2x2 = 0

and
2x1 + (1 − λ)x2 = 2x1 + 2x2 = 0.
 
1
Thus, the only eigenvector is . Because of the repeated eigenvalue and
−1
the fact that we have only one eigenvector, we guess for the second solution
   
a + bt −t ′ −a − bt + b
x= e and x = e−t .
c + dt −c − dt + d
Worked Solutions 65

Substitution into the matrix equation yields

−a + b = −3a − 2c, −b = −3b − 2d,

−c + d = 2a + c, and − d = 2b + d;
or 2a + 2c = −b and b = −d. If we choose d = 2 and c = 0, the general
solution is    
1 −t 1 − 2t
x = c1 e + c2 e−t .
−1 2t

7. In matrix notation,
   
′ 1 −1 x1
x = x, where x= .
1 3 x2

Assuming x = x0 eλt ,
   
1 −1 1 0
−λ x0 = 0.
1 3 0 1

Solving the eigenvalue problem,

1−λ −1
|A − λI| = = (λ − 2)2 = 0.
1 3−λ

Thus, the eigenvalues are λ1,2 = 2. For λ1 = 2,

(1 − λ)x1 − x2 = −x1 − x2 = 0

and
x1 + (3 − λ)x2 = x1 + x2 = 0.
 
1
Thus, the only eigenvector is . Because of the repeated eigenvalue and
−1
the fact that we have only one eigenvector, we guess for the second solution:
   
a + bt 2t ′ 2a + 2bt + b
x= e and x = e2t .
c + dt 2c + 2dt + d

Substitution into the matrix equation yields

b + 2a = a − c, 2b = b − d,

d + 2c = a + 3c and 2d = b + 3d;
66 Advanced Engineering Mathematics with MATLAB

or a + c = d and b = −d. If we choose d = −1 and c = 0, the general solution


is    
1 −1 + t
x = c1 e2t + c2 e2t .
−1 −t

8. In matrix notation,
   
3 2 x1
x′ = x, where x= .
−2 −1 x2

Assuming x = x0 eλt ,
   
3 2 1 0
−λ x0 = 0.
−2 −1 0 1

Solving the eigenvalue problems,

3−λ 2
|A − λI| = = (λ − 1)2 = 0.
−2 −1 − λ

Thus, the eigenvalues are λ1,2 = 1. For λ1 = 1,

(3 − λ)x1 + 2x2 = 2x1 + 2x2 = 0

and
−2x1 − (1 + λ)x2 = −2x1 − 2x2 = 0.
 
1
Thus, the only eigenvector is . Because of the repeated eigenvalue and
−1
the fact that we have only one eigenvector, we guess for the second solution:
   
a + ct t ′ a + ct + c
x= e and x = et .
b + dt b + dt + d

Substitution into the matrix equation yields

a + c = 3a + 2b, c = 3c + 2d,

b + d = −2a − b and d = −2c − d;


or 2a + 2b = c and c = −d. If we choose c = 2 and b = 0, the general solution
is    
1 t 1 + 2t
x = c1 e + c2 et .
−1 −2t

9. In matrix notation,
   
′ −2 −13 x1
x = x, where x= .
1 4 x2
Worked Solutions 67

Assuming x = x0 eλt ,
   
−2 −13 1 0
−λ x0 = 0.
1 4 0 1

Solving the eigenvalue problem,

−2 − λ −13
|A − λI| = = (λ − 1)2 + 4 = 0.
1 4−λ

Thus, the eigenvalues are λ1,2 = 1 ± 2i. For λ1 = 1 + 2i,

(−2 − λ)x1 − 13x2 = (−3 − 2i)x1 − 13x2 = 0

and
x1 + (4 − λ)x2 = x1 + (3 − 2i)x2 = 0.
 
3 − 2i
Thus, the eigenvector is . For λ2 = 1 − 2i,
−1

(−2 − λ)x1 − 13x2 = (−3 + 2i)x1 − 13x2 = 0

and
x1 + (4 − λ)x2 = x1 + (3 + 2i)x2 = 0.
 
3 + 2i
Thus, the eigenvector is . The general solution is
−1
   
3 − 2i t+2it 3 + 2i
x = c1 e + c2 et−2it
−1 −1
   
3 cos(2t) + 2 sin(2t) t 2 cos(2t) − 3 sin(2t)
= c3 e + c4 et ,
− cos(2t) sin(2t)

where c3 = c1 + c2 and c4 = −ic1 + ic2 .

10. In matrix notation,


   
′ 3 −2 x1
x = x, where x= .
5 −3 x2

Assuming x = x0 eλt ,
   
3 −2 1 0
−λ x0 = 0.
5 −3 0 1

Solving the eigenvalue problems,

3−λ −2
|A − λI| = = λ2 + 1 = 0.
5 −3 − λ
68 Advanced Engineering Mathematics with MATLAB

Thus, the eigenvalues are λ1,2 = ±i. For λ1 = i,

(3 − λ)x1 − 2x2 = (3 − i)x1 − 2x2 = 0

and
5x1 − (3 + λ)x2 = 5x1 − (3 + i)x2 = 0.
 
3+i
Thus, the eigenvector is . For λ2 = −i,
5

(3 − λ)x1 − 2x2 = (3 + i)x1 − 2x2 = 0

and
5x1 − (3 + λ)x2 = 5x1 − (3 − i)x2 = 0.
 
3−i
Thus, the eigenvector is . The general solution is
5
   
3+i 3−i
x = c1 eit + c2 e−it
5 5
   
3 cos(t) − sin(t) cos(t) + 3 sin(t)
= c3 + c4 ,
5 cos(t) 5 sin(t)

where c3 = c1 + c2 and c4 = ic1 − ic2 .

11. In matrix notation,


   
′ 4 −2 x1
x = x, where x= .
25 −10 x2

Assuming x = x0 eλt ,
   
4 −2 1 0
−λ x0 = 0.
25 −10 0 1

Solving the eigenvalue problem,

4−λ −2
|A − λI| = = (λ + 3)2 + 1 = 0.
25 −10 − λ

Thus, the eigenvalues are λ1,2 = −3 ± i. For λ1 = −3 + i,

(4 − λ)x1 − 2x2 = (7 − i)x1 − 2x2 = 0

and
25x1 − (10 + λ)x2 = 25x1 − (7 + i)x2 = 0.
Worked Solutions 69
 
2
Thus, the eigenvector is . For λ2 = −3 − i,
7−i

(4 − λ)x1 − 2x2 = (7 + i)x1 − 2x2 = 0

and
25x1 − (10 + λ)x2 = 25x1 − (7 − i)x2 = 0.
 
2
Thus, the eigenvector is . The general solution is
7+i
   
2 2
x = c1 e−3t+it + c2 e−3t−it
7−i 7+i
   
2 cos(t) 2 sin(t)
= c3 e−3t + c4 e−3t ,
7 cos(t) + sin(t) 7 sin(t) − cos(t)

where c3 = c1 + c2 and c4 = ic1 − ic2 .

12. In matrix notation,


   
−3 −4 x1
x′ = x, where x= .
2 1 x2

Assuming x = x0 eλt ,
   
−3 −4 1 0
−λ x0 = 0.
2 1 0 1

Solving the eigenvalue problems,

−3 − λ −4
|A − λI| = = (λ + 1)2 + 4 = 0.
2 1−λ

Thus, the eigenvalues are λ1,2 = −1 ± 2i. For λ1 = −1 + 2i,

(−3 − λ)x1 − 4x2 = (−2 − 2i)x1 − 4x2 = 0

and
2x1 + (1 − λ)x2 = 2x1 + (2 − 2i)x2 = 0.
 
−1 + i
Thus, the eigenvector is . For λ2 = −1 − 2i,
1

(−3 − λ)x1 − 4x2 = (−2 + 2i)x1 − 4x2 = 0

and
2x1 + (1 − λ)x2 = 2x1 + (2 + 2i)x2 = 0.
70 Advanced Engineering Mathematics with MATLAB
 
−1 − i
Thus, the eigenvector is . The general solution is
1
   
−1 + i −1 − i
x = c1 e−t+2it + c2 e−t−2it
1 1
   
− cos(2t) − sin(2t) cos(2t) − sin(2t)
= c3 e−t + c4 e−t ,
cos(2t) sin(2t)

where c3 = c1 + c2 and c4 = ic1 − ic2 .

13. In matrix notation,


   
3 4 x1
x′ = x, where x= .
−2 −1 x2

Assuming x = x0 eλt ,
   
3 4 1 0
−λ x0 = 0.
−2 −1 0 1

Solving the eigenvalue problem,

3−λ 4
|A − λI| = = (λ − 1)2 + 4 = 0.
−2 −1 − λ

Thus, the eigenvalues are λ1,2 = 1 ± 2i. For λ1 = 1 + 2i,

(3 − λ)x1 + 4x2 = (2 − 2i)x1 + 4x2 = 0

and
−2x1 − (1 + λ)x2 = −2x1 − 2(1 + i)x2 = 0.
 
−1 − i
Thus, the eigenvector is . For λ2 = 1 − 2i,
1

(3 − λ)x1 + 4x2 = (2 + 2i)x1 + 4x2 = 0

and
−2x1 − (1 + λ)x2 = −2x1 − 2(1 − i)x2 = 0.
 
−1 + i
Thus, the eigenvector is . The general solution is
1
   
−1 − i −1 + i
t+2it
x = c1 e + c2 et−2it
1 1
   
− cos(2t) + sin(2t) t − cos(2t) − sin(2t)
= c3 e + c4 et ,
cos(2t) sin(2t)
Worked Solutions 71

where c3 = c1 + c2 and c4 = ic1 − ic2 .

14. In matrix notation,


     
1 1 ′ 5 3 x1
x + x = 0, where x= .
2 1 1 1 x2

Assuming x = x0 eλt ,
   
5 3 1 1
+λ x0 = 0.
1 1 2 1

Solving the eigenvalue problems,

5+λ 3+λ
= (2 + λ)(1 − λ) = 0.
1 + 2λ 1+λ

Thus, the eigenvalues are λ1,2 = −2, 1. For λ1 = −2,

(5 + λ)x1 + (3 + λ)x2 = 3x1 + x2 = 0

and
(1 + 2λ)x1 + (1 + λ)x2 = −3x1 − x2 = 0.
 
1
Thus, the eigenvector is . For λ2 = 1,
−3

(5 + λ)x1 + (3 + λ)x2 = 6x1 + 4x2 = 0

and
(1 + 2λ)x1 + (1 + λ)x2 = 3x1 + 2x2 = 0.
 
2
Thus, the eigenvector is . The general solution is
−3
   
1 2
x = c1 e−2t + c2 et .
−3 −3

15. In matrix notation,


     
1 1 ′ −1 −2 x1
x + x = 0, where x= .
1 2 −5 −7 x2

Assuming x = x0 eλt ,
   
−1 −2 1 1
+λ x0 = 0.
−5 −7 1 2
72 Advanced Engineering Mathematics with MATLAB

Solving the eigenvalue problem,

−1 + λ −2 + λ
= (λ − 3)(λ + 1) = 0.
−5 + λ −7 + 2λ

Thus, the eigenvalues are λ1,2 = −1, 3. For λ1 = −1,

(−1 + λ)x1 + (−2 + λ)x2 = −2x1 − 3x2 = 0

and
(−5 + λ)x1 + (−7 + 2λ)x2 = −6x1 − 9x2 = 0.
 
−3
Thus, the eigenvector is . For λ2 = 3,
2

(−1 + λ)x1 + (−2 + λ)x2 = 2x1 + x2 = 0

and
(−5 + λ)x1 + (−7 + 2λ)x2 = −2x1 − x2 = 0.
 
−1
Thus, the eigenvector is . The general solution is
2
   
−1 3t −3
x = c1 e + c2 e−t .
2 2

16. In matrix notation,


  
1 −2 0 x1
x′ =  0 0 0  x, where x =  x2  .
−5 0 7 x3

Assuming x = x0 eλt ,
   
1 −2 0 1 0 0
 0 0 0 − λ0 1 0  x0 = 0.
−5 0 7 0 0 1

Solving the eigenvalue problems,

1−λ −2 0
1−λ 0
|A − λI| = 0 −λ 0 = −λ
−5 7−λ
−5 0 7−λ
= −λ(1 − λ)(7 − λ) = 0.
Worked Solutions 73

Thus, the eigenvalues are λ1,2,3 = 0, 1, 7. For λ1 = 0,

(1 − λ)x1 − 2x2 = x1 − 2x2 = 0,

−λx2 = 0 · x2 = 0
and
−5x1 + (7 − λ)x3 = −5x1 + 7x3 = 0.
 
14
Thus, the eigenvector is  7 . For λ2 = 1,
10

(1 − λ)x1 − 2x2 = −2x2 = 0,

−λx2 = −x2 = 0
and
−5x1 + (7 − λ)x3 = −5x1 + 6x3 = 0.
 
6
Thus, the eigenvector is  0 . For λ3 = 7,
5

(1 − λ)x1 − 2x2 = −6x1 − 2x2 = 0,

−λx2 = −7x2 = 0
and
−5x1 + (7 − λ)x3 = −5x1 = 0.
 
0
Thus, the eigenvector is  0 . The general solution is
1
     
14 6 0
x = c1  7  + c2  0  et + c3  0  e7t .
10 5 1

17. In matrix notation,


   
2 0 0 x1
x′ =  1 0 2  x, where x =  x2  .
0 0 1 x3

Assuming x = x0 eλt ,
   
2 0 0 1 0 0
 1 0 2  − λ  0 1 0  x0 = 0.
0 0 1 0 0 1
74 Advanced Engineering Mathematics with MATLAB

Solving the eigenvalue problem,

2−λ 0 0
−λ 2
|A − λI| = 1 −λ 2 = (2 − λ)
0 1−λ
0 0 1−λ
= (2 − λ)(−λ)(1 − λ) = 0.

Thus, the eigenvalues are λ1,2,3 = 0, 1, 2. For λ1 = 0, (2 − λ)x1 = 2x1 = 0,


x1 
− λx2 + 2x3 = x1 + 2x3 = 0 and (1 − λ)x3 = x3 = 0. Thus, the eigenvector
0
is  1 . For λ2 = 1, (2 − λ)x1 = x1 = 0, x1 − λx2 + 2x3 = x1 − x2 + 2x3 = 0
0  
0
and (1 − λ)x3 = 0 · x3 = 0. Thus, the eigenvector is  2 . For λ3 = 2,
1
(2 − λ)x1 = 0 · x1 = 0, x1 − λx2 + 
2x3 
= x1 − 2x2 + 2x3 = 0 and (1 − λ)x3 =
2
−x3 = 0. Thus, the eigenvector is  1 . The general solution is
0
     
0 0 2
x = c1  1  + c2  2  et + c3  1  e2t .
0 1 0

18. In matrix notation,


   
3 0 −2 x1
x′ =  −1 2 1  x, where x =  x2  .
4 0 −3 x3

Assuming x = x0 eλt ,
   
3 0 −2 1 0 0
 −1 2 1  − λ  0 1 0  x0 = 0.
4 0 −3 0 0 1

Solving the eigenvalue problems,

3−λ 0 −2
3−λ −2
|A − λI| = −1 2−λ 1 = (2 − λ)
4 −3 − λ
4 0 −3 − λ
= (2 − λ)(λ − 1)(λ + 1) = 0.

Thus, the eigenvalues are λ1,2,3 = −1, 1, 2. For λ1 = −1,

(3 − λ)x1 − 2x3 = 4x1 − 2x3 = 0,


Worked Solutions 75

−x1 + (2 − λ)x2 + x3 = −x1 + 3x2 + x3 = 0


and
4x1 − (3 + λ)x3 = 4x1 − 2x3 = 0.
 
3
Thus, the eigenvector is  −1 . For λ2 = 1,
6

(3 − λ)x1 − 2x3 = 2x1 − 2x3 = 0,

−x1 + (2 − λ)x2 + x3 = −x1 + x2 + x3 = 0


and
4x1 − (3 + λ)x3 = 4x1 − 4x3 = 0.
 
1
Thus, the eigenvector is  0 . For λ3 = 2,
1

(3 − λ)x1 − 2x3 = x1 − 2x3 = 0,

−x1 + (2 − λ)x2 + x3 = −x1 + x3 = 0


and
4x1 − (3 + λ)x3 = 4x1 − 5x3 = 0.
 
0
Thus, the eigenvector is  1 . The general solution is
0
     
3 1 0
x = c1  −1  e−t + c2  0  et + c3  1  e2t .
6 1 0

19. In matrix notation,


   
3 0 −1 x1
x′ =  −2 2 1  x, where x =  x2  .
8 0 −3 x3

Assuming x = x0 eλt ,
   
3 0 −1 1 0 0
 −2 2 1  − λ  0 1 0  x0 = 0.
8 0 −3 0 0 1
76 Advanced Engineering Mathematics with MATLAB

Solving the eigenvalue problem,

3−λ 0 −1
3−λ −1
|A − λI| = −2 2−λ 1 = (2 − λ)
8 −3 − λ
8 0 −3 − λ
= (2 − λ)(λ − 1)(λ + 1) = 0.

Thus, the eigenvalues are λ1,2,3 = −1, 1, 2. For λ1 = −1,

(3 − λ)x1 − x3 = 4x1 − x3 = 0,

−2x1 + (2 − λ)x2 + x3 = −2x1 + 3x2 + x3 = 0


and
8x1 − (3 + λ)x3 = 8x1 − 2x3 = 0.
 
3
Thus, the eigenvector is  −2 . For λ2 = 1,
12

(3 − λ)x1 − x3 = 2x1 − x3 = 0,

−2x1 + (2 − λ)x2 + x3 = −2x1 + x2 + x3 = 0


and
8x1 − (3 + λ)x3 = 8x1 − 4x3 = 0.
 
1
Thus, the eigenvector is  0 . For λ3 = 2,
2

(3 − λ)x1 − x3 = x1 − x3 = 0,

−2x1 + (2 − λ)x2 + x3 = −2x1 + x3 = 0


and
8x1 − (3 + λ)x3 = 8x1 − 5x3 = 0.
 
0
Thus, the eigenvector is  1 . The general solution is
0
     
3 1 0
x = c1  −2  e−t + c2  0  et + c3  1  e2t .
12 2 0
Worked Solutions 77

Section 3.7

1. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply
1−λ 3
|λI − A| = = (1 − λ)2 = 0.
0 1−λ
Consequently, λ = 1 twice and the fundamental solutions are S = {et , tet }.
Therefore,  t 
e et
Bt = ,
tet et + tet
and    
1 1 1 −1
B0 = , B0−1 = .
0 1 0 1
The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t) and x2 (t), we have from Equation 3.7.5 that
    t   t 
x1 (t) 1 −1 e e − tet
= = ,
x2 (t) 0 1 tet tet
or
x1 (t) = et − tet and x2 (t) = tet .
Note that x1 (0) = 1 while x2 (0) = 0.
Finally, we have that
   
At 1 0 1 3
e = x1 (t) + x2 (t) .
0 1 0 1

Substituting for x1 (t) and x2 (t) and simplifying, we finally obtain


 t 
e 3tet
eAt = .
0 et

2. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply
3−λ 5
|λI − A| = = (3 − λ)2 = 0.
0 3−λ
Consequently, λ = 3 twice and the fundamental solutions are S = {e3t , te3t }.
Therefore,  3t 
e 3e3t
Bt = ,
te3t e3t + 3te3t
and    
1 3 1 −3
B0 = , B0−1 = .
0 1 0 1
78 Advanced Engineering Mathematics with MATLAB

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t) and x2 (t), we have from Equation 3.7.5 that
      
x1 (t) 1 −3 e3t e3t − 3te3t
= = ,
x2 (t) 0 1 te3t te3t
or
x1 (t) = e3t − 3te3t and x2 (t) = te3t .
Note that x1 (0) = 1 while x2 (0) = 0.
Finally, we have that
   
At 1 0 3 5
e = x1 (t) + x2 (t) .
0 1 0 3

Substituting for x1 (t) and x2 (t) and simplifying, we finally obtain


 
e3t 5te3t
eAt = .
0 e3t

3. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply
λ−1 −1 0
|λI − A| = 0 λ−1 −1 = (λ − 1)3 = 0.
0 0 λ−1
Consequently, λ = 1 thrice and the fundamental solutions are

S = {et , tet , t2 et }.

Therefore,  
et et et
Bt =  tet e + tet
t
2et + tet ,
t 2 et 2tet + t2 et t t
2e + 4te + t e2 t

and
     
1 2 1 1 1 1 1 −1 0.5
A2 =  0 1 2  , B0 =  0 1 2  , B0−1 =  0 1 −1  .
0 0 1 0 0 2 0 0 0.5

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
    t   t 
x1 (t) 1 −1 0.5 e e − tet + 12 t2 et
 x2 (t)  =  0 1 −1   tet  =  tet − t2 et ,
2 t 1 2 t
x3 (t) 0 0 0.5 t e 2 t e
Worked Solutions 79

or
x1 (t) = et − tet + 21 t2 et , x2 (t) = tet − t2 et , x3 (t) = 21 t2 et .
Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.
Finally, we have that
     
1 0 0 1 1 0 1 2 1
eAt = x1 (t)  0 1 0  + x2 (t)  0 1 1  + x3 (t)  0 1 2.
0 0 1 0 0 1 0 0 1

Substituting for x1 (t), x2 (t) and x3 (t) and simplifying, we finally obtain
 t 1 2 t

e tet 2t e
At 
e = 0 et tet  .
0 0 et

4. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply
2−λ 3 4
|λI − A| = 0 2−λ 3 = (λ − 2)3 = 0.
0 0 2−λ
Consequently, λ = 2 thrice and the fundamental solutions are

S = {e2t , te2t , t2 e2t }.

Therefore,
 
e2t 2e2t 4e2t
Bt =  te2t e + 2te2t
2t
4e2t + 4te2t ,
t2 e2t 2te2t + 2t2 e2t 2e + 8te2t + 4t2 e2t
2t

and
     
4 12 25 1 2 4 1 −2 2
A2 =  0 4 12  , B0 =  0 1 4  , B0−1 =  0 1 −2  .
0 0 4 0 0 2 0 0 0.5

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
     2t   2t 
x1 (t) 1 −2 2 e e − 2te2t + 2t2 e2t
 x2 (t)  =  0 1 −2   te2t  =  te2t − 2t2 e2t ,
2 2t 1 2 2t
x3 (t) 0 0 0.5 t e 2t e

or

x1 (t) = e2t − 2te2t + 2t2 e2t , x2 (t) = te2t − 2t2 e2t , x3 (t) = 12 t2 e2t .
80 Advanced Engineering Mathematics with MATLAB

Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.


Finally, we have that
     
1 0 0 2 3 4 4 12 25
eAt = x1 (t)  0 1 0  + x2 (t)  0 2 3  + x3 (t)  0 4 12  .
0 0 1 0 0 2 0 0 4

Substituting for x1 (t), x2 (t) and x3 (t) and simplifying, we finally obtain
 
e2t 3te2t 4te2t + 29 t2 e2t
eAt =  0 e2t 3te2t .
2t
0 0 e

5. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply
1−λ 2 0
|λI − A| = 0 1−λ 2 = (λ − 1)3 = 0.
0 0 1−λ
Consequently, λ = 1 thrice and the fundamental solutions are

S = {et , tet , t2 et }.

Therefore,  
et et et
Bt =  tet e + tet
t
2et + tet ,
t 2 et 2tet + t2 et t t
2e + 4te + t e2 t

and
     
1 4 4 1 1 1 1 −1 0.5
A2 =  0 1 4  , B0 =  0 1 2  , B0−1 =  0 1 −1  .
0 0 1 0 0 2 0 0 0.5

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
    t   t 
x1 (t) 1 −1 0.5 e e − tet + 21 t2 et
 x2 (t)  =  0 1 −1   tet  =  tet − t2 et ,
2 t 1 2 t
x3 (t) 0 0 0.5 t e 2t e

or
x1 (t) = et − tet + 21 t2 et , x2 (t) = tet − t2 et , x3 (t) = 21 t2 et .
Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.
Worked Solutions 81

Finally, we have that


     
1 0 0 1 2 0 1 4 4
eAt = x1 (t)  0 1 0  + x2 (t)  0 1 2  + x3 (t)  0 1 4.
0 0 1 0 0 1 0 0 1

Substituting for x1 (t), x2 (t) and x3 (t) and simplifying, we finally obtain
 t 
e 2tet 2t2 et
eAt =  0 et 2tet  .
0 0 et

6. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply

3−λ −2
|λI − A| = = (3 − λ)(−1 − λ) + 8 = 0.
4 −1 − λ

Consequently, λ = 1 ± 2i and the fundamental solutions are S = {et cos(2t),


et sin(2t)}. Therefore,
 t 
e cos(2t) et cos(2t) − 2et sin(2t)
Bt = ,
et sin(2t) et sin(2t) + 2et cos(2t)

and    
1 1 1 − 21
B0 = , B0−1 = 1 .
0 2 0 2

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t) and x2 (t), we have from Equation 3.7.5 that
    t   t 
x1 (t) 1 − 12 e cos(2t) e cos(2t) − 12 et sin(2t)
= 1 = 1 t ,
x2 (t) 0 2 et sin(2t) 2 e sin(2t)

or
x1 (t) = et cos(2t) − 12 et sin(2t) and x2 (t) = 21 et sin(2t).
Note that x1 (0) = 1 while x2 (0) = 0.
Finally, we have that
   
1 0 3 −2
eAt = x1 (t) + x2 (t) .
0 1 4 −1

Substituting for x1 (t) and x2 (t) and simplifying, we finally obtain


 t 
e cos(2t) + et sin(2t) −et sin(2t)
eAt = .
2et sin(2t) et cos(2t) − et sin(2t)
82 Advanced Engineering Mathematics with MATLAB

The homogeneous solution is therefore


 
x1H (t) = et cos(2t) + et sin(2t) x1 (0) − et sin(2t)x2 (0),

and  
x2H (t) = 2et sin(2t)x1 (0) + et cos(2t) − et sin(2t) x2 (0).
The particular solution is given by
Z t
xp (t) = eAs b(t − s) ds
0
Z t s   t−s 
e cos(2s) + es sin(2s) −es sin(2s) e
= s s s ds
0 2e sin(2s) e cos(2s) − e sin(2s) et−s
Z t 
t cos(2s)
=e ds
0 sin(2s) + cos(2s)
   
et 0 et − sin(2t)
= − .
2 1 2 cos(2t) − sin(2t)

Therefore, the particular solution is

et et
x1p (t) = sin(2t) and x2p (t) = [1 + sin(2t) − cos(2t)] .
2 2

7. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply
2−λ −1
|λI − A| = = λ2 − 1 = 0.
3 −2 − λ
Consequently, λ = ±1 and the fundamental solutions are S = {et , e−t }.
Therefore,  t 
e e−t
Bt = ,
et −e−t
and   1 
1
1 1
B0 = , B0−1 = 2
1
2 .
−1 1 2 − 21
The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t) and x2 (t), we have from Equation 3.7.5 that
  1 1
 t   
x1 (t) e cosh(t)
= 12 2 = ,
x2 (t) 2 − 12 e−t sinh(t)
or
x1 (t) = cosh(t) and x2 (t) = sinh(t).
Note that x1 (0) = 1 while x2 (0) = 0.
Worked Solutions 83

Finally, we have that


   
At 1 0 2 −1
e = x1 (t) + x2 (t) .
0 1 3 −2

Substituting for x1 (t) and x2 (t) and simplifying, we finally obtain


 
At 1 3et − e−t e−t − et
e = .
2 3et − 3e−t 3e−t − et

The homogeneous solution is therefore


 
x1H (t) = 12 3et − e−t x1 (0) + 1
2 e−t − et x2 (0),

and  
x2H (t) = 1
2 3et − 3e−t x1 (0) + 1
2 3e−t − et x2 (0).
The particular solution is given by
Z t
xp (t) = eAs b(t − s) ds
0
Z    t−s 
1 t 3es − e−s e−s − es e
= s −s −s s ds
2 0 3e − 3e 3e − e t −s
Z t t  
e 3 − e−2s  + (t − s) (e−s − es )
= ds
0 et 3 − 3e−2s + (t − s) (3e−s − es )
 
3tet − 3 sinh(t) + 2t
= .
3tet + 2e−t − 5 sinh(t) + 4t − 2

Therefore, the particular solution is

x1p (t) = 3tet − 3 sinh(t) + 2t and x2p (t) = 3tet + 2e−t − 5 sinh(t) + 4t − 2.

8. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply
2−λ 1
|λI − A| = = (2 − λ)2 + 4 = 0.
−4 2−λ
Consequently, λ = 2 ± 2i and the fundamental solutions are S = {e2t cos(2t),
e2t sin(2t)}. Therefore,
 2t 
e cos(2t) 2e2t cos(2t) − 2e2t sin(2t)
Bt = ,
e2t sin(2t) 2e2t sin(2t) + 2e2t cos(2t)

and    
1 2 1 −1
B0 = , B0−1 = .
0 2 0 21
84 Advanced Engineering Mathematics with MATLAB

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t) and x2 (t), we have from Equation 3.7.5 that
     2t   2t 
x1 (t) 1 −1 e cos(2t) e cos(2t) − e2t sin(2t)
= = ,
x2 (t) 0 12 e2t sin(2t) 1 2t
2 e sin(2t)

or
x1 (t) = e2t cos(2t) − e2t sin(2t) and x2 (t) = 12 e2t sin(2t).
Note that x1 (0) = 1 while x2 (0) = 0.
Finally, we have that
   
At 1 0 2 1
e = x1 (t) + x2 (t) .
0 1 −4 2

Substituting for x1 (t) and x2 (t) and simplifying, we finally obtain


 2t 1 2t

e cos(2t) 2 e sin(2t)
eAt = .
−2e2t sin(2t) e2t cos(2t)

The homogeneous solution is therefore

x1H (t) = e2t cos(2t)x1 (0) + 12 e2t sin(2t)x2 (0),

and
x2H (t) = −2e2t sin(2t)x1 (0) + e2t cos(2t)x2 (0).
The particular solution is given by
Z t
xp (t) = eAs b(t − s) ds
0
Z t  2s 1 2s
 
e cos(2s) 2 e sin(2s) (t − s)e2t−2s
= ds
0 −2e2s sin(2s) e2s cos(2s) −e2t−2s
Z t 
(t − s) cos(2s) − 12 sin(2s)
= e2t ds
−2(t − s) sin(2s) − cos(2s)
 0 
0
= .
−te2t

Therefore, the particular solution is

x1p (t) = 0 and x2p (t) = −te2t .

9. Our first task is to compute the characteristic polynomial p(λ) = 0. This


is simply

2−λ −5
|λI − A| = = (2 − λ)(−2 − λ) + 5 = 0.
1 −2 − λ
Worked Solutions 85

Consequently, λ = ±i and the fundamental solutions are S = {cos(t), sin(t)}.


Therefore,  
cos(t) − sin(t)
Bt = ,
sin(t) cos(t)
and    
1 0 1 0
B0 = , B0−1 = .
0 1 0 1

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t) and x2 (t), we have from Equation 3.7.5 that
      
x1 (t) 1 0 cos(t) cos(t)
= = ,
x2 (t) 0 1 sin(t) sin(t)

or
x1 (t) = cos(t) and x2 (t) = sin(t).
Note that x1 (0) = 1 while x2 (0) = 0.
Finally, we have that
   
1 0 2 −5
eAt = x1 (t) + x2 (t) .
0 1 1 −2

Substituting for x1 (t) and x2 (t) and simplifying, we finally obtain


 
cos(t) + 2 sin(t) −5 sin(t)
eAt = .
sin(t) cos(t) − 2 sin(t)

The homogeneous solution is therefore

x1H (t) = [cos(t) + 2 sin(t)]x1 (0) − 5 sin(t)x2 (0),

and
x2H (t) = sin(t)x1 (0) + [cos(t) − 2 sin(t)]x2 (0).
The particular solution is given by
Z t
xp (t) = eAs b(t − s) ds
0
Z t  
cos(s) + 2 sin(s) −5 sin(s) − cos(t − s)
= ds
0 sin(s) cos(s) − 2 sin(s) sin(t − s)
Z t 
− cos(s) cos(t − s) − 2 sin(s) cos(t − s) − 5 sin(s) sin(t − s)
= ds
0 − sin(s) cos(t − s) + cos(s) sin(t − s) − 2 sin(s) sin(t − s)
 
2t cos(t) − t sin(t) − 3 sin(t)
= .
t cos(t) − sin(t)
86 Advanced Engineering Mathematics with MATLAB

Therefore, the particular solution is

x1p (t) = 2t cos(t) − t sin(t) − 3 sin(t) and x2p (t) = t cos(t) − sin(t).

10. Our first task is to compute the characteristic polynomial p(λ) = 0. This
is simply
2−λ −1
|λI − A| = = λ2 + 1 = 0.
5 −2 − λ

Consequently, λ = ±i and the fundamental solutions are S = {cos(t), sin(t)}.


Therefore,  
cos(t) − sin(t)
Bt = ,
sin(t) cos(t)
and  
1 0
B0 = B0−1 = .
0 1

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t) and x2 (t), we have from Equation 3.7.5 that
      
x1 (t) 1 0 cos(t) cos(t)
= = ,
x2 (t) 0 1 sin(t) sin(t)

or
x1 (t) = cos(t) and x2 (t) = sin(t).

Note that x1 (0) = 1 while x2 (0) = 0.


Finally, we have that
   
At 1 0 2 −1
e = x1 (t) + x2 (t) .
0 1 5 −2

Substituting for x1 (t) and x2 (t) and simplifying, we finally obtain


 
At cos(t) + 2 sin(t) − sin(t)
e = .
5 sin(t) cos(t) − 2 sin(t)

The homogeneous solution is therefore

x1H (t) = [cos(t) + 2 sin(t)]x1 (0) − sin(t)x2 (0),

and
x2H (t) = 5 sin(t)x1 (0) + [cos(t) − 2 sin(t)]x2 (0).
Worked Solutions 87

The particular solution is given by


Z t
xp (t) = eAs b(t − s) ds
0
Z t  
cos(s) + 2 sin(s) − sin(s) cos(t − s)
= ds
0 5 sin(s) cos(s) − 2 sin(s) sin(t − s)
Z t 
cos(s) cos(t − s) + 2 sin(s) cos(t − s) − sin(s) sin(t − s)
= ds
0 5 sin(s) cos(t − s) + cos(s) sin(t − s) − 2 sin(s) sin(t − s)
 
t cos(t) + t sin(t)
= .
t cos(t) + 3t sin(t) − sin(t)

Therefore, the particular solution is

x1p (t) = t cos(t) + t sin(t) and x2p (t) = t cos(t) + 3t sin(t) − sin(t).

11. Our first task is to compute the characteristic polynomial p(λ) = 0. This
is simply

2−λ 1 1
|λI − A| = 1 2−λ 1 = (4 − λ)(λ − 1)2 = 0.
1 1 2−λ

Consequently, λ = 1 twice and λ = 4, and the fundamental solutions are


S = {et , tet , e4t }. Therefore,
 
et et et
Bt =  tet e + tet
t
2et + tet  ,
e4t 4e4t 16e4t

and    
1 1 1 8/9 −12/9 −1/9
B0 =  0 1 2 , B0−1 =  2/9 15/9 −2/9  .
0 4 16 −1/9 −3/9 1/9
The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
    t 
x1 (t) 8/9 −12/9 −1/9 e
 x2 (t)  =  2/9 15/9 −2/9   tet  ,
x3 (t) −1/9 −3/9 1/9 e4t

or
x1 (t) = 98 et − 12 t
9 te + 91 e4t ,
x2 (t) = 92 et + 15 t
9 te − 92 e4t ,
88 Advanced Engineering Mathematics with MATLAB

and
x3 (t) = − 19 et − 93 tet + 19 e4t .
Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.
Finally, we have that
     
1 0 0 2 1 1 6 5 5
eAt = x1 (t)  0 1 0  + x2 (t)  1 2 1  + x3 (t)  5 6 5.
0 0 1 1 1 2 5 5 6

Substituting for x1 (t), x2 (t), and x3 (t) and simplifying, we finally obtain
 4t 
e + 2et e4t − et e4t − et
1
eAt =  e4t − et e4t + 2et e4t − et  .
3
e4t − et e4t − et e4t + 2et

The homogeneous solution is therefore


     
x1H (t) = 31 e4t + 2et x1 (0) + 13 e4t − et x2 (0) + 1
3 e4t − et x3 (0),
     
x2H (t) = 1
3 e4t − et x1 (0) + 1
3 e4t + 2et x2 (0) + 1
3 e4t − et x3 (0),
and
     
x3H (t) = 1
3 e4t − et x1 (0) + 1
3 e4t − et x2 (0) + 1
3 e4t + 2et x3 (0).

The particular solution is given by


Z t
xp (t) = eAs b(t − s) ds
0
 4s  
Z e + 2es e4s − es e4s − es 0
1 t  4s
= e − es e4s + 2es e4s − es   (t − s)et−s  ds
3 0
e4s − es e4s − es e4s + 2es et−s
  
Z (t − s) e3s − 1 + e3s − 1
et t 
= (t − s) e3s + 2 + e3s − 1  ds
3 0
(t − s) e3s − 1 + e3s + 2
 2 t 
−t e /6 − 4tet /9 + 4e4t /27 − 4et /27
=  t2 et /3 − 4tet /9 + 4e4t /27 − 4et /27  .
−t2 et /6 + 5tet /9 + 4e4t /27 − 4et /27

Therefore, the particular solution is

t2 t 4t t 4 4
x1p (t) = − e − e + e4t − et ,
6 9 27 27
t2 t 4t t 4 4
x2p (t) = e − e + e4t − et ,
3 9 27 27
Worked Solutions 89

and
t2 t 5t t 4 4
x3p (t) = − e + e + e4t − et .
6 6 27 27

12. Our first task is to compute the characteristic polynomial p(λ) = 0. This
is simply

1−λ 1 1
|λI − A| = 0 2−λ 1 = (1 − λ)(2 − λ)(3 − λ) = 0.
0 0 3−λ

Consequently, λ = 1, λ = 2, and λ = 3, and the fundamental solutions are


S = {et , e2t , e3t }. Therefore,
 t 
e et et
Bt =  e2t 2e2t 4e2t  ,
e3t 3e3t 9e3t

and    
1 1 1 3 −3 1
B0 =  1 2 4, B0−1 =  −5/2 4 −3/2  .
1 3 9 1/2 −1 1/2
The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
    t 
x1 (t) 3 −3 1 e
 x2 (t)  =  −5/2 4 −3/2   e2t  ,
x3 (t) 1/2 −1 1/2 e3t
or
x1 (t) = 3et − 3e2t + e3t ,
x2 (t) = − 52 et + 4e2t − 23 e3t ,
and
x3 (t) = 21 et − e2t + 21 e3t .
Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.
Finally, we have that
     
1 0 0 1 1 1 1 3 5
eAt = x1 (t)  0 1 0  + x2 (t)  0 2 1  + x3 (t)  0 4 5.
0 0 1 0 0 3 0 0 9

Substituting for x1 (t), x2 (t), and x3 (t) and simplifying, we finally obtain
 t 
e e2t − et e3t − e2t
eAt =  0 e2t e3t − e2t  .
0 0 e3t
90 Advanced Engineering Mathematics with MATLAB

The homogeneous solution is therefore


   
x1H (t) = et x1 (0) + e2t − et x2 (0) + e3t − e2t x3 (0),
 
x2H (t) = e2t x2 (0) + e3t − e2t x3 (0),
and
x3H (t) = e3t x3 (0).
The particular solution is given by
Z t
xp (t) = eAs b(t − s) ds
0
  
Z t es e2s − es e3s − e2s 2(t − s)
= 0 e2s e3s − e2s   t − s + 2  ds
0 0 0 e3s 3(t − s)
 
Z t 2(t − s)e + (t − s + 2)(e − es ) + 3(t − s)(e3s − e2s )
s 2s

=  (t − s + 2)e2s + 3(t − s)(e3s − e2s )  ds


0 3(t − s)e3s
 3t 
e /3 + e2t /2 − et − t + 1/6
= e3t /3 + e2t /2 − 5/6 .
e3t /3 − t − 1/3

Therefore, the particular solution is

x1p (t) = 31 e3t + 12 e2t − et − t + 61 ,

x2p (t) = 13 e3t + 12 e2t − 65 ,


and
x3p (t) = 13 e3t − t − 31 .

13. Our first task is to compute the characteristic polynomial p(λ) = 0. This
is simply

1−λ 0 1
1−λ 1
|λI − A| = 0 −2 − λ 0 = (−2 − λ)
4 1−λ
4 0 1−λ
= (−2 − λ)(λ2 − 2λ − 3) = (−2 − λ)(λ − 3)(λ + 1) = 0.

Consequently, λ = −2, λ = −1, and λ = 3, and the fundamental solutions are


S = {e3t , e−t , e−2t }. Therefore,
 3t 
e 3e3t 9e3t
Bt =  e−t −e−t e−t  ,
−2t −2t
e −2e 4e−2t
Worked Solutions 91

and    
1 3 9 1/10 3/2 −3/5
B0 =  1 −1 1, B0−1 =  3/20 1/4 −2/5  .
1 −2 4 1/20 −1/4 1/5
The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
     3t 
x1 (t) 1/10 3/2 −3/5 e
 x2 (t)  =  3/20 1/4 −2/5   e−t  ,
x3 (t) 1/20 −1/4 1/5 e−2t
or
1 3t
x1 (t) = 10 e + 23 e−t − 53 e−2t ,
3 3t
x2 (t) = 20 e + 41 e−t − 52 e−2t ,
and
1 3t
x3 (t) = 20 e − 41 e−t + 51 e−2t .
Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.
Finally, we have that
     
1 0 0 1 0 1 5 0 2
eAt = x1 (t)  0 1 0  + x2 (t)  0 −2 0  + x3 (t)  0 4 0.
0 0 1 4 0 1 0 0 5
Substituting for x1 (t), x2 (t), and x3 (t) and simplifying, we finally obtain
 1 3t 1 −t 1 3t 1 −t

2e + 2e 0 4e − 4e
eAt =  0 e−2t 0 .
3t −t 1 3t 1 −t
e −e 0 2e + 2e
The homogeneous solution is therefore
 
x1H (t) = 12 e3t + 12 e−t x1 (0) + 1 3t
4e − 41 e−t x3 (0),
x2H (t) = e−2t x2 (0),
and  
x3H (t) = e3t − e−t x1 (0) + 1 3t
2e + 12 e−t x3 (0).
The particular solution is given by
Z t
xp (t) = eAs b(t − s) ds
0
  
Z t 1 e3s + 1 e−s 0 1 3s 1 −s
−3et−s
2 2 4e − 4e
=  0 e−2s 0   6et−s  ds
3s −s 1 3s 1 −s
0 e −e 0 e + 2e −4et−s
 5 2s 1 −2s  2
Z t − e − e
2 2
= et  6e−3s  ds
0 2s −2s
−5e + e
5 t 3t
 1 −t 
4 e −e + 4 (e  − et )
= 2 et − e−2t .
5 t 3t 1 t −t
2 e −e + 2 (e − e )
92 Advanced Engineering Mathematics with MATLAB

Therefore, the particular solution is


 
x1p (t) = 5
4 et − e3t + 1
4 e−t − et ,

x2p (t) = 2 et − e−2t ,
and  
x3p (t) = 5
2 et − e3t + 1
2 et − e−t .

14. Our first task is to compute the characteristic polynomial p(λ) = 0. This
is simply

1−λ 0 2
1−λ 2
|λI − A| = 0 1 − λ 0 = (1 − λ)
1 −λ
1 0 −λ
= (1 − λ)(λ2 − λ − 2) = (1 − λ)(λ − 2)(λ + 1) = 0.

Consequently, λ = −1, λ = 1, and λ = 2, and the fundamental solutions are


S = {e−t , et , e2t }. Therefore,
 
e−t −e−t e−t
B t =  et et et  ,
e2t 2e2t 4e2t

and    
1 −1 1 1/3 1 −1/3
B0 =  1 1 1, B0−1 =  −1/2 1/2 0 .
1 2 4 1/6 −1/2 1/3

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
     −t 
x1 (t) 1/3 1 −1/3 e
 x2 (t)  =  −1/2 1/2 0   et  ,
x3 (t) 1/6 −1/2 1/3 e2t

or
x1 (t) = 31 e−t + et − 31 e2t ,

x2 (t) = − 12 e−t + 12 et ,
and
x3 (t) = 61 e−t − 12 et + 31 e2t .
Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.
Worked Solutions 93

Finally, we have that


     
1 0 0 1 0 2 3 0 2
eAt = x1 (t)  0 1 0  + x2 (t)  0 1 0  + x3 (t)  0 1 0.
0 0 1 1 0 0 1 0 2

Substituting for x1 (t), x2 (t), and x3 (t) and simplifying, we finally obtain
2 
3e + 13 e−t
2t
0 2 2t
3e − 23 e−t
eAt =  0 et 0 .
1 2t 1 −t 1 2t 2 −t
3 e − 3e 0 3e + 3e

The homogeneous solution is therefore

2 2t
 
x1H (t) = 3e + 13 e−t x1 (0) + 2 2t
3e − 32 e−t x3 (0),

x2H (t) = et x2 (0),

and
1 2t
 
x3H (t) = 3e − 13 e−t x1 (0) + 1 2t
3e + 32 e−t x3 (0).

The particular solution is given by


Z t
xp (t) = eAs b(t − s) ds
0
   t−s 
Z t 2 e2s + 1 e−s 0 2 e2s − 2 e−s e
3 3 3 3
=  0 es 0   et−s  ds
1 2s 1 −s
0
3e − 3e 0 31 e2s + 23 e−s et−s
 
Z t 4 es − 1 e−2s
3 3
=e t  1  ds
0 2 s 1 −2s
e + e
 4 2t 3 1 −t 3 3 t 
3e + 6e − 2e
= tet .
2 2t 1 −t 1 t
3e − 6e − 2e

Therefore, the particular solution is

x1p (t) = 34 e2t + 16 e−t − 23 et ,

x2p (t) = tet ,

and
x3p (t) = 23 e2t − 16 e−t − 21 et .
94 Advanced Engineering Mathematics with MATLAB

15. Our first task is to compute the characteristic polynomial p(λ) = 0. This
is simply

1−λ 1 2
1−λ 1
|λI − A| = −1 3−λ 4 = (2 − λ)
−1 3−λ
0 0 2−λ
= (2 − λ)(λ2 − 4λ + 4) = (2 − λ)(λ − 2)2 = 0.

Consequently, λ = 2 thrice and the fundamental solutions are S = {e2t , te2t ,


t2 e2t }. Therefore,
 
e2t 2e2t 4e2t
Bt =  te2t e + 2te2t
2t
4e2t + 4te2t ,
t2 e2t 2te2t + 2t2 e2t 2e + 8te2t + 4t2 e2t
2t

and    
1 2 4 1 −2 2
B0 =  0 1 4, B0−1 = 0 1 −2  .
0 0 2 0 0 1/2

The inverse B0−1 can be found using either Gaussian elimination or MATLAB.
To find x1 (t), x2 (t) and x3 (t), we have from Equation 3.7.5 that
     2t 
x1 (t) 1 −2 2 e
 x2 (t)  =  0 1 −2   te2t  ,
x3 (t) 0 0 1/2 t2 e2t

or
x1 (t) = e2t − 2te2t + 2t2 e2t ,
x2 (t) = te2t − 2t2 e2t ,
and
x3 (t) = 21 t2 e2t .
Note that x1 (0) = 1 while x2 (0) = x3 (0) = 0.
Finally, we have that
     
1 0 0 1 1 2 0 4 10
eAt = x1 (t)  0 1 0  + x2 (t)  −1 3 4  + x3 (t)  −4 8 18  .
0 0 1 0 0 2 0 0 4

Substituting for x1 (t), x2 (t), and x3 (t) and simplifying, we finally obtain
 
1−t t 2t + t2
eAt = e2t  −t 1+t 4t + t2  .
0 0 1
Worked Solutions 95

The homogeneous solution is therefore

x1H (t) = (1 − t)e2t x1 (0) + te2t x2 (0) + (2t + t2 )e2t x3 (0),

x2H (t) = −te2t x1 (0) + (1 + t)e2t x2 (0) + (4t + t2 )e2t x3 (0),


and
x3H (t) = e2t x3 (0).
The particular solution is given by
Z t
xp (t) = eAs b(t − s) ds
0
  
Z t 1−s s 2s + s2 t−s
= e2s  −s 1 + s 4s + s2   1  ds
0 0 0 1 et−s
 
Z t (t − ts + s2 )e2s + (2s + s2 )et+s
=  (s − t)se2s + (1 + s)e2s + (4s + s2 )et+s  ds
0 et+s
 
(t2 + t/4 + 1/4)e2t − 3t/4 − 1/4
=  (t2 + 9t/4 − 3/2)e2t + 2et − t/4 − 1/2  .
e2t − et

Therefore, the particular solution is



x1p (t) = t2 + t/4 + 1/4 e2t − 3t/4 − 1/4,

x2p (t) = t2 + 9t/4 − 3/2 e2t + 2et − t/4 − 1/2,
and
x3p (t) = e2t − et .

Section 4.1

1.
i j k
a × b = 4 −2 5 = −3i + 19j + 10k
3 1 −1
a · (a × b) = −12 − 38 + 50 = 0, b · (a × b) = −9 + 19 − 10 = 0

2.
i j k
a × b = 1 −3 1 = −12i − 2j + 6k
2 0 4
96 Advanced Engineering Mathematics with MATLAB

a · (a × b) = −12 + 6 + 6 = 0
b · (a × b) = −24 + 0 + 24 = 0

3.
i j k
a×b= 1 1 1 = i − 8j + 7k
−5 2 3
a · (a × b) = 1 − 8 + 7 = 0, b · (a × b) = −5 − 16 + 21 = 0

4.
i j k
a×b= 8 1 −6 = −2i − 86j − 17k
1 −2 10
a · (a × b) = −16 − 86 + 102 = 0
b · (a × b) = −2 + 172 − 170 = 0

5.
i j k
a×b= 2 7 −4 = −3i − 2j − 5k
1 1 −1
a · (a × b) = −6 − 14 + 20 = 0, b · (a × b) = −3 − 2 + 5 = 0

6.
i j k
b × c = b1 b2 b3 = (b2 c3 − c2 b3 )i − (b1 c3 − c1 b3 )j + (b1 c2 − c1 b2 )k
c1 c2 c3

i j k
a × (b × c) = a1 a2 a3
b2 c 3 − c 2 b3 c 1 b3 − b 1 c 3 b1 c 2 − c 1 b2
= [a2 (b1 c2 − c1 b2 ) − a3 (c1 b3 − b1 c3 )]i
− [a1 (b1 c2 − c1 b2 ) − a3 (b2 c3 − c2 b3 )]j
+ [a1 (c1 b3 − b1 c3 ) − a2 (b2 c3 − c2 b3 )]k
(a · c)b − (a · b)c = (a1 c1 + a2 c2 + a3 c3 )b1 i + (a1 c1 + a2 c2 + a3 c3 )b2 j
+ (a1 c1 + a2 c2 + a3 c3 )b3 k − (a1 b1 + a2 b2 + a3 b3 )c1 i
− (a1 b1 + a2 b2 + a3 b3 )c2 j − (a1 b1 + a2 b2 + a3 b3 )c3 k
= [a2 (b1 c2 − c1 b2 ) − a3 (c1 b3 − b1 c3 )]i
− [a1 (b1 c2 − c1 b2 ) − a3 (b2 c3 − c2 b3 )]j
+ [a1 (c1 b3 − b1 c3 ) − a2 (b2 c3 − c2 b3 )]k
= a × (b × c)
Worked Solutions 97

7.
a × (b × c) = (a · c)b − (a · b)c

b × (c × a) = (b · a)c − (b · c)a

c × (a × b) = (c · b)a − (c · a)b

a × (b × c) + b × (c × a) + c × (a × b) = (a · c)b − (a · b)c + (b · a)c


− (b · c)a + (c · b)a − (c · a)b
=0

8.
     
∂ xy 2 ∂ xy 2 ∂ xy 2 y2 2xy 3xy 2
∇f = i+ j+ k= i+ 3 j− 4 k
∂x z3 ∂y z3 ∂z z3 z 3 z z

9.      
∂ ∂ ∂
∇f = xy cos(yz) i + xy cos(yz) j + xy cos(yz) k
∂x ∂y ∂z
= y cos(yz)i + [x cos(yz) − xyz sin(yz)]j − xy 2 sin(yz)k

10.    
∂ ∂
∇f = ln(x2 + y 2 + z 2 ) i + ln(x2 + y 2 + z 2 ) j
∂x ∂y
 

+ ln(x2 + y 2 + z 2 ) k
∂z
2x 2y 2z
= 2 2 2
i+ 2 2 2
j+ 2 k
x +y +z x +y +z x + y2 + z2

11.    
∂ ∂
∇f = x2 y 2 (2z + 1)2 i + x2 y 2 (2z + 1)2 j
∂x ∂y
 

+ x2 y 2 (2z + 1)2 k
∂z
= 2xy 2 (2z + 1)2 i + 2x2 y(2z + 1)2 j + 4x2 y 2 (2z + 1)k

12.    
∂ ∂
∇f = 2x − y 2 + z 2 i + 2x − y 2 + z 2 j
∂x ∂y
 

+ 2x − y 2 + z 2 k = 2i − 2yj + 2zk
∂z
98 Advanced Engineering Mathematics with MATLAB

13. Plane parallel to the xy plane at height of z = 3. Let f (x, y, z) = z = 3.


Then N = 3k and n = k.

14. Cylinder of radius 2. Let f (x, y, z) = x2 + y 2 = 4. Then N = 2xi + 2yj,


and
2x 2y x y x y
n= p i+ p j= p i+ p j = i + j.
2
4x + 4y 2 2
4x + 4y 2 2
x +y 2 2
x +y 2 2 2

15. Paraboloid. Let f (x, y, z) = z − x2 − y 2 = 0. Then N = −2xi − 2yj + k,


and
2x 2y 1
n = −p i− p j+ p k.
1+ 4x2 + 4y 2 1+ 4x2 + 4y 2 1 + 4x2 + 4y 2

p p
16. pCone. Let f (x, y, z) = x2 + y 2 − z = 0. Then N = xi/ x2 + y 2 +
yj/ x2 + y 2 − k, and

x y k
n= p i+ p j− √ .
2(x2 + y 2 ) 2(x2 + y 2 ) 2

√ √
17. A plane. Let f (x, y, z) = y−z = 0. Then N = j−k, and n = j/ 2−k/ 2.

18. A plane. Let f (x, y, z) = x + y + z = 1. Then N = i + j + k, and

1 1 1
n = √ i + √ j + √ k.
3 3 3

2
19. A parabola of infinite extent along
√ the y-axis. Let
√ f (x, y, z) = z − x = 0.
2
Then N = −2xi + k, and n = −2xi/ 1 + 4x + k/ 1 + 4x . 2

20.
dx dy dz
= = ⇒ x = y + c1 , and y = z + c2 .
1 1 1
Upon substituting for the point, x = y − 1 and y = z.

21.
dx dy dz x 1 1
=− 2 = ⇒ = + c1 , and − = ln(z) + c2 .
2 y z 2 y y
Upon substituting for the point, y = 2/(x + 1), and z = exp [(y − 1)/y] .
Worked Solutions 99

22.
dx dy dz 1 1 1 1
=− 2 = 2 ⇒− = + c1 , and = − + c2 .
3x2 y z 3x y y z
Upon substituting for the point, x = 2y/(7y − 6), and z = 3y/(4y − 3).

23.
dx dy dz 1 1 1 1
= 2 = − 3 ⇒ = + c1 , and − = 2 + c2 .
x2 y z x y y 2z
Upon substituting for the point, y = x, and z 2 = y/(3y − 2).

24.

x dx = e−y dy = −dz ⇒ 21 x2 = −e−y + c1 , and z = − 21 x2 + c2 .



Upon substituting for the point, y = − ln 3 − 12 x2 , and z = 6 − 21 x2 .

25. Let z = x + iy. Then Equation 4.1.13 to Equation 4.1.14 can be written

d2 z dz g
− 2Ωi sin(λ) + z = 0
dt2 dt L
by multiplying Equation 4.1.14 by i and adding the two equations together.
This equation has the characteristic equation:
q
r = Ω sin(λ)i ± i g/L + Ω2 sin2 (λ).

If Ω2 ≪ g/L, the approximate solution is


p 
z(t) = A0 eΩ sin(λ)ti sin g/L t .

Taking the real and imaginary part of z(t) give x(t) and y(t) in Equation
4.1.15 to Equation 4.1.16.

26. A fluid cannot flow through a solid surface. The normal to the surface
is ∇f . Therefore, the direction derivative in the direction of the flow must
equal zero ∇f · v = 0 at the surface.

27. If we jump on an inertial frame moving with the sphere the fluid appears
to have the velocity v − u. The position of the surface of the sphere is r − ut.
Because the fluid cannot flow through the surface, (v − u) · (r − ut) = 0.

Section 4.2

1.      
∂ ∂ ∂
∇·F= x2 z + yz 2 + xy 2 = 2xz + z 2
∂x ∂y ∂z
100 Advanced Engineering Mathematics with MATLAB

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = (2xy − 2yz)i + (x2 − y 2 )j
2 2 2
x z yz xy
     
∂ ∂ ∂
∇·∇×F= 2xy − 2yz + x2 − y 2 + 0 =0
∂x ∂y ∂z
     
∂ 2 ∂ 2 ∂ 2
∇(∇ · F) = 2xz + z i + 2xz + z j + 2xz + z k
∂x ∂y ∂z
= 2zi + (2x + 2z)k

2.
     
∂ ∂ ∂
∇·F= 4x2 y 2 + 2x + 2yz + 3z + y 2 = 8xy 2 + 2z + 3
∂x ∂y ∂z

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = (2 − 8x2 y)k
2 2 2
4x y
2x + 2yz 3z + y
     
∂ ∂ ∂
∇·∇×F= 0 + 0 + 2 − 8x2 y = 0
∂x ∂y ∂z
   
∂ 2 ∂ 2
∇(∇ · F) = = 8xy + 2z + 3 i + 8xy + 2z + 3 j
∂x ∂y
 

+ 8xy 2 + 2z + 3 k = 8y 2 i + 16xyj + 2k
∂z

3.
     
∂ ∂ ∂
∇·F = (x − y)2 + e−xy + xze2y = 2(x − y) − xe−xy + xe2y
∂x ∂y ∂z

i j k  
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = 2xze2y i − ze2y j + 2(x − y) − ye−xy k
(x − y)2 exze−xy 2y
     
∂ ∂ ∂
∇·∇×F= 2xze2y + −ze2y + 2(x − y) − ye−xy = 0
∂x ∂y ∂z
 
∂ −xy 2y
∇(∇ · F) = = 2(x − y) − xe + xe i
∂x
 
∂ −xy 2y
+ 2(x − y) − xe + xe j
∂y
 
∂ −xy 2y
+ 2(x − y) − xe + xe k
∂z
 
= 2 − e−xy + xye−xy + e2y i + x2 e−xy + 2xe2y − 2 j
Worked Solutions 101

4.      
∂ ∂ 2 ∂
∇·F= 3xy + 2xz + y 3 = 3y
∂x ∂y ∂z
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = (3y 2 − 4xz)i + (2z 2 − 3x)k
2 3
3xy
2xz y
   
∂ 2 ∂ 2
∇·∇×F= 3y − 4xz + 2z − 3x = 0
∂x ∂z
     
∂ ∂ ∂
∇(∇ · F) = 3y i + 3y j + 3y k = 3j
∂x ∂y ∂z

5.      
∂ ∂ 2 ∂ 3
∇·F= 5yz + x z + 3x = 0
∂x ∂y ∂z
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = −x2 i + (5y − 9x2 )j + (2xz − 5z)k
2 3
5yz
x z 3x
     
∂ 2 ∂ 2 ∂
∇·∇×F= −x + 5y − 9x + 2xz − 5z = 0
∂x ∂y ∂z
     
∂ ∂ ∂
∇(∇ · F) = 0 i+ 0 j+ 0 k=0
∂x ∂y ∂z

6.      
∂ ∂ ∂
∇·F= y3 + x3 y 2 − xy + xz − x3 yz = x3 y
∂x ∂y ∂z
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z
3 3 2
y x y − xy xz − x3 yz
= −x3 zi + (3x2 yz − z)j + (3x2 y 2 − y − 3y 2 )k
     
∂ 3 ∂ 2 ∂ 2 2 2
∇·∇×F= −x z + 3x yz − z + 3x y − y − 3y = 0
∂x ∂y ∂z
     
∂ 3 ∂ 3 ∂
∇(∇ · F) = x y i+ x y j+ x y k = 3x2 yi + x3 j
3
∂x ∂y ∂z

7.
     
∂ ∂ ∂
∇·F= xe−y + yz 2 + 3e−z = e−y + z 2 − 3e−z
∂x ∂y ∂z
102 Advanced Engineering Mathematics with MATLAB

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = −2yzi + xe−y k
−y 2 −z
xeyz 3e
   
∂ ∂
∇·∇×F= −2yz + xe−y = 0
∂x ∂z
   
∂ −y 2 −z ∂ −y 2 −z
∇(∇ · F) = e + z − 3e i+ e + z − 3e j
∂x ∂y
 

+ e−y + z 2 − 3e−z k = −e−y j + (2z + 3e−z )k
∂z

8.
     
∂ ∂ ∂ 3
∇·F= y ln(x) + 2 − 3yz + xyz = y/x − 3z + 3xyz 2
∂x ∂y ∂z

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = (xz 3 + 3y)i + (−yz 3 )j − ln(x)k
3
y ln(x) 2 − 3yz xyz
     
∂ ∂ ∂
∇·∇×F= xz 3 + 3y + −yz 3 + − ln(x) = 0
∂x ∂y ∂z
   
∂ ∂
∇(∇ · F) = y/x − 3z + 3xyz 2 i + y/x − 3z + 3xyz 2 j
∂x ∂y
 

+ y/x − 3z + 3xyz 2 k
∂z
  
= −y/x2 + 3yz 2 i + 1/x + 3xz 2 j + −3 + 6xyz k

9.
     
∂ ∂ ∂
∇·F= xyz + x3 yzez + xyez = yz + x3 zez + xyez
∂x ∂y ∂z

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z
xyz x3 yzez xyez
= (xe − x ye − x3 yzez )i + (xy − yez )j + (3x2 yzez − xz)k
z 3 z

   
∂ z 3 z 3 z ∂ z
∇·∇×F= xe − x ye − x yze + xy − ye
∂x ∂y
 

+ 3x2 yzez − xz = 0
∂z
Worked Solutions 103
   
∂ 3 z z ∂ 3 z z
∇(∇ · F) = yz + x ze + xye i + yz + x ze + xye j
∂x ∂y
 

+ yz + x3 zez + xyez k
∂z
  
= 3x2 zez + yez i + z + xez j + y + x3 ez + x3 zez + xyez k

10.
     
∂ ∂ ∂
∇·F = xy 3 − z 4 + 4x4 y 2 z + −y 4 z 5 = y 3 + 8x4 yz − 5y 4 z 4
∂x ∂y ∂z
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z
3 4 4 2 4 5
xy − z 4x y z −y z
= (−4y z − 4x y )i − 4z 3 j + (16x3 y 2 z − 3xy 2 )k
3 5 4 2

   
∂ ∂
∇·∇×F= −4y 3 z 5 − 4x4 y 2 + −4z 3
∂x ∂y
 

+ 16x3 y 2 z − 3xy 2 = 0
∂z
   
∂ 3 4 4 4 ∂ 3 4 4 4
∇(∇ · F) = y + 8x yz − 5y z i + y + 8x yz − 5y z j
∂x ∂y
 

+ y 3 + 8x4 yz − 5y 4 z 4 k
∂z
 
= 32x3 yzi + 3y 2 + 8x4 z − 20y 3 z 4 j + 8x4 y − 20y 4 z 3 k

11.
     
∂ 2 ∂ 2 ∂
∇·F= xy + xyz + xy cos(z) = y 2 + xz 2 − xy sin(z)
∂x ∂y ∂z
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z
2
xy xyz 2 xy cos(z)
= [x cos(z) − 2xyz]i − y cos(z)j + (yz 2 − 2xy)k
     
∂ ∂ ∂ 2
∇·∇×F= x cos(z) − 2xyz + −y cos(z) + yz − 2xy = 0
∂x ∂y ∂z
   
∂ ∂ 2
∇(∇ · F) = y 2 + xz 2 − xy sin(z) i + y + xz 2 − xy sin(z) j
∂x ∂y
 
∂ 2
+ y + xz 2 − xy sin(z) k
∂z
   
= [z 2 − y sin(z)]i + 2y − x sin(z) j + 2xz − xy cos(z) k
104 Advanced Engineering Mathematics with MATLAB

12.
     
∂ 2 ∂ 2 ∂
∇·F= xy + xyz + xy sin(z) = y 2 + xz 2 + xy cos(z)
∂x ∂y ∂z

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z
2
xy xyz 2 xy sin(z)
= [x sin(z) − 2xyz]i − y sin(z)j + (yz 2 − 2xy)k
     
∂ ∂ ∂ 2
∇·∇×F= x sin(z) − 2xyz + −y sin(z) + yz − 2xy = 0
∂x ∂y ∂z
   
∂ 2 2 ∂ 2 2
∇(∇ · F) = y + xz + xy cos(z) i + y + xz + xy cos(z) j
∂x ∂y
 
∂ 2
+ y + xz 2 + xy cos(z) k
∂z
   
= [z 2 + y cos(z)]i + 2y + x cos(z) j + 2xz − xy sin(z) k

13.
     
∂ 2 ∂ ∂
∇·F= xy + xyz + xy cos(z) = y 2 + xz − xy sin(z)
∂x ∂y ∂z

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z
2
xy xyz xy cos(z)
= [x cos(z) − xy]i − y cos(z)j + (yz − 2xy)k
     
∂ ∂ ∂
∇·∇×F= x cos(z) − xy + −y cos(z) + yz − 2xy = 0
∂x ∂y ∂z
   
∂ 2 ∂ 2
∇(∇ · F) = y + xz − xy sin(z) i + y + xz − xy sin(z) j
∂x ∂y
 
∂ 2
+ y + xz − xy sin(z) k
∂z
   
= [z − y sin(z)]i + 2y − x sin(z) j + x − xy cos(z) k

14.(a) If F = P (x, y, z)i + Q(x, y, z)j + R(x, y, z)k,

i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z
P (x, y, z) Q(x, y, z) R(x, y, z)
= [Ry − Qz ]i + [Pz − Rx ]j + [Qx − Py ]k
Worked Solutions 105

i j k
∂ ∂ ∂
∇×∇×F= ∂x ∂y ∂z
R y − Qz Pz − R x Q x − Py
= [Pxx + Qxy + Rxz − Pxx − Pyy − Pzz ]i
+ [Pxy + Qyy + Ryz − Qxx − Qyy − Qzz ]j
+ [Pxz + Qyz + Rzz − Rxx − Ryy − Rzz ]k
= ∇ (∇ · F) − ∇2 F
(b)
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = −4yi − 2zj − 3xk
3xy 4yz 2xz
i j k
∂ ∂ ∂
∇×∇×F= ∂x ∂y ∂z = 2i + 3j + 4k
−4y −2z −3x
∇ (∇ · F) = ∇(3y + 4z + 2x) = 2i + 3j + 4k, ∇2 F = 0
∇ × ∇ × F = ∇ (∇ · F) − ∇2 F = 2i + 3j + 4k

15.
1 ∂ 1 ∂2E 1 ∂2E
∇×∇×E = − (∇ × B) , ∇ (∇ · E)−∇2 E = − , ∇2 E =
c ∂t c2 ∂t2 c2 ∂t2
1 ∂ 1 ∂2B 1 ∂2B
∇×∇×B = (∇ × E) , ∇ (∇ · B)−∇2 B = − , ∇2 B =
c ∂t c2 ∂t2 c2 ∂t2

16. From Equation 4.2.19, ∇ × (f ∇g) = f ∇ × ∇g + ∇f × ∇g. But, ∇ ×


∇g = 0 from Equation 4.2.17. Therefore, ∇ × (f ∇g) = ∇f × ∇g. Finally,
∇ · (∇f × ∇g) = ∇ · ∇ × (f ∇g) = 0 from Equation 4.2.18.

17. Taking the curl of both sides of the equilibrium condition: ∇ × ∇p = ∇ ×


(ρF) = 0. Then ∇×(ρF) = ∇ρ×F+ρ∇×F = 0. Dotting the equation with F,
we have that F·(∇ρ×F)+ρF·(∇×F) = 0. But F·(∇ρ×F) = ∇ρ·(F×F) = 0.
Therefore, F · ∇ × F = 0 after dividing by ρ.

Section 4.3

1. Z Z
F · dr = y sin(πz) dx + x2 ey dy + 3xz dz
C C
Z 1
2
= t2 sin(πt3 ) dt + t2 et (2t dt) + 9t6 dt
0
1 1
1 2  1 9 7 16 2
=− cos(πt3 ) + et t2 − 1 + t = +
3π 0 0 7 0 7 3π
106 Advanced Engineering Mathematics with MATLAB

2. Z Z Z Z
F · dr = y dx + z dy + x dz = F · dr + F · dr
C C C1 C2

Along C1 , z = dz = 0 and x = 2t, y = 3t, 0 ≤ t ≤ 1, so that


Z Z Z 1
F · dr = y dx + z dy + x dz = (3t)(2 dt) + (0)(3 dt) + (2t)(0)
C1 C1 0
Z 1
1
= 6t dt = 3t2 0
=3
0
Z Z Z 4
F · dr = y dx + z dy + x dz = 3 · 0 + z · 0 + 2 dz = 8
C2 C2 0
Z
F · dr = 3 + 8 = 11
C

3.
Z Z Z 2
3 6
F · dr = ex dx + xexy dy + xyexyz dz = et dt + 2t2 et dt + 3t5 et dt
C C 0
2 2 2
2 3 1 6
= et + et + et = e2 + 23 e8 + 21 e64 − 13
6
0 3 0 2 0

4.
Z Z Z 2
F · dr = yz dx + xz dy + xy dz = t2 · t · 3t2 dt + t3 · t · 2t dt + t5 dt
C C 1
Z 2
2
= 6t5 dt = t6 1
= 63
1

5. Z Z Z Z
F · dr = y dx − x dy + 3xy dz = F · dr + F · dr
C C C1 C2

Along C1 , z = dz = 0 and x = 2 cos(t), y = 2 sin(t), 0 ≤ t ≤ π, so that


Z Z
F · dr = y dx − x dy + 3xy dz
C1 C1
Z π
= [2 sin(t)][−2 sin(t) dt] − [2 cos(t)][2 cos(t) dt]
0
+ 3[2 cos(t)][2 sin(t)] · 0
Z π
= −4 sin2 (t) dt − 4 cos2 (t) dt = −4π
0
Worked Solutions 107
Z Z Z 2
F · dr = y dx − x dy + 3xy dz = 0 · dx − x · 0 + 3x · 0 · 0 = 0
C2 C2 −2
Z
F · dr = −4π + 0 = −4π
C

6.
Z Z Z Z Z
F · dr = (x + 2y) dx + (6y − 2x) dy = F · dr + F · dr + F · dr
C C C1 C2 C3

Along C1 , x = y = z = t and dx = dy = dz = dt so that


Z Z Z 1
F · dr = (x + 2y) dx + (6y − 2x) dy = (t + 2t) dt + (6t − 2t) dt
C1 C1 0
1
7 2 7
= t = .
2 0 2

Along C2 , x = y = 1 and dx = dy = 0 so that


Z Z Z 0
F · dr = (x + 2y) dx + (6y − 2x) dy = (3 · 0 + 4 · 0 + 0 dz) = 0.
C2 C2 1

Along C3 , x = y = t and z = 0 so that


Z Z Z 0 1
7 2 7
F · dr = (x + 2y) dx + (6y − 2x) dy = 3t dt + 4t dt = t =− .
C3 C3 1 2 0 2

Z
7 7
F · dr = 2 +0− 2 =0
C

7. Let x = 2 cos(t) and y = 3 sin(t). Then,


Z Z
F · dr = 2xz dx + 4y 2 dy + x2 dz
C C
Z 2π
= 2[2 cos(t)] · 1 · [−2 sin(t) dt]
0
+ 4[9 sin2 (t)][3 cos(t) dt] + 4 cos2 (t) · 0
2π 2π
= 4 cos2 (t) + 108
3 sin3 (t) =0
0 0
108 Advanced Engineering Mathematics with MATLAB

8. Z Z
F · dr = 2x dx + y dy + z dz
C C
Z 2π
= 2t dt + sin(t) cos(t) dt
0
+ [cos(t) + sin(t)][− sin(t) dt + cos(t) dt]
2π 2π 2π
= t2 + 1
2 sin2 (t) + 12 [cos(t) + sin(t)]2 = 4π 2
0 0 0

9.
Z Z
F · dr = (2y 2 + z) dx + 4xy dy + x dz
C C
Z 2π
= [2 sin2 (t) + t][− sin(t) dt] + 4 cos(t) sin(t)[cos(t) dt] + cos(t) dt
0
Z 2π
= [−2 sin(t) + 6 cos2 (t) sin(t) − t sin(t) + cos(t)] dt
0

= [2 cos(t) − 2 cos3 (t) + t cos(t)] = 2π
0

10. Z Z
F · dr = x2 dx + y 2 dy + (z 2 + 2xy) dz
C C
Z
= x2 dx + y 2 dy + (z 2 + 2xy) dz
C1
Z
+ x2 dx + y 2 dy + (z 2 + 2xy) dz
C2
Z
+ x2 dx + y 2 dy + (z 2 + 2xy) dz
C3
Z Z 1
x2 dx + y 2 dy + (z 2 + 2xy) dz = x2 dx + x2 dx + (02 + 2x2 ) · 0 = 2
3
C1 0
Z Z 0
2 2 2
x dx + y dy + (z + 2xy) dz = x2 dx + 12 · 0 + (02 + 2x · 1) · 0 = − 13
C2 1
Z Z 0
x2 dx + y 2 dy + (z 2 + 2xy) dz = 02 · 0 + y 2 dy + (02 + 2y · 0) · 0 = − 13
C3 1
Z
x2 dx + y 2 dy + (z 2 + 2xy) dz = 0
C
Worked Solutions 109

Section 4.4

1. Because ∇ × F = 0, we have a conservative field. To find the potential, we


must integrate ϕx = 2xy, ϕy = x2 + 2yz and ϕz = y 2 + 4. Integrating first
with respect to x, ϕ(x, y, z) = x2 y + f (y, z) and ϕy = x2 + fy = x2 + 2yz.
Therefore, f (y, z) = y 2 z + h(z) and ϕ(x, y, z) = x2 y + y 2 z + h(z). Then
ϕz = y 2 + h′ (z) = y 2 + 4 and h(z) = 4z + constant. The final answer is
ϕ(x, y, z) = x2 y + y 2 z + 4z + constant.

2. Because ∇ × F = 0, we have a conservative field. To find the potential,


we must integrate ϕx = 2x + 2ze2x , ϕy = 2y − 1 and ϕz = e2x . Integrating
first with respect to x, ϕ(x, y, z) = x2 + ze2x + f (y, z) and ϕy = fy = 2y − 1.
Therefore, f (y, z) = y 2 − y + h(z) and ϕ(x, y, z) = x2 + ze2x + y 2 − y + h(z).
Then ϕz = e2x + h′ (z) = e2x and h(z) = constant. The final answer is
ϕ(x, y, z) = x2 + ze2x + y 2 − y + constant.

3. Because ∇ × F = 0, we have a conservative field. To find the potential,


we must integrate ϕx = yz, ϕy = xz and ϕz = xy. Integrating first with
respect to x, ϕ(x, y, z) = xyz + f (y, z) and ϕy = xz + fy = xz. Therefore,
f (y, z) = h(z) and ϕ(x, y, z) = xyz + h(z). Then ϕz = xy + h′ (z) = xy and
h(z) = constant. The final answer is ϕ(x, y, z) = xyz + constant.

4. Because ∇ × F = 0, we have a conservative field. To find the potential,


we must integrate ϕx = 2x, ϕy = 3y 2 and ϕz = 4z 3 . Integrating first with
respect to x, ϕ(x, y, z) = x2 + f (y, z) and ϕy = fy = 3y 2 . Therefore, f (y, z) =
y 3 + h(z) and ϕ(x, y, z) = x2 + y 3 + h(z). Then ϕz = h′ (z) = 4z 3 and
h(z) = z 4 + constant. The final answer is ϕ(x, y, z) = x2 + y 3 + z 4 + constant.

5. Because ∇ × F = 0, we have a conservative field. To find the potential,


we must integrate ϕx = 2x sin(y) + e3z , ϕy = x2 cos(y) and ϕz = 3xe3z + 4.
Integrating first with respect to x, ϕ(x, y, z) = x2 sin(y) + xe3z + f (y, z) and
ϕy = x2 cos(y) + fy = x2 cos(y). Therefore, f (y, z) = h(z) and ϕ(x, y, z) =
x2 sin(y) + xe3z + h(z). Then ϕz = 3xe3z + h′ (z) = 3xe3z + 4 and h(z) =
4z + constant. The final answer is ϕ(x, y, z) = x2 sin(y) + xe3z + 4z + constant.

6. Because ∇ × F = 0, we have a conservative field. To find the potential, we


must integrate ϕx = 2x + 5, ϕy = 3y 2 and ϕz = 1/z. Integrating first with
respect to x, ϕ(x, y, z) = x2 + 5x + f (y, z) and ϕy = fy = 3y 2 . Therefore,
f (y, z) = y 3 +h(z) and ϕ(x, y, z) = x2 +5x+y 3 +h(z). Then ϕz = h′ (z) = 1/z
and h(z) = ln(z) + constant. The final answer is ϕ(x, y, z) = x2 + 5x + y 3 +
ln(z) + constant.

7. Because ∇ × F = 0, we have a conservative field. To find the potential,


we must integrate ϕx = e2z , ϕy = 3y 2 and ϕz = 2xe2z . Integrating first
with respect to x, ϕ(x, y, z) = xe2z + f (y, z) and ϕy = fy = 3y 2 . Therefore,
110 Advanced Engineering Mathematics with MATLAB

f (y, z) = y 3 +h(z) and ϕ(x, y, z) = xe2z +y 3 +h(z). Then ϕz = 2xe2z +h′ (z) =
2xe2z and h(z) = constant. The final answer is ϕ(x, y, z) = xe2z + y 3 +
constant.

8. Because ∇ × F = 0, we have a conservative field. To find the potential,


we must integrate ϕx = y, ϕy = x + z and ϕz = y. Integrating first with
respect to x, ϕ(x, y, z) = xy + f (y, z) and ϕy = x + fy = x + z. Therefore,
f (y, z) = yz + h(z) and ϕ(x, y, z) = xy + yz + h(z). Then ϕz = y + h′ (z) = y
and h(z) = constant. The final answer is ϕ(x, y, z) = xy + yz + constant.

9. Because ∇ × F = 0, we have a conservative field. To find the potential,


we must integrate ϕx = y + z, ϕy = x and ϕz = x. Integrating first with
respect to x, ϕ(x, y, z) = xy + xz + f (y, z) and ϕy = x + fy = x. Therefore,
f (y, z) = h(z) and ϕ(x, y, z) = xy + xz + h(z). Then ϕz = x + h′ (z) = x and
h(z) = constant. The final answer is ϕ(x, y, z) = xy + xz + constant.

Section 4.5

1.
ZZ Z 1 Z 1 Z 1 Z 1
1
F · n dσ = (xi − j + yk) · k dx dy = y dx dy =
S 0 0 0 0 2

2.
ZZ ZZ
F · n dσ = (xi + yj + xzk) · k dσ
S S
Z 3 Z 2π 3 2π
r3
= [r cos(θ)] · 1 · r dθ dr = sin(θ) =0
0 0 3 0 0

3. First, we write the surface integral as a sum of the top and bottom lids:
ZZ ZZ ZZ
F · n dσ = F · n dσ + F · n dσ.
S S1 S2

For the top,


ZZ ZZ
F · n dσ = (xyi + 2j + 2xk) · k dσ
S1 S1
Z 2π Z 2
= [r2 cos(θ) sin(θ)i + 2j + 2r cos(θ)k] · k r dr dθ
0 0
2 2π
2r3
= sin(θ) = 0.
3 0 0
Worked Solutions 111

For the bottom,


ZZ ZZ Z 2π Z 2
F · n dσ = xyi · k dσ = r2 cos(θ) sin(θ)i · k r dr dθ = 0.
S2 S2 0 0

Therefore, ZZ
F · n dσ = 0.
S

4. The equation for the surface is f (x, y, z) = x2 + y 2 = 4 and the outward


pointing unit normal is

∇f 2xi + 2yj x y
n= =p = i + j.
|∇f | 2
4x + 4y 2 2 2

Because x = 2 cos(θ) and y = 2 sin(θ). Then,


ZZ ZZ x y 
F · n dσ = (xi + zj + yk) · i + j dσ
S S 2 2
Z 3 Z 2π
= [2 cos(θ)i + zj + 2 sin(θ)k] · [cos(θ)i + sin(θ)j] 2 dθ dz
−3 0
Z 3 Z 2π
=2 [2 cos2 (θ) + z sin(θ)] dθ dz
−3 0
Z 3 2π Z 3
 1

=2 θ+ 2 sin(2θ) − z cos(θ) dz = 4π dz = 24π.
−3 0 −3

5. The equation for the surface is f (x, y, z) = y 2 + z 2 = 9 and the outward


pointing unit normal is

∇f 2yj + 2zk y z
n= =p = j + k.
|∇f | 2
4y + 4z 2 3 3

Let y = 3 cos(θ) and z = 3 sin(θ). Then,


ZZ ZZ y z 
F · n dσ = (xyi + z 2 j + yk) · j + k dσ
S S 3 3
Z π/2 Z 1
= 31 [27 sin2 (θ) cos(θ) + 9 cos(θ) sin(θ)] 3 dx dθ
0 0
Z π/2
= [27 sin2 (θ) cos(θ) + 9 cos(θ) sin(θ)] dθ
0
π/2 π/2
= 9 sin3 (θ) + 9
2 sin2 (θ) = 27
2 .
0 0
112 Advanced Engineering Mathematics with MATLAB

6. The equation for the surface is f (x, y, z) = y 2 + z 2 = 4 and the outward


pointing unit normal is

∇f 2yj + 2zk y z
n= =p = j + k.
|∇f | 2
4y + 4z 2 2 2

Let y = 2 cos(θ) and z = 2 sin(θ). Then,


ZZ ZZ y ZZ
z  1
F · n dσ = (yj + z 2 k) · j + k dσ = (y 2 + z 3 ) dσ
S S 2 2 2 S
Z π Z 1
1
= [4 cos2 (θ) + 8 sin3 (θ)] 2 dx dθ
2 0 0
Z π
= 2[1 + cos(2θ)] + 8[sin(θ) − cos2 (θ) sin(θ)] dθ
0
 π  π
= 2 θ + 21 sin(2θ) 0 + 8 13 cos3 (θ) − cos(θ) 0 = 2π + 32
3 .

7. The equation for the surface is f (x, y, z) = x2 + y 2 = 4 and the outward


pointing unit normal is

∇f 2xi + 2yj x y
n= =p = i + j.
|∇f | 2
4x + 4y 2 2 2

ZZ ZZ x y 
F · n dσ = (zi + xj + yk) · i + j dσ
S S 2 2
Z 2 Z π/2
= [zi + 2 cos(θ)j + 2 sin(θ)k] · [cos(θ)i + sin(θ)j] 2 dθ dz
1 0

ZZ Z 2 Z π/2
F · n dσ = [z cos(θ) + 2 cos(θ) sin(θ)] 2 dθ dz
S 1 0
Z 2 π/2 π/2 
2
=2 z sin(θ) + sin (θ) dz
1 0 0
Z 2  2
=2 (z + 1) dz = z 2 + 2z 1
=5
1

8. The equation for the surface is f (x, y, z) = x2 + y 2 + z 2 = 16 and the


outward pointing unit normal is

∇f 2xi + 2yj + 2zk x y z


n= =p = i + j + k.
|∇f | 2 2
4x + 4y + 4z 2 4 4 4
Worked Solutions 113
ZZ ZZ x y z
F · n dσ = (x2 i − z 2 j + yzk) · i+ j+ dσ
S S 4 4 4
Z 2π Z π/3 
= 16 cos2 (θ) sin2 (ϕ)i − 16 cos2 (ϕ)j
0 0

+ 16 sin(θ) sin(ϕ) cos(ϕ)k
· [cos(θ) sin(ϕ)i + sin(θ) sin(ϕ)j + cos(ϕ)k]
· 16 sin(θ) dθ dϕ
Z 2π π/3
= −64 sin3 (ϕ) cos4 (θ) dϕ
0 0
Z 2π
= 60 [sin(ϕ) − cos2 (ϕ) sin(ϕ)] dϕ
0

 1

= 60 − cos(ϕ) + 3 cos3 (ϕ) =0
0

9. Setting r = xi + yj + (x + 1)k, rx = i + k, ry = j, and


i j k
rx × ry = 1 0 1 = −i + k.
0 1 0
Then, ZZ Z Z
1 1
F · n dσ = [yi + xj + yk] · [−i + k] dx dy
S −1 −1
Z 1 Z 1
= (−y + y) dx dy = 0.
−1 −1

10. Setting r = xi + yj + (2a − x − y)k, rx = i − k, ry = j − k, and


i j k
rx × ry = 1 0 −1 = i + j + k.
0 1 −1
Then,
ZZ Z a Z a
F · n dσ = [(2a − x − y)i + xj − 3(2a − x − y)k]
S 0 0
· [i + j + k] dx dy
Z a Z a
= (3x + 2y − 4a) dx dy
0 0
Z a a Z a
3 2
 
= 2x + 2xy − 4ax dy = − 52 a2 + 2ay dy
0 0 0
a

= − 52 a2 y + ay 2
= − 25 a3 + a3 = − 32 a3 .
0
114 Advanced Engineering Mathematics with MATLAB

11. Setting r = xi + yj + (1 − x2 )k, rx = i − 2xk, ry = j, and


i j k
rx × ry = 1 0 −2x = 2xi + k.
0 1 0
Then,
ZZ Z 2 Z 1
F · n dσ = {[y 2 + (1 − x2 )2 ]i + [x2 + (1 − x2 )2 ]j
S −2 −1
+ (x2 + y 2 )k} · [2xi + k] dx dy
Z 2 Z 1
= {2x[y 2 + (1 − x2 )2 ] + x2 + y 2 } dx dy
−2 −1
Z 2 Z 1
= (2xy 2 + 2x − 4x3 + 2x5 + x2 + y 2 ) dx dy
−2 −1
Z 2 Z 2
1 3 2
 1 2

=2 3x + xy 0
dy = 3 + 2y 2 dy
−2 −2
2
2

=2 3y + 23 y 3
= 40
3 .
0

12. Setting r = r cos(θ)i + r sin(θ)j + rk, rr = cos(θ)i + sin(θ)j + k, rθ =


−r sin(θ)i + r cos(θ)j, and
i j k
rr × rθ = cos(θ) sin(θ) 1 = −r cos(θ)i − r sin(θ)j + rk.
−r sin(θ) r cos(θ) 0
Then,
ZZ Z 1 Z 2π
F · n dσ = [r2 sin2 (θ)i + r2 cos(θ)j − k]
S 0 0
· [r cos(θ)i + r sin(θ)j − rk] dθ dr
Z 1 Z 2π
= [r3 sin2 (θ) cos(θ) + r3 sin(θ) cos(θ) + r] dθ dr
0 0
Z 1 
1 3 3 2π 1 3 2 2π 2π
= 3 r sin (θ) 0
+ 2 r sin (θ) 0
+ rθ 0
dr
0
Z 1
1
=π 2r dr = πr2 0
= π.
0

13. Setting r = xi + yj + (y + 1)k, rx = i, ry = j + k, and


i j k
rx × ry = 1 0 0 = −j + k.
0 1 1
Worked Solutions 115

Then,
ZZ Z 1 Z 1
F · n dσ = [y 2 i + x2 j + 5(y + 1)k] · (−j + k) dx dy
S −1 −1
Z 1Z 1 Z 1
2
  1
= (−x + 5y + 5) dx dy = − 31 x3 + 5x(y + 1) −1
dy
−1 −1 −1
Z 1 1
28
 28
 86
= 3 + 10y dy = 3 y + 5y 2 = 3 .
−1 −1

14. We set r = r cos(θ)i + r sin(θ)j + r2 k, rr = cos(θ)i + sin(θ)j + 2rk,


rθ = −r sin(θ)i + r cos(θ)j, and

i j k
rr × rθ = cos(θ) sin(θ) 2r = −2r2 cos(θ)i − 2r2 sin(θ)j + rk.
−r sin(θ) r cos(θ) 0

We need exterior normal so we must take the opposite of rr × rθ . Then,


ZZ Z 2π Z 1
F · n dσ = [−r sin(θ)i + r cos(θ)j + r2 k]
S 0 0
· [2r2 cos(θ)i + 2r2 sin(θ)j − rk] dr dθ
Z 1Z 2π 1
r4 π
= −r3 dθ dr = −2π =− .
0 0 4 0 2

15. For the paraboloid z = 4−x2 −y 2 , we set r = r cos(θ)i+r sin(θ)j+(4−r2 )k,


rr = cos(θ)i + sin(θ)j − 2rk, rθ = −r sin(θ)i + r cos(θ)j, and

i j k
rr × rθ = cos(θ) sin(θ) −2r = 2r2 cos(θ)i + 2r2 sin(θ)j + rk.
−r sin(θ) r cos(θ) 0

Then,
ZZ Z √ Z
2 2π
F · n dσ = [−r sin(θ)i + r cos(θ)j + 6(4 − r2 )2 k]
S 0 0
· [2r2 cos(θ)i + 2r2 sin(θ)j + rk] dθ dr
Z √ Z √2
2 Z 2π
2 2 2π
= 6(4 − r ) r dθ dr = 6(4 − r2 )2 r θ 0
dr
0 0 0

2
= −2π(4 − r2 )3 0
= 112π.
116 Advanced Engineering Mathematics with MATLAB

For the paraboloid z = x2 + y 2 , we set r = r cos(θ)i + r sin(θ)j + r2 k, rr =


cos(θ)i + sin(θ)j + 2rk, rθ = −r sin(θ)i + r cos(θ)j, and
i j k
rr × rθ = cos(θ) sin(θ) 2r = −2r2 cos(θ)i − 2r2 sin(θ)j + rk.
−r sin(θ) r cos(θ 0
Then,
ZZ Z √ Z
2 2π
F · n dσ = [−r sin(θ)i + r cos(θ)j + 6r4 k]
S 0 0
· [2r2 cos(θ)i + 2r2 sin(θ)j − rk] dθ dr
Z √ Z √2
2Z 2π
5 2π
=− 6r dθ dr = − 6r5 θ 0 dr
0 0 0

6 2
= −2πr 0
= −16π.
Thus, the total flux is 96π.

Section 4.6

1. I Z
2
(x + 4y) dx + (y − x) dy = (x2 + 4y) dx + (y − x) dy
C C1
Z
+ (x2 + 4y) dx + (y − x) dy
C2
Z
+ (x2 + 4y) dx + (y − x) dy
C3
Z
+ (x2 + 4y) dx + (y − x) dy
C4

Along C1 , x = dx = 0 and
Z Z 0 Z 0
(x2 + 4y) dx + (y − x) dy = (02 + 4y) · 0 + (y − 0) dy = y dy = − 12 .
C1 1 1

Along C2 , y = dy = 0 and
Z Z 1
(x2 + 4y) dx + (y − x) dy = (x2 + 0) dx + (0 − x) · 0 = 13 .
C2 0

Along C3 , x = 1 and dx = 0 and


Z Z 1
(x2 + 4y) dx + (y − x) dy = (1 + 4y) · 0 + (y − 1) dy
C3 0
1
1 2

= 2y −y = − 12 .
0
Worked Solutions 117

Along C4 , y = 1 and dy = 0 and


Z Z 0
(x2 + 4y) dx + (y − x) dy = (x2 + 4) dx + (1 − x) · 0
C2 1
0
= 31 x3 + 4x = − 31 − 4.
1

Thus, I
(x2 + 4y) dx + (y − x) dy = −5.
C

By Green’s lemma,
I ZZ  
2 ∂ ∂ 2
(x + 4y) dx + (y − x) dy = (y − x) − (x + 4y) dx dy
C R ∂x ∂y
Z 1Z 1
= (−1 − 4) dx dy = −5.
0 0

2.
I Z Z
(x − y) dx + xy dy = (x − y) dx + xy dy + (x − y) dx + xy dy
C C1 C2
Z Z
+ (x − y) dx + xy dy + (x − y) dx + xy dy
C3 C4

Along C1 , y = dy = 0 and
Z Z 1 Z 1
(x − y) dx + xy dy = (x − 0) dx + x · 0 · 0 = x dx = 12 .
C1 0 0

Along C2 , x = 1, dx = 0 and
Z Z 1
(x − y) dx + xy dy = (1 − y) · 0 + 1 · y dy = 12 .
C2 0

Along C3 , y = 1, dy = 0 and
Z Z 0 0
1 2

(x − y) dx + xy dy = (x − 1) dx + x · 1 · 0 = 2x −x = 21 .
C3 1 1

Along C4 , x = dx = 0 and
Z Z 0
(x − y) dx + xy dy = (0 − y) · 0 + 0 · y dy = 0.
C4 1
118 Advanced Engineering Mathematics with MATLAB

Thus, I
(x − y) dx + xy dy = 32 .
C

By Green’s lemma,
I ZZ  
∂ ∂
(x − y) dx + xy dy = (xy) − (x − y) dx dy
C R ∂x ∂y
Z 1Z 1
= (y + 1) dx dy = 23 .
0 0

3. I Z Z
−y 2 dx + x2 dy = −y 2 dx + x2 dy + −y 2 dx + x2 dy
C
Z C1 C2

2 2
+ −y dx + x dy
C3

Along C1 , y = dy = 0 and
Z Z 1
−y 2 dx + x2 dy = −02 dx + x2 · 0 = 0.
C1 0

Along C2 , x = 1 and dx = 0 and


Z Z 1
2 2
−y dx + x dy = −y 2 · 0 + 12 dy = 1.
C2 0

Along C3 , y = x and dy = dx and


Z Z 0
2 2
−y dx + x dy = −x2 dx + x2 dx = 0.
C3 1

Thus, I
−y 2 dx + x2 dy = 1.
C

By Green’s lemma,
I ZZ  
∂ 2 ∂
−y 2 dx + x2 dy = (x ) − (−y 2 ) dx dy
C R ∂x ∂y
Z 1Z x Z 1
x
= (2x + 2y) dy dx = (2xy + y 2 ) 0
dx
0 0 0
Z 1 1
= 3x2 dx = x3 = 1.
0 0
Worked Solutions 119

4. I Z
(xy − x2 ) dx + x2 y dy = (xy − x2 ) dx + x2 y dy
C
Z C1
+ (xy − x2 ) dx + x2 y dy
Z C2
+ (xy − x2 ) dx + x2 y dy
C3

Along C1 , y = dy = 0 and
Z Z 1 1
(xy − x2 ) dx + x2 y dy = (x · 0 − x2 ) dx + x2 0 · 0 = − 13 x3 = − 13 .
C1 0 0

Along C2 , x = 1 and dx = 0 and


Z Z 1 1
y2
(xy − x2 ) dx + x2 y dy = (y − 12 ) · 0 + y dy = = 21 .
C2 0 2 0

Along C3 , y = x and dy = dx and


Z Z 0 0
(xy − x2 ) dx + x2 y dy = (x2 − x2 ) dx + x3 dx = 41 x4 = − 41 .
C3 1 1

Thus, I
(xy − x2 ) dx + x2 y dy = − 12
1
.
C

By Green’s lemma,
I ZZ  
2 2∂ 2 ∂ 2
(xy − x ) dx + x y dy = (x y) − (xy − x ) dx dy
C R ∂x ∂y
Z 1Z x Z 1
x
= (2xy − x) dy dx = (xy 2 − xy) 0
dx
0 0 0
Z 1 1
= (x3 − x2 ) dx = 14 x4 − 31 x3 1
= − 12 .
0 0

5. I Z
sin(y) dx + x cos(y) dy = sin(y) dx + x cos(y) dy
C C1
Z
+ sin(y) dx + x cos(y) dy
C2
Z
+ sin(y) dx + x cos(y) dy
C3
120 Advanced Engineering Mathematics with MATLAB

Along C1 , y = dy = 0 and
Z Z 1
sin(y) dx + x cos(y) dy = 0 dx + x · 1 · 0 = 0.
C1 −1

Along C2 , y = 1 − x and dy = −dx and


Z Z 0
sin(y) dx + x cos(y) dy = sin(1 − x) dx + x cos(1 − x) (−dx)
C2 1
Z 1 Z 1
= sin(x − 1) dx + x cos(x − 1) dx
0 0
1 1
= (x − 1) sin(x − 1) + sin(x − 1) = 0.
0 0

Along C3 , y = x + 1 and dy = dx and


Z Z −1
sin(y) dx + x cos(y) dy = [sin(x + 1) + x cos(x + 1)] dx
C3 0
−1 −1
= (x + 1) sin(x + 1) − sin(x + 1) = 0.
0 0

Thus, I
sin(y) dx + x cos(y) dy = 0.
C

By Green’s lemma,
I ZZ  
∂ ∂
sin(y) dx + x cos(y) dy = [x cos(y)] − [sin(y)] dx dy = 0.
C R ∂x ∂y

6. I Z Z
y 2 dx + x2 dy = y 2 dx + x2 dy + y 2 dx + x2 dy
C C1 C2
Z
+ y 2 dx + x2 dy
C3

Along C1 , y = dy = 0 and
Z Z 1
y 2 dx + x2 dy = 0 dx + x2 · 0 = 0.
C1 0

Along C2 , x = 1 and dx = 0 and


Z Z 1
2 2
y dx + x dy = y 2 · 0 + 12 dy = 1.
C2 0
Worked Solutions 121

Along C3 , y = x and dy = dx and


Z Z 0 0
2 2
y dx + x dy = x2 dx + x2 dx = 23 x3 = − 32 .
C3 1 1
Thus, I
y 2 dx + x2 dy = 13 .
C
By Green’s lemma,
I ZZ  
∂ 2 ∂ 2
y 2 dx + x2 dy = (x ) − (y ) dx dy
C R ∂x ∂y
Z 1Z x Z 1 x
= (2x − 2y) dy dx = (2xy − y 2 ) dx
0 0 0 0
Z 1
= x2 dx = 13 .
0

7.
I Z 2π
−y 2 dx + x2 dy = [−4 sin2 (θ)][−2 sin(θ) dθ]
C 0
+ [4 cos2 (θ)][2 cos(θ) dθ]
Z 2π
=8 [cos3 (θ) + sin3 (θ)] dθ
0
Z 2π
=8 {cos(θ)[1 − sin2 (θ)] + sin(θ)[1 − cos2 (θ)]}dθ
0

 
= 8 sin(θ) − 1
3 sin3 (θ) − cos(θ) + 1
3 cos3 (θ) =0
0
By Green’s lemma,
I ZZ  
∂ 2 ∂
−y 2 dx + x2 dy = (x ) − (−y 2 ) dx dy
C R ∂x ∂y
Z 2 Z 2π
= [2r cos(θ) + 2r sin(θ)] r dθ dr
0 0
2 2π
2r3
= [sin(θ) − cos(θ)] = 0.
3 0 0

8.
I Z 2π
2 2
−x dx + xy dy = [−a2 cos2 (θ)][−a sin(θ) dθ]
C 0
+ [a3 cos(θ) sin2 (θ)][a cos(θ) dθ]
2π 2π
a3 a4   a4 π
=− cos3 (θ) + θ− 1
4 sin(4θ) = .
3 0 8 0 4
122 Advanced Engineering Mathematics with MATLAB

By Green’s lemma,
I ZZ  
2 2 ∂ 2 ∂ 2
−x dx + xy dy = (xy ) − (−x ) dx dy
C R ∂x ∂y
Z a Z 2π
= [r2 sin2 (θ)] r dθ dr
0 0
4 a  2π
r 1 1
 a4 π
= θ − sin(2θ) = .
4 02 2
0 4

9. Let x = 1 + 2 cos(θ) and y = 2 + 2 sin(θ) . Then,


I Z 2π
(6y + x) dx + (y + 2x) dy = [12 + 12 sin(θ) + 1 + 2 cos(θ)]
C 0
× [−2 sin(θ) dθ]
+ [2 + 2 sin(θ) + 2 + 4 cos(θ)]
× [2 cos(θ) dθ]
Z 2π
= [−26 sin(θ) − 24 sin2 (θ)
0
+ 8 cos(θ) + 8 cos2 (θ)] dθ
2π 2π
= 26 cos(θ) 0
− 12[θ − 12 sin(2θ)] 0
2π 2π
+ 8 sin(θ) 0
+ 4[θ + 21 sin(2θ)] 0 = −16π.

By Green’s lemma,
I ZZ  
∂ ∂
(6y + x) dx + (y + 2x) dy = (y + 2x) − (6y + x) dx dy
C R ∂x ∂y
Z 2 Z 2π
= −4 r dθ dr = (−4)(2π)(2) = −16π.
0 0

10. I Z
(x + y) dx + (2x2 − y 2 ) dy = (x + y) dx + (2x2 − y 2 ) dy
C C1
Z
+ (x + y) dx + (2x2 − y 2 ) dy
C2

For C1 , y = x2 and
Z Z 2
(x + y) dx + (2x2 − y 2 ) dy = (x + x2 ) dx + (2x2 − x4 )(2x dx)
C1 −2
  2
x2 x3 x6
= + + x4 − = 16
3 .
2 3 3 −2
Worked Solutions 123

For C2 , y = 4 and
Z Z −2
(x + y) dx + (2x2 − y 2 ) dy = (x + 4) dx + (2x2 − 16) · 0
C2 2
  −2
x2
= + 4x = −16.
2 2

Therefore, I
32
(x + y) dx + (2x2 − y 2 ) dy = − .
C 3
By Green’s lemma,
I ZZ  
∂ ∂
(x + y) dx + (2x2 − y 2 ) dy = (2x2 − y 2 ) − (x + y) dx dy
C R ∂x ∂y
Z 2Z 4
= (2x − 1) dy dx
−2 x2
Z 2
= (−4 + 8x + x2 − 2x3 ) dx
−2
  2
= −4x + 4x2 + 31 x3 − 12 x4 = − 32
3 .
−2

11. I Z Z
3y dx + 2x dy = 3y dx + 2x dy + 3y dx + 2x dy
C C1 C2

For C1 , y = 0 and
Z Z π
3y dx + 2x dy = 3 · 0 · dx + 2x · 0 = 0.
C1 0

For C2 , y = sin(x) and


Z Z 0
3y dx + 2x dy = 3 sin(x) dx + 2x cos(x) dx
C2 π
0 0
= −3 cos(x) π
+ 2[x sin(x) + cos(x)] π
= −2.
Therefore, I
3y dx + 2x dy = −2.
C
By Green’s lemma,
I ZZ   Z π Z sin(x)
∂ ∂
3y dx + 2x dy = (2x) − (3y) dx dy = − dy dx
C ∂x ∂y
Z πR 0 0
π
= sin(x) dx = cos(x) 0 = −2.
0
124 Advanced Engineering Mathematics with MATLAB

12. I Z
−16y dx + (4ey + 3x2 ) dy = −16y dx + (4ey + 3x2 ) dy
C C1
Z
+ −16y dx + (4ey + 3x2 ) dy
C2
Z
+ −16y dx + (4ey + 3x2 ) dy
C3

For C1 , y = x and

Z Z √
2
y 2
−16y dx + (4e + 3x ) dy = −16x dx + (4ex + 3x2 ) dx
C1 0

2 √
2 x 3
 √
2
= −8x + 4e + x = 4e + 2 2 − 20.
0

For C2 , x = 2 cos(θ), y = 2 sin(θ) and


Z Z 3π/4
−16y dx + (4ey + 3x2 ) dy = −16[2 sin(θ)][−2 sin(θ) dθ]
C2 π/4

+ [4e2 sin(θ) + 12 cos2 (θ)][2 cos(θ) dθ]



= 32[θ − 21 sin(2θ)] + 4e2 sin(θ)
 3π/4
 
+ 24 sin(θ) − 1
3 sin3 (θ) = 32 + 16π.
π/4

For C3 , y = −x and
Z Z 0
−16y dx + (4ey + 3x2 ) dy = √ 16xdx + (4e−x + 3x2 ) (−dx)
C3 − 2
0

= 8x2 + 4e−x − x3 √
− 2
√ √
= −4e 2 − 2 2 − 12.

Therefore, I
−16y dx + (4ey + 3x2 ) dy = 16π.
C

By Green’s lemma,
I ZZ  
y 2 ∂ y 2 ∂
−16y dx + (4e + 3x ) dy = (4e + 3x ) − (−16y) dx dy
C R ∂x ∂y
Worked Solutions 125
I Z 3π/4 Z 2
−16y dx + (4ey + 3x2 ) dy = [6r cos(θ) + 16] r dr dθ
C π/4 0
Z 2 3π/4
= [6r sin(θ) + 16θ] r dr
0 π/4
Z 2 2
= 8πr dr = 4πr2 = 16π.
0 0

Section 4.7

1.
I Z Z
F · dr = 5y dx − 5x dy + 3z dz + 5y dx − 5x dy + 3z dz
C C1 C2
Z Z
+ 5y dx − 5x dy + 3z dz + 5y dx − 5x dy + 3z dz
C3 C4

Along C1 , y = 0, z = 1, dy = dz = 0, and
Z Z 1
5y dx − 5x dy + 3z dz = 0 dx − 5x · 0 + 3 · 0 = 0.
C1 0

Along C2 , x = z = 1, dx = dz = 0, and
Z Z 1
5y dx − 5x dy + 3z dz = 5y · 0 − 5 dy + 3 · 0 = −5.
C2 0

Along C3 , y = z = 1, dy = dz = 0, and
Z Z 0
5y dx − 5x dy + 3z dz = 5 dx − 5x · 0 + 3 · 0 = −5.
C3 1

Along C4 , x = 0, z = 1, dx = dz = 0, and
Z Z 0
5y dx − 5x dy + 3z dz = 5y · 0 − 0 dy + 3 · 0 = 0.
C4 1

Thus, I
F · dr = −10.
C

Now,
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = −10k
5y −5x 5z
126 Advanced Engineering Mathematics with MATLAB
ZZ Z 1 Z 1
∇ × F · n dσ = −10k · k dx dy = −10.
S 0 0

2.
I Z Z
F · dr = x2 dx + y 2 dy + z 2 dz + x2 dx + y 2 dy + z 2 dz
C C1 C2
Z Z
+ x2 dx + y 2 dy + z 2 dz + x2 dx + y 2 dy + z 2 dz
C3 C4

Along C1 , y = 0, z = 2, dy = dz = 0, and
Z Z 2
x2 dx + y 2 dy + z 2 dz = x2 dx = 83 .
C1 0

Along C2 , x = z = 2, dx = dz = 0, and
Z Z 1
x2 dx + y 2 dy + z 2 dz = y 2 dy = 13 .
C2 0

Along C3 , y = 1, z = 2, dy = dz = 0, and
Z Z 0
x2 dx + y 2 dy + z 2 dz = x2 dx = − 83 .
C3 2

Along C4 , x = 0, z = 2, dx = dz = 0, and
Z Z 0
2 2 2
x dx + y dy + z dz = y 2 dy = − 31 .
C4 1

Thus, I
F · dr = 0.
C
Now,
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = 0.
2 2 2
x y z
ZZ Z 2 Z 1
∇ × F · n dσ = 0 · k dy dx = 0.
S 0 0

3. I Z Z
F · dr = z dx + x dy + y dz + z dx + x dy + y dz
C
Z C1 C2

+ z dx + x dy + y dz
C3
Worked Solutions 127

Along C1 , y = 0 and z = 1, so that


Z Z 2
z dx + x dy + y dz = dx = 2.
C1 0

Along C2 , y = 2 − x and z = 1, so that


Z Z 0   0
1 2
z dx + x dy + y dz = dx + x(−dx) = x− 2x = 0.
C2 2 2

Along C3 , x = 0 and z = 1, so that


Z Z 0
z dx + x dy + y dz = 0 dy = 0.
C3 2

Thus, I
F · dr = 2.
C

Now,
i j k
∂ ∂ ∂
∇×F= = i + j + k. ∂x ∂y ∂z
z x y
ZZ Z 2 Z 2−x
∇ × F · n dσ = [i + j + k] · k dy dx
S 0 0
Z 2 2

= (2 − x) dx = 2x − 12 x2 = 2.
0 0

4. Because x = 2 cos(θ), y = 2 sin(θ), and z = 5,


I Z
F · dr = 2z dx − 3x dy + 4y dz
C C
Z 2π
= 10[−2 sin(θ) dθ] − 3[2 cos(θ)][2 cos(θ) dθ] + 8 sin(θ) · 0
0
  2π
 1

= 20 cos(θ) − 6 θ + 2 sin(2θ) = −12π
0

Now,
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = 4i + 2j − 3k.
2z −3x 4y
ZZ Z 2π Z 2 2 2π
r2
∇ × F · n dσ = [4i + 2j − 3k] · k r dr dθ = −3 θ = −12π.
S 0 0 2 0 0
128 Advanced Engineering Mathematics with MATLAB

5. I Z Z
F · dr = z dx + x dy + y dz + z dx + x dy + y dz
C C1 C2
Z
+ z dx + x dy + y dz
C3
Along C1 , y = 0 and z = 3, so that
Z Z 2
z dx + x dy + y dz = 3 dx = 6.
C1 0

Along C2 , x = 2 cos(θ), y = 2 sin(θ), and z = 3 so that


Z Z π/2
z dx + x dy + y dz = 3[−2 sin(θ) dθ] + [2 cos(θ)][2 cos(θ) dθ]
C2 0
  π/2
 1

= 6 cos(θ) + 2 θ + 2 sin(2θ) = π − 6.
0

Along C3 , x = 0 and z = 3, so that


Z Z 0
z dx + x dy + y dz = 0 dy = 0.
C3 2

Thus, I
F · dr = π.
C
Now,
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = i + j + k.
z x y
ZZ Z π/2 Z 2 2 π/2
r2
∇ × F · n dσ = [i + j + k] · k r dr dθ = θ = π.
S 0 0 2 0 0

6. I Z
F · dr = (2z + x) dx + (y − z) dy + (x + y) dz
C C1
Z
+ (2z + x) dx + (y − z) dy + (x + y) dz
C2
Z
+ (2z + x) dx + (y − z) dy + (x + y) dz
C3
Along C1 , z = 0 and x + y = 1, so that
Z Z 0
(2z + x) dx + (y − z) dy + (x + y) dz = x dx + (1 − x) (−dx) + 0
C1 1
0
= [x2 − x] 1
= 0.
Worked Solutions 129

Along C2 , x = 0 and y + z = 1, so that


Z Z 1
(2z + x) dx + (y − z) dy + (x + y) dz = (1 − 2z) (−dz) + (1 − z) dz
C2 0
1
= 21 z 2 0
= 12 .

Along C3 , y = 0 and x + z = 1, so that


Z Z 1
(2z + x) dx + (y − z) dy + (x + y) dz = [x + 2(1 − x)] dx + x (−dx)
C3 0
1
= (2x − x2 ) 0
= 1.

Thus, I
F · dr = 23 .
C

Now,
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = 2i + j.
2z + x y−z x+y
Because r = xi + yj + (1 − x − y)k, rx = i − k and ry = j − k,

rx × ry = i + j + k.
ZZ Z 1 Z 1−x
∇ × F · n dσ = [(2i + j) · (i + j + k)] dy dx
S 0 0
Z 1 1

=3 (1 − x) dx = 3 x − 12 x2 = 23 .
0 0

7. I Z Z
F · dr = z dx + x dy + y dz + z dx + x dy + y dz
C C1 C2
Z
+ z dx + x dy + y dz
C3

Along C1 , z = 0 and 2x + y = 6, so that


Z Z 0
z dx + x dy + y dz = 0 dx + x(−2 dx) + (6 − 2x) · 0 = 9.
C1 3

Along C2 , x = 0 and y + 2z = 6, so that


Z Z 3  3
z dx + x dy + y dz = z · 0 + 0 (−2 dz) + (6 − 2z) dz = 6z − z 2 0
= 9.
C2 0
130 Advanced Engineering Mathematics with MATLAB

Along C3 , y = 0 and x + z = 3, so that


Z Z 3 3

z dx + x dy + y dz = (3 − x) dx + x · 0 + 0(−dx) = 3x − 21 x2 = 92 .
C3 0 0

Thus, I
45
F · dr = 2 .
C

Now,
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = i + j + k.
z x y

Because r = xi + yj + (3 − x − y/2)k, rx = i − k, and ry = j − 12 k,

i j k
rx × ry = 1 0 −1 = i + 21 j + k.
0 1 − 21

ZZ Z 3 Z 6−2x
∇ × F · n dσ = [(i + j + k) · (i + 12 j + k)] dy dx
S 0 0
Z 3
5 45
= 2 (6 − 2x) dx = 2 .
0

8. Because x = 2 cos(θ), y = 2 sin(θ), and z = 5,


I Z
F · dr = x dx + zx dy + y dz
C C
Z 2π
= [2 cos(θ)][−2 sin(θ) dθ] + 5[2 cos(θ)][2 cos(θ) dθ]
0


= 2 cos2 (θ) + 10[θ + 1
2 sin(2θ)] = 20π.
0

Now,
i j k
∂ ∂ ∂
∇×F= ∂x ∂y ∂z = (1 − x)i + zk.
x zx y

Because r = r cos(θ)i + r sin(θ)j + (9 − r2 )k, rr = cos(θ)i + sin(θ)j − 2rk, and


rθ = −r sin(θ)i + r cos(θ)j,

rr × rθ = 2r2 cos(θ)i + 2r2 sin(θ)j + rk.


Worked Solutions 131
ZZ Z 2π Z 2
∇ × F · n dσ = {[1 − r cos(θ)]i + (9 − r2 )k}
S 0 0
· [2r2 cos(θ)i + 2r2 sin(θ)j + rk] dr dθ
Z 2π Z 2
= [2r2 cos(θ) − 2r3 cos2 (θ) + 9r − r3 ] dr dθ
0 0
Z 2  2π
 
= 2r2 sin(θ) − r3 θ + 1
2 sin(2θ) + (9r − r )θ 3
dr
0 0
Z 2   2
= 2π (9r − 2r3 ) dr = 2π 9 2
2r − 12 r4 = 20π.
0 0

Section 4.8

1. ZZ ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ + F · n dσ
S S1 S2 S3
ZZ ZZ ZZ
+ F · n dσ + F · n dσ + F · n dσ
S4 S5 S6

Along the surface S1 , z = 1 and n = k,


ZZ Z 1 Z 1
F · n dσ = [x2 i + y 2 j + k] · k dx dy = 1.
S1 0 0

Along the surface S2 , z = 0 and n = −k,


ZZ Z 1 Z 1
F · n dσ = [x2 i + y 2 j + 0k] · [−k] dx dy = 0.
S2 0 0

Along the surface S3 , x = 1 and n = i,


ZZ Z 1 Z 1
F · n dσ = [i + y 2 j + z 2 k] · i dy dz = 1.
S3 0 0

Along the surface S4 , x = 0 and n = −i,


ZZ Z 1 Z 1
F · n dσ = [0i + y 2 j + z 2 k] · [−i] dy dz = 0.
S4 0 0

Along the surface S5 , y = 1 and n = j,


ZZ Z 1 Z 1
F · n dσ = [x2 i + j + z 2 k] · j dx dz = 1.
S5 0 0
132 Advanced Engineering Mathematics with MATLAB

Along the surface S6 , y = 0 and n = −j,


ZZ Z 1 Z 1
F · n dσ = [x2 i + 0j + z 2 k] · [−j] dx dz = 0.
S6 0 0

Thus, ZZ
⊂⊃ F · n dσ = 3.
S

Because
∇ · F = 2x + 2y + 2z,
ZZZ Z 1Z 1Z 1
∇ · F dV = (2x + 2y + 2z) dx dy dz
V 0 0 0
Z 1 Z 1 Z 1 Z 1 Z 1 Z 1
= 2x dx dy dz + 2y dx dy dz
0 0 0 0 0 0
Z 1 Z 1 Z 1
+ 2z dx dy dz = 3
0 0 0

2. ZZ ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ + F · n dσ
S S1 S2 S3
ZZ ZZ ZZ
+ F · n dσ + F · n dσ + F · n dσ
S4 S5 S6

Along the surface S1 , z = 1 and n = k,


ZZ Z 1 Z 1 Z 1 Z 1
F · n dσ = [xyi + yj + xk] · k dx dy = x dx dy = 12 .
S1 0 0 0 0

Along the surface S2 , z = 0 and n = −k,


ZZ Z 1 Z 1
F · n dσ = [xyi + 0j + 0k] · [−k] dx dy = 0.
S2 0 0

Along the surface S3 , x = 1 and n = i,


ZZ Z 1 Z 1 Z 1 Z 1
F · n dσ = [yi + yzj + zk] · i dy dz = y dy dz = 12 .
S3 0 0 0 0

Along the surface S4 , x = 0 and n = −i,


ZZ Z 1 Z 1
F · n dσ = [0i + yzj + 0k] · [−i] dy dz = 0.
S4 0 0
Worked Solutions 133

Along the surface S5 , y = 1 and n = j,


ZZ Z 1Z 1 Z 1 Z 1
F · n dσ = [xi + zj + xzk] · j dx dz = z dx dz = 12 .
S5 0 0 0 0

Along the surface S6 , y = 0 and n = −j,


ZZ Z 1Z 1
F · n dσ = [0i + 0j + xzk] · [−j] dx dz = 0.
S6 0 0

Thus, ZZ
⊂⊃ F · n dσ = 32 .
S
Because
∇ · F = x + y + z,
ZZZ Z 1 Z 1Z 1
∇ · F dV = (x + y + z) dx dy dz
V 0 0 0
Z 1 Z 1 Z 1 Z 1 Z 1 Z 1
= x dx dy dz + y dx dy dz
0 0 0 0 0 0
Z 1 Z 1 Z 1
+ z dx dy dz = 32 .
0 0 0

3. ZZ ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ + F · n dσ
S
ZZ S1 ZZ S2 ZZ S3
+ F · n dσ + F · n dσ + F · n dσ
S4 S5 S6
Along the surface S1 , z = 1 and n = k,
ZZ Z 1Z 1
F · n dσ = [(y − x)i + (1 − y)j + (y − x)k] · k dx dy
S1 −1 −1
Z 1 Z 1 Z 1   1
1 2
= (y − x) dx dy = 2y − yx dx
−1 −1 −1 −1
Z 1
= −2 x dx = 0.
−1

Along the surface S2 , z = −1 and n = −k,


ZZ Z 1Z 1
F · n dσ = [(y − x)i + (−1 − y)j + (y − x)k] · [−k] dx dy
S2 −1 −1
Z 1 Z 1 Z 1   1
1 2
=− (y − x) dx dy = − 2y − yx dx
−1 −1 −1 −1
Z 1
=2 x dx = 0.
−1
134 Advanced Engineering Mathematics with MATLAB

Along the surface S3 , x = 1 and n = i,


ZZ Z 1Z 1
F · n dσ = [(y − 1)i + (z − y)j + (y − 1)k] · i dy dz
S3 −1 −1
Z 1 Z 1 Z 1   1
1 2
= (y − 1) dy dz = 2y −y dz
−1 −1 −1 −1
Z 1
= −2 dz = −4.
−1

Along the surface S4 , x = −1 and n = −i,


ZZ Z 1Z 1
F · n dσ = [(y + 1)i + (z − y)j + (y + 1)k] · [−i] dy dz
S4 −1 −1
Z 1 Z 1 Z 1   1
1 2
=− (y + 1) dy dz = − 2y +y dz
−1 −1 −1 −1
Z 1
= −2 dz = −4.
−1

Along the surface S5 , y = 1 and n = j,


ZZ Z 1Z 1
F · n dσ = [(1 − x)i + (z − 1)j + (1 − x)k] · j dx dz
S5 −1 −1
Z 1 Z 1 Z 1   1
1 2
= (z − 1) dz dx = 2z −z dx
−1 −1 −1 −1
Z 1
= −2 dx = −4.
−1

Along the surface S6 , y = −1 and n = −j,


ZZ Z 1Z 1
F · n dσ = [(−1 − x)i + (z + 1)j + (−1 − x)k] · [−j] dx dz
S6 −1 −1
Z 1 Z 1 Z 1   1
1 2
=− (z + 1) dz dx = − 2z +z dx
−1 −1 −1 −1
Z 1
= −2 dx = −4.
−1

Thus, ZZ
⊂⊃ F · n dσ = −16.
S
Because
ZZZ Z 1 Z 1 Z 1
∇ · F = −2 ∇ · F dV = −2 dx dy dz = −16.
V −1 −1 −1
Worked Solutions 135

4. ZZ ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ + F · n dσ
S S1 S2 S3

Along the surface S1 , z = 1 and n = k,


ZZ Z 2π Z 1
F · n dσ = [r2 cos2 (θ)i + r sin(θ)j + k] · k r dr dθ = π.
S1 0 0

Along the surface S2 , z = 0 and n = −k,


ZZ Z 2π Z 1
F · n dσ = [r2 cos2 (θ)i + r sin(θ)j] · [−k] r dr dθ = 0.
S2 0 0

Along the surface S3 , n = xi + yj, x = cos(θ) and y = sin(θ),


ZZ Z 2π Z 1
F · n dσ = [cos2 (θ)i + sin(θ)j + zk] · [cos(θ)i + sin(θ)j] dz dθ
S3 0 0
Z 2π Z 1
= [cos3 (θ) + sin2 (θ)] dz dθ
0 0
  2π
1 3 1 1
= sin(θ) − 3 sin (θ) + 2 [θ − 2 sin(2θ)] = π.
0

Thus, ZZ
⊂⊃ F · n dσ = 2π.
S
Because
∇ · F = 2x + 2,
ZZZ Z 1 Z 1 Z 2π
∇ · F dV = 2 [r cos(θ) + 1] dθ r dr dz
V 0 0 0
Z 1 Z 1 Z 1 1
 2π r2
=2 r sin(θ) + θ 0
r dr dz = 4π dz = 2π.
0 0 0 2 0

5. ZZ ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ + F · n dσ
S S1 S2 S3

Along the surface S1 , z = 1 and n = k,


ZZ Z 2π Z 2
F · n dσ = [r2 cos2 (θ)i + r2 sin2 (θ)j + k] · k r dr dθ = 4π.
S1 0 0

Along the surface S2 , z = 0 and n = −k,


ZZ Z 2π Z 2
F · n dσ = [r2 cos2 (θ)i + r2 sin2 (θ)j] · [−k] r dr dθ = 0.
S2 0 0
136 Advanced Engineering Mathematics with MATLAB

Along the surface S3 , n = xi/2 + yj/2, x = 2 cos(θ) and y = 2 sin(θ),


ZZ Z 2π Z 1
F · n dσ = [4 cos2 (θ)i + 4 sin2 (θ)j + z 2 k]
S3 0 0
· [cos(θ)i + sin(θ)j] 2 dz dθ
Z 2π Z 1
=8 [cos3 (θ) + sin3 (θ)] dz dθ
0 0
  2π
= 8 sin(θ) − 1
3 sin3 (θ) − cos(θ) + 1
3 cos3 (θ) = 0.
0

Thus, ZZ
⊂⊃ F · n dσ = 4π.
S
Because
∇ · F = 2x + 2y + 2z,
ZZZ 1 Z 2 Z 2π
Z
∇ · F dV = 2 [r cos(θ) + r sin(θ) + z] dθ r dr dz
V 0 0 0
Z 1 Z 1  2π
=2 r sin(θ) − r cos(θ) + zθ 0
r dr dz
0 0
Z 1 2
r2 1
= 4π z dz = 4π z 2 0
= 4π.
0 2 0

6. ZZ ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ + F · n dσ
S S1 S2 S3
Along the surface S1 , z = 5 and n = k,
ZZ Z 2π Z 2
F · n dσ = [r2 sin2 (θ)i + 125r cos(θ)j + 16k] · k r dr dθ = 64π.
S1 0 0

Along the surface S2 , z = 1 and n = −k,


ZZ Z 2π Z 2
F · n dσ = [r2 sin2 (θ)i + r cos(θ)j] · [−k] r dr dθ = 0.
S2 0 0

Along the surface S3 , n = xi/2 + yj/2, x = 2 cos(θ) and y = 2 sin(θ),


ZZ Z 5 Z 2π
F · n dσ = [4 sin2 (θ)i + 2z 3 cos(θ)j + (z − 1)2 k]
S3 1 0
· [cos(θ)i + sin(θ)j] 2 dθ dz
Z 5 Z 2π
=2 [4 sin2 (θ) cos(θ) + 2z 3 cos(θ) sin(θ)] dθ dz
1 0
Z 5 2π
4 3 3 2

=2 3 sin (θ) + z sin (θ) dz = 0.
1 0
Worked Solutions 137

Thus, ZZ
⊂⊃ F · n dσ = 64π.
S
Because
∇ · F = 2(z − 1),
ZZZ Z 5 Z 2 Z 2π 2 2π 5
r2
∇ · F dV = 2 (z − 1) dθ r dr dz = θ (z − 1)2 = 64π.
V 1 0 0 2 0 0 1

7.
ZZ ZZ ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ + F · n dσ + F · n dσ
S S1 S2 S3 S4

Along the surface S1 , z = 0 and n = −k,


ZZ Z 1 Z 1−x
 
F · n dσ = 6xyi + xe−y k · [−k] dy dx
S1 0 0
Z 1 Z 1−x Z 1
1−x
= −xe−y dy dx = xe−y 0
dx
0 0 0
Z 1 1
  
= xex−1 − x dx = (x − 1)ex−1 − 21 x2 = e−1 − 21 .
0 0
Along the surface S2 , x = 0 and n = −i,
ZZ Z 1 Z 1−z
F · n dσ = 4yzj · [−i] dy dz = 0.
S2 0 0

Along the surface S3 , y = 0 and n = −j,


ZZ Z 1 Z 1−x
F · n dσ = xk · [−j] dz dx = 0.
S3 0 0

Along the slanted roof, r = xi + yj + (1 − x − y)k, rx = i − k, ry = j − k, and


rx × ry = i + j + k, so that
ZZ Z 1 Z 1−x
 
F · n dσ = 6xyi + 4y(1 − x − y)j + xe−y k · [i + j + k] dy dx
S4 0 0
Z 1 Z 1−x 
= 2xy + 4y − 4y 2 + xe−y dy dx
0 0
Z 1 1−x
 
= xy 2 + 2y 2 − 43 y 3 − xe−y dx
0 0
Z 1  
= 3(1 − x)2 − 37 (1 − x)3 − xex−1 + x dx
0
1
 7

= 12 (1 − x)4 − (1 − x)3 − (x − 1)ex−1 + 12 x2
0
7
=1− 12 − e−1 + 12 .
138 Advanced Engineering Mathematics with MATLAB

Thus, ZZ
5
⊂⊃ F · n dσ = 12 .
S

Because
∇ · F = 6y + 4z,
ZZZ Z 1Z 1−x Z 1−x−y
∇ · F dV = (6y + 4z) dz dy dx
V 0 0 0
Z 1 Z 1−x
1−x−y
= (6yz + 2z 2 ) 0
dy dx
0 0
Z 1Z 1−x
= [2(1 − x)2 + 2(1 − x)y − 4y 2 ] dy dx
0 0
Z 1
1−x
= [2(1 − x)2 y + (1 − x)y 2 − 34 y 3 ] 0
dx
0
Z 1
1
= 5
3 (1 − x)3 dx = − 12
5
(1 − x)4 0
= 5
12 .
0

8. ZZ ZZ ZZ
⊂⊃ F · n dσ = F · n dσ + F · n dσ
S S1 S2

Along the surface S1 , z = 1 and n = k,


ZZ Z 2π Z 1
F · n dσ = [r sin(θ)i + r2 sin(θ) cos(θ)j − k] · k r dr dθ = −π.
S1 0 0

Along the surface S2 , r = r cos(θ)i+r sin(θ)j+r2 k, rr = cos(θ)i+sin(θ)j+2rk,


rθ = −r sin(θ)i + r cos(θ)j, and rr × rθ = −2r2 cos(θ)i − 2r2 sin(θ)j + rk, so
that
ZZ Z 1 Z 2π
F · n dσ = [r sin(θ)i + r2 sin(θ) cos(θ)j − r2 k]
S2 0 0
· [2r2 cos(θ)i + 2r2 sin(θ)j − rk] dθ dr
Z 1 Z 2π
= [2r3 sin(θ) cos(θ) + 2r4 sin2 (θ) cos(θ) + r3 ] dθ dr
0 0
Z 1 2π
= [r3 sin2 (θ) + 32 r4 sin3 (θ) + r3 θ] dr
0 0
Z 1 1
π 4 π
= 2π r3 dr = r = .
0 2 0 2

Thus, ZZ
π
⊂⊃ F · n dσ = − .
S 2
Worked Solutions 139

Because
∇ · F = x − 1,
ZZZ Z 1Z 1Z 2π
∇ · F dV = [r cos(θ) − 1] dθ dz r dr
V 0 r2 0
Z 1Z 1 Z 1

= [r sin(θ) − θ] 0
dz r dr = −2π (1 − r2 ) r dr
0 r2 0
  1
r2 r4 π
= −2π − =−
2 4 0 2

Section 5.1

1. Z Z
0 π 0
1 1 t
a0 = 1 dt + 0 dt = =1
π −π π 0 π −π
Z 0 Z π 0
1 1 sin(nt)
an = 1 cos(nt) dt + 0 cos(nt) dt = =0
π −π π 0 nπ −π
Z 0 Z π 0
1 1 cos(nt) (−1)n − 1
bn = 1 sin(nt) dt + 0 sin(nt) dt = − =
π −π π 0 nπ −π nπ

X
1 2 sin[(2m − 1)t]
f (t) = −
2 π m=1
2m − 1

2.
Z 0 Z π 0
1 1 t2 π
a0 = t dt + 0 dt = =−
π −π π 0 2π −π 2
Z 0 Z π
1 1
an = t cos(nt) dt + 0 cos(nt) dt
π −π π 0
  0
1 cos(nt) t 1 − (−1)n
= + sin(nt) =
π n2 n −π n2 π
Z 0 Z π
1 1
bn = t sin(nt) dt + 0 sin(nt) dt
π −π π 0
  0
1 sin(nt) t (−1)n
= − cos(nt) =−
π n2 n −π n
∞ ∞
π 2 X cos[(2m − 1)t] X (−1)n
f (t) = − + − sin(nt)
4 π m=1 (2m − 1)2 n=1
n
140 Advanced Engineering Mathematics with MATLAB

3.
Z 0 Z π
1 1 0 1 2 π π
a0 = −π dt + t dt = −t −π
+ t 0
=−
π −π π 0 2π 2
Z 0 Z π
1 1
an = −π cos(nt) dt + t cos(nt) dt
π −π π 0
0   π
sin(nt) 1 cos(nt) t (−1)n − 1
=− + + sin(nt) =
n −π π n2 n 0 n2 π
Z 0 Z
1 1 π
bn = −π sin(nt) dt + t sin(nt) dt
π −π π 0
0  π
cos(nt) 1 sin(nt) t 1 − 2(−1)n
= + 2
− cos(nt) =
n −π π n n 0 n


π X (−1)n − 1 1 − 2(−1)n
f (t) = − + cos(nt) + sin(nt)
4 n=1 n2 π n

4. Because f (t) is an even function, bn = 0. Then


Z 0 
 Z  
1 1 1 1 1
a0 = + t dt + − t dt
1 −1 2 1 0 2
Z 1 
1 1
=2 − t dt = t − t2 0 = 0
0 2

Z 0  Z  
1 1 1 1 1
an = + t cos(nπt) dt + − t cos(nπt) dt
1 −1 2 1 0 2
Z 1  
1
=2 − t cos(nπt) dt
0 2
1  1
sin(nπt) cos(nπt) t sin(nπt) 2[1 − (−1)n ]
= −2 2 2
+ =
nπ 0 n π nπ 0 n2 π 2
∞ ∞
2 X [1 − (−1)n ] 4 X cos[(2m − 1)πt]
f (t) = cos(nπt) =
π 2 n=1 n2 π 2 m=1 (2m − 1)2

5.
Z π/2 Z π π/2 π π
1 1 t2 t2 π
a0 = t dt + (π − t) dt = +t − =
π 0 π π/2 2π 0 π/2 2π π/2 4
Worked Solutions 141
Z π/2 Z π
1 1
an = t cos(nt) dt + (π − t) cos(nt) dt
π 0 π π/2
  π/2 π
1 cos(nt) t sin(nt)
= + sin(nt) +
π n2 n 0 n π/2
 π
1 cos(nt) t 4 cos(nπ/2) sin2 (nπ/4)
− + sin(nt) = ,
π n2 n π/2 n2 π

where we have used the identities 1+cos(nπ) = 2 cos2 (nπ/2) and 1−cos(nπ/2)
= 2 sin2 (nπ/4).
Z π/2 Z π
1 1
bn = t sin(nt) dt + (π − t) sin(nt) dt
π 0 π π/2
  π/2 π
1
sin(nt) t cos(nt)
= − cos(nt) −
πn2 n 0 n π/2
 π
1 sin(nt) t 2 sin(nπ/2)
− − cos(nt) =
π n2 n π/2 πn2


π 2 X 2 cos(nπ/2) sin2 (nπ/4) sin(nπ/2)
f (t) = + cos(nt) + sin(nt)
8 π n=1 n2 n2

6. Because f (t) is an odd function, a0 = an = 0. If n 6= 2,


Z π/2 Z π/2
1 2
bn = sin(2t) sin(nt) dt = sin(2t) sin(nt) dt
π −π/2 π 0
  π/2
1 sin[(n − 2)t] sin[(n + 2)t] 4 sin(nπ/2)
= − =−
π n−2 n+2 0 π(n2 − 4)

Z π/2 Z π/2
2 2 1
b2 = sin (2t) dt = [1 − cos(4t)] dt
π 0 π 0
π/2 π/2
1 1 1
= t − sin(4t) =
π 0 4π 0 2

X
1 4 (−1)m
f (t) = sin(2t) + sin[(2m − 1)t]
2 π m=1
[(2m − 1)2 − 4]

7. Z L L
1 1 at 2
a0 = eat dt = e = sinh(aL)
L −L aL −L aL
142 Advanced Engineering Mathematics with MATLAB

Z L 

1 at nπt
an = e cos dt
L −L L
     L
1 eat nπt nπ nπt
= a cos + sin
L a2 + n2 π 2 /L2 L L L −L
2aL(−1)n
= 2 2 sinh(aL)
a L + n2 π 2
Z  
1 L at nπt
bn = e sin dt
L −L L
     L
1 eat nπt nπ nπt
= a sin − cos
L a2 + n2 π 2 /L2 L L L −L
2nπ(−1)n
=− 2 2 sinh(aL)
a L + n2 π 2
X∞  
sinh(aL) (−1)n nπt
f (t) = + 2aL sinh(aL) cos
aL n=1
a2 L2 + n2 π 2 L

X n(−1)n  
nπt
− 2π sinh(aL) sin
n=1
a2 L2 + n2 π 2 L

8. Z Z
L L L
1 2 2t3 2L2
a0 = (t + t2 ) dt = t2 dt ==
L −L 0L 3L 0 3
Z L   Z L  
1 nπt 2 nπt
an = (t + t2 ) cos dt = t2 cos dt
L −L L L 0 L
 L
2 2t cos(nπt/L) n2 π 2 t2 /L2 − 2 4L2 (−1)n
= − sin(nπt/L) =
L n2 π 2 /L2 n3 π 3 /L3 0 n2 π 2
Z L   Z L  
1 nπt 2 nπt
bn = (t + t2 ) sin dt = t sin dt
L −L L L 0 L
 2     L
2 L nπt Lt nπt 2L
= sin − cos = − (−1)n
L n2 π 2 L nπ L 0 nπ
2 X∞   ∞  
L 2
4L (−1) n
nπt 2L X (−1)n nπt
f (t) = + 2 cos − sin
3 π n=1 n2 L π n=1 n L

9. Z
1 π 1 π 2
a0 = sin(t) dt = − cos(t) 0 =
π 0 π π
Z
1 π 1 π
a1 = sin(t) cos(t) dt = sin2 (t) 0 = 0
π 0 2π
Worked Solutions 143
Z π Z π
1 2 1 1 1 π 1
b1 = sin (t) dt = [1 − cos(2t)] dt = [t − 2 sin(2t)] 0
= 2
π 0 2π 0 2π
For n > 1,
Z π   π
1 1 cos[(n − 1)t] cos[(n + 1)t]
an = sin(t) cos(nt) dt = −
π 0 π 2(n − 1) 2(n + 1) 0
1 + (−1)n
=−
π(n2 − 1)
Z π   π
1 1 sin[(n − 1)t] sin[(n + 1)t]
bn = sin(t) sin(nt) dt = − =0
π 0 π 2(n − 1) 2(n + 1) 0

1 1 2 X cos(2mt)
f (t) = + sin(t) −
π 2 π m=1 4m2 − 1

10.
Z 1/2 Z 3/2 1/2 3/2 3/2
1 1 t2 t2
a0 = t dt + (1 − t) dt = +t − =0
1 −1/2 1 1/2 2 −1/2 1/2 2 1/2

Z Z
1 1/2 1 3/2
an = t cos(nπt) dt + (1 − t) cos(nπt) dt
1 −1/2 1 1/2
  1/2 3/2
1 t sin(nπt)
= cos(nπt) + sin(nπt) +
n2 π 2 nπ −1/2 nπ 1/2
  3/2
1 t
− 2 2
cos(nπt) + sin(nπt) =0
n π nπ 1/2
Z 1/2 Z 3/2
1 1
bn = t sin(nπt) dt + (1 − t) sin(nπt) dt
1 −1/2 1 1/2
  1/2 3/2
1 t cos(nπt)
= sin(nπt) − cos(nπt) −
n2 π 2 nπ −1/2 nπ 1/2
  3/2 3
1 t 4 sin (nπ/2)
− sin(nπt) − cos(nπt) =
n2 π 2 nπ 1/2 n2 π 2

4 X (−1)m
f (t) = − sin[(2m − 1)πt]
π 2 m=1 (2m − 1)2

11. Z a
a
1 t2
a0 = 2t dt = =a
a 0 a 0
144 Advanced Engineering Mathematics with MATLAB
Z a  
1 nπt
an = dt
2t cos
0 a a
 2     a
2 a nπt at nπt 2a
= cos + sin = 2 2 [(−1)n − 1]
a n2 π 2 a nπ a 0 n π
Z a  
1 nπt
bn = 2t sin dt
a 0 a
 2     a
2 a nπt at nπt 2a
= sin − cos = − (−1)n
a n2 π 2 a nπ a 0 nπ
∞   ∞  
a 4a X 1 (2m − 1)πt 2a X (−1)n nπt
f (t) = − 2 cos − sin
2 π m=1 (2m − 1)2 a π n=1 n a

12. Z π
π
1 t3 π2
a0 = t2 dt = =
π 0 3π 0 3
Z π  π
1 2t cos(nt) n2 t2 − 2
1 2(−1)n
an = t2 cos(nt) dt = 2
− 3
sin(nt) =
π 0 π n n 0 n2
Z π  π
1 2 1 2t sin(nt) n2 t2 − 2
bn = t sin(nt) dt = − cos(nt)
π 0 π n2 n3 0
 
1 2 − n2 π 2 2
= (−1)n − 3
π n3 n
X∞ ∞
π2 (−1)n 1 X (2 − n2 π 2 )(−1)n − 2
f (t) = +2 cos(nt) + sin(nt)
6 n=1
n2 π n=1 n3

13. Z  2
1 2 π−t πt t2
a0 = dt = − =π−1
1 0 2 2 4 0
Z
1 2 π−t
an = cos(nπt) dt
1 0 2
2  2
sin(nπt) 1 cos(nπt) t
= − + sin(nπt) =0
2n 0 2 n2 π 2 nπ 0
Z
1 2 π−t
bn = sin(nπt) dt
1 0 2
2  2
cos(nπt) 1 sin(nπt) t 1
=− − 2 π2
− cos(nπt) =
2n 0 2 n nπ 0 nπ

π−1 1 X sin(nπt)
f (t) = +
2 π n=1 n
Worked Solutions 145

14. Because f (t) is odd, a0 = an = 0. Then, if n 6= 1,


Z L   
2 πt nπt
bn = t cos
sin dt
L0 L L
Z     
1 L (n + 1)πt (n − 1)πt
= t sin + sin dt
L 0 L L
     L
1 L2 (n + 1)πt Lt (n + 1)πt
= sin + cos
L (n + 1)2 π 2 L (n + 1)π L 0
 2
    L
1 L (n − 1)πt Lt (n − 1)πt
+ sin + cos
L (n − 1)2 π 2 L (n − 1)π L 0
2nL(−1)n
=−
π(n2 − 1)

For n = 1,
Z L   Z   
2 πt 1 L πt2πt
b1 = t cos sin t sin dt =
dt
L0 L L 0 L L
     L
1 L2 2πt Lt 2πt L
= 2
sin + cos =
L 4π L 2π L 0 2π
  ∞  
L πt 2L X (−1)n n nπt
f (t) = sin − sin
2π L π n=2 n2 − 1 L

15. Because f (t) is an even function, bn = 0. Therefore,


Z h π i h π i
2 π 2 π
a0 = sinh a − t dt = − cosh a −t
π 0 2 aπ 2 0
2 h  aπ   aπ i
= cosh − cosh =0
aπ 2 2
and Z h π i
2 π
an = sinh a − t cos(nt) dt
π 0 2
Z Z π
1 aπ/2 π −at 1
= e e cos(nt) dt − e−aπ/2 eat cos(nt) dt
π 0 π 0
π
1 e−at
= eaπ/2 2 [−a cos(nt) + n sin(nt)]
π a + n2 0
π
1 −aπ/2 eat
− e [a cos(nt) + n sin(nt)]
π a2 + n2 0
2a cosh(aπ/2)
= [1 − (−1)n ] .
π(a2 + n2 )
146 Advanced Engineering Mathematics with MATLAB

Thus,

4a cosh(aπ/2) X cos[(2m − 1)t]
f (t) = .
π m=1
a2 + (2m − 1)2

16. The answer is



32L2 X sin[(2m − 1)πx/(2L)]
f (x) =
π 3 m=1 (2m − 1)3

because
Z 2L Z 4L
1 1  1 1 2 2

a0 = 2 x(2L − x) dt + 2L 2 x − 3Lx + 4L dt
2L 0 2L
  2L   4L
1 Lx2 x3 1 x3 3Lx2
= − + − + 4L2 x = 0,
L 2 6 0 L 6 2 2L
Z 2L  nπx  Z 2L  nπx 
1
an = x cos dx − x2 cos
dx
0 2L 0 2L 2L
Z 4L  nπx  Z 4L  nπx 
1 2
+ x cos dx − 3 x cos dx
2L 2L 2L 2L 2L
Z 4L  nπx 
+ 4L cos dx
2L 2L
  nπx  2Lx  nπx  2L
4L2
an = cos + sin
n2 π 2 2L nπ 2L 0
 2      
nπx 
2 2L
1 8L x nπx 2Lx 16L3
− cos + − 3 3 sin
2L n2 π 2 2L nπ n π 2L 0
 2      
nπx 
2 3 4L
1 8L x nπx 2Lx 16L
+ cos + − 3 3 sin
2L n2 π 2 2L nπ n π 2L 2L
  nπx  2Lx  nπx   4L
4L2
−3 cos + sin
n2 π 2 2L nπ 2L 2L

8L 2  nπx  4L
− sin =0
nπ 2L 2L
and Z Z 2L
2L  nπx 
1  nπx 
bn = x sin dx − x2 sin dx
0 2L 2L 0 2L
Z 4L  nπx  Z 4L  nπx 
1
+ x2 sin dx − 3 x sin dx
2L 2L 2L 2L 2L
Z 4L 
nπx 
+ 4L sin dx
2L 2L
Worked Solutions 147
  nπx  2Lx  nπx  2L
4L2
bn = sin − cos
n2 π 2 2L nπ 2L 0
 2    2
  nπx  2L
1 8L x nπx 2Lx 16L3
− sin − − cos
2L n2 π 2 2L nπ n3 π 3 2L 0
 2      
nπx 
4L
1 8L x nπx 2Lx2 16L3
+ sin − − cos
2L n2 π 2 2L nπ n3 π 3 2L 2L
 2      4L
4L nπx 2Lx nπx
−3 2 2
sin − cos
n π 2L nπ 2L 2L

8L 2  nπx  4L
16L 2
− cos = 3 3 [1 − (−1)n ]
nπ 2L 2L n π

Section 5.2

1. Z x X∞ Z x
π 2 − 2πτ cos[(2n + 1)τ ]
dτ = dτ
0 8 n=0 0
(2n + 1)2
x X∞ x
π 2 τ − πτ 2 sin[(2n + 1)τ ]
=
8 0 n=0
(2n + 1)3 0
2 2 ∞
X
π x − πx sin[(2n + 1)x]
=
8 n=0
(2n + 1)3

2. Z Z
x X∞
π 2 − 3τ 2 (−1)n+1 x
dτ = cos(nτ ) dτ
0 12 n=1
n2 0
x X∞ x
π2 τ − τ 3 (−1)n+1
= sin(nτ )
12 0 n=1
n3 0
2 3 ∞
X n+1
π x−x (−1)
= sin(nx)
12 n=1
n3

3. Because f (t) is an odd function, a0 = an = 0. On the other hand,


Z  
2 2 2 nπt
bn = (2t − t ) sin dt
2 0 2
     2
4 nπt 2t nπt
= 2 2 2 sin − cos
n π 2 nπ 2 0
    2 2 2    2
8t nπt 8 n π t nπt
− 2 2 sin − 3 3 − 2 cos
n π 2 n π 4 2 0
16[1 − (−1)n ]
= .
n3 π 3
148 Advanced Engineering Mathematics with MATLAB

Then,
∞  
32 X 1 (2m − 1)πt
f (t) = sin .
π 3 m=1 (2m − 1)3 2

From Parseval’s equality,


Z ∞ ∞
2 2
2 2 16 (32)2 X 1 π6 X 1
(2t − t ) dt = = or = .
2 0 15 π 6 n=1 (2n − 1)6 960 n=1 (2n − 1)6

Section 5.3

1. Z π
π
2 x2
a0 = x dx = =π
π 0 π 0

Z π  π
2 2 cos(nx) x sin(nx) 2[(−1)n − 1]
an = x cos(nx) dx = + =
π 0 π n2 n 0 n2 π


π 4 X cos[(2m − 1)x]
f (x) = −
2 π m=1 (2m − 1)2

Z π  π
2 2 sin(nx) x cos(nx) 2(−1)n
bn = x sin(nx) dx = − = −
π 0 π n2 n 0 n


2 X (−1)n+1 sin(nx)
f (x) =
π n=1 n

2. Z π
π
2 π x2
a0 = (π − x) dx = 2x|0 − =π
π 0 π 0

Z π
2
an = (π − x) cos(nx) dx
π 0
π  π
sin(nx) 2 cos(nx) x sin(nx) 2[(−1)n − 1]
=2 − 2
+ =−
n 0 π n n 0 n2 π


π 4 X cos[(2m − 1)x]
f (x) = +
2 π m=1 (2m − 1)2
Worked Solutions 149

Z π
2
bn = (π − x) sin(nx) dx
π 0
π  π
2 cos(nx) 2 sin(nx) x cos(nx) 2
=− − 2
− =
n 0 π n n 0 n

X∞
sin(nx)
f (x) = 2
n=1
n

3. Z   a
a
2 2 ax2 x3 a2
a0 = x(a − x) dx = − =
a 0 a 2 3 0 3
Z a  nπx 
2
an = x(a − x) cos dx
a a
Z 0a  nπx   nπx Z a
2
=2 x cos dx − x2 cos dx
0 a a 0 a
 2  nπx  ax  nπx a
a
= 2 2 2 cos + sin
n π a nπ a 0
 2    nπx a
2 2xa nπx n π ax − 2a3
2 2 2
− cos − sin
a n2 π 2 a n3 π 3 a 0
2a2
=− [1 + (−1)n ]
n2 π 2
∞  
a3 a2 X 1 2mπx
f (x) = − 2 cos
6 π m=1 m2 a
Z a  nπx 
2
bn = x(a − x) sin dx
a 0 a
Z a nπx   nπx  Z a
2
=2 x sin dx − x2 sin dx
a a 0 a
0 2  nπx  ax 
 nπx  a
a
= 2 2 2 sin − cos
n π a nπ a 0
 2   2 2 2 3  nπx a
2 2xa nπx n π ax − 2a
− sin − cos
a n2 π 2 a n3 π 3 a 0
4a2
= [1 − (−1)n ]
n3 π 3
∞  
8a2 X 1 (2m − 1)πx
f (x) = 3 sin
π m=1 (2m − 1)3 a
150 Advanced Engineering Mathematics with MATLAB

4. Z a
2 2 kx a 2 
a0 = ekx dx = e 0
= eak − 1
a 0 ak ak
Z  nπx 
2 a kx
an = e cos dx
a 0 a
    nπx  nπ  nπx  a
2 ekx
= k cos + sin
a k 2 + (nπ/a)2 a a a 0
2ka  
= 2 2 (−1)n eka − 1
k a + n2 π 2

eak − 1 X∞
(−1)n eka − 1  nπx 
f (x) = + 2ka cos
ak n=1
k 2 a2 + n2 π 2 a
Z  nπx 
2 a kx
bn = e sin dx
a 0 a
   nπx  nπ  nπx  a
2 ekx
= k sin − cos
a k 2 + (nπ/a)2 a a a 0
2nπ  
=− 2 2 (−1)n eka − 1
k a + n2 π 2

X∞
n[(−1)n eka − 1]  nπx 
f (x) = −2π 2 2 2 2
sin
n=1
k a +n π a

5.
Z 1/2 Z 1
1/2 1 1
a0 = 2 x dx + 2 (1 − x) dx = x2 0
+ (2x − x2 ) 1/2
=
0 1/2 2

Z 1/2 Z 1
an = 2 x cos(nπx) dx + 2 (1 − x) cos(nπx) dx
0 1/2
 1/2 1
cos(nπx) x sin(nπx) 2 sin(nπx)
=2 + +
n2 π 2 nπ 0 nπ 1/2
 1
cos(nπx) x sin(nπx) 4 cos(nπ/2) 2[1 + (−1)n ]
−2 + = −
n2 π 2 nπ 1/2 n2 π 2 n2 π 2


1 2 X cos[2(2m − 1)πx]
f (x) = − 2
4 π m=1 (2m − 1)2
Worked Solutions 151

Z 1/2 Z 1
bn = 2 x sin(nπx) dx + 2 (1 − x) sin(nπx) dx
0 1/2
 1/2 1
sin(nπx) x cos(nπx) 2 cos(nπx)
=2 − −
n2 π 2 nπ 0 nπ 1/2
 1
sin(nπx) x cos(nπx) 4 sin(nπ/2)
−2 − =
n2 π 2 nπ 1/2 n2 π 2

4 X (−1)m+1 sin[(2m − 1)πx]
f (x) =
π 2 m=1 (2m − 1)2

6. Z Z
1 2 1
2 2 x2 2 3
a0 = x dx + 1 dx = + x|1 =
2 0 2 1 2 0 2

Z 1  nπx  Z 2  nπx 
2 2
an = x cos dx + 1 cos dx
2 0 2 2 1 2
  nπx  2x  nπx 1  nπx  2
4 2
= 2 2
cos + sin + sin
n π 2 nπ 2 0 nπ 2 1
4 h  nπ i 8  nπ 
= 2 2 1 + cos = 2 2 cos2
n π 2 n π 4

3

8 X 1  nπ   nπx 
f (x) = + 2 2
cos2 cos
4 π n=1 n 4 2

Z 1  nπx  Z 2  nπx 
2 2
bn = x sin dx + 1 sin dx
2 0 2 2 1 2
  nπx  2x  nπx 1  nπx  2
4 2
= sin − cos − cos
n2 π 2 2 nπ 2 0 nπ 2 1
4  nπ  2
= 2 2 sin − (−1)n
n π 2 nπ

∞   ∞  nπx 
4 X (−1)m+1 (2m − 1)πx 2 X (−1)n
f (x) = sin − sin
π 2 m=1 (2m − 1)2 2 π n=1 n 2

7. Z π
π
2 π 2x3 4π 2
a0 = (π 2 − x2 ) dx = 2πx|0 − =
π 0 3π 0 3
152 Advanced Engineering Mathematics with MATLAB

Z
2 π 2
an = (π − x2 ) cos(nx) dx
π 0
 π  π
2π sin(nx) 2 2x cos(nx) n2 x2 − 2 4(−1)n
= − 2
+ 3
sin(nx) =−
n 0 π n n 0 n2

X∞
2π 2 (−1)n
f (x) = −4 cos(nx)
3 n=1
n2

Z π
2
bn = (π 2 − x2 ) sin(nx) dx
π0
 π  π
2π cos(nx) 2 2x sin(nx) n2 x2 − 2
=− − − cos(nx)
n 0 π n2 n3 0
2π 4(−1)n 4
= − + 3
n n3 π n π

X∞ ∞
sin(nx) 8 X sin[(2m − 1)x]
f (x) = 2π +
n=1
n π m=1 (2m − 1)3

8. Z a
2
a0 = dx = 1
a a/2

Z a  nπx   nπx  a  nπ 
2 2 2
an = cos dx = sin =− sin
a a/2 a nπ a a/2 nπ 2

∞  
1 2 X (−1)m (2m − 1)πx
f (x) = + sin
2 π m=1 2m − 1 a
Z  nπx   nπx 
2 a 2 a
bn = sin dx = − cos
a a/2 a nπ a a/2
2 h  nπ  i
= cos − (−1)n
nπ 2

∞   ∞  nπx 
1 X (−1)m 2mπx 2 X (−1)n
f (x) = sin − sin
π m=1 m a π n=1 n a
Worked Solutions 153

9.
Z 2a/3 Z a
2 a
 2 a
a0 = x− 3 dx + dx
a a/3 a 2a/3 3
 2
2a/3 a
2 x ax 2x a
= − + =
a 2 3 a/3 3 2a/3 3

Z 2a/3 Z
 nπx   nπx 
2 a
 2 a a
an = x− cos 3 dx + cos dx
a a/3 a a 2a/3 3 a
  nπx  ax  nπx 2a/3  nπx  2a/3
2 a2 2a
= cos + sin − sin
a n2 π 2 a nπ a a/3 3nπ a a/3

2a  nπx  a
+ sin
3nπ a 2a/3
    nπ   nπ   nπ 
2a 2nπ 4a
= 2 2 cos − cos = − 2 2 sin sin
n π 3 3 n π 2 6

∞  
a 4a X (−1)m sin[(2m − 1)π/6] (2m − 1)πx
f (x) = + 2 cos
6 π m=1 (2m − 1)2 a

Z 2a/3  nπx  Z
 nπx a
2 a
 a 2
bn = x− 3 sin dx + sin dx
a a/3 a 2a/3 3 a a
  nπx  ax  nπx 2a/3  nπx  2a/3
2 a2 2a
= sin − cos + cos
a n2 π 2 a nπ a a/3 3nπ a a/3

2a  nπx  a
− cos
3nπ a 2a/3
    nπ 
2a 2nπ 2a
= sin − sin − cos(nπ)
n2 π 2 3 3 3nπ
4a  nπ   nπ  2a(−1)n
= cos sin −
n2 π 2 2 6 3nπ

∞  
a X (−1)m sin(mπ/3) 2mπx
f (x) = sin
π 2 m=1 m2 a

2a X (−1)n  nπx 
− sin
3π n=1 n a
154 Advanced Engineering Mathematics with MATLAB

10. Z 3a/4 3a/4


2 2x
a0 = 1 dx = =1
a a/4 a a/4

Z 3a/4  nπx 
 nπx  3a/4
2 2
an = cossin dx =
aa/4 a nπ a a/4
      
2 3nπ nπ 4 nπ   nπ 
= sin − sin = cos sin
nπ 4 4 nπ 2 4
∞  mπ   
1 2 X (−1)m 2mπx
f (x) = + sin cos
2 π m=1 m 2 a

Z 3a/4  nπx   nπx  3a/4


2 2
bn = sin cos dx = −
a
a/4 a nπ a a/4
      
2 3nπ nπ 4 nπ   nπ 
=− cos − cos = sin sin
nπ 4 4 nπ 2 4
∞    
4 X (−1)m+1 (2m − 1)π (2m − 1)πx
f (x) = sin sin
π m=1 2m − 1 4 a

11. Z Z
a/2 a a
2 1 2 x a/2 2x 3
a0 = 2 dx + 1 dx = + =
a 0 a a/2 a 0 a a/2 2
Z a/2  nπx  Z a  nπx 
2 1 2
an = 2 cos dx + cos dx
a 0 a a a/2 a
1  nπx  a/2 2  nπx  a
= sin + sin
nπ a 0 nπ a a/2
1  nπ  2  nπ  1  nπ 
= sin − sin =− sin
nπ 2 nπ 2 nπ 2
∞  
3 1 X (−1)m (2m − 1)πx
f (x) = + cos
4 π m=1 2m − 1 a
Z a/2  nπx  Z a  nπx 
2 1 2
bn = 2 sin dx + sin dx
a 0 a a a/2 a
1 2  nπx  a/2
 nπx  a
=− cos − cos
nπ a 0 nπ a a/2
1  nπ  1 2 2  nπ 
n
=− cos + − (−1) + cos
nπ 2 nπ nπ nπ 2
1 + cos(nπ/2) − 2 cos(nπ)
=

Worked Solutions 155


1 X 1 + cos(nπ/2) − 2(−1)n  nπx 
f (x) = sin
π n=1 n a

12.
Z a/2 Z a
2 2x 2 3a − 2x
a0 = dx + dx
a 0 a a a/2 2a
2 a/2 a a
2x 3x x2 5
= + − =
a2 0 a a/2 a2 a/2 4

Z a/2  nπx  Z  nπx 


2 2x 2 a 3a − 2x
an = cos dx + cos dx
a 0 a a a a/2 2a a
 2  nπx  ax  nπx a/2  nπx 
4 a 3 a
= 2 2 2 cos + sin + sin
a n π a nπ a 0 nπ a a/2
 2  nπx  ax  nπx a
2 a
− 2 2 2 cos + sin
a n π a nπ a a/2
4 h  nπ  i 2 h  nπ i
= 2 2 cos − 1 − 2 2 cos(nπ) − cos
n π 2 n π 2
6  nπ  4 2 n
= 2 2 cos − 2 2 − 2 2 (−1)
n π 2 n π n π

5

2 X 3 cos(nπ/2) − 2 − (−1)n  nπx 
f (x) = + 2 cos
8 π n=1 n2 a
Z a/2  nπx  Z  nπx 
2 2x 2 a 3a − 2x
bn = sin dx + sin dx
a0 a a a a/2 2a a
 2  nπx  ax  nπx a/2  nπx  a
4 a 3
= 2 2 2 sin − cos − cos
a n π a nπ a nπ a a/2
 2     a0
2 a nπx ax nπx
− 2 2 2 sin − cos
a n π a nπ a a/2
4  nπ  3 2 h  nπ  i
= 2 2 sin − cos(nπ) + 2 2 sin + nπ cos(nπ)
n π 2 nπ n π 2
6  nπ  (−1)n
= 2 2 sin −
n π 2 nπ

X∞   nπ  (−1)n   nπx 
6
f (x) = sin − sin
n=1
n2 π 2 2 nπ a
156 Advanced Engineering Mathematics with MATLAB

13.
Z a/2 Z a a/2
2 2 a x2 a 3a
a0 = x dx + dx = + x|a/2 =
a 0 a a/2 2 a 0 4

Z a/2  nπx   nπx  Z a


2 a 2
an = x cos cos dx +
dx
a 0 a a/2 2 a a
  nπx  ax  nπx a/2  nπx 
2 a2 a a
= cos + sin + sin
a n2 π 2 a nπ a 0 nπ a a/2
2a h  nπ  i
= 2 2 cos −1
n π 2


3a 2a X cos(nπ/2) − 1  nπx 
f (x) = + 2 cos
8 π n=1 n2 a

Z a/2  nπx   nπx  Z a


2 a 2
bn = x sin sin dx +
dx
a
0 a a/2 2 a a
  nπx  ax  nπx a/2  nπx 
2 a2 a a
= sin − cos − cos
a n2 π 2 a nπ a 0 nπ a a/2
2a  nπ  a
= 2 2 sin − (−1)n
n π 2 nπ

∞   nπ  (−1)n   nπx 
aX 2
f (x) = 2
sin − sin
π n=1 n π 2 n a

14. Z  a
a
2 a−x 2 x2
a0 = dx = 2 ax − =1
a 0 a a 2 0

Z  nπx 
2 a a−x
an = cos dx
a 0 a a
Z a  nπx  Z a  nπx 
2 2
= cos dx − 2 x cos dx
a 0 a a 0 a
 nπx  a   nπx  ax  nπx a
2 2 a2
= sin − 2 2 2 cos + sin
nπ a 0 a n π a nπ a 0
2
= 2 2 [1 − (−1)n ]
n π
Worked Solutions 157

∞  
1 4 X 1 (2m − 1)πx
f (x) = + 2 cos
2 π m=1 (2m − 1)2 a

Z  nπx 
2 a a−x
bn = sin dx
a 0 a a
Z a  nπx  Z a  nπx 
2 2
= sin dx − 2 x sin dx
a 0 a a 0 a
 nπx  a   nπx  ax  nπx a
2 2 a2 2
=− cos − 2 2 2 sin − cos =
nπ a 0 a n π a nπ a 0 nπ

2X1
∞  nπx 
f (x) = sin
π n=1 n a

15. For 0 < x < 1, half-range cosine series is


1 a0 X
√ = + an cos(nπx),
1−x 2 2 n=1

where
Z 1 Z π/2
dx
a0 = 2 √ =2 du = π,
0 1 − x2 0

and
Z 1
cos(nπx)
an = 2 √ dx = πJ0 (nπ).
0 1 − x2
Substitution of a0 and an into the top line gives the final result. On the other
hand,
p X∞
1 − x2 = an cos[(2n − 1)πx/2], 0 < x < 1.
n=1

Here,
Z 1 p 2
an = 2 1 − x2 cos[(2n − 1)πx/2] dx = J1 [(2n − 1)π/2],
0 2n − 1

if we use ν = 1, u = 1, and a =
√ (2n−1)π/2 in the listed integrals. Substitution
of an into the expansion for 1 − x2 completes the problem.
158 Advanced Engineering Mathematics with MATLAB

16.
Z Z
2 π 2(a + 1) π
bn = sin(nx) dx − x sin(nx) dx
π 0 π2 0
Z π Z
2(a − 1) 2 2(a + 1) π 3
+ x sin(nx) dx + x sin(nx) dx
π3 0 π4 0
Z π
2a
− 5 x4 sin(nx) dx
π 0
 π
2 π 2(a + 1) sin(nx) x cos(nx)
=− cos(nx)|0 − −
nπ π2 n2 n 0
 2 2

2(a − 1) 2x n x −2
+ sin(nx) − cos(nx)
π3 n2 n3 0
 π
2(a + 1) 3n2 x2 − 6 n2 x3 − 6x
+ sin(nx) − cos(nx)
π4 n4 n3 0
 2 3  π
2a 4n x − 24x n4 x4 − 12n2 x2 + 24
− 5 sin(nx) − cos(nx)
π n4 n5 0
2 8(a − 1)(−1)n 4(a − 1) 48a
= − − − 5 5 [1 − (−1)n ]
nπ n3 π 3 n3 π 3 n π

X∞  
2 8(a − 1)(−1)n 4(a − 1) 48a n
f (x) = − − − [1 − (−1) ] sin(nx)
n=1
nπ n3 π 3 n3 π 3 n5 π 5

To obtain the final solution, break the solution apart according whether you
have an even or odd harmonic. Upon simplification, the desired result follows.

Section 5.4

1. In both cases, the amplitude is given by


p 2
An = Bn = a2n + b2n = .
π(2n − 1)

For the sine series,



1 2 X sin[(2n − 1)t]
ϕn = tan−1 (0/bn ) = 0 so that f (t) = + .
2 π n=1 2n − 1

For the cosine series,



π 1 2 X cos[(2n − 1)t − π/2]
ϕn = tan−1 (−bn /0) = − and f (t) = + .
2 2 π n=1 2n − 1
Worked Solutions 159

2. In both cases, the amplitude is given by


p 2
An = Bn = a2n + b2n = .
π(2n − 1)

For the cosine series,


ϕn = tan−1 (0/an ) = 0.
If n is even, ϕn = 0; if n is odd, ϕn = π. Therefore
∞  
3 2X 1 (2n − 1)πt π
f (t) = + cos + [1 − (−1)n ] .
2 π n=1 2n − 1 2 2

For the sine series,


π
ϕn = tan−1 (an /0) = (−1)n
2
and  

3 2X 1 (2n − 1)πt π
f (t) = + sin + (−1)n .
2 π n=1 2n − 1 2 2

3. In both cases, the amplitude is given by


p 2
An = Bn = a2n + b2n = .
n

For the cosine series, ϕn = tan−1 (−bn /0) = (−1)n π/2 so that

X∞
1 h πi
f (t) = 2 cos nt + (−1)n .
n=1
n 2

For the sine series, ϕn = tan−1 (0/bn ) = 0. Then ϕn = 0, if n is odd, and


ϕn = π, if n is even. Then

X∞
1 n πo
f (t) = 2 sin nt + [1 + (−1)n ] .
n=1
n 2

4. In both cases, the amplitude is given by


p 4
An = Bn = a2n + b2n = .
π(2n − 1)2

For the cosine series,

ϕn = tan−1 (0) = 0 or π.
160 Advanced Engineering Mathematics with MATLAB

For the coefficients to be correct, ϕn = π and



π 4 X cos[(2n − 1)t + π]
f (t) = + .
2 π n=1 (2n − 1)2

For the sine series,


π
ϕn = tan−1 (−an /0) = −
2
and

π 4 X sin[(2n − 1)t − π/2]
f (t) = + .
2 π n=1 (2n − 1)2

Section 5.5

1. For n 6= 0,
Z 0 Z π
1 1
cn = (−t)e−int dt + te−int dt
2π −π 2π 0
0 π
1 e−int 1 e−int [1 − (−1)n ]
= (−int − 1) − (−int − 1) =− .
2π n2 −π 2π n2 0 πn2

For n = 0,
Z Z " 0 π
#
0 π
1 1 1 t2 t2 π
c0 = (−t) dt + t dt = − + = .
2π −π 2π 0 2π 2 −π 2 0 2


π 2 X ei(2m−1)t
f (t) = −
2 π m=−∞ (2m − 1)2

2. Z Z
2 2
1 t −inπt 1
cn = ee dt = e(1−inπ)t dt
2 0 2 0
2
1 e2 − 1
= e(1−inπt) =
2(1 − inπ) 0 2(1 − inπ)

e − 1 X 1 + inπ inπt
2
f (t) = e
2 n=−∞ 1 + n2 π 2

3. If n 6= 0,
Z 2 2
1 e−nπit i
cn = te−nπit dt = − (−nπit − 1) = .
2 0 2n2 π 2 0 nπ
Worked Solutions 161
Z ∞
1 2
2 i X enπit
c0 = t dt = 14 t2 0
= 1, so that f (t) = 1 + .
2 0 π n=−∞ n
n6=0

4. If n 6= 0,
Z π  2 −int  π
1 2 −nit 1 t e 2e−int 2(−1)n
cn = t e dt = − − (−int − 1) =
2π −π 2π in in3 −π n2
Z π π
1 t3 π2
c0 = t2 dt = =
2π −π 3π 0 3
X
2∞
π (−1)n int
f (t) = +2 e
3 n=−∞
n2
n6=0

5. If n 6= 0,
Z π/2 π/2
1 1 −2nit [(−1)n − 1]
cn = e−2nit dt = − e =− .
π 0 2nπi 0 2nπi
Z ∞
1 π/2
1 1 i X e2(2m−1)it
c0 = dt = , so that f (t) = − .
π 0 2 2 π m=−∞ 2m − 1

6. If n 6= 0,
Z 1 1
1 e−inπt (−1)n i
cn = te−nπit dt = − (−inπt − 1) =
2 −1 2n2 π 2 −1 nπ
Z 1
1
c0 = t dt = 0
2 −1

i X (−1)n inπt
f (t) = e
π n=−∞ n
n6=0

Section 5.6

1. The Fourier series for f (t) is



1 2 X sin[(2n − 1)t]
f (t) = + .
2 π n=1 2n − 1
162 Advanced Engineering Mathematics with MATLAB

The complementary solution is yH (t) = A cosh(t) + B sinh(t). Now, from the


method of undetermined coefficients we take the particular solution to be

X
yp (t) = A0 + Bn sin[(2n − 1)t]
n=1

and

X
yp′′ (t) =− (2n − 1)2 Bn sin[(2n − 1)t].
n=1

Substituting into the differential equation, we have that



X ∞
1 2 X sin[(2n − 1)t]
−A0 + [−1 − (2n − 1)2 ]Bn sin[(2n − 1)t] = + .
n=1
2 π n=1 2n − 1

Therefore,
1 2
A0 = − and Bn = −
2 π(2n − 1)[1 + (2n − 1)2 ]
or

1 2X sin[(2n − 1)t]
yp (t) = − − .
2 π n=1 (2n − 1) + (2n − 1)3
The general solution is y(t) = yH (t) + yp (t).

2. In problem 1, we already found the Fourier series for f (t). The comple-
mentary solution is
yH (t) = A cos(t) + B sin(t).
For the particular solution, we guess

X
yp (t) = A0 + A1 t cos(t) + B1 t sin(t) + Bn sin[(2n − 1)t]
n=2

and
yp′′ (t) = − 2A1 sin(t) − A1 t cos(t) + 2B1 cos(t) − B1 t sin(t)
X∞
− (2n − 1)2 Bn sin[(2n − 1)t].
n=2

We have written the n = 1 term in this manner because there is resonance


between the homogeneous solution and the n = 1 term in the forcing. There-
fore,

X
A0 − 2A1 sin(t) + 2B1 cos(t) + [1 − (2n − 1)2 ]Bn sin[(2n − 1)t]
n=2

1 2 2 X sin[(2n − 1)t]
= + sin(t) +
2 π π n=2 2n − 1
Worked Solutions 163

so that
1 1
A0 = , A1 = − , B1 = 0,
2 π
and
2
Bn = .
π(2n − 1)[1 − (2n − 1)2 ]
Therefore,

1 t 2X sin[(2n − 1)t]
yp (t) = − cos(t) − .
2 π π n=2 (2n − 1)3 − (2n − 1)

3. In problem 1, we already found the Fourier series for f (t). The com-
plementary solution is yH (t) = Ae2t + Bet . For the particular solution we
have
X∞
yp (t) = A0 + An cos[(2n − 1)t] + Bn sin[(2n − 1)t],
n=1

X
yp′ (t) = (2n − 1){Bn cos[(2n − 1)t] − An sin[(2n − 1)t]}
n=1

and

X
yp′′ (t) = − (2n − 1)2 {An cos[(2n − 1)t] + Bn sin[(2n − 1)t]}.
n=1

Substituting into the ordinary differential equation,



X
2A0 + {−(2n − 1)2 An − 3(2n − 1)Bn + 2An } cos[(2n − 1)t]
n=1
X∞
+ {−(2n − 1)2 Bn + 3(2n − 1)An + 2Bn } sin[(2n − 1)t]
n=1

1 2 X sin[(2n − 1)t]
= + .
2 π n=2 2n − 1

Setting all of the terms of the same harmonic equal to each other, we find
that A0 = 1/4 and

−(2n − 1)2 An − 3(2n − 1)Bn + 2An = 0

and
2
−(2n − 1)2 Bn + 3(2n − 1)An + 2Bn =
π(2n − 1)
164 Advanced Engineering Mathematics with MATLAB

or
6
An =
π{[2 − (2n − 1)2 ]2 + 9(2n − 1)2 }
and
2[2 − (2n − 1)2 ]
Bn = .
(2n − 1)π{[2 − (2n − 1)2 ]2 + 9(2n − 1)2 }
The particular solution is then

1 6X cos[(2n − 1)t]
yp (t) = +
4 π n=1 [2 − (2n − 1)2 ]2 + 9(2n − 1)2

2X [2 − (2n − 1)2 ] sin[(2n − 1)t]
+ .
π n=1 (2n − 1){[2 − (2n − 1)2 ]2 + 9(2n − 1)2 }

4. First we compute complex Fourier series for f (t).


Z 0 Z π
1 1
cn = (−t)e−int dt + te−int dt
2π −π 2π 0
0 π
1 e−int 1 e−int [1 − (−1)n ]
= (−int − 1) − (−int − 1) =−
2π n2 −π 2π n2 0 n2 π

with Z π
1 π
c0 = t dt = .
π 0 2
Therefore,

π 2 X ei(2n−1)t
f (t) = − .
2 π n=−∞ (2n − 1)2

From the method of undetermined coefficients,



X
yp (t) = c0 + cn ei(2n−1)t
n=−∞

and

X
yp′′ (t) = − (2n − 1)2 cn ei(2n−1)t .
n=−∞

Then

X ∞
π 2 X ei(2n−1)t
−c0 − [1 + (2n − 1)2 ]cn ei(2n−1)t = − .
n=−∞
2 π n=−∞ (2n − 1)2
Worked Solutions 165

Setting each harmonic equal to each other, we have that


π 2
c0 = − , cn =
2 π(2n − 1)2 [1+ (2n − 1)2 ]
and

π 2 X ei(2n−1)t
yp (t) = − + .
2 π n=−∞ π(2n − 1)2 [1 + (2n − 1)2 ]

5. First we compute complex Fourier series for f (t).


Z 0 Z π
1 −int 1
cn = (−t)e dt + te−int dt
2π −π 2π 0
0 π
1 e−int 1 e−int
= (−int − 1) − (−int − 1)
2π n2 −π 2π n2 0
Z
[1 − (−1)n ] 1 π π
=− with c0 = t dt = .
n2 π π 0 2
Therefore,

π 2 X ei(2n−1)t
f (t) = − .
2 π n=−∞ (2n − 1)2
From the method of undetermined coefficients,

X ∞
X
yp (t) = c0 + cn ei(2n−1)t and yp′′ (t) = − (2n − 1)2 cn ei(2n−1)t .
n=−∞ n=−∞

Then,

X ∞
2 i(2n−1)t π 2 X ei(2n−1)t
4c0 + [4 − (2n − 1) ]cn e = − .
n=−∞
2 π n=−∞ (2n − 1)2

Setting all of the terms of the same harmonic equal to each other, we have
that
π 2
c0 = , cn = −
8 π(2n − 1)2 [4 − (2n − 1)2 ]
and

π 2 X ei(2n−1)t
yp (t) = − .
8 π n=−∞ (2n − 1)2 [4 − (2n − 1)2 ]

6. The general solution y(t) is the sum of the complementary solution yH (t) =
Ee−at and the particular solution

X
yp (t) = C0 + Cn cos(nωt) + Dn sin(nωt).
n=1
166 Advanced Engineering Mathematics with MATLAB

Substituting the particular solution into the differential equation and equating
the coefficients for each harmonic gives aC0 = A0 ,

aCn + nωDn = An

and
−nωCn + aDn = Bn
or
(a2 + n2 ω 2 )Dn = nωAn + aBn
and
(a2 + n2 ω 2 )Cn = aAn − nωBn .
Therefore, the solution is

A0 X aAn − nωBn nωAn + aBn
y(t) = Ee−at + + 2 2 2
cos(nωt) + 2 sin(nωt).
a n=1
a +n ω a + n2 ω 2

Applying the initial condition yields:



A0 X aAn − nωBn
T0 = E + + .
a n=1
a2 + n2 ω 2

Eliminating E from the solution yields:


A0 
y(t) = T0 e−at + 1 − e−at
a
X∞
aAn − nωBn   nωAn + aBn
+ 2 2 2
cos(nωt) − e−at + 2 sin(nωt)
n=1
a +n ω a + n2 ω 2
A0 
= T0 e−at + 1 − e−at
a
X∞
a cos(nωt) + nω sin(nωt) − a exp(−at)
+ An
n=1
a2 + n2 ω 2
X∞
a sin(nωt) + nω cos(nωt) + nω exp(−at)
+ Bn .
n=1
a2 + n2 ω 2

7. Assuming that

X
q(t) = cn einω0 t ,
n=−∞

we substitute this solution into the ordinary differential equation and find
that
X∞ ∞
X
[(inω0 )2 + 2iαnω0 + ω 2 ]cn einω0 t = ω 2 ϕn einω0 t .
n=−∞ n=−∞
Worked Solutions 167

Therefore,

ω 2 ϕn
[(inω0 )2 + 2iαnω0 + ω 2 ]cn = ω 2 ϕn or cn =
(inω0 )2 + 2iαnω0 + ω 2

and

X ω 2 ϕn
q(t) = 2 + 2iαnω + ω 2
einω0 t .
n=−∞
(inω 0 ) 0

8. We must first re-express the right side of the differential equation as a


Fourier series. If we extent it into the region (−λ/2, 0) as an even function,
Bn = 0. The coefficients for the Fourier cosine series is
Z λ/4 Z λ/2  
2 2 4 λ λ λ
A0 = 1 dx + (−1) dx = − + = 0,
λ/2 0 λ/2 λ/4 λ 4 2 4

and
Z λ/4 Z λ/2
2 2
An = cos(nqx) dx − cos(nqx) dx
λ/2 0 λ/2 λ/4
4h λ/4 λ/2
i 4  nπ 
= sin(nqx)|0 − sin(nqx)|λ/4 = sin ,
λ nπ 2

where q = 2π/λ. Therefore, the solution y(x) has the form


X
y(x) = Cn cos(nqx).
n=1

Direct substitution into the ordinary differential equations yields


   nπ 
2 2 2 2 4
(k − n q )Cn = −k VL sin .
nπ 2

Solving for Cn ,  
VL 4  nπ 
Cn = 2 2 2 sin .
n q /k − 1 nπ 2
Consequently, the final solution is


4VL X sin(nπ/2)
y(x) = cos(nqx).
π n=1 n [n2 q 2 /k 2 − 1]
168 Advanced Engineering Mathematics with MATLAB

Section 5.7

1.
1
A0 = 2 [f (0) + f (1) + f (2) + f (3)] = 3
1
A1 = 2 [f (0) cos(0) + f (1) cos(π/2) + f (2) cos(π) + f (3) cos(3π/2)] = −1
1
A2 = 2 [f (0) cos(0) + f (1) cos(π) + f (2) cos(2π) + f (3) cos(3π)] = −1
1
B1 = 2 [f (0) sin(0) + f (1) sin(π/2) + f (2) sin(π) + f (3) sin(3π/2)] = −1
Thus, the final answer is

3 1
f (t) = 2 − cos(πx/2) − sin(πx/2) − 2 cos(πx).

2.
1
A0 = 2 [f (0) + f (1) + f (2) + f (3)] = 0
1
A1 = 2 [f (0) cos(0) + f (1) cos(π/2) + f (2) cos(π) + f (3) cos(3π/2)] = 1
1
A2 = 2 [f (0) cos(0) + f (1) cos(π) + f (2) cos(2π) + f (3) cos(3π)] = 0
1
B1 = 2 [f (0) sin(0) + f (1) sin(π/2) + f (2) sin(π) + f (3) sin(3π/2)] = 1
Thus, the final answer is

f (t) = cos(πx/2) + sin(πx/2).

Section 6.1

1. If λ = −m2 , then y(x) = A cosh(mx)+B sinh(mx), y ′ (x) = Am sinh(mx)+


Bm cosh(mx). Substituting in the boundary conditions, y ′ (0) = Bm = 0 ⇒
B = 0, y(L) = A cosh(mL) = 0 ⇒ A = 0.
If λ = 0, then y(x) = C + Dx, y ′ (x) = D, y ′ (0) = D = 0 and y(L) = C = 0.
If λ = k 2 , y(x) = E cos(kx) + F sin(kx), y ′ (x) = −Ek sin(kx) + F k cos(kx).
Substituting in the boundary conditions, y ′ (0) = F k = 0 ⇒ F = 0. y(L) =
E cos(kL) = 0 ⇒ cos(kL) = 0 ⇒ kn L = (2n − 1)π/2, where n = 1, 2, 3, . . .
Therefore, in summary, λn = kn2 = (2n−1)2 π 2 /(4L2 ) with yn (x) = cos[(2n−1)
πx/(2L)].
2. If λ = −m2 , then y(x) = A cosh(mx)+B sinh(mx), y ′ (x) = Am sinh(mx)+
Bm cosh(mx) so that y ′ (0) = Bm = 0 or B = 0. At the other end, y ′ (π) =
Am sinh(mπ) = 0 or A = 0.
If λ = 0, then y(x) = C + Dx and y ′ (x) = D so that y ′ (0) = y ′ (π) = D = 0.
Therefore, we have that λ = 0 and y0 (x) = 1.
Worked Solutions 169

If λ = k 2 , then y(x) = E cos(kx) + F sin(kx) and y ′ (x) = −Ek sin(kx) +


F k cos(kx) so that y ′ (0) = F k = 0 and F = 0. At the other end, y ′ (π) =
−Ek sin(kπ) = 0 or sin(kπ) = 0 and kn = n, where n = 1, 2, 3, . . .
Therefore, in summary, λ = 0, y0 (x) = 1; λn = kn2 = n2 , yn (x) = cos(nx).

3. If λ = −m2 , then y(x) = A cosh(mx)+B sinh(mx), y ′ (x) = Am sinh(mx)+


Bm cosh(mx). Substituting into the boundary conditions: y(0) + y ′ (0) =
A + Bm = 0, y(π) + y ′ (π) = A cosh(mπ) + B sinh(mπ) + Am sinh(mπ) +
Bm cosh(mπ) = 0. Solving for nontrivial solutions yields (1−m2 ) sinh(mπ) =
0. Hence, m = 1, λ0 = −1 and y0 (x) = e−x .
If λ = 0, then y(x) = C + Dx, y ′ (x) = D. Substituting into the boundary
conditions: y(0) + y ′ (0) = C + D = 0, y(π) + y ′ (π) = C + Dπ + D = 0. This
system gives C = D = 0.
If λ = k 2 , y(x) = E cos(kx) + F sin(kx), y ′ (x) = −Ek sin(kx) + F k cos(kx).
Substituting into the boundary conditions: y(0) + y ′ (0) = E + kF = 0,
y(π) + y ′ (π) = E cos(kπ) + F sin(kπ) − Ek sin(kπ) + F k cos(kπ) = 0. For a
nontrivial solution: (1 + k 2 ) sin(kπ) = 0. This occurs if kn = n and yn (x) =
sin(nx) − n cos(nx), where n = 1, 2, 3, . . .
Therefore, in summary, λ0 = −1, y0 (x) = e−x and λn = n2 , yn (x) = sin(nx)−
n cos(nx).

4. If λ = −m2 , then y(x) = A cosh(mx)+B sinh(mx), y ′ (x) = Am sinh(mx)+


Bm cosh(mx). Substituting into the x = 0 boundary conditions: y ′ (0) =
Bm = 0 or B = 0. Then y(π)−y ′ (π) = A cosh(mπ)−Am sinh(mπ) = 0. Solv-
ing for nontrivial solutions yields coth(m0 π) = m0 and y0 (x) = cosh(m0 x).
If λ = 0, then y(x) = C + Dx, y ′ (x) = D. Substituting into the x = 0
boundary condition: y ′ (0) = D = 0. Then y(π) − y ′ (π) = C = 0 and we have
only trivial solutions.
If λ = k 2 , y(x) = E cos(kx) + F sin(kx), y ′ (x) = −Ek sin(kx) + F k cos(kx).
Substituting into the x = 0 boundary condition: y ′ (0) = kF = 0 or F = 0.
Then y(π)−y ′ (π) = E cos(kπ)+Ek sin(kπ) = 0. For a nontrivial solution: k =
− cot(kπ). Thus, the eigenfunctions are yn (x) = cos(kn x), kn = − cot(kn ),
where n = 1, 2, 3, . . .
Therefore, in summary, λ0 = −m20 , y0 = cosh(m0 x) with coth(m0 π) = m0
and λn = kn2 , yn (x) = cos(kn x) with kn = − cot(kn ).

5. If λ = −m4 , y(x) = A cosh(mx) + B sinh(mx) + C cos(mx) + D sin(mx),


and y ′′ (x) = Am2 sinh(mx) + Bm2 cosh(mx) − Cm2 cos(mx) − Dm2 sin(mx).
Substituting into the boundary conditions: y(0) = A + C = 0, y ′′ (0) =
m2 A−m2 C = 0. Therefore, A = C = 0. y(L) = B sinh(mL)+D sin(mL) = 0,
y ′′ (L) = Bm2 sinh(mL) − m2 D sin(mL) = 0. Solving for nontrivial solutions
yields B = 0 and mn = nπ/L.
170 Advanced Engineering Mathematics with MATLAB

If λ = 0, then y(x) = A+Bx+Cx2 +Dx3 , y ′′ (x) = 2C+6Dx. Substituting into


the boundary conditions: y(0) = A = 0, y ′′ (0) = 2C = 0, y(L) = BL+DL3 =
0 and y ′′ (L) = 6DL = 0. This system gives A = B = C = D = 0.
If λ = k 4 , then
√ √
y(x) = A exp[(1 + i)kx/ 2 ] + B exp[(−1 + i)kx/ 2 ]
√ √
+ C exp[(−1 − i)kx/ 2 ] + D exp[(1 − i)kx/ 2 ],
√ √
y ′′ (x) = 2iA exp[(1 + i)kx/ 2 ] − 2iB exp[(−1 + i)kx/ 2 ]
√ √
+ 2iC exp[(−1 − i)kx/ 2 ] − 2iD exp[(1 − i)kx/ 2 ].
Substituting into the boundary conditions: y(0) = A + B + C + D = 0,
y ′′ (0) = A − B + C − D = 0,
√ √
y(L) = A exp[(1 + i)kL/ 2] + B exp[(−1 + i)kL/ 2]
√ √
+ C exp[(−1 − i)kL/ 2] + D exp[(1 − i)kL/ 2] = 0

and
√ √
y ′′ (L) = 2iA exp[(1 + i)kL/ 2] − 2iB exp[(−1 + i)kL/ 2]
√ √
+ 2iC exp[(−1 − i)kL/ 2] − 2iD exp[(1 − i)kL/ 2] = 0.

The solution to this system is A = B = C = D = 0.


Therefore, in summary, λn = −n4 π 4 /L4 , yn (x) = sin (nπx/L) .

6. If λ = −m2 , y(x) = A cosh(mx) + B sinh(mx), and y ′ (x) = Am sinh(mx) +


Bm cosh(mx). Substituting into the boundary conditions: y(0) + y ′ (0) =
A + Bm = 0 and y(1) = A cosh(m) + B sinh(m) = 0. Solving for nontrivial
solutions yields m = tanh(m). This is impossible. So there is only a trivial
solution here.
If λ = 0, then y(x) = C + Dx and y ′ (x) = D. Substituting into the boundary
conditions: y(0) + y ′ (0) = C + D = 0 and y(1) = C + D = 0. This system
gives the nontrivial solution y0 (x) = 1 − x.
If λ = k 2 , then y(x) = E cos(kx) + F sin(kx) and y ′ (x) = −Ek sin(kx) +
F k cos(kx). Substituting into the boundary conditions: y(0) + y ′ (0) = E +
kF = 0 and y(1) = E cos(k) + F sin(k) = 0. For a nontrivial solution:
tan(k) = k. Thus, the eigenfunction is yn (x) = sin(kn x) − kn cos(kn x) with
kn = tan(kn ), where n = 1, 2, 3, . . .
Therefore, in summary, λ0 = 0, y0 (x) = 1−x and λn = kn2 , yn (x) = sin(kn x)−
kn cos(kn x).

7. If λ = −m2 , then y(x) = A cosh(mx)+B sinh(mx), y ′ (x) = Am sinh(mx)+


Bm cosh(mx). Substituting into the boundary conditions: y(0) = A = 0 ⇒
Worked Solutions 171

A = 0, y(π) + y ′ (π) = B sinh(mπ) + Bm cosh(mπ) = 0. Solving for nontrivial


solutions yields tanh(mπ) = −m, which is impossible.
If λ = 0, then y(x) = C + Dx, y ′ (x) = D. Substituting into the boundary
conditions: y(0) = C = 0, y(π) + y ′ (π) = Dπ + D = 0. This system gives
C = D = 0.
If λ = k 2 , then y(x) = E cos(kx) + F sin(kx), and y ′ (x) = −Ek sin(kx) +
F k cos(kx). Substituting into the boundary conditions: y(0) = E = 0 ⇒
E = 0, y(π) + y ′ (π) = F sin(kπ) + F k cos(kπ) = 0. For a nontrivial solution:
k = − tan(kπ). Thus, the eigenfunctions are yn (x) = sin(kn x) with kn =
− tan(kn ), where n = 1, 2, 3, . . .
Therefore, in summary, λn = kn2 , yn (x) = sin(kn x) with kn = − tan(kn ).

8. If λ = −m2 , then y(x) = A cosh(mx)+B sinh(mx), y ′ (x) = Am sinh(mx)+


Bm cosh(mx). Substituting into the x = 0 boundary condition: y ′ (0) =
mB = 0 or B = 0. At the other end, y(1)−y ′ (1) = A cosh(m)−Am sinh(m) =
0. Solving for nontrivial solutions yields coth(m) = m. Therefore, λ0 = −m20 ,
y0 (x) = cosh(m0 x) with coth(m0 ) = m0 .
If λ = 0, then y(x) = C + Dx, y ′ (x) = D. Substituting into the x = 0
boundary condition: y ′ (0) = D = 0. At the other end, y(1) + y ′ (1) = C = 0
and we only have trivial solutions.
If λ = k 2 , y(x) = E cos(kx)+F sin(kx) and y ′ (x) = −Ek sin(kx)+F k cos(kx).
Substituting into the x = 0 boundary condition: y ′ (0) = kF = 0 and F = 0.
At the other end, y(1) + y ′ (1) = E cos(k) + Ek sin(k) = 0. For a nontrivial
solution: k = − cot(kπ). Thus, the eigenfunctions are yn (x) = cos(kn x) with
kn = − cot(kn ), where n = 1, 2, 3, . . .
Therefore, in summary, λ0 = −m20 , y0 (x) = cosh(m0 x) with coth(m0 ) = m0
and λn = kn2 , yn (x) = cos(kn x) with kn = − cot(kn ).

9. If λ = −m2 , then y(x) = A cosh(mx)+B sinh(mx), y ′ (x) = Am sinh(mx)+


Bm cosh(mx). Substituting into the boundary conditions: y(0) + y ′ (0) = A +
Bm = 0, y ′ (π) = Am sinh(mπ) + Bm cosh(mπ) = 0. Solving for nontrivial
solutions yields m = coth(mπ). Hence, y0 (x) = sinh(m0 x) − m0 cosh(m0 x)
with coth(m0 π) = m0 .
If λ = 0, then y(x) = C + Dx, y ′ (x) = D. Substituting into the boundary
conditions: y(0) + y ′ (0) = C + D = 0, y ′ (π) = D = 0. This is a trivial solution
because C = D = 0.
If λ = k 2 , y(x) = E cos(kx)+F sin(kx) and y ′ (x) = −Ek sin(kx)+F k cos(kx).
Substituting into the boundary conditions: y(0)+y ′ (0) = E +kF = 0, y ′ (π) =
−Ek sin(kπ)+F k cos(kπ) = 0. For a nontrivial solution: cot(kπ) = −k. Thus,
the eigenfunction is yn (x) = sin(kn x) − kn cos(kn x) with kn = − cot(kn π),
where n = 1, 2, 3, . . .
172 Advanced Engineering Mathematics with MATLAB

Therefore, in summary, λ0 = −m20 , y0 (x) = sinh(m0 x) − m0 cosh(m0 x) with


coth(m0 π) = m0 and λn = kn2 , yn (x) = sin(kn x) − kn cos(kn x) with kn =
− cot(kn π).

10. If λ = −m2 , y(x) = A cosh(mx) + B sinh(mx), y ′ (x) = Am sinh(mx) +


Bm cosh(mx). Substituting into the boundary conditions: y(0) + y ′ (0) =
A + Bm = 0 and y(π) − y ′ (π) = A cosh(mπ) + B sinh(mπ) − Am sinh(mπ) −
Bm cosh(m) = 0. Solving for nontrivial solutions yields tanh(mπ) = 2m/(1 +
m2 ). Hence, y0 (x) = sinh(m0 x) − m0 cosh(m0 x) with tanh(m0 π) = 2m0 /(1 +
m20 ).
If λ = 0, then y(x) = C + Dx, y ′ (x) = D. Substituting into the boundary
conditions: y(0) + y ′ (0) = C + D = 0, y(π) − y ′ (π) = C + Dπ − D = 0. This
yields a trivial solution because C = D = 0.
If λ = k 2 , y(x) = E cos(kx) + F sin(kx), y ′ (x) = −Ek sin(kx) + F k cos(kx).
Substituting into the boundary conditions: y(0) + y ′ (0) = E + kF = 0,
y(π) − y ′ (π) = E cos(kπ) + F sin(kπ) + Ek sin(kπ) − F k cos(kπ) = 0. For a
nontrivial solution: tan(kπ) = 2k/(1 − k 2 ). Thus, the eigenfunction is yn (x) =
sin(kn x) − kn cos(kn x) with tan(kn π) = 2kn /(1 − kn2 ), where n = 1, 2, 3, . . .
Therefore, in summary, λ0 = −m20 , y0 (x) = sinh(m0 x) − m0 cosh(m0 x) with
tanh(m0 π) = 2m0 /(1 + m20 ) and λn = kn2 , yn (x) = sin(kn x) − kn cos(kn x)
with tan(kn π) = 2kn /(1 − kn2 ).

11. Using the transformation η = ln(x), we can transform the differential


equation into
d2 y
+ λy = 0, 0 ≤ η ≤ 1.
dη 2
Consider now the different boundary conditions
(a) The boundary condition here is y(0) = y(1) = 0. If λ = −m2 , then
y(η) = A cosh(mη) + B sinh(mη). Substituting into the boundary conditions:
y(0) = 0 ⇒ A = 0, y(1) = B sinh(m) = 0 ⇒ B = 0. We only have trivial
solutions.
If λ = 0, then y(η) = C + Dη. Substituting into the boundary conditions:
y(0) = C = 0 and y(1) = D = 0. We only have trivial solutions.
If λ = k 2 , then y(η) = E cos(kη) + F sin(kη). Substituting into the boundary
conditions: y(0) = E = 0, y(1) = F sin(k) = 0 ⇒ kn = nπ. We have a
nontrivial solution yn (η) = sin(nπη).
In summary, λn = n2 π 2 , yn (x) = sin[nπ ln(x)].
(b) The boundary condition here is y(0) = y ′ (1) = 0. If λ = −m2 , then y(η) =
A cosh(mη) + B sinh(mη), y ′ (η) = Am sinh(mη) + Bm cosh(mη). Substituting
into the boundary conditions: y(0) = 0 ⇒ A = 0, y ′ (1) = Bm cosh(m) = 0 ⇒
B = 0. We only have trivial solutions.
Worked Solutions 173

If λ = 0, then y(η) = C + Dη, y ′ (η) = D. Substituting into the boundary


conditions: y(0) = C = 0 and y ′ (1) = D = 0. We only have trivial solutions.
If λ = k 2 , y(η) = E cos(kη) + F sin(kη), y ′ (η) = −Ek sin(kη) + F k cos(kη).
Substituting into the boundary conditions: y(0) = E = 0, y ′ (1) = F k cos(k) =
0 ⇒ kn = (2n−1)π/2. We have a nontrivial solution yn (η) = sin[(2n−1)πη/2].
In summary, λn = (2n − 1)2 π 2 /4 and yn (x) = sin[(2n − 1)π ln(x)/2].
(c) The boundary condition here is y ′ (0) = y ′ (1) = 0. If λ = −m2 , then
y(η) = A cosh(mη) + B sinh(mη), y ′ (η) = Am sinh(mη) + Bm cosh(mη).
Substituting into the boundary conditions: y ′ (0) = Bm = 0 ⇒ B = 0,
y ′ (1) = Am sinh(m) = 0 ⇒ A = 0. We only have trivial solutions.
If λ = 0, then y(η) = C + Dη and y ′ (η) = D. Substituting into the boundary
conditions: y ′ (0) = D = 0 and y ′ (1) = D = 0. We have the nontrivial solution:
y0 (η) = 1 with λ0 = 0.
If λ = k 2 , y(η) = E cos(kη) + F sin(kη), y ′ (η) = −Ek sin(kη) + F k cos(kη).
Substituting into the boundary conditions: y(0) = kF = 0 ⇒ F = 0, y ′ (1) =
−kE sin(k) = 0 ⇒ kn = nπ. We have a nontrivial solution yn (η) = cos(nπη).
In summary, λ0 = 0, y0 (x) = 1 and λn = n2 π 2 , yn (x) = cos[nπ ln(x)].

12. We can rewrite the differential equation:


 
d dy dy
x(xy ′′ + y ′ ) + xy ′ + λy = 0, or x x +x + λy = 0.
dx dx dx

Using the transformation η = ln(x), we can transform the differential equation


into
d2 y dy
+ + λy = 0, 0 ≤ η ≤ 1.
dη 2 dη
The boundary conditions are now y(0) = y(1) = 0.
If λ = −m2 , then
 q   q 
−η/2 2 1 −η/2 1
y(η) = Ae cosh η m + 4 + Be sinh η m2 + 4 .

Substituting into the boundary conditions:


q 
y(0) = 0 ⇒ A = 0, y(1) = e−1/2 B sinh m2 + 14 = 0 ⇒ B = 0.

We only have trivial solutions.


If λ = 0, then y(η) = C + De−η . Substituting into the boundary conditions:
y(0) = C + D = 0, y(1) = C + D/e = 0 ⇒ C = D = 0. We only have trivial
solutions.
174 Advanced Engineering Mathematics with MATLAB

If λ = k 2 , then
 q   q 
y(η) = Ee−η/2 cos η k 2 − 1
4 + F e−η/2 sin η k 2 − 1
4 .

Substituting into the boundary conditions:


q 
−1/2
y(0) = E = 0, y(1) = F e sin k2 − 1
4 = 0 ⇒ kn2 − 1
4 = n2 π 2 .

We have a nontrivial solution yn (η) = e−η/2 sin(nπη).


In summary, λn = n2 π 2 + 14 with yn (x) = e− ln(x)/2 sin[nπ ln(x)] or yn (x) =
x−1/2 sin[nπ ln(x)].

13. We can rewrite the differential equation:


 
d dy dy
x(xy ′′ + y ′ ) + 2xy ′ + λy = 0 or x x + 2x + λy = 0.
dx dx dx

Using the transformation η = ln(x), we can transform the differential equation


into
d2 y dy
+2 + λy = 0, 0 ≤ η ≤ π.
dη 2 dη
The boundary conditions are now y(0) = y(π) = 0.
√  √ 
If λ = −m2 , then y(η) = Ae−η cosh η m2 + 1 + Be−η sinh η m2 + 1 .
Substituting √
into the boundary conditions: y(0) = 0 ⇒ A = 0, y(π) =
e−π B sinh π m2 + 1 = 0 ⇒ B = 0. We only have trivial solutions.
If λ = 0, then y(η) = C + De−2η . Substituting into the boundary conditions:
y(0) = C + D = 0 and y(π) = C + De−2π = 0. We only have trivial solutions.
If λ = k 2 , then
 p   p 
y(η) = Ee−η cos η k 2 − 1 + F e−η sin η k 2 − 1 .

Substituting into the boundary conditions: y(0) = E = 0,


 p 
y(π) = F e−π sin π k 2 − 1 = 0 ⇒ kn2 − 1 = n2 .

We have a nontrivial solution yn (η) = e−η sin(nη).


In summary, λn = n2 + 1, yn (x) = e− ln(x) sin[n ln(x)] = sin[n ln(x)]/x.

14. We can rewrite the differential equation:


 
′′ ′ ′ d dy dy
x(xy + y ) − 2xy + λy = 0 or x x − 2x + λy = 0.
dx dx dx
Worked Solutions 175

Using the transformation η = ln(x), we can transform the differential equation


into
d2 y dy
−2 + λy = 0, 0 ≤ η ≤ 1.
dη 2 dη
The boundary conditions are now y(0) = y(1) = 0.
If λ = −m2 , then
 p   p 
y(η) = Aeη cosh η m2 + 1 + Beη sinh η m2 + 1 .

Substituting into the boundary conditions:


p 
y(0) = 0 ⇒ A = 0, y(1) = eB sinh m2 + 1 = 0 ⇒ B = 0.

We only have trivial solutions.


If λ = 0, then y(η) = C + De2η . Substituting into the boundary conditions:
y(0) = C + D = 0, y(π) = C + De2 = 0 ⇒ C = D = 0. We only have trivial
solutions.
If λ = k 2 , then
 p   p 
y(η) = Eeη cos η k 2 − 1 + F eη sin η k 2 − 1 .

Substituting into the boundary conditions:


p 
y(0) = E = 0, y(1) = F eπ sin k 2 − 1 = 0 ⇒ kn2 − 1 = n2 π 2 .

We have a nontrivial solution yn (η) = eη sin(nπη).


In summary, λn = n2 π 2 + 1, with yn (x) = eln(x) sin[nπ ln(x)] or yn (x) =
x sin[nπ ln(x)].

15. There are three possibilities: λ4 < 0, λ = 0, and λ4 > 0. For λ4 < 0,
we write λ4 = k 4 eπi with k > 0. In this case, the solution is y(x) = Aeλ1 x +
Beλ2 x + Ceλ3 x + Deλ4 x , where λ1 = keπi/4 , λ2 = ke3πi/4 , λ3 = ke5πi/4 ,
λ4 = ke7πi/4 . Substituting this solution into the boundary conditions, we
obtain the following linear equations: A−B +C −D = 0, A−iB −C +iD = 0,
eλ1 A − eλ2 B + eλ3 C − eλ4 D = 0, and ieλ1 A − eλ2 B − ieλ3 C + eλ4 D = 0. Since
the determinant of this system of equations does not equal zero, A = B =
C = D = 0 and we have a trivial solution for λ4 < 0.
If λ = 0, then y(x) = A + Bx + Cx2 + Dx3 . Substituting into the boundary
conditions: y ′′′ (0) = 6D = 0, y ′′ (0) = 2C = 0, so that C = D = 0. Finally,
y ′ (1) = B = 0. Therefore, the eigenfunction here is y0 (x) = 1.
If λ4 > 0, then y(x) = A cosh(λx) + B sinh(λx) + C cos(λx) + B sin(λx).
Substituting into the boundary conditions: y ′′′ (0) = λ3 B − λ3 D = 0, y ′′ (0) =
176 Advanced Engineering Mathematics with MATLAB

λ2 A − λ2 C = 0. Therefore, B = D and A = C. The other two boundary


conditions yields A sinh(λ) + B cosh(λ) = 0, C sin(λ) = D cos(λ). These
equations are satisfied by a set of λ’s which satisfy the equation tanh(λ) =
− tan(λ). The corresponding eigenfunction is yn (x) = cosh(λn x) + cos(λn x) −
tanh(λn )[sinh(λn x) + sin(λn x)].
In summary, the eigenfunctions are y0 (x) = 1 for λ = 0 and yn (x) = cosh(λn x)
+ cos(λn x) − tanh(λn )[sinh(λn x) + sin(λn x)], where n = 1, 2, 3, . . . , and λn is
the nth root of tanh(λ) = − tan(λ).

Section 6.2

1. If n 6= m, then
Z L 
nπx   mπx 
sin sin dx
0 L L
  L
sin[(n − m)πx/L] sin[(n + m)πx/L]
= − =0
2(n − m)π/L 2(n + m)π/L 0

2. Z L  nπx  L  nπx  L
1 · cos dx = sin =0
0 L nπ L 0
If n 6= m, then
Z L  nπx   mπx 
cos cos dx
0 L L
  L
sin[(n − m)πx/L] sin[(n + m)πx/L]
= + =0
2(n − m)π/L 2(n + m)π/L 0

3. If n 6= m, then
Z L    
(2n − 1)πx (2m − 1)πx
sin sin dx
0 2L 2L
  L
sin[(n − m)πx/L] sin[(n + m − 1)πx/L]
= − =0
2(n − m)π/L 2(n + m − 1)π/L 0

4. If n 6= m, then
Z L    
(2n − 1)πx (2m − 1)πx
cos cos dx
0 2L 2L
  L
sin[(n − m)πx/L] sin[(n + m − 1)πx/L]
= + =0
2(n − m)π/L 2(n + m − 1)π/L 0
Worked Solutions 177

Section 6.3

1. If

X  nπx 
f (x) = cn sin ,
n=1
L

then
RL
x sin(nπx/L) dx
cn = R0L
0
sin2 (nπx/L) dx
 2    nπx 
nπx  nπx
L
2 L 2(−1)n+1
= sin − cos = .
L n2 π 2 L L L 0 nπ

The final answer is



2 X (−1)n+1  nπx 
f (x) = sin .
π n=1 n L

2. If

X  nπx 
f (x) = c0 + cn cos ,
n=1
L

then RL
x · 1 dx L
c0 = R0 L =
2
1 dx 2
0

and
RL
x cos(nπx/L) dx
cn = R0L
0
cos2 (nπx/L) dx
 2   nπx  nπx  nπx  L
2 L 2L[(−1)n − 1]
= cos + sin = .
L n2 π 2 L L L 0 n2 π 2

The final answer is



L 4L X cos[(2m − 1)πx/L]
f (x) = − 2 .
2 π m=1 (2m − 1)2

3. If  

X (2n − 1)πx
f (x) = cn sin ,
n=1
2L
178 Advanced Engineering Mathematics with MATLAB

then
RL
x sin[(2n − 1)πx/2L] dx
cn = R0L
0
sin2 [(2n − 1)πx/2L] dx
      L
2 4L2 (2n − 1)πx (2n − 1)πx (2n − 1)πx
= sin − cos
L (2n − 1)2 π 2 2L 2L 2L 0
8L(−1)n+1
= .
(2n − 1)2 π 2

The final answer is


∞  
8L X (−1)n+1 (2n − 1)πx
f (x) = 2 sin .
π n=1 (2n − 1)2 2L

4. If  

X (2n − 1)πx
f (x) = cn cos ,
n=1
2L

then
RL
x cos[(2n − 1)πx/2L] dx
cn = R0L
0
cos2 [(2n − 1)πx/2L] dx
      L
2 4L2 (2n − 1)πx (2n − 1)πx (2n − 1)πx
= cos + sin
L (2n − 1)2 π 2 2L 2L 2L 0
 
8L (2n − 1)π
= (−1)n+1 − 1 .
(2n − 1)2 π 2 2

The final answer is


∞    
4L X (−1)n+1 π 2 (2n − 1)πx
f (x) = − cos .
π 2 n=1 2n − 1 (2n − 1)2 2L

5. This is a regular Sturm-Liouville problem because it conforms to Equation


6.1.1 and Equation 6.1.2 with a = 0, b = 1, p(x) = 1, q(x) = −a2 , r(x) = 1,
α = a, β = 1, γ = a, δ = 1.
We begin our search for eigenvalues and eigenfunctions assuming that
λ < 0 and letting m2 = a2 − λ. Then the general solution is y(x) =
A cosh(mx) + B sinh(mx), and y ′ (x) = Am sinh(mx) + Bm cosh(mx). The
boundary conditions yields Bm = −aA and mA sinh(m) + mB cosh(m) +
aA cosh(m) + aB sinh(m) = 0. Eliminating A between the equations, we find
that (a2 − m2 )B sinh(m) = 0. Therefore, A = B = 0.
Worked Solutions 179

For λ = 0, y(x) = Ce−ax + Deax , and y ′ (x) = −aCe−ax + aDeax . The


boundary condition at x = 0, leads to D = 0. The solution y(x) = Ce−ax
satisfies the boundary condition at x = 1 identically. Therefore, we have an
eigenvalue λ = 0 and the eigenfunction y0 (x) = e−ax .
If λ > 0, we let k 2 = λ − a2 > 0. Here y(x) = E cos(kx) + F sin(kx), and

y (x) = −kE sin(kx) + kF cos(kx). From the boundary condition at x = 0,
aE = −kF . From the boundary condition at x = 1, −kE sin(k) + kF cos(k) +
aE cos(k) + aF sin(k) = 0. Eliminating E between the two equations, we find
that (a2 +k 2 )F sin(k) = 0. Therefore, kn = nπ and λn = a2 +n2 π 2 associated
with the eigenfunction yn (x) = a sin(nπx) − nπ cos(nπx).
From Equation 6.3.1 and Equation 6.3.4 with r(x) = 1,

X
f (x) = C0 e−ax + Cn [a sin(nπx) − nπ cos(nπx)] ,
n=1

with R1 R1
0
f (x)e−ax dx 2a 0
f (x)e−ax dx
C0 = R1 = ,
e−2ax dx 1 − e−2a
0
and R1
0
f (x)[a sin(nπx) − nπ cos(nπx)] dx
Cn = R1
0
[a sin(nπx) − nπ cos(nπx)]2 dx
R1
2 0 f (x)[a sin(nπx) − nπ cos(nπx)] dx
=
a2 + n2 π 2
with n = 1, 2, 3, . . ..

6. The general solution to y ′′′′ + k 2 y ′′ = 0, where λ = k 2 , is y(x) = A + Bx +


C cos(kx) + D sin(kx). The boundary conditions yield y(0) = 0 ⇒ A + C = 0,
y ′ (0) = 0 ⇒ B + kD = 0, y(1) = 0 ⇒ A + B + C cos(k) + D sin(k) = 0,
and y ′ (1) = 0 ⇒ B − kC sin(k) + kD cos(k) = 0. Eliminating A and B gives
[cos(k) − 1]C + [sin(k) − k]D = 0, and − sin(k)C + [cos(k) − 1]D = 0. For
this system to have a nontrivial solution, the determinant must equal zero or
2−2 cos(k)−k sin(k) = 0. We then use double-angle formulas to replace sin(k)
and cos(k) with sin(k/2) and cos(k/2) and thereby obtain the final formula
in Step 1.
To find the eigenvalues/eigenfunctions, we note that y(x) = C[cos(kx) −
1] + D[sin(kx) − kx] with D = [cos(k) − 1]C/[k − sin(k)]. Let us take C =
−1 for the arbitrary constant. From Step 1, we have that sin(k/2) = 0 or
kn = 2nπ with n = 1, 2, 3, . . .. Substituting into the equation for y(x), we
find that kn = 2nπ, yn (x) = 1 − cos(2nπx). On the other hand, solving
sin(k/2)/ cos(k/2) = k/2 leads to the roots κn , n = 1, 2, 3, . . .. Again, using
double-angle formulas leads to sin(κn ) = 2[1 − cos(κn )]/κn , or sin(κn ) =
κn [1 + cos(κn )]/2. Therefore,
cos(κn ) − 1
yn (x) = 1 − cos(κn x) − [sin(κn x) − κn x].
κn − sin(κn )
180 Advanced Engineering Mathematics with MATLAB

Because
κn − sin(κn ) = κn [1 − cos(κn )]/2,
we obtain
2
yn (x) = 1 − cos(κn x) + [sin(κn x) − κn x].
κn
′′′′
Next, we have that yn′′′′ + λn yn′′ = 0, and ym ′′
+ λm ym = 0. Multiplying
the first equation by ym (x) and second equation by yn (x) and subtracting, we
obtain

ym (x)yn′′′′ (x) − yn (x)ym


′′′′
(x) + λn ym (x)yn′′ (x) − λm yn (x)ym
′′
(x) = 0.

This can be rewritten as


d d ′ ′′ d d ′ ′′
[ym yn′′′ ] − [ym yn ] − ′′′
[yn ym ]+ [y y ]
dx dx dx dx n m
d d
+ λn [ym yn′ ] − λm ′
[yn ym ] − (λn − λm )yn′ ym

= 0.
dx dx
Integrating this equation from 0 to 1 and applying the boundary conditions
leads to the orthogonality condition provided n 6= m.
Finally, assuming that

X
f (x) = Cn yn (x), 0 < x < 1,
n=1

we formally compute its derivative by term-by-term differentiation or



X
f ′ (x) = Cn yn′ (x).
n=1


Next, we multiply each side of this equation by ym (x) and integrating from 0
to 1. We obtain
Z 1 ∞
X Z 1
f ′ (x)ym

(x) dx = Cn yn′ (x)ym′
(x) dx.
0 n=1 0

From the orthogonality condition, all of the terms on the right side vanish
except for n = m. Using n as the dummy integer, the simplified equation
gives the final result. Of course f ′ (x) must exist for this method to work.

Section 6.4

1. Z

X 1
2n + 1
f (x) = An Pn (x) where An = xPn (x) dx.
n=0
2 0
Worked Solutions 181

Therefore,
Z 1 Z 1
1 1 3 1
A0 = x dx = , A1 = x2 dx =
2 0 4 2 0 2
and Z 1
5 5
A2 = x(3x2 − 1) dx = .
4 0 16
The final answer is

f (x) = 14 P0 (x) + 12 P1 (x) + 5


16 P2 (x) + ···

2. Z

X ǫ
2n + 1 1
f (x) = An Pn (x), where An = Pn (x) dx.
n=0
2 −ǫ 2ǫ

Because f (x) is an even function, we need only even Legendre polynomials:


Z ǫ Z ǫ
1 1 5 5(ǫ2 − 1)
A0 = dx = , A2 = (3x2 − 1) dx =
4ǫ −ǫ 2 8ǫ −ǫ 4

and Z ǫ
9 9(7ǫ4 − 10ǫ2 + 3)
A4 = (35x4 − 30x2 + 3) dx = .
32ǫ −ǫ 16
The final answer is

1 5(ǫ2 − 1) 9(7ǫ4 − 10ǫ2 + 3)


f (x) = P0 (x) + P2 (x) + P4 (x) + · · ·
2 4 16

3. Z

X 1
2n + 1
f (x) = An Pn (x) where An = |x|Pn (x) dx.
n=0
2 −1

Because f (x) is an even function, we need only even Legendre polynomials:


Z 1 Z 1
1 1 5 3x2 − 1 5
A0 = 2 x dx = , A2 = 2 x dx =
2 0 2 2 0 2 8

and Z 1
9 35x4 − 30x2 + 3 3
A4 = 2 x dx = − .
2 0 8 16
The final answer is

f (x) = 21 P0 (x) + 58 P2 (x) − 3


16 P4 (x) + ···
182 Advanced Engineering Mathematics with MATLAB

4. Because x3 is an odd function, we need only A1 and A3 . Therefore, x3 =


A1 P1 (x)+A3 P3 (x). Substituting for the Legendre polynomials and solving for
A1 and A3 , A1 = 35 and A3 = 52 . The final answer is f (x) = 53 P1 (x) + 25 P3 (x).

5. Z

X 1
2n + 1
f (x) = An Pn (x) where An = f (x)Pn (x) dx.
n=0
2 −1

Because f (x) is an odd function, we need only odd Legendre polynomials:


Z 1 Z 1
3 3 7 5x3 − 3x 7
A1 = 2 x dx = , A3 = 2 dx = −
2 0 2 2 0 2 8

and Z 1
11 63x5 − 70x3 + 15x 11
A5 = 2 dx = .
2 0 8 16
The final answer is

f (x) = 23 P1 (x) − 78 P3 (x) + 11


16 P5 (x) + ···

6. Z

X 1
2n + 1
f (x) = An Pn (x), where An = f (x)Pn (x) dx.
n=0
2 −1

Therefore, Z Z
0 1
1 1 1
A0 = −1 dx + x dx = − ,
2 −1 2 0 4
Z 0 Z 1
3 3 5
A1 = −x dx + x2 dx =
2 −1 2 0 4
and Z Z
0 1
5 3x2 − 1 5 3x2 − 1 5
A2 = − dx + x dx = .
2 −1 2 2 0 2 16
The final answer is

f (x) = − 14 P0 (x) + 54 P1 (x) + 5


16 P2 (x) + ···

7.
1 d4  2 4
 1 d4 
P4 (x) = 4 4
(x − 1) = 4 4
x8 − 4x6 + 6x4 − 4x2 + 1
2 4! dx 2 4! dx
1 
= 8 · 7 · 6 · 5x − 4 · 6 · 5 · 4 · 3x2 + 6 · 4 · 3 · 2 · 1
4
(16)(24)

= 81 35x4 − 30x2 + 3
Worked Solutions 183

8. From Equation 6.4.24 with n = 5, 6P6 (x)−11xP5 (x)+5P4 (x) = 0. Solving


for P6 (x),
 63 70 3 15
  35 30 2 3

6P6 (x) = 11x 8 x5 − 8 x + 8 x − 5 8 x4 − 8 x + 8
1 6 4 2
P6 (x) = 16 (231x − 315x + 105x − 5).

9. (a) From

(n + 1)Pn+1 (x) − (2n + 1)xPn (x) + nPn−1 (x) = 0,

(n + 1)Pn+1 (1) − (2n + 1)Pn (1) + nPn−1 (1) = 0


at x = 1. Now, Pn (1) = k, a constant, is the solution to this difference
equation for any n. However, because P0 (1) = 1, Pn (1) = 1.
(b) From

(n + 1)Pn+1 (x) − (2n + 1)xPn (x) + nPn−1 (x) = 0,

(n + 1)Pn+1 (−1) + (2n + 1)Pn (−1) + nPn−1 (−1) = 0


at x = −1. Now, Pn (−1) = (−1)n k, where k is a constant, is the solution to
this difference equation. However, because P0 (−1) = 1, Pn (−1) = (−1)n .
(c) For 2n + 1, Equation 6.4.14 becomes
n
X (−1)k (4n + 2 − 2k)!
P2n+1 (x) = x2n+1−2k .
22n+1 k!(2n + 1 − k)!(2n + 1 − 2k)!
k=0

All of the terms vary with some positive power of x. Therefore, P2n+1 (0) = 0.
(d) For 2n, Equation 6.4.14 becomes
n
X (−1)k (4n − 2k)!
P2n (x) = x2n−2k .
22n k!(2n − k)!(2n − 2k)!
k=0

All of the terms vanish if x = 0 except for k = n. Therefore,

(−1)n (2n)! (−1)n (2n)!


P2n (0) = = .
22n n!n!0! 22n (n!)2

10. From Equation 6.4.30,


Z 1 Z 1 Z 1
′ ′
Pn+1 (τ ) dτ − Pn−1 (τ ) dτ = (2n + 1) Pn (τ ) dτ,
x x x
184 Advanced Engineering Mathematics with MATLAB
Z 1
1 1
Pn+1 (τ )|x − Pn−1 (τ )|x = (2n + 1) Pn (τ ) dτ
x
and
Z 1
Pn+1 (1) − Pn+1 (x) − Pn−1 (1) + Pn−1 (x) = (2n + 1) Pn (τ ) dτ.
x

Because Pn+1 (1) = Pn−1 (1),


Z 1
1
Pn (τ ) dτ = [Pn−1 (x) − Pn+1 (x)] .
x 2n + 1

11. If the eigenfunction expansion reads



X
H(θ − x)  1
 
p = cn cos n+ 2 x ,
2 cos(x) − 2 cos(θ) n=0

then
Z    Z π
π
H(θ − x) cos n + 12 x   
cn = p dx cos2 n + 21 x dx
0 2 cos(x) − 2 cos(θ) 0
Z θ
 1
  
cos n + 2 x π
= p dx = Pn [cos(θ)].
0 2 cos(x) − 2 cos(θ) 2

Therefore,

X
H(θ − t)  1
 
p = Pn [cos(θ)] cos n+ 2 t , 0 ≤ t < θ ≤ π.
2 cos(t) − 2 cos(θ) n=0

If the eigenfunction expansion reads



X
H(x − θ)  1
 
p = cn sin n+ 2 x ,
2 cos(θ) − 2 cos(x) n=0

then
Z    Z π
π
H(x − θ) sin n + 21 x   
cn = p dx sin2 n + 21 x dx
0 2 cos(θ) − 2 cos(x) 0
Z π
 1
  
sin n + 2 x π
= p dx = Pn [cos(θ)].
θ 2 cos(θ) − 2 cos(x) 2

Therefore,

X
H(t − θ)  1
 
p = Pn [cos(θ)] sin n+ 2 t , 0 ≤ θ < t ≤ π.
2 cos(θ) − 2 cos(t) n=0
Worked Solutions 185

12. If

X ∞
X
H(θ − t)  1
 
p = cos n+ 2 t Pn [cos(θ)] = An Pn [cos(θ)],
2 cos(t) − 2 cos(θ) n=0 n=0

then
Z π
 1
  2 H(θ − t)Pn [cos(θ)] sin(θ)
An = cos n+ 2 t = p dθ.
2n + 1 0 2 cos(t) − 2 cos(θ)

Therefore,   
Z π
Pn [cos(θ)] sin(θ) cos n + 21 t
p dθ = .
t 2 cos(t) − 2 cos(θ) n + 21
If

X ∞
X
H(t − θ)  1
 
p = sin n+ 2 t Pn [cos(θ)] = An Pn [cos(θ)],
2 cos(θ) − 2 cos(t) n=0 n=0

then
Z π
 1
  2 H(t − θ)Pn [cos(θ)] sin(θ)
An = sin n+ 2 t = p dθ.
2n + 1 0 2 cos(θ) − 2 cos(t)

Therefore,   
Z t
Pn [cos(θ)] sin(θ) sin n + 21 t
p dθ = .
0 2 cos(θ) − 2 cos(t) n + 21

13. Setting h = 1/t, we have that


1 1 h
√ =p =√
1 − 2tx + t 2 1 − 2x/h + 1/h 2 1 − 2xh + h2

X ∞
X
=h hn Pn (x) = t−n−1 Pn (x).
n=0 n=0

Turning to the expansion,



X
f (x) = An Pn (x),
n=0

where
Z 1 Z
2n + 1 2n + 1 1
Pn (x) Pn (x)
An = p dx = √ √ dx
2 −1 cosh(µ) − x 2 −1 e −|µ| − 2x + e|µ|
Z 1
2n + 1 Pn (x)
= √ e|µ|/2 √ dx.
2 1 − 2xe |µ| + e2|µ|
−1
186 Advanced Engineering Mathematics with MATLAB

Using the results from part(a) with t = e|µ| and the orthogonality property
of Legendre polynomials,
∞ Z
2n + 1 −|µ|/2 X −m|µ| 1 √ 1
An = √ e e Pm (x)Pn (x) dx = 2e−(n+ 2 )|µ| .
2 m=0 −1

Substituting An into the first equation, we obtain the final answer.

14. The first formula follows by simply letting h = 1. For the second formula,
we integrate the generating function from 0 to h or
X∞ Z h Z h

τ n Pn (x) dτ = √
n=0 0 0 1 − xτ + τ 2
X∞
Pn (x)  p h
hn+1 = ln 2 1 − 2xτ + τ 2 + 2τ − 2x
n=0
n+1 0
√ !
1 − 2xh + h2 + h − x
= ln .
1−x

The final result is obtained by settingph = 1 and dividing the top and bottom
of the argument of the logarithm by (1 − x)/2 . The last formula is found
by direct substitution of earlier results into the two summations on the right
side.

Section 6.5

1. Because
X∞
(−1)m (kx/2)2m
J0 (kx) = ,
m=0
m!m!
X∞ X∞
(−1)m (kx/2)2m−1 (−1)i (kx/2)2i+1
J0′ (kx) = k = −k = −kJ1 (kx).
m=1
(m − 1)!m! i=0
i!(i + 1)!

2. Because J0′ (x) = −J1 (x), J0′′ (x) = −J1′ (x) = 12 [J2 (x) − J0 (x)] from Equa-
tion 6.5.30. Multiplying both sides by 2 finishes the job.

3. Starting with J0 (x) + J2 (x) = 2J1 (x)/x from Equation 6.5.29 and J2 (x) =
J0 (x) + 2J0′′ (x) from problem 2 and J1 (x) = −J0′ (x), we eliminate J1 (x) and
J0 (x) between these two equations.

4. Taking the derivative of problem 2:


2J0′′′ (x) = J2′ (x) − J0′ (x)
= J1 (x) − 2J2 (x)/x − J0′ (x) from Equation 6.5.27
= J1 (x) − J0′ (x) − 2[2J1 (x)/x − J0 (x)]/x from Equation 6.5.29
= −2J0′ (x) + 4J0′ (x)/x2 + 2J0 (x)/x because J1 (x) = −J0′ (x).
Worked Solutions 187

Dividing by 2,  
2 1
J0′′′ (x) = − 1 J0′ (x) + J0 (x).
x2 x

5. From problem 3,

J2 (x) J ′ (x) J ′′ (x) 1 J ′′ (x)


=− 0 + 0 = − 0′ .
J1 (x) xJ1 (x) J1 (x) x J0 (x)

Using Equation 6.5.29, J0 (x) + J2 (x) = 2J1 (x)/x,

J2 (x) 2 J0 (x) 2 J0 (x)


= − = + ′ .
J1 (x) x J1 (x) x J0 (x)

6. From Equation 6.5.29,J4 (x) = 6J3 (x)/x − J2 (x), J3 (x) = 4J2 (x)/x − J1 (x)
and J2 (x) = 2J1 (x)/x − J0 (x). Eliminating J3 (x) and J2 (x) between these
equations gives the desired result.

7. From Equation 6.5.29, Jn−2 (x) + Jn (x) = 2(n − 1)Jn−1 (x)/x, Jn−1 (x) +
Jn+1 (x) = 2nJn (x)/x, and Jn (x) + Jn+2 (x) = 2(n + 1)Jn+1 (x)/x, we find
that

Jn−2 (x) + Jn (x) = 4n(n − 1)Jn (x)/x2 − (n − 1)[Jn (x) + Jn+2 (x)]/(n + 1).

′ ′
From Equation 6.5.30, 2Jn−1 (x) − 2Jn+1 (x) = 4Jn′′ (x), Jn−2 (x) − 2Jn (x) +
Jn+2 (x) = 4Jn′′ (x). Substituting into the last equation:

4n(n − 1) n−1
2
Jn (x) − [Jn (x) + Jn+2 (x)] − 3Jn (x) + Jn+2 (x) = 4Jn′′ (x).
x n+1

Simplifying this equation and solving for Jn+2 (x) gives the desired result.

8. Because J3 (x) = 4J2 (x)/x − J1 (x) and J2 (x) = 2J1 (x)/x − J0 (x), we can
eliminate J2 (x) between the two equations and obtain the desired result.

′ ′
9. From Equation 6.5.30, 2Jn−1 (x) − 2Jn+1 (x) = 4Jn′′ (x) after we take

the derivative. Using Equation 6.5.30 twice again to eliminate Jn−1 (x) and

Jn+1 (x) in the first equation, we obtain the desired result.

10. At the maximum or minimum, Jn′ (x) = 0. From Equation 6.5.30,


Jn−1 (x) = Jn+1 (x). From Equation 6.5.27, x = nJn (x)/Jn−1 (x). From Equa-
tion 6.5.28, x = nJn (x) /Jn+1 (x).
188 Advanced Engineering Mathematics with MATLAB

11.
d  2 
x J3 (2x) = 2xJ3 (2x) + 2x2 J3′ (2x)
dx
= 2xJ3 (2x) + 2x2 [J2 (2x) − 3J3 (2x)/2x]
= 2x2 J2 (2x) − xJ3 (2x)
from Equation 6.5.27.

12.
d  
xJ0 (x2 ) = J0 (x2 ) + 2x2 J0′ (x2 ) = J0 (x2 ) − 2x2 J1 (x2 ).
dx

13.
Z Z
1 1 3 1
x3 J2 (3x) dx = η 3 J2 (η) dη = η J3 (η) + C = x3 J3 (3x) + C
81 81 3

14.
Z Z
x−2 J3 (2x) dx = 2 η −2 J3 (η) dη = −2η −2 J2 (η) + C = − 21 x−2 J2 (2x) + C

15.
Z Z Z
x ln(x)J0 (x) dx = ln(x)[xJ0 (x) dx] = x ln(x)J1 (x) − J1 (x) dx

= x ln(x)J1 (x) + J0 (x) + C

16.
Z a Z ka
1 1 ka a2
xJ0 (kx) dx = ηJ0 (η) dη = ηJ1 (η)|0 = J1 (ka)
0 k2 0 k 2 ka

17.
Z 1 Z 1 Z 1
x(1 − x2 )J0 (kx) dx = xJ0 (kx) dx − x3 J0 (kx) dx
0 0 0
Z k Z k
1 1
= ηJ0 (η) dη − 4 η 3 J0 (η) dη
k2 0 k 0
" Z k #
1 k 1 3 k 2
= ηJ1 (η)|0 − 4 η J1 (η) 0 − 2 η J1 (η) dη
k2 k 0

J1 (k) 1 h k
i
= − 4 k 3 J1 (k) − 2 η 2 J2 (η) 0
k k  
2 2 2
= J2 (k) = 2 J1 (k) − J0 (k)
k2 k k
4 2
= J1 (k) − 2 J0 (k)
k3 k
Worked Solutions 189

18. Z Z
1 k
1
x3 J0 (kx) dx = η 3 J0 (η) dη
0 k4
"0 Z #
k
1 3 k 2
= 4 η J1 (η) 0
−2 η J1 (η) dη
k 0
1 h 3 k
i
= 4
k J1 (k) − 2 η 2 J2 (η) 0
k   
1 3 2 2
= 4 k J1 (k) − 2k J1 (k) − J0 (k)
k k
k2 − 4 2
= J1 (k) + 2 J0 (k)
k3 k

19. Because

X
f (x) = Ak J0 (µk x),
k=1
R1 Rµ
0
xJ0 (µk x) dx 2 0 k ηJ0 (η) dη 2µk J1 (µk ) 2
Ak = 1 2 = 2 2 = 2 2 = .
2 J1 (µk )
µk J1 (µk ) µk J1 (µk ) µk J1 (µk )

Therefore,

X J0 (µk x)
f (x) = 2 .
µk J1 (µk )
k=1

20. Because

X
f (x) = Ak J0 (µk x),
k=1

R1 R µk 1
R µk
1
x(1 − x2 )J0 (µk x) dx 0
ηJ0 (η) dη − µ2k 0
η 3 J0 (η) dη
8 0
Ak = 1 2 =
2 J1 (µk )
4µ2k J12 (µk )
1
µk J1 (µk ) − µ2k
[µ3k J1 (µk ) − 2µ2k J2 (µk )] 4J1 (µk )/µk 1
= = = 3 .
4µ2k J12 (µk ) 2 2
4µk J1 (µk ) µk J1 (µk )
Therefore

X J0 (µk x)
f (x) = .
µ3k J1 (µk )
k=1

21. Because

X
f (x) = Ak J1 (µk x),
k=1
190 Advanced Engineering Mathematics with MATLAB
R2
0
x(4x − x3 )J1 (µk x) dx
Ak =
2J22 (2µk )
R 2µk 2 R 2µ
4 0 η J1 (η) dη − µ12 0 k η 4 J1 (η) dη
k
=
2µ3k J22 (2µk )
1
16µ2k J2 (2µk ) − µ2k
[16µ4k J2 (2µk ) − 16µ3k J3 (2µk )]
=
2µ3k J22 (2µk )
16J3 (2µk ) 16 16
= = 3 =− 3 .
2µ2k J22 (2µk ) µk J2 (2µk ) µk J0 (2µk )
Therefore,

X J1 (µk x)
f (x) = −16 .
µ3k J0 (2µk )
k=1

22. Because

X
f (x) = Ak J1 (µk x),
k=1
R1 Rµ
0
x4 J1 (µk x) dx 2 0 k η 4 J1 (η) dη 2[µ4k J2 (µk ) − 2µ2k J3 (µk )]
Ak = 1 2 = 5 2 =
2 J2 (µk )
µk J2 (µk ) µ5k J22 (µk )
2[µk J2 (µk ) − 8J2 (µk )/µk ] 2(µ2k − 8)
= = .
µ2k J22 (µk ) µ3k J2 (µk )
Therefore,

X (µ2k − 8)J1 (µk x)
f (x) = 2 .
µ3k J2 (µk )
k=1

23. Because

X
f (x) = Ak J1 (µk x),
k=1
R1 Rµ
2µ2k 0 x2 J1 (µk x) dx 2 0 k η 2 J1 (η) dη 2µk J2 (µk )
Ak = = = 2 .
(µ2k − 1)J12 (µk ) µk (µ2k − 1)J12 (µk ) (µk − 1)J12 (µk )
Therefore,

X µk J2 (µk )J1 (µk x)
f (x) = 2 .
(µ2k − 1)J12 (µk )
k=1

24. Because

X
f (x) = Ak J0 (µk x),
k=1
Worked Solutions 191
R1 Z µk  
0
(1 − x4 )xJ0 (µk x) dx 2 u4
Ak = 1 2 = 2 2 1 − 4 J0 (u) u du
2 J1 (µk )
µk J1 (µk ) 0 µk
  µ Z µ 
2 u4 k
4 k
4
= 1 − u J 1 (u) + u J 1 (u) du
µ2k J12 (µk ) µ4k 0
µ4k 0
Z µk
8
= u2 · u2 J1 (u) du
µ6k J12 (µk ) 0
 Z µk 
8 4 µk 3
= u J 2 (u) − 2 u J 2 (u) du
µ6k J12 (µk ) 0
0
8 h µk
i
4 3
= µ J 2 (µ k ) − 2u J 3 (u)
µ6k J12 (µk ) k 0

8
= 3 2 [µk J2 (µk ) − 2J3 (µk )]
µk J1 (µk )
 
32 2J2 (µk ) 32(µ2k − 4)
= J 1 (µ k ) − = .
µ3k J12 (µk ) µk µ5k J1 (µk )
Therefore,

X (µ2k − 4)J0 (µk x)
f (x) = 32 .
µ5k J1 (µk )
k=1

25. Using Equation 6.5.31, Equation 6.5.35, and Equation 6.5.45 with h = α
and n = 0, we have that


X
1= Ak J0 (λk x), 0 < x < L,
k=1

with
Z L
1
Ak = xJ0 (λk x) dx and Ck = (λ2k L2 + α2 L2 )J02 (λk L)/(2λ2k ),
Ck 0

if λk is the kth root of λJ1 (λL) = αJ0 (λL). Therefore,


Z L
2λ2k 2α
Ak = x J0 (λk x) dx = .
(λk + α )L2 J02 (λk L)
2 2
0 (λ2k + α2 )LJ0 (λk L)

The final result follows by letting µk = λk L.

26. Because

X
f (x) = Ak J0 (µk x),
k=1
192 Advanced Engineering Mathematics with MATLAB
Ra
x[J0 (bx) − J0 (ba)]J0 (µk x) dx
0
Ak = 1 2 2
2 a J0 (ab)J1 (µk a)
2[abJ0 (µk a)J1 (ba) − aµk J0 (ba)J1 (µk a)] 2
= 2 2 2 2 −
a (b − µk )J0 (ba)J1 (µk a) aµk J1 (µk a)
2b2
= .
aµk (µ2k − b2 )J1 (µk a)
Therefore,

2b2 X J0 (µk x)
f (x) = 2 .
a µk (µk − b2 )J1 (µk a)
k=1

27. Because

X
f (x) = Ak J0 (µk x),
k=1
Rt √ R1 p
0
J0 (µk x) x dx/ t2 − x2 2t 0 J0 (bη) η dη/ 1 − η 2 2 sin(µk t)
Ak = 1 2 = 2 (µ ) = .
J
2 1 (µ k ) J 1 k µk J12 (µk )

Therefore,

X sin(µk t)J0 (µk x)
f (x) = 2 .
µk J12 (µk )
k=1

28. Because

X
f (x) = Ak J0 (µk x/b),
k=1
Ra √
J0 (µk x/b) x dx/ a2 − x2
0
Ak = 1 2 2
2 b J0 (µk )
R1 p
2a 0 J0 (µk aη/b) η dη/ 1 − η 2 2 sin(µk a/b)
= 2 =
2
b J0 (µk ) bµk J02 (µk )
from Equation 6.5.31, Equation 6.5.35, and Equation 6.5.44. Therefore,


2 X sin(µk a/b)J0 (µk x/b)
f (x) = .
b µk J02 (µk )
k=1

29. Because √
X∞
cosh(b t2 − x2 )
√ H(t − x) = Ak J0 (µk x),
t2 − x 2 k=1
Worked Solutions 193
Z t
√ 
2 cosh b t2 − x2
Ak = 2 2 √ J0 (µk x) x dx
a J1 (µk a) 0 t2 − x 2
Z t  p 
2
= 2 2 cosh(bη) J0 µk t2 − η 2 dη
a J1 (µk a) 0
p 
2 sin t µ2k − b2
= p ,
a2 µ2k − b2 J12 (µk a)
where η 2 = t2 − x2 . The final result is obtained by substituting Ak into the
first equation.

30. If we expand the function as a Fourier half-range sine expansion,

x X∞  nπx 
√ H(t − x) = Bn sin .
t t2 − x 2 n=1
L

Then, the coefficient Bn is given by


Z t Z 1  
2 x sin(nπx/L) 2 η sin(nπtη/L) π nπt
Bn = √ dx = p dη = J1 .
L 0
2
t t −x 2 L 0 1 − η2 L L

Substitution of Bn into the first equation completes the problem.

31. Because

X
f (x) = Ak J0 (µk x/a),
k=1
Ra
0
δ(x − b)J0 (µk x/a) x dx 2bJ1 (µk b/a)
Ak = 1 2 2 = .
2 a J1 (µk )
a2 J12 (µk )
Therefore,

2b X J1 (µk b/a)
f (x) = J1 (µk x/a).
a2 J12 (µk )
k=1

32. Because

X
f (x) = Ak J0 (µk x/a),
k=1
Ra
0
[δ(x)/(2πx)]J0 (µk x/a) x dx 1
Ak = 1 2 2 = 2 2 .
2 a J1 (µk )
πa J 1 (µk )

Therefore

1 X J0 (µk x/a)
f (x) = .
πa2 J12 (µk )
k=1
194 Advanced Engineering Mathematics with MATLAB

Section 6.6

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Finite-Element Solution
% of Sturm-Liouville Problems
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function fem1d ( )
%
%
% Discussion:
%
% FEM1D solves a one dimensional ODE using
% the finite element method.
%
% The differential equation has the form:
%
% -d/dx ( p(x) du/dx ) + q(x) * u = f(x)
%
% The finite-element method uses piecewise
% linear basis functions.
%
% Here U is an unknown scalar function of X defined on the
% interval [XL,XR], and P, Q and F are GIVEN functions of X.
% See function value ff, pp and ff below that give P, Q and F.
%
% The values of U or U’ at XL and XR are also specified.
%
% The interval [XL,XR] is "meshed" with NSUB+1 points,
%
% XN(0) = XL, XN(1)=XL+H, XN(2)=XL+2*H, ..., XN(NSUB)=XR.
%
% This creates NSUB subintervals, with interval number 1
% having endpoints XN(0) and XN(1), and so on up to interval
% NSUB, which has endpoints XN(NSUB-1) and XN(NSUB).
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% real ADIAG(NU).
Worked Solutions 195

% ADIAG(I) is the "diagonal" coefficient of the I-th


% equation in the linear system. That is, ADIAG(I) is
% the coefficient of the I-th unknown in the I-th equation.
%
% real ALEFT(NU).
% ALEFT(I) is the "left hand" coefficient of the I-th
% equation in the linear system. That is, ALEFT(I) is the
% coefficient of the (I-1)-th unknown in the I-th equation.
% There is no value in ALEFT(1), since the first equation
% does not refer to a "0-th" unknown.
%
% real ARITE(NU).
% ARITE(I) is the "right hand" coefficient of the I-th
% equation in the linear system. ARITE(I) is the coefficient
% of the (I+1)-th unknown in the I-th equation. There is
% no value in ARITE(NU) because the NU-th equation does not
% refer to an "NU+1"-th unknown.
%
% real F(NU).
% ASSEMBLE stores into F the right hand side of the linear
% equations.
% SOLVE replaces those values of F by the solution of the
% linear equations.
%
% real H(N), the length of the subintervals.
%
% integer IBC. declares what the boundary conditions are.
% 1, at the left endpoint, U has the value UL,
% at the right endpoint, U’ has the value UR.
% 2, at the left endpoint, U’ has the value UL,
% at the right endpoint, U has the value UR.
% 3, at the left endpoint, U has the value UL,
% and at the right endpoint, U has the value UR.
% 4, at the left endpoint, U’ has the value UL,
% at the right endpoint U’ has the value UR.
%
% integer INDX(1:N+1).
% For a node I, INDX(I) is the index of the unknown
% associated with node I.
% If INDX(I) is equal to -1, then no unknown is associated
% with the node, because a boundary condition fixing the
% value of U has been applied at the node instead.
% Unknowns are numbered beginning with 1.
% If IBC is 2 or 4, then there is an unknown value of U
% at node 0, which will be unknown number 1. Otherwise,
196 Advanced Engineering Mathematics with MATLAB

% unknown number 1 will be associated with node 1.


% If IBC is 1 or 4, then there is an unknown value of U
% at node N, which will be unknown N or N+1,
% depending on whether there was an unknown at node 0.
%
% integer NL, the number of basis functions used in a single
% subinterval. (NL-1) is the degree of the polynomials
% used. For this code, NL is fixed at 2, meaning that
% piecewise linear functions are used as the basis.
%
% integer NODE(NL,N).
% For each subinterval I:
% NODE(1,I) is the number of the left node, and
% NODE(2,I) is the number of the right node.
%
% integer NQUAD.
% The number of quadrature points used in a subinterval.
% This code uses NQUAD = 1.
%
% integer NSUB, the number of subintervals into which
% the interval [XL,XR] is broken.
%
% integer NU, the number of unknowns in the linear system.
% Depending on the value of IBC, there will be N-1,
% N, or N+1 unknown values, which are the coefficients
% of basis functions.
%
% real UL.
% If IBC is 1 or 3, UL is the value that U is required
% to have at X = XL.
% If IBC is 2 or 4, UL is the value that U’ is required
% to have at X = XL.
%
% real UR.
% If IBC is 2 or 3, UR is the value that U is required
% to have at X = XR.
% If IBC is 1 or 4, UR is the value that U’ is required
% to have at X = XR.
%
% real XL, the left endpoint of the interval over which the
% differential equation is being solved.
%
% real XN(1:N+1).
% XN(I) is the location of the I-th node. XN(1) is XL,
% and XN(N+1) is XR.
Worked Solutions 197

%
% real XQUAD(N)
% XQUAD(I) is the location of the single quadrature point
% in interval I.
%
% real XR, the right endpoint of the interval over which the
% differential equation is being solved.
%
n = 10; % Number of subintervals
nl = 2; % Number of basis functions
fprintf ( 1, ’\n’ );
timestamp ( );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’FEM1D\n’ );
fprintf ( 1, ’ MATLAB version\n’ );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’ Solve the two-point boundary value problem:\n’ );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’ -d/dx [p(x) du/dx] + q(x)*u = f(x)\n’ );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’ on an interval [xl,xr], with the values of\n’ );
fprintf ( 1, ’ u or u’’ specified at xl and xr.\n’ );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’ The interval is broken into %d subintervals. ...
\n’, n );
fprintf ( 1, ’ The number of basis functions per element is ...
%d\n’, nl );

% **** Initialize variables that define the problem.

[ ibc, nquad, ul, ur, xl, xr ] = init ( );

% Compute the quantities that describe the geometry


% of the problem.

[h, indx, node, nu, xn, xquad] = geometry( ibc, nl, n, xl, xr );

% **** Assemble the matrix.

[ adiag, aleft, arite, f ] = assemble ( h, indx, nl, node, ...


nu, nquad, n, ul, ur, xn, xquad );

% **** Print out the linear system.

system print ( adiag, aleft, arite, f, nu );


198 Advanced Engineering Mathematics with MATLAB

% **** Solve the linear system.

u = solve ( adiag, aleft, arite, f, nu );

% **** Print the current solution.

output ( u, ibc, indx, n, nu, ul, ur, xn );

fprintf ( 1, ’\n’ );
fprintf ( 1, ’FEM1D:\n’ );
fprintf ( 1, ’ Normal end of execution.\n’ );

fprintf ( 1, ’\n’ ); timestamp ( );

return
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [adiag, aleft, arite, f] = assemble ( h, indx, nl, ...


node, nu, nquad, n, ul, ur, xn, xquad )
%***************************************************************
%
% ASSEMBLE assembles the matrix and right hand side
% of the linear system.
%
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Input, real H(N), the length of the subintervals.
%
% Input, integer INDX(1:N+1).
% For a node I, INDX(I) is the index of the unknown
% associated with node I.
% If INDX(I) is equal to -1, then no unknown is associated
% with the node, because a boundary condition fixing the
% value of U has been applied at the node instead.
% Unknowns are numbered beginning with 1.
% If IBC is 2 or 4, then there is an unknown value of U
Worked Solutions 199

% at node 0, which will be unknown number 1. Otherwise,


% unknown number 1 will be associated with node 1.
% If IBC is 1 or 4, then there is an unknown value of U
% at node N, which will be unknown N or N+1,
% depending on whether there was an unknown at node 0.
%
% Input, integer NL.
% The number of basis functions used in a single
% subinterval. (NL-1) is the degree of the polynomials
% used. For this code, NL is fixed at 2, meaning that
% piecewise linear functions are used as the basis.
%
% Input, integer NODE(NL,N).
% For each subinterval I:
% NODE(1,I) is the number of the left node, and
% NODE(2,I) is the number of the right node.
%
% Input, integer NU.
% NU is the number of unknowns in the linear system.
% Depending on the value of IBC, there will be N-1,
% N, or N+1 unknown values, which are the coefficients
% of basis functions.
%
% Input, integer NQUAD, the number of quadrature points
% in a subinterval. This code uses NQUAD = 1.
% Input, integer N, the number of subintervals into which
% the interval [XL,XR] is broken.
%
% Input, real UL.
% If IBC is 1 or 3, UL is the value that U is required
% to have at X = XL.
% If IBC is 2 or 4, UL is the value that U’ is required
% to have at X = XL.
%
% Input, real UR.
% If IBC is 2 or 3, UR is the value that U is required
% to have at X = XR.
% If IBC is 1 or 4, UR is the value that U’ is required
% to have at X = XR.
%
% Input, real XN(1:N+1), the location of the I-th node.
% XN(1) is XL, and XN(N+1) is XR.
%
% Input, real XQUAD(N), the location of the single
% quadrature point in interval I.
200 Advanced Engineering Mathematics with MATLAB

%
% Output, real ADIAG(NU).
% ADIAG(I) is the "diagonal" coefficient of the I-th
% equation in the linear system. That is, ADIAG(I) is
% the coefficient of the I-th unknown in the I-th equation.
%
% Output, real ALEFT(NU).
% ALEFT(I) is the "left hand" coefficient of the I-th
% equation in the linear system. That is, ALEFT(I) is the
% coefficient of the (I-1)-th unknown in the I-th equation.
% There is no value in ALEFT(1), since the first equation
% does not refer to a "0-th" unknown.
%
% Output, real ARITE(NU).
% ARITE(I) is the "right hand" coefficient of the I-th
% equation in the linear system. ARITE(I) is the coefficient
% of the (I+1)-th unknown in the I-th equation. There is
% no value in ARITE(NU) because the NU-th equation does not
% refer to an "NU+1"-th unknown.
%
% Output, real F(NU), the right hand side
% the linear equations.

f(1:nu) = 0.0; adiag(1:nu) = 0.0;


aleft(1:nu) = 0.0; arite(1:nu) = 0.0;

% **** For element IE...

for ie = 1 : n

he = h(ie);
xleft = xn(node(1,ie)+1);
xrite = xn(node(2,ie)+1);

% **** For quadrature point IQ...

for iq = 1 : nquad

xqe = xquad(ie);

% **** For basis function IL...

for il = 1 : nl

ig = node(il,ie);
Worked Solutions 201

iu = indx(ig+1);

if ( 0 < iu )

[ phii, phiix ] = phi ( il, xqe, xleft, xrite );


f(iu) = f(iu) + he * ff ( xqe ) * phii;

% **** Handle boundary conditions.

if ( ig == 0 )
x = xn(1); f(iu) = f(iu) - pp ( x ) * ul;
elseif ( ig == n )
x = xn(n+1); f(iu) = f(iu) + pp ( x ) * ur;
end

% **** For basis function JL...

for jl = 1 : nl

jg = node(jl,ie);
ju = indx(jg+1);

[ phij, phijx ] = phi ( jl, xqe, xleft, xrite );

aij = he * ( pp ( xqe ) * phiix * phijx ...


+ qq ( xqe ) * phii * phij );

if ( ju <= 0 )

if ( jg == 0 )
f(iu) = f(iu) - aij * ul;
elseif ( jg == n )
f(iu) = f(iu) - aij * ur;
end

elseif ( iu == ju )
adiag(iu) = adiag(iu) + aij;
elseif ( ju < iu )
aleft(iu) = aleft(iu) + aij;
else
arite(iu) = arite(iu) + aij;
end
end
end
end
202 Advanced Engineering Mathematics with MATLAB

end
end

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function value = ff ( x )

%*************************************************************
%
% FF returns the right hand side of the differential equation.
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Input, real X, the evaluation point.
%
% Output, real VALUE, the value of F(X).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% This is where the right side of ode is loaded %%%%
value = 2*x*exp(2*x) + 3*exp(2*x)*sin(x);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

return
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [h, indx, node, nu, xn, xquad] ...


= geometry ( ibc, nl, nsub, xl, xr )

%*************************************************************
%
% GEOMETRY sets up the geometry for the interval [XL,XR].
%
% Licensing:
% This code is distributed under the GNU LGPL license.
% Author: MATLAB version by John Burkardt
%
Worked Solutions 203

% Parameters:
%
% Input, integer IBC.
% IBC declares what the boundary conditions are.
% 1, at the left endpoint, U has the value UL,
% at the right endpoint, U’ has the value UR.
% 2, at the left endpoint, U’ has the value UL,
% at the right endpoint, U has the value UR.
% 3, at the left endpoint, U has the value UL,
% and at the right endpoint, U has the value UR.
% 4, at the left endpoint, U’ has the value UL,
% at the right endpoint U’ has the value UR.
%
% Input, integer NL.
% The number of basis functions used in a single
% subinterval. (NL-1) is the degree of the polynomials
% used. For this code, NL is fixed at 2, meaning that
% piecewise linear functions are used as the basis.
%
% Input, integer NSUB.
% The number of subintervals into which the interval
% [XL,XR] is broken.
%
% Input, real XL.
% XL is the left endpoint of the interval over which the
% differential equation is being solved.
%
% Input, real XR.
% XR is the right endpoint of the interval over which the
% differential equation is being solved.
%
% Output, real H(N), the length of the subintervals.
%
% Output, integer INDX(1:N+1).
% For a node I, INDX(I) is the index of the unknown
% associated with node I.
% If INDX(I) is equal to -1, then no unknown is associated
% with the node, because a boundary condition fixing the
% value of U has been applied at the node instead.
% Unknowns are numbered beginning with 1.
% If IBC is 2 or 4, then there is an unknown value of U
% at node 0, which will be unknown number 1. Otherwise,
% unknown number 1 will be associated with node 1.
% If IBC is 1 or 4, then there is an unknown value of U
% at node N, which will be unknown N or N+1,
204 Advanced Engineering Mathematics with MATLAB

% depending on whether there was an unknown at node 0.


%
% Output, integer NODE(NL,N).
% For each subinterval I:
% NODE(1,I) is the number of the left node, and
% NODE(2,I) is the number of the right node.
%
% Output, integer NU.
% NU is the number of unknowns in the linear system.
% Depending on the value of IBC, there will be N-1,
% N, or N+1 unknown values, which are the coefficients
% of basis functions.
%
% Output, real XN(1:N+1).
% XN(I) is the location of the I-th node. XN(1) is XL,
% and XN(N+1) is XR.
%
% Output, real XQUAD(N)
% XQUAD(I) is the location of the single quadrature point
% in interval I.
%
% **** Set the value of XN, the locations of the nodes.
%
fprintf ( 1, ’\n’ );
fprintf ( 1, ’ Node Location\n’ );
fprintf ( 1, ’\n’ );

for i = 0 : nsub
xn(i+1) = ( ( nsub - i ) * xl + ( i ) * xr ) / ( nsub );
fprintf ( 1, ’ %6d %12f\n’, i, xn(i+1) );
end

% **** Set the lengths of each subinterval.

fprintf ( 1, ’\n’ );
fprintf ( 1, ’Subint Length\n’ );
fprintf ( 1, ’\n’ );

for i = 1 : nsub
h(i) = xn(i+1) - xn(i);
fprintf ( 1, ’ %6d %12f\n’, i, h(i) );
end

% **** Set the quadrature points, each of which is the


% **** midpoint of its subinterval.
Worked Solutions 205

fprintf ( 1, ’\n’ );
fprintf ( 1, ’Subint Quadrature point\n’ );
fprintf ( 1, ’\n’ );

for i = 1 : nsub
xquad(i) = 0.5 * ( xn(i) + xn(i+1) );
fprintf ( 1, ’ %6d %12f\n’, i, xquad(i) );
end

% **** Set the value of NODE, which records, for each interval,
% **** the node numbers at the left and right.

fprintf ( 1, ’\n’ );
fprintf ( 1, ’Subint Left Node Right Node\n’ );
fprintf ( 1, ’\n’ );

for i = 1 : nsub
node(1,i) = i - 1; node(2,i) = i;
fprintf ( 1, ’ %6d %6d %6d\n’, i, node(1,i), node(2,i) );
end

% **** Starting with node 0, see if an unknown is associated


% **** with the node. If so, give it an index.

nu = 0;

% **** Handle first node.

i = 0;
if ( ibc == 1 | ibc == 3 )
indx(i+1) = -1;
else
nu = nu + 1; indx(i+1) = nu;
end

% ***** Handle nodes 1 through nsub-1

for i = 1 : nsub-1
nu = nu + 1; indx(i+1) = nu;
end

% **** Handle the last node.

i = nsub;
206 Advanced Engineering Mathematics with MATLAB

if ( ibc == 2 | ibc == 3 )
indx(i+1) = -1;
else
nu = nu + 1; indx(i+1) = nu;
end

fprintf ( 1, ’\n’ );
fprintf ( 1, ’ Node Unknown\n’ );
fprintf ( 1, ’\n’ );

for i = 0 : nsub
fprintf ( 1, ’ %6d %6d\n’, i, indx(i+1) );
end

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [ ibc, nquad, ul, ur, xl, xr ] = init ( )

% *************************************************************
%
% INIT initializes variables that define the problem.
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Output, integer IBC.
% IBC declares what the boundary conditions are.
% 1, at the left endpoint, U has the value UL,
% at the right endpoint, U’ has the value UR.
% 2, at the left endpoint, U’ has the value UL,
% at the right endpoint, U has the value UR.
% 3, at the left endpoint, U has the value UL,
% and at the right endpoint, U has the value UR.
% 4, at the left endpoint, U’ has the value UL,
% at the right endpoint U’ has the value UR.
%
% Output, integer NQUAD.
% The number of quadrature points used in a subinterval.
% This code uses NQUAD = 1.
Worked Solutions 207

%
% Output, real UL.
% If IBC is 1 or 3, UL is the value that U is required
% to have at X = XL.
% If IBC is 2 or 4, UL is the value that U’ is required
% to have at X = XL.
%
% Output, real UR.
% If IBC is 2 or 3, UR is the value that U is required
% to have at X = XR.
% If IBC is 1 or 4, UR is the value that U’ is required
% to have at X = XR.
%
% Output, real XL.
% XL is the left endpoint of the interval over which the
% differential equation is being solved.
%
% Output, real XR.
% XR is the right endpoint of the interval over which the
% differential equation is being solved.
%
%%%%%% LOAD IN END POINT VALUES HERE %%%%%%
ibc = 4; nquad = 1; ul = -2.0; ur = 3.0; xl = 0.0; xr = 1.0;

% **** Print out the values that have been set.

fprintf ( 1, ’\n’ );
fprintf ( 1, ’The equation is to be solved for\n’ );
fprintf ( 1, ’X greater than XL = ’, xl );
fprintf ( 1, ’ and less than XR = ’, xr );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’The boundary conditions are:\n’ );
fprintf ( 1, ’\n’ );

if ( ibc == 1 | ibc == 3 )
fprintf ( 1, ’ At X = XL, U = %f\n’, ul );
else
fprintf ( 1, ’ At X = XL, U’’ = %f\n’, ul );
end

if ( ibc == 2 | ibc == 3 )
fprintf ( 1, ’ At X = XR, U = %f\n’, ur );
else
fprintf ( 1, ’ At X = XR, U’’ = %f\n’, ur );
end
208 Advanced Engineering Mathematics with MATLAB

fprintf ( 1, ’\n’ );
fprintf ( 1, ’Number of quadrature points per element is ...
%d\n’, nquad );

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function output ( f, ibc, indx, nsub, nu, ul, ur, xn )

%**********************************************************
%
% OUTPUT prints out the computed solution at the nodes.
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Input, real F(NU), the solution of the linear equations.
%
% Input, integer IBC.
% IBC declares what the boundary conditions are.
% 1, at the left endpoint, U has the value UL,
% at the right endpoint, U’ has the value UR.
% 2, at the left endpoint, U’ has the value UL,
% at the right endpoint, U has the value UR.
% 3, at the left endpoint, U has the value UL,
% and at the right endpoint, U has the value UR.
% 4, at the left endpoint, U’ has the value UL,
% at the right endpoint U’ has the value UR.
%
% Input, integer INDX(1:N+1).
% For a node I, INDX(I) is the index of the unknown
% associated with node I.
% If INDX(I) is equal to -1, then no unknown is associated
% with the node, because a boundary condition fixing the
% value of U has been applied at the node instead.
% Unknowns are numbered beginning with 1.
% If IBC is 2 or 4, then there is an unknown value of U
% at node 0, which will be unknown number 1. Otherwise,
% unknown number 1 will be associated with node 1.
Worked Solutions 209

% If IBC is 1 or 4, then there is an unknown value of U


% at node N, which will be unknown N or N+1,
% depending on whether there was an unknown at node 0.
%
% integer NSUB.
% The number of subintervals into which the interval
% [XL,XR] is broken.
%
% Input, integer NU.
% NU is the number of unknowns in the linear system.
% Depending on the value of IBC, there will be N-1,
% N, or N+1 unknown values, which are the coefficients
% of basis functions.
%
% Input, real UL.
% If IBC is 1 or 3, UL is the value that U is required
% to have at X = XL.
% If IBC is 2 or 4, UL is the value that U’ is required
% to have at X = XL.
%
% Input, real UR.
% If IBC is 2 or 3, UR is the value that U is required
% to have at X = XR.
% If IBC is 1 or 4, UR is the value that U’ is required
% to have at X = XR.
%
% Input, real XN(1:N+1).
% XN(I) is the location of the I-th node. XN(1) is XL,
% and XN(N+1) is XR.

fprintf ( 1, ’\n’ );
fprintf ( 1, ’Computed solution:\n’ );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’ Node X(I) U(I)\n’ );
fprintf ( 1, ’\n’ );

for i = 0 : nsub

if ( i == 0 )
if ( ibc == 1 | ibc == 3 )
u(i+1) = ul;
else
u(i+1) = f(indx(i+1));
end
elseif ( i == nsub )
210 Advanced Engineering Mathematics with MATLAB

if ( ibc == 2 | ibc == 3 )
u(i+1) = ur;
else
u(i+1) = f(indx(i+1));
end
else
u(i+1) = f(indx(i+1));
end

fprintf ( 1, ’ %6d %12f %12f\n’, i, xn(i+1), u(i+1) );

end

%%%%%% LOAD IN EXACT SOLUTION HERE %%%%%%


for i = 0 : nsub
xx = xn(i+1);
y exact(i+1) = 2*xx - 4 - 1.5*cos(xx) + 0.5*(3*sin(1)-2) ...
*exp(1-xx) + 0.5*(-8/exp(1) + 3*sin(1) - 2) ...
*xx*exp(1-xx);
end

%%%%%%%% PLOT RESULTS %%%%%%%%


hold on
plot(xn,u,’-k’,’LineWidth’,2)
plot(xn,y exact,’--+r’,’LineWidth’,2,’MarkerSize’,20)
xlabel(’x’,’FontSize’,20)
ylabel(’y(x)’,’FontSize’,20)

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [ phii, phiix ] = phi ( il, x, xleft, xrite )

%**************************************************************
%
% PHI evaluates a linear basis function and its derivative.
%
% Discussion:
%
% In any interval, there are just two basis functions. The
% first basis function is a line which is 1 at the left endpoint
% and 0 at the right. The second basis function is 0 at
% the left endpoint and 1 at the right.
%
Worked Solutions 211

% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Input, integer IL, the index of the basis function.
% 1, the function which is 1 at XLEFT and 0 at XRITE.
% 2, the function which is 0 at XLEFT and 1 at XRITE.
%
% Input, real X, the evaluation point.
%
% Input, real XLEFT, XRITE, the left and right
% endpoints of the interval.
%
% Output, real PHII, PHIIX, the value of the
% basis function and its derivative at X.

if ( xleft <= x & x <= xrite )

if ( il == 1 )
phii = ( xrite - x ) / ( xrite - xleft );
phiix = -1.0 / ( xrite - xleft );
else
phii = ( x - xleft ) / ( xrite - xleft );
phiix = 1.0 / ( xrite - xleft );
end

% **** If X is outside of the interval, then the basis function


% **** is always zero.

else

phii = 0.0;
phiix = 0.0;
end

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function value = pp ( x )

%*********************************************************
212 Advanced Engineering Mathematics with MATLAB

%
% PP returns the value of the coefficient function P(X).
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Input, real X, the evaluation point.
%
% Output, real VALUE, the value of P(X).

value = -exp(2*x);

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function value = qq ( x )

%********************************************************
%
% QQ returns the value of the coefficient function Q(X).
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Input, real X, the evaluation point.
%
% Output, real VALUE, the value of Q(X).

value = exp(2*x);

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function u = solve ( adiag, aleft, arite, f, nu )


Worked Solutions 213

%*********************************************************
%
% SOLVE solves a tridiagonal matrix system of the form A*x = b.
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: MATLAB version by John Burkardt
%
% Parameters:
%
% Input, real ADIAG(NU), ALEFT(NU), ARITE(NU).
% the diagonal, left and right entries of the equations.
% Note that for the first equation, there is no ALEFT
% coefficient, and for the last, there is no ARITE.
% So there is no need to store a value in ALEFT(1), nor
% in ARITE(NU).
%
% Input, real F(NU), the right hand side of the linear
% system to be solved.
%
% Input, integer NU.
% NU is the number of equations to be solved.
%
% Output, real U(NU), the solution of the linear system.

arite(1) = arite(1) / adiag(1);

for i = 2 : nu-1
adiag(i) = adiag(i) - aleft(i) * arite(i-1);
arite(i) = arite(i) / adiag(i);
end

adiag(nu) = adiag(nu) - aleft(nu) * arite(nu-1);

u(1) = f(1) / adiag(1);

for i = 2 : nu
u(i) = ( f(i) - aleft(i) * u(i-1) ) / adiag(i);
end

for i = nu-1 : -1 : 1
u(i) = u(i) - arite(i) * u(i+1);
end
214 Advanced Engineering Mathematics with MATLAB

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function system print ( adiag, aleft, arite, f, nu )

%***********************************************************
%
% SYSTEM PRINT prints out the tridiagonal linear
% system to be solved.
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: John Burkardt
%
% Parameters:
%
% Input, real ADIAG(NU), ALEFT(NU), ARITE(NU),
% the diagonal, left and right entries of the equations.
% Input, real F(NU), the right hand side of the linear system.
% Input, integer NU, the number of equations to be solved.
%
fprintf ( 1, ’\n’ );
fprintf ( 1, ’Printout of tridiagonal linear system:\n’ );
fprintf ( 1, ’\n’ );
fprintf ( 1, ’Equation ALEFT ADIAG ARITE RHS\n’ );
fprintf ( 1, ’\n’ );

for i = 1 : nu

fprintf ( 1, ’%3d’, i );

if ( i == 1 )
fprintf ( 1, ’ ’ );
else
fprintf ( 1, ’ %12f’, aleft(i) );
end

fprintf ( 1, ’ %12f’, adiag(i) );

if ( i < nu )
fprintf ( 1, ’
else
fprintf ( 1, ’ ’ );
Worked Solutions 215

end

fprintf ( 1, ’ %12f\n’, f(i) );

end

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function timestamp ( )

%*********************************************************
%
% TIMESTAMP prints the current YMDHMS date as a timestamp.
%
% Licensing:
% This code is distributed under the GNU LGPL license.
%
% Author: John Burkardt

t = now;
c = datevec ( t );
s = datestr ( c, 0 );
fprintf ( 1, ’%s\n’, s );
return; end

Section 7.3

1. From separation of variables, X ′′ /X = T ′′ /(c2 T ) = −λ. This leads to the


differential equation: X ′′ + λX = 0 with X(0) = X(L) = 0. The boundary
conditions come from u(0, t) = X(0)T (t) = 0 or X(0) = 0. Similarly, u(L, t) =
X(L)T (t) = 0 or X(L) = 0. Solving the Sturm-Liouville problem,

n2 π 2  nπx 
λn = , Xn (x) = sin .
L2 L
The temporal equation is
   
a2 n2 π 2 nπct nπct
Tn′′ + Tn = 0 and Tn (t) = An cos + Bn sin .
L2 L L

The product solution is


 nπx   
nπct
 
nπct

un (x, t) = sin An cos + Bn sin
L L L
216 Advanced Engineering Mathematics with MATLAB

and

X  nπx   
nπct
 
nπct

u(x, t) = sin An cos + Bn sin .
n=1
L L L

At t = 0,

X  nπx 
u(x, 0) = An sin = 0 or An = 0.
n=1
L

Because
X∞
nπc  nπx   
nπct
 
nπct

ut (x, t) = sin −An sin + Bn cos .
n=1
L L L L

Therefore,
X∞
nπc  nπx 
ut (x, 0) = Bn sin = 1.
n=1
L L

This is a half-range sine Fourier series. Therefore, we can immediately write


Z L  nπx 
nπc 2 2L[1 − (−1)n ]
Bn = 1 sin dx or Bn = .
L L 0 L cn2 π 2

The final answer is


∞    
4L X 1 (2m − 1)πx (2m − 1)πct
u(x, t) = 2 sin sin .
cπ m=1 (2m − 1)2 L L

2. The solution proceeds as in problem 1 up to the point:



X  nπx   
nπct
 
nπct

u(x, t) = sin An cos + Bn sin .
n=1
L L L

At t = 0,

X  nπx 
u(x, 0) = An sin = 1.
n=1
L

This is a half-range sine expansion. Therefore,


Z L  nπx 
2 2[1 − (−1)n ]
An = 1 sin dx = .
L 0 L nπ

Because
X∞
nπc  nπx   
nπct
 
nπct

ut (x, t) = sin −An sin + Bn cos ,
n=1
L L L L
Worked Solutions 217

X∞
nπc  nπx 
ut (x, 0) = Bn sin = 0 ⇒ Bn = 0.
n=1
L L

The final answer is


∞    
4 X 1 (2m − 1)πx (2m − 1)πct
u(x, t) = sin cos .
π m=1 2m − 1 L L

3. The solution proceeds as in problem 1 up to the point:



X  nπx   
nπct
 
nπct

u(x, t) = sin An cos + Bn sin .
n=1
L L L

At t = 0,

X  nπx 
u(x, 0) = An sin = f (x).
n=1
L

This is a half-range sine expansion. Therefore,


Z 2L/3  nπx  Z L  nπx 
2 3hx 2 3h(L − x)
An = sin dx + sin dx
0L 2L L L 2L/3 2L L
 
9h 2nπ
= 2 2 sin .
n π 3

Because

X∞
nπc  nπx   
nπct
 
nπct

ut (x, t) = sin −An sin + Bn cos ,
n=1
L L L L

X∞
nπc  nπx 
ut (x, 0) = Bn sin = 0 or Bn = 0.
n=1
L L

. The final answer is


∞    nπx   
9h X 1 2nπ nπct
u(x, t) = sin sin cos .
π 2 n=1 n2 3 L L

4. The solution proceeds as in problem 1 up to the point:



X  nπx   
nπct
 
nπct

u(x, t) = sin An cos + Bn sin .
n=1
L L L
218 Advanced Engineering Mathematics with MATLAB

At t = 0,

X  nπx   πx   
2πx
u(x, 0) = An sin = A1 sin + A2 sin
n=1
L L L
   
3πx 4πx
+ A3 sin + A4 sin + ···
L L

By inspection, A1 = 3/4, A2 = 0, A3 = −1/4, A4 = A5 = · · · = 0. Because

X∞
nπc  nπx   
nπct
 
nπct

ut (x, t) = sin −An sin + Bn cos ,
n=1
L L L L

X∞
nπc  nπx 
ut (x, 0) = Bn sin = 0 ⇒ Bn = 0.
n=1
L L
The final answer is
  πx       
1 πct 3πx 3πct
u(x, t) = 3 sin cos − sin cos .
4 L L L L

5. The solution proceeds as in problem 1 up to the point:



X  nπx   
nπct
 
nπct

u(x, t) = sin An cos + Bn sin .
n=1
L L L

At t = 0,

X  nπx   πx   
2πx
u(x, 0) = An sin = A1 sin + A2 sin
n=1
L L L
   
3πx 4πx
+ A3 sin + A4 sin + ···
L L

By inspection, A1 = 1, A2 = A3 = · · · = 0. Because
X∞
nπc  nπx   
nπct
 
nπct

ut (x, t) = sin −An sin + Bn cos ,
n=1
L L L L

X∞
nπc  nπx 
ut (x, 0) = Bn sin = g(x).
n=1
L L
This is a half-range sine Fourier series. Therefore, we can immediately write
Z 3L/4  nπx 
nπc 2
Bn = a sin dx
L L L/4 L
Worked Solutions 219

or
  nπ     nπ   nπ 
2aL 3nπ 4aL
Bn = 2 2 cos − cos = 2 2 sin sin .
n π c L L n π c 2 4

The final answer is


 πx   
πct
u(x, t) = sin cos
L L
∞    
4aL X (−1)n+1 (2n − 1)π (2n − 1)πx
+ 2 sin sin
π c n=1 (2n − 1)2 4 L
 
(2n − 1)πct
× sin .
L

6. The solution proceeds as in problem 1 up to the point:



X  nπx   
nπct
 
nπct

u(x, t) = sin An cos + Bn sin .
n=1
L L L

At t = 0,

X  nπx 
u(x, 0) = An sin = 0 ⇒ An = 0.
n=1
L

Because
X∞
nπc  nπx   
nπct
 
nπct

ut (x, t) = sin −An sin + Bn cos ,
n=1
L L L L

X∞
nπc  nπx 
ut (x, 0) = Bn sin = g(x).
n=1
L L

This is a half-range sine Fourier series. Therefore, we can immediately write


Z L/2  nπx  Z L  nπx 
nπc 2 ax 2 a(L − x)
Bn = sin dx + sin dx
L L 0 L L L L/2 L L

or  nπ 
4aL
Bn = sin .
cn3 π 3 2
The final answer is
∞    
4aL X (−1)m+1 (2m − 1)πx (2m − 1)πct
u(x, t) = sin sin .
cπ 3 m=1 (2m − 1)3 L L
220 Advanced Engineering Mathematics with MATLAB

7. The solution proceeds as in problem 1 up to the point:



X  nπx   
nπct
 
nπct

u(x, t) = sin An cos + Bn sin .
n=1
L L L

At t = 0,

X  nπx 
u(x, 0) = An sin = f (x).
n=1
L
This is a half-range sine expansion. Therefore,
Z  nπx  Z  nπx 
2 L/2 2 L
An = x sin dx + (L − x) sin dx
L 0 L L L/2 L
4L  nπ 
= 2 2 sin .
n π 2
Because
X∞
nπc  nπx   
nπct
 
nπct

ut (x, t) = sin −An sin + Bn cos ,
n=1
L L L L

X∞
nπc  nπx 
ut (x, 0) = Bn sin = 0 or Bn = 0.
n=1
L L
The final answer is
∞    
4L X (−1)n+1 (2n − 1)πx (2n − 1)πct
u(x, t) = sin cos .
π 2 n=1 (2n − 1)2 L L

8. From separation of variables, X ′′ /X = T ′′ /(c2 T ) = −λ. This leads to the


differential equation: X ′′ + λX = 0 with X ′ (0) = X ′ (π) = 0. The boundary
conditions come from ux (0, t) = X ′ (0)T (t) = 0 or X ′ (0) = 0. Similarly,
ux (π, t) = X ′ (π)T (t) = 0 or X ′ (π) = 0. Solving the Sturm-Liouville problem,
λ0 = 0, X0 (x) = 1 and λn = n2 , Xn (x) = cos (nx) . The temporal equations
are T0′′ = 0 and Tn′′ + n2 c2 Tn = 0. The corresponding solutions are T0 (t) =
A0 + B0 t and Tn (t) = An cos (nct) + Bn sin (nct) . The product solutions are
u0 (x, t) = A0 + B0 t and
 
un (x, t) = cos (nx) An cos (nct) + Bn sin (nct) .

Therefore, the complete solution is



X  
u(x, t) = A0 + B0 t + cos (nx) An cos (nct) + Bn sin (nct) .
n=1
Worked Solutions 221

At t = 0,

X
u(x, 0) = A0 + An cos (nx) = 0 ⇒ A0 = An = 0.
n=1

Because

X  
ut (x, t) = B0 + (nc) cos (nx) −An sin (nct) + Bn cos (nct) ,
n=1

ut (x, 0) = B0 + cB1 cos(x) + 2cB2 cos(2x) + 3cB3 cos(3x) + 4cB4 cos(4x) + ·


= 1 + 41 [3 cos(x) + cos(3x)].
Therefore, by inspection, B0 = 1, cB1 = 34 , B2 = 0, 3cB3 = 1
4 and Bn = 0 if
n ≥ 4. The final answer is
3 1
u(x, t) = t + 4c cos(x) sin(ct) + 12c cos(3x) sin(3ct).

9. We begin by transforming the problem using the substitution 4x = r2 and


obtain
∂2u ∂ 2 u 1 ∂u
= + , 0 ≤ r < 2, 0 < t,
∂t2 ∂r2 r ∂r
with the boundary conditions

lim |u(r, t)| < ∞, u(2, t) = 0, 0 < t,


r→0

and the initial conditions

u(r, 0) = 0, 0 ≤ r < 2,

and  √
1, 0√
≤ r < 2 a,
ut (r, 0) =
0, 2 a < r < 2.
We now use separation of variables with u(r, t) = R(r)T (t). The product solu-
tion with satisfies the boundary conditions and the initial condition u(r, 0) = 0
is

X
u(r, t) = An sin(kn t)J0 (kn r),
n=1

where kn is the nth solution of J0 (2k) = 0. Finally, we have that



X  √
1, ≤ r < 2 a,
0√
ut (r, 0) = kn An J0 (kn r) =
0, 2 a < r < 2.
n=1
222 Advanced Engineering Mathematics with MATLAB

To find An , we realize that we are dealing with a Fourier-Bessel series with


Dirichlet boundary conditions. This immediately yields
Z √
2 a
2
kn An = 2 rJ0 (kn r) dr
4J1 (2kn ) 0
Z √ √ √
2kn a
1 aJ1 (2kn a )
= 2 2 ηJ0 (η) dη = ,
2kn J1 (2kn ) 0 kn J12 (2kn )

and √ √
aJ1 (2kn a )
An = .
kn2 J12 (2kn )
Therefore,
∞ √
√ X J1 (2kn a )J0 (kn r)
u(r, t) = a sin(kn t),
n=1
kn2 J12 (2kn )
or √ √

√ X J1 (2kn a )J0 (2kn x )
u(x, t) = a sin(kn t).
n=1
kn2 J12 (2kn )

10. From separation of variables, X ′′ /X = (T ′′ + 2hT ′ )/(c2 T ) = −λ. This


leads to the differential equation: X ′′ + λX = 0 with X(0) = X ′ (L) =
0. The boundary conditions come from u(0, t) = X(0)T (t) = 0 or X(0) =
0. Similarly, ux (L, t) = X ′ (L)T (t) = 0 or X ′ (L) = 0. Solving the Sturm-
Liouville problem,
 
(2n − 1)2 π 2 (2n − 1)πx
λn = , Xn (x) = sin .
4L2 2L

The temporal equation is

(2n − 1)2 c2 π 2
Tn′′ + 2hTn′ + Tn = 0.
4L2
The corresponding solution is
 hp i hp i
Tn (t) = e−ht An cos t λn c2 − h2 + Bn sin t λn c2 − h2 .

The product solution is


  hp i
−ht (2n − 1)πx
un (x, t) = e sin An cos t λn c2 − h2
2L
hp i
2
+ Bn sin t λn c − h 2 .
Worked Solutions 223

Therefore, the complete solution is



X   hp i
−ht (2n − 1)πx
u(x, t) = e sin An cos t λn c2 − h2
n=1
2L
hp i
+ Bn sin t λn c2 − h2 .

At t = 0,

X  
(2n − 1)πx
u(x, 0) = An sin = x.
n=1
2L

This is an eigenfunction expansion in Xn (x) and the coefficient An equals


RL h i
(2n−1)πx
0
x sin 2L dx
An = R L h i
0
sin2 (2n−1)πx
2L dx
h i L h i L
4L2 (2n−1)πx 2Lx (2n−1)πx
2
(2n−1) π 2 sin 2L − (2n−1)π cos 2L 8L(−1)n+1
0 0
= = .
L/2 (2n − 1)2 π 2

On the other hand,



X  
−ht (2n − 1)πx
ut (x, t) = e sin
n=1
2L
 p  hp i
× Bn λn c − h − hAn cos t λn c2 − h2
2 2

 p  hp i
2 2 2
+ −An λn c − h − hBn sin t λn c − h 2

and   

X p
(2n − 1)πx
ut (x, 0) = sin Bn λn c2 − h2 − hAn .
n=1
2L

Consequently, p
Bn = hAn λ n c 2 − h2 .

The final answer is


∞   hp i
8L −ht X (−1)n+1 (2n − 1)πx 2 − h2
u(x, t) = 2 e sin cos t λ n c
π n=1
(2n − 1)2 2L
hp 
i p 
+ h sin t λn c2 − h2 λ n c 2 − h2 .
224 Advanced Engineering Mathematics with MATLAB

11. From separation of variables, X ′′ /X = T ′′ /(c2 T ) = −λ. This leads to


the differential equation: X ′′ + λX = 0 with X ′ (0) = X ′′ (L) = 0. The
boundary conditions come from ux (0, t) = X ′ (0)T (t) = 0 or X ′ (0) = 0.
Similarly, uxx (L, t) = X ′′ (L)T (t) = 0 or X ′′ (L) = 0. Solving the Sturm-
Liouville problem, λn = (2n − 1)2 π 2 /(4L2 ), Xn (x) = cos [(2n − 1)πx/(2L)] .
The temporal equation is

(2n − 1)2 c2 π 2
Tn′′ + Tn = 0.
4L2
The corresponding solution is
   
(2n − 1)πct (2n − 1)πct
Tn (t) = An cos + Bn sin .
2L 2L

Because Tn (0) = 0, An = 0. The product solution is


   
(2n − 1)πx (2n − 1)πct
un (x, t) = Bn cos sin .
2L 2L
Therefore, the complete solution is
X∞    
(2n − 1)πx (2n − 1)πct
u(x, t) = Bn cos sin .
n=1
2L 2L

At t = 0,
X∞  
(2n − 1)πc (2n − 1)πx
ut (x, 0) = Bn cos = −c2 s0 .
n=1
2L 2L

This is an eigenfunction expansion in Xn (x) and the coefficient Bn equals


RL h i
(2n − 1)πc 0
(−c2 s0 ) cos (2n−1)πx
2L dx
Bn = RL h i
2L cos2 (2n−1)πx dx
0 2L
h i L
2L (2n−1)πx
−c2 s0 (2n−1)π sin 2L
0
= h i L
,
L L (2n−1)πx
2 + 2(2n−1)π sin L
0

and
8Lcs0
Bn = (−1)n .
(2n − 1)2 π 2
Thus, the final solution is
∞    
8Lcs0 X (−1)n (2n − 1)πx (2n − 1)πct
u(x, t) = cos sin .
π 2 n=1 (2n − 1)2 2L 2L
Worked Solutions 225

12. From separation of variables, X ′′ /X = T ′′ /(c2 T ) = −λ. This leads to the


differential equation: X ′′ + λX = 0 with X(0) = X(L) = 0. The boundary
conditions come from u(0, t) = X(0)T (t) = 0 or X(0) = 0. Similarly, u(L, t) =
X(L)T (t) = 0 or X(L) = 0. Solving the Sturm-Liouville problem,

n2 π 2  nπx 
λn = , Xn (x) = sin .
L2 L
The temporal equation is Tn′′ + n2 c2 π 2 Tn /L2 = 0. The corresponding solution
is    
nπct nπct
Tn (t) = An cos + Bn sin .
L L

Part (a) Because Tn′ (0) = 0, Bn = 0. The product solution is


 nπx   
nπct
un (x, t) = An sin cos .
L L
Therefore, the complete solution is

X  nπx   
nπct
u(x, t) = An sin cos .
n=1
L L

At t = 0,

X  nπx 
u(x, 0) = An sin = f (x).
n=1
L
This is an eigenfunction expansion in Xn (x) and the coefficient An equals
Z  nπx  Z  nπx 
2 a βx 2 L β(L − x)
An = sin dx + sin dx
L 0 a L L a L−a L
   nπx  a
2βL nπx  nπx
= sin − cos
an2 π 2 L L L 0

2βL  nπx  L
− cos
(L − a)nπ L a
   nπx  L
2βL nπx  nπx
− sin − cos
(L − a)n2 π 2 L L L a
2βL 2  nπa 
= sin .
a(L − a)n2 π 2 L
Substitution of An in the general solution yields the desired result.

Part (b) Because Tn (0) = 0, An = 0. The product solution is


 nπx   
nπct
un (x, t) = Bn sin sin .
L L
226 Advanced Engineering Mathematics with MATLAB

Therefore, the complete solution is



X  nπx   
nπct
u(x, t) = Bn sin sin .
n=1
L L

At t = 0,
X∞
nπc  nπx 
ut (x, 0) = Bn sin = f (x).
n=1
L L

This is an eigenfunction expansion in Xn (x) and the coefficient Bn equals


Z a+ǫ  nπx   nπx  a+ǫ
nπc 2 2µ
Bn = µ sin dx = − cos ,
L L a−ǫ L nπ L a−ǫ

and   nπa nπǫ   nπa nπǫ 


2µL
Bn = − 2 2 cos + − cos −
n π c L L L L
4µL  nπa   nπǫ 
= 2 2 sin sin .
n π c L L
Substitution of Bn in the general solution yields the desired result.

Part (c) Because Tn (0) = 0, An = 0. The product solution is


 nπx   
nπct
un (x, t) = Bn sin sin .
L L

Therefore, the complete solution is



X  nπx   
nπct
u(x, t) = Bn sin sin .
n=1
L L

At t = 0,
X∞
nπc  nπx  4βc(L − x)
ut (x, 0) = Bn sin = .
n=1
L L L2

This is an eigenfunction expansion in Xn (x) and the coefficient Bn equals


 Z L  nπx 
nπc 2 4βc
Bn = (L − x) sin dx
L L L2 0 L
  nπx   nπx  Lx  nπx  L
8β L2 L2
= − cos − sin + cos
nπL2 nπ L n2 π 2 L nπ L 0

or

Bn = .
n2 π 2
Worked Solutions 227

Substitution of Bn in the general solution yields the desired result.

Section 7.4

1.
u(x, t) = sin(x + ct) cos(x + ct) + sin(x − ct) cos(x − ct)
Z x+ct
1
+ cos(τ ) dτ
2c x−ct
1
= sin(2x) cos(2ct) + [sin(x + ct) − sin(x − ct)]
2c
1
= sin(2x) cos(2ct) + cos(x) sin(ct)
c

2.
Z x+ct
1 1
u(x, t) = 2 [(x + ct) sin(x + ct) + (x − ct) sin(x − ct)] + cos(2τ ) dτ
2c x−ct
= 21 [(x + ct)[sin(x) cos(ct) + cos(x) sin(ct)]
+ 21 [(x − ct)[sin(x) cos(ct) − cos(x) sin(ct)]
1
+ 4c [sin(2x + 2ct) − sin(2x − 2ct)]
1
= x sin(x) cos(ct) + ct cos(x) sin(ct) + cos(2x) sin(2ct)
2c

3.
  Z x+ct
1 1 1 1
u(x, t) = + + eτ dτ
2 1 + (x + ct)2 1 + (x − ct)2 2c x−ct
 
1 1 1
= +
2 1 + x2 + 2xct + c2 t2 1 + x2 − 2xct + c2 t2
1  x+ct 
+ e − ex−ct
2c
1 + x 2 + c 2 t2 ex
= + sinh(ct)
(1 + x2 + c2 t2 )2 + 4x2 c2 t2 c

4.
Z x+ct
1 h −(x+ct) i 1 dτ
u(x, t) = e + e−(x−ct) +
2 2c x−ct τ 2 + 1
1  −1 
= e−x cosh(ct) + tan (x + ct) − tan−1 (x − ct)
2c
228 Advanced Engineering Mathematics with MATLAB

5.
     Z x+ct
1 π(x + ct) π(x − ct) 1
u(x, t) = cos + cos + sinh(aτ ) dτ
2 2 2 2c x−ct
  πx     πx   
1 πct πct
= cos cos − sin sin
2 2 2 2 2
 πx     πx   
πct πct
+ cos cos + sin sin
2 2 2 2
1
+ {cosh[a(x + ct)] − cosh[a(x − ct)]}
2ac  
 πx  πct 1
= cos cos + sinh(ax) sinh(act)
2 2 ac

6.
Z x+ct
1 1
u(x, t) = [sin(3x + 3ct) + sin(3x − 3ct)] +
2 [sin(2τ ) − sin(τ )] dτ
2c x−ct

u(x, t) = 12 sin(3x) cos(3ct) + cos(3x) sin(3ct)

+ sin(3x) cos(3ct) − cos(3x) sin(3ct)
− [cos(2x + 2ct) − cos(2x − 2ct)]/(4c)
+ [cos(x + ct) − cos(x − ct)]/(2c)
1 1
= sin(3x) cos(3ct) + sin(2x) sin(2ct) − cos(x) sin(ct)
2c c

7.
∂u ∂u
= EcF ′ (x + ct) + EcG′ (x − ct) − 14 kc2 t = E
∂t ∂t
and
∂u
= EF ′ (x + ct) − EG′ (x − ct) + 34 kx
∂t
= EF ′ (x + ct) − EG′ (x − ct) + kx − 41 kx
kρc2
= ρc2 F ′ (x + ct) − ρc2 G′ (x − ct) + kx − x + kx
4E
∂v
=ρ + kx.
∂t

8. From Equation 7.4.17 we have that


Z     x+ct
Vmax x+ct ξ Vmax ξ2
u(x, t) = 1− dξ = ξ−
2c x−ct L 2c 2L x−ct
 2

Vmax (x + ct) (x − ct)2
= x + ct − − (x − ct) +
2c 2L 2L
1
= 2 [V0 (x + ct) − V0 (x − ct)] ,
Worked Solutions 229

where  
Vmax χ2 Vmax χ  χ
V0 (χ) = χ− = 1− .
c 2L c 2L
At x = 0, u(0, t) = 12 [V0 (ct) − V0 (−ct)] = 0. Therefore, V0 (χ) = V0 (−χ).
At x = L, u(L, t) = 21 [V0 (L + ct) − V0 (L − ct)] = 0. Therefore, V0 (L + χ) =
V0 (L − χ).
Consider the time t = t′ + 2nL/c, where 0 < t′ < 2L/c and 0 < n. Then,

u(x, t) = 1
2 [V0 (x + ct′ + 2nL) − V0 (x − ct′ − 2nL)] .

Using V0 (L + χ) = V0 (L − χ),

V0 (x + ct′ + 2nL) = V0 [x + ct′ + 2(n − 1)L] = · · · = V0 (x + ct′ ).

Similarly,

V0 (x − ct′ − 2nL) = V0 [x − ct′ − 2(n − 1)L] = · · · = V0 (x − ct′ ).

Therefore, we can relate any solution u(x, t) for 0 < x < L and at time t back
to the solution u(x, t′ ).
Because
u(x, t + L/c) = 21 [V0 (x + ct + L) − V0 (x − ct − L)]
= − 12 [V0 (L − x + ct) − V0 (L − x − ct)]
= −u(L − x, t)

for 0 < x < L, the solution at (x, t + L/c) when 0 < ct < L is the mirror
reflection of the solution at (L − x, t).
Consider 0 < x < ct. Then, for 0 < x + ct < L,
   
Vmax (x + ct)2 (x − ct)2 Vmax x ct
u(x, t) = x + ct − + x − ct + = 1− .
2c 2L 2L c L

For fixed time, the maximum occurs for largest value of x or x = ct. For
L < x + ct < 2L,
 
Vmax (2L − x − ct)2 (x − ct)2
u(x, t) = 2L − x − ct − + x − ct +
2c 2L 2L
 
Vmax x ct
= 1− .
c L

For the same reason x = ct.


Turning to the case ct < x < L. Then, for 0 < x + ct < L,
 
Vmax (x + ct)2 (x − ct)2 Vmax t  x
u(x, t) = x + ct − − (x − ct) + = 1− .
2c 2L 2L c L
230 Advanced Engineering Mathematics with MATLAB

Maximum occurs at t = x/c. For L < x + ct < 2L,


 
Vmax (2L − x − ct)2 (x − ct)2
u(x, t) = 2L − x − ct − − (x − ct) +
2c 2L 2L
Vmax t  x
= 1− .
c L

For the same reason x = ct.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Lax-Wendroff Portion
% of the Wave Equation Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear
coeff = 2/3; coeffsq = coeff * coeff; % coeff = ∆t/∆x
ncount = 1; dx = 0.02; dt = coeff * dx; nselect = 1/dt;
N = 1481; x = 0:dx:1+dx; xx = 0:dx:1;
M = 1/dx + 2; % M = number of spatial grid points

% introduce the initial condition F and G

F = zeros(M,1);
for m = 1:M
if x(m) >= 0.25 & x(m) <= 0.5
F(m) = 4 * x(m) - 1; end
if x(m) >= 0.5 & x(m) <= 0.75
F(m) = 3 - 4 * x(m); end; end
% at t = 0, the solution is:
u = zeros(M,N+1); u(1:M,1) = F(1:M);
tplot(1) = 0; solution(1:M-1,1) = u(1:M-1,1);

% integrate forward using Lax-Wendroff method

for n = 1:N
t = dt * n;
for m = 2:M-1
u(m,n+1) = u(m,n) - 0.5 * coeff * (u(m+1,n) - u(m-1,n)) ...
+ 0.5 * coeffsq * (u(m+1,n) - 2 * u(m,n) + u(m-1,n));
end

% update end points using periodicity


Worked Solutions 231

u(1,n+1) = u(M-1,n+1); u(M,n+1) = u(2,n+1);

% save output at select times

if n > 1 & mod(n-1,nselect) == 0


ncount = ncount + 1; tplot(ncount) = t;
for m = 1:M-1; solution(m,ncount) = u(m,n); end
end
end

% plot results

X = xx’ * ones(1,length(tplot)); T = ones(M-1,1) * tplot;


surf(X,T,solution)
xlabel(’DISTANCE’,’Fontsize’,20); ylabel(’TIME’,’Fontsize’,20)
zlabel(’SOLUTION’,’Fontsize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Leapfrog Portion
% of the Wave Equation Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear
coeff = 2/3; coeffsq = coeff * coeff; % coeff = ∆t/∆x
ncount = 1; dx = 0.02; dt = coeff * dx; nselect = 1/dt;
N = 1481; x = 0:dx:1+dx; xx = 0:dx:1;
M = 1/dx + 2; % M = number of spatial grid points

% introduce the initial condition F and G

F = zeros(M,1);
for m = 1:M
if x(m) >= 0.25 & x(m) <= 0.5
F(m) = 4 * x(m) - 1; end
if x(m) >= 0.5 & x(m) <= 0.75
F(m) = 3 - 4 * x(m); end; end
% at t = 0, the solution is:
u = zeros(M,N+1); u(1:M,1) = F(1:M);
tplot(1) = 0; solution(1:M-1,1) = u(1:M-1,1);

% take the second time step using a forward time step

for m = 2:M-1
232 Advanced Engineering Mathematics with MATLAB

u(m,2) = u(m,1) - 0.5 * coeff * (u(m+1,1) - u(m-1,1));


end

% update end points using periodicity

u(1,2) = u(M-1,2); u(M,2) = u(2,2);

% integrate remaining time steps using centered-in-time,


% centered-in-space

for n = 2:N
t = dt * n;
for m = 2:M-1
u(m,n+1) = u(m,n-1) - coeff * (u(m+1,n) - u(m-1,n));
end

% update end points using periodicity

u(1,n+1) = u(M-1,n+1); u(M,n+1) = u(2,n+1);

% save output at select times

if n > 1 & mod(n-1,nselect) == 0


ncount = ncount + 1; tplot(ncount) = t;
for m = 1:M-1; solution(m,ncount) = u(m,n); end
end
end

% plot the results

X = xx’ * ones(1,length(tplot)); T = ones(M-1,1) * tplot;


surf(X,T,solution)
xlabel(’DISTANCE’,’Fontsize’,20); ylabel(’TIME’,’Fontsize’,20)
zlabel(’U(X,T)’,’Fontsize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 8.3

1. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X(0) = X(π) = 0 because
u(0, t) = X(0)T (t) = 0 or X(0) = 0 and u(π, t) = X(π)T (t) = 0 or X(π) = 0.
The solution of the Sturm-Liouville problem is Xn (x) = sin(nx). The time
Worked Solutions 233
2 2
equation is Tn′ + n2 a2 Tn = 0 or Tn (t) = Bn e−a n t . Thus, the general solution
is

X 2 2
u(x, t) = Bn sin(nx)e−a n t .
n=1

At t = 0,

X
u(x, 0) = Bn sin(nx) = A.
n=1

This is a half-range Fourier sine expansion and


Z
2 π 2A π 2A
Bn = A sin(nx) dx = − cos(nx)|0 = [1 − (−1)n ].
π 0 nπ nπ

Thus, the final solution is



2A X [1 − (−1)n ] 2 2
u(x, t) = sin(nx)e−a n t
π n=1 n

4A X sin[(2m − 1)x] −a2 (2m−1)2 t
= e .
π m=1 2m − 1

2. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0, X(0) = X(π) = 0 because
u(0, t) = X(0)T (t) = 0 or X(0) = 0 and u(π, t) = X(π)T (t) = 0 or X(π) = 0.
The solution of the Sturm-Liouville problem is Xn (x) = sin(nx). The time
2 2
equation is Tn′ + n2 a2 Tn = 0 or Tn (t) = Bn e−a n t . Thus, the general solution
is

X 2 2
u(x, t) = Bn sin(nx)e−a n t .
n=1

At t = 0,

u(x, 0) = B1 sin(x) + B2 sin(2x) + B3 sin(3x) + B4 sin(4x) + · · · .

By inspection, B1 = 3/4, B2 = 0, B3 = −1/4 and Bn = 0, where n ≥ 4.


Thus, the final answer is
2 2
3 1
u(x, t) = 4 sin(x)e−a t − 4 sin(3x)e−9a t .

3. From problem 1, the general solution is



X 2
n2 t
u(x, t) = Bn sin(nx)e−a .
n=1
234 Advanced Engineering Mathematics with MATLAB

At t = 0,

X
u(x, 0) = Bn sin(nx) = x.
n=1

This is a half-range Fourier sine expansion and


Z   π
2 π 2 sin(nx) x cos(nx) 2(−1)n
Bn = x sin(nx) dx = − =− .
π 0 π n2 n 0 n

Thus, the final solution is

X∞
(−1)n 2 2
u(x, t) = −2 sin(nx)e−a n t .
n=1
n

4. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0, X(0) = X(π) = 0 because
u(0, t) = X(0)T (t) = 0 or X(0) = 0 and u(π, t) = X(π)T (t) = 0 or X(π) = 0.
The solution of the Sturm-Liouville problem is Xn (x) = sin(nx). The time
2 2
equation is Tn′ + n2 a2 Tn = 0 or Tn (t) = Bn e−a n t . Thus, the general solution
is

X 2 2
u(x, t) = Bn sin(nx)e−a n t .
n=1

At t = 0,

X
u(x, 0) = Bn sin(nx) = π − x.
n=1

This is a half-range Fourier sine expansion and


Z
2 π
Bn = (π − x) sin(nx) dx
π 0
π   π
2 cos(nx) 2 sin(nx) x cos(nx) 2
=− − − = .
n 0 π n2 n 0 n

Thus, the final solution is

X∞
sin(nx) −a2 n2 t
u(x, t) = 2 e .
n=1
n

5. From problem 1, the general solution is



X 2
n2 t
u(x, t) = Bn sin(nx)e−a .
n=1
Worked Solutions 235

At t = 0,

X
u(x, 0) = Bn sin(nx) = f (x).
n=1

This is a half-range Fourier sine expansion and


Z π/2 Z
2 2 π
Bn = x sin(nx) dx + (π − x) sin(nx) dx
π 0 π π/2
  π/2 π
2 sin(nx) x cos(nx) 2
= 2
− − cos(nx)
π n n 0 n π/2
 π  nπ 
2 sin(nx) x cos(nx) 4
− − = 2 sin .
π n2 n π/2 n π 2

Thus, the final solution is



4X 1  nπ  2 2
u(x, t) = sin sin(nx)e−a n t
π n=1 n2 2

4 X (−1)m+1 2 2
= 2
sin[(2m − 1)x]e−a (2m−1) t .
π m=1 (2m − 1)

6. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0, X ′ (0) = X ′ (π) = 0 because
ux (0, t) = X ′ (0)T (t) = 0 or X ′ (0) = 0 and ux (π, t) = X ′ (π)T (t) = 0 or
X ′ (π) = 0. The solution of the Sturm-Liouville problem is X0 (x) = 1 and
Xn (x) = cos(nx). The time equation is T0′ = 0 and Tn′ + n2 a2 Tn = 0 or
2 2
T0 (t) = 12 A0 and Tn (t) = An e−a n t . Thus, the general solution is

X 2
n2 t
u(x, t) = 1
2 A0 + An cos(nx)e−a .
n=1

At t = 0,

X
u(x, 0) = 12 A0 + An cos(nx) = 1
n=1

so that
Z π Z π π
2 2 2 sin(nx)
A0 = 1 dx = 2, An = 1 cos(nx) dx = = 0.
π 0 π 0 nπ 0

Thus, the final solution is u(x, t) = 1.

7. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X ′ (0) = X ′ (π) = 0 because
236 Advanced Engineering Mathematics with MATLAB

ux (0, t) = X ′ (0)T (t) = 0 or X ′ (0) = 0 and ux (π, t) = X ′ (π)T (t) = 0 or


X ′ (π) = 0. The solution of the Sturm-Liouville problem is X0 (x) = 1 and
Xn (x) = cos(nx). The time equation is T0′ = 0, Tn′ + n2 a2 Tn = 0 or T0 (t) =
1 −a2 n2 t
2 A0 and Tn (t) = An e . Thus, the general solution is

X 2
n2 t
u(x, t) = 21 A0 + An cos(nx)e−a .
n=1

At t = 0,

X Z π
1 2
u(x, 0) = 2 A0 + An cos(nx) = x so that A0 = x dx = π
n=1
π 0

and
Z π   π
2 2 cos(nx) x sin(nx) 2 [(−1)n − 1]
An = x cos(nx) dx = + = .
π 0 π n2 n 0 π n2

Thus, the final solution is



π 4 X cos[(2m − 1)x] −a2 (2m−1)2 t
u(x, t) = − e .
2 π m=1 (2m − 1)2

8. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X ′ (0) = X ′ (π) = 0 because
ux (0, t) = X ′ (0)T (t) = 0 or X ′ (0) = 0 and ux (π, t) = X ′ (π)T (t) = 0 or
X ′ (π) = 0. The solution of the Sturm-Liouville problem is X0 (x) = 1 and
Xn (x) = cos(nx). The time equation is T0′ = 0 and Tn′ + n2 a2 Tn = 0 or
2 2
T0 (t) = 12 A0 and Tn (t) = An e−a n t . Thus, the general solution is

X 2
n2 t
u(x, t) = 12 A0 + An cos(nx)e−a .
n=1

At t = 0,

u(x, 0) = 12 A0 + A1 cos(x) + A2 cos(2x) + A3 cos(3x) + · · · .

By inspection, A0 = 1, A1 = 0, A2 = 1/2 and An = 0 for n ≥ 3. Thus, the


final solution is
2
u(x, t) = 21 + 21 cos(2x)e−4a t .

9. From problem 7, the general solution is



X 2
n2 t
u(x, t) = 12 A0 + An cos(nx)e−a .
n=1
Worked Solutions 237

At t = 0,

X
u(x, 0) = 12 A0 + An cos(nx) = π − x.
n=1

This is a half-range Fourier cosine expansion with


Z π π
2 x2
A0 = (π − x) dx = 2x − = π,
π 0 π 0

and Z π
2
An = (π − x) cos(nx) dx,
π 0
or
Z π   π
2 π 2 2 cos(nx) x sin(nx)
An = (π − x) cos(nx) dx = sin(nx) + +
π 0 n 0 π n2 n 0
2[(−1)n − 1]
= .
n2 π

Thus, the final solution is



π 4 X cos[(2m − 1)x] −a2 (2m−1)2 t
u(x, t) = − e .
2 π m=1 (2m − 1)2

10. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X ′ (0) = X ′ (π) = 0 because
ux (0, t) = X ′ (0)T (t) = 0 or X ′ (0) = 0 and ux (π, t) = X ′ (π)T (t) = 0 or
X ′ (π) = 0. The solution of the Sturm-Liouville problem is X0 (x) = 1 and
Xn (x) = cos(nx). The time equation is T0′ = 0 and Tn′ + n2 a2 Tn = 0 or
2 2
T0 (t) = 12 A0 and Tn (t) = An e−a n t . Thus, the general solution is


X 2
n2 t
u(x, t) = 12 A0 + An cos(nx)e−a .
n=1

At t = 0,

X
u(x, 0) = 12 A0 + An cos(nx) = f (x).
n=1

This is a half-range Fourier cosine expansion and


Z π/2 Z π
2 2
A0 = T0 dx + T1 dx = T0 + T1 ,
π 0 π π/2
238 Advanced Engineering Mathematics with MATLAB

Z π/2 Z π
2 2
An = T0 cos(nx) dx + T1 cos(nx) dx
π 0 π π/2

2T0
π/2
2T1
π
2(T0 − T1 )  nπ 
= sin(nt) + sin(nt) = sin .
nπ 0 nπ π/2 nπ 2

Thus, the final solution is



T0 + T1 2(T0 − T1 ) X (−1)m 2 2
u(x, t) = − cos[(2m − 1)x]e−a (2m−1) t .
2 π m=1
2m − 1

11. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X ′ (0) = X(π) = 0 because
ux (0, t) = X ′ (0)T (t) = 0 or X ′ (0) = 0 and u(π, t) = X(π)T (t) = 0 or X(π) =
0. The solution of the Sturm-Liouville problem is Xn (x) = cos[(2n − 1)x/2].
The time equation is

(2n − 1)2 a2 2
(2n−1)2 t/4
Tn′ + Tn = 0 or Tn (t) = An e−a .
4

Thus, the general solution is



X  
(2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = An cos e .
n=1
2

At t = 0,

X  
(2n − 1)x
u(x, 0) = An cos = x2 − π 2 .
n=1
2

This is a generalized Fourier expansion with



0
(x2 − π 2 ) cos[(2n − 1)x/2] dx
An = Rπ
cos2 [(2n − 1)x/2] dx
 0     π
2 8x (2n − 1)x (2n − 1)2 x2 /4 − 2 (2n − 1)x
= cos + sin
π (2n − 1)2 2 (2n − 1)3 /8 2 0
 π n
4π (2n − 1)x 32(−1)
− sin = .
2n − 1 2 0 (2n − 1)3 π

Thus, the final solution is


∞  
32 X (−1)n (2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = cos e .
π n=1 (2n − 1)3 2
Worked Solutions 239

12. Let us define u(x, t) = T0 +v(x, t). Then the problem to be solved becomes

∂v ∂2v
= a2 2 , 0 < x < π, t < 0,
∂t ∂x
with the boundary conditions v(0, t) = v(π, t) = 0, t < 0 and the initial
condition v(x, 0) = T1 − T0 for 0 < x < π. We can now use separation of
variables and find that

X 2
n2 t
v(x, t) = Bn sin(nx)e−a .
n=1

Using the initial condition,



X
v(x, 0) = Bn sin(nx) = T1 − T0 .
n=1

This is a half-range Fourier sine expansion and


Z π
2 π 2(T1 − T0 )
Bn = (T1 − T0 ) sin(nx) dx = − cos(nx)
π 0 nπ 0
2(T1 − T0 )[1 − (−1)n ]
= .

Thus, the final solution is

4(T1 − T0 ) X sin[(2m − 1)x] −a2 (2m−1)2 t
u(x, t) = T0 + e .
π m=1
2m − 1

13. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X(0) = X ′ (π) = 0 because
u(0, t) = X(0)T (t) = 0 or X(0) = 0 and ux (π, t) = X ′ (π)T (t) = 0 or X ′ (π) =
0. The solution of the Sturm-Liouville problem is Xn (x) = sin[(2n − 1)x/2].
The time equation is

(2n − 1)2 a2 2
(2n−1)2 t/4
Tn′ + Tn = 0 or Tn (t) = An e−a .
4
Thus, the general solution is

X  
(2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = An sin e .
n=1
2

At t = 0,

X 
(2n − 1)x
u(x, 0) = An sin = 1.
n=1
2
240 Advanced Engineering Mathematics with MATLAB

This is a generalized Fourier expansion with


Rπ   π
sin[(2n − 1)x/2] dx 4 (2n − 1)x 4
An = R π0 =− cos = .
0
sin2 [(2n − 1)x/2] dx (2n − 1)π 2 0 (2n − 1)π

Thus, the final solution is



4 X sin[(2n − 1)x/2] −a2 (2n−1)2 t/4
u(x, t) = e .
π n=1 2n − 1

14. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X(0) = X ′ (π) = 0 because
ux (0, t) = X(0)T (t) = 0 or X(0) = 0 and ux (π, t) = X ′ (π)T (t) = 0 or X ′ (π) =
0. The solution of the Sturm-Liouville problem is Xn (x) = sin[(2n − 1)x/2].
2 2
The time equation is Tn′ + (2n − 1)2 a2 Tn /4 = 0 or Tn (t) = An e−a (2n−1) t/4 .
Thus, the general solution is

X  
(2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = An sin e .
n=1
2

At t = 0,

X  
(2n − 1)x
u(x, 0) = An sin = x.
n=1
2

This is a generalized Fourier expansion with



x sin[(2n − 1)x/2] dx
An = R0π
sin2 [(2n − 1)x/2] dx
0
     π
2 4 (2n − 1)x 2x (2n − 1)x
= sin − cos
π (2n − 1)2 2 2n − 1 2 0
8(−1)n+1
= .
(2n − 1)2 π

Thus, the final solution is


∞  
8 X (−1)n+1 (2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = sin e .
π n=1 (2n − 1)2 2

15. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X(0) = X ′ (π) = 0 because
u(0, t) = X(0)T (t) = 0 or X(0) = 0 and ux (π, t) = X ′ (π)T (t) = 0 or X ′ (π) =
Worked Solutions 241

0. The solution of the Sturm-Liouville problem is Xn (x) = sin[(2n − 1)x/2].


The time equation is

(2n − 1)2 a2 2
(2n−1)2 t/4
Tn′ + Tn = 0 or Tn (t) = An e−a .
4
Thus, the general solution is

X  
(2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = An sin e .
n=1
2

At t = 0,

X  
(2n − 1)x
u(x, 0) = An sin = π − x.
n=1
2
This is a generalized Fourier expansion with
Rπ  π
(π − x) sin[(2n − 1)x/2] dx 4 (2n − 1)x
An = 0 R π 2 =− cos
sin [(2n − 1)x/2] dx 2n − 1 2 0
 0     π
2 4 (2n − 1)x 2x (2n − 1)x
− sin − cos
π (2n − 1)2 2 2n − 1 2 0
4 8(−1)n+1
= − .
2n − 1 (2n − 1)2 π

Thus, the final solution is


∞ 
X   
4 8(−1)n+1 (2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = − sin e .
n=1
2n − 1 (2n − 1)2 π 2

16. Let us define u(x, t) = T0 +v(x, t). Then the problem to be solved becomes

∂v ∂2v
= a2 2 , 0 < x < π, t < 0,
∂t ∂x
with the boundary conditions v(0, t) = vx (π, t) = 0, t < 0 and the initial
condition v(x, 0) = T1 − T0 for 0 < x < π. We can now use separation of
variables and find that
X∞    
(2n − 1)x (2n − 1)2 a2 t
v(x, t) = Bn sin exp − .
n=1
2 4

Using the initial condition,



X 
(2n − 1)x
v(x, 0) = Bn sin = T1 − T0 .
n=1
2
242 Advanced Engineering Mathematics with MATLAB

This is a generalized Fourier expansion and



(T1 − T0 ) sin[(2n − 1)x/2] dx
Bn = 0 R π 2
0
sin [(2n − 1)x/2] dx
 π
4(T1 − T0 ) (2n − 1)x 4(T1 − T0 )
=− cos = .
(2n − 1)π 2 0 (2n − 1)π

Thus, the final solution is



4(T1 − T0 ) X sin[(2n − 1)x/2] −a2 (2n−1)2 t/4
u(x, t) = T0 + e .
π n=1
2n − 1

17. We first find the steady-state solution. We find it by solving w′′ = 0 with
w(0) = 0 and w(π) = T0 . The steady-state solution is w(x) = T0 x/π. To find
the transient solution, u(x, t) = T0 x/π + v(x, t). Then we must solve

∂v ∂2v
= a2 2 , 0 < x < π, t > 0,
∂t ∂x
with the boundary conditions v(0, t) = v(π, t) = 0, t > 0 and the initial
condition v(x, 0) = T0 − T0 x/π for 0 < x < π. We can now use separation of
variables and find that

X 2
n2 t
v(x, t) = Bn sin(nx)e−a .
n=1

Using the initial condition,



X
v(x, 0) = Bn sin(nx) = T0 − T0 x/π.
n=1

This is a half-range Fourier sine expansion and


Z
2 π
Bn = (T0 − T0 x/π) sin(nx) dx
π 0
π   π
2T0 2T0 sin(nx) x cos(nx)
=− cos(nx) − 2 −
nπ 0 π n2 n 0
n
2T0 [1 − (−1) ] 2T0
= + (−1)n .
nπ nπ
Thus, the final solution is

T0 x 2T0 X 1 2 2
u(x, t) = + sin(nx)e−a n t .
π π n=1 n
Worked Solutions 243

18. We first find the steady-state solution. We find it by solving w′′ = 0


with w′ (0) = −H/κ and w(L) = T0 . The steady-state solution is w(x) =
T0 + HL (1 − x/L) /κ. To find the transient solution, u(x, t) = w(x) + v(x, t).
Then we must solve
∂v ∂2v
= a2 2 , 0 < x < L, t < 0,
∂t ∂x
with the boundary conditions vx (0, t) = v(L, t) = 0, t < 0 and the initial
condition v(x, 0) = H(x − L)/κ for 0 < x < L. We can now use separation of
variables and find that
X∞    2 
(2n − 1)πx a (2n − 1)2 π 2 t
v(x, t) = Bn cos exp − .
n=1
2L 4L2

Using the initial condition,



X  
(2n − 1)πx H(x − L)
v(x, 0) = Bn cos = .
n=1
2L κ

This is a generalized Fourier expansion with


RL
[H(x − L)/κ] cos[(2n − 1)πx/(2L)] dx
An = 0 RL
0
cos2 [(2n − 1)πx/(2L)] dx
  L   L
2H 4L2 (2n − 1)πx 2xL (2n − 1)πx
= cos + sin
Lκ (2n − 1)2 π 2 2L 0 (2n − 1)π 2L 0
2
  L
2L (2n − 1)πx
− sin
(2n − 1)π 2L 0
8HL
=− .
κ(2n − 1)2 π 2

Thus, the final solution is



HL x
u(x, t) = T0 + 1−
κ L
∞    2 
8 X 1 (2n − 1)πx a (2n − 1)2 π 2 t
− 2 cos exp − .
π n=1 (2n − 1)2 2L 4L2

19. We first find the steady-state solution. We find it by solving w′′ = 0 with
w(0) = h1 and w(L) = h2 . The steady-state solution is w(x) = h1 + (h2 −
h1 )x/L. To find the transient solution, u(x, t) = w(x)+v(x, t). Then we must
solve
∂v ∂2v
= a2 2 , 0 < x < L, t > 0,
∂t ∂x
244 Advanced Engineering Mathematics with MATLAB

with the boundary conditions v(0, t) = v(L, t) = 0, t > 0 and the initial
condition v(x, 0) = −(h2 − h1 )x/L for 0 < x < L. We can now use separation
of variables and find that
X∞  nπx   2 2 2 
a n π t
v(x, t) = Bn sin exp − .
n=1
L L2

Using the initial condition,



X  nπx  (h2 − h1 )x
v(x, 0) = Bn sin =− .
n=1
L L

This is a half-range sine expansion


Z  nπx 
2(h2 − h1 ) L
Bn = − x sin dx
L2 0 L
  nπx  Lx  nπx  L
2(h2 − h1 ) L2 2(h2 − h1 )
=− sin − cos = (−1)n .
L2 n2 π 2 L nπ L 0 nπ
Thus, the final solution is
(h2 − h1 )x
u(x, t) = h1 +
L
∞  nπx   2 2 2 
2(h2 − h1 ) X (−1)n a n π t
+ sin exp − .
π n=1
n L L2

20. Separating the variables yields X ′′ /X = T ′ /(a2 T ) = −λ. This leads to


the Sturm-Liouville problem X ′′ + λX = 0 with X(0) = X(L) = 0 because
u(0, t) = X(0)T (t) = 0 or X(0) = 0 and u(L, t) = X(L)T (t) = 0 or X(L) = 0.
The solution of the Sturm-Liouville problem is Xn (x) = sin(nπx/L). The
2 2 2 2
time equation is Tn′ + n2 π 2 a2 Tn /L2 = 0 or Tn (t) = Bn e−a n π t/L . Thus,
the general solution is
X∞  nπx   2 2 2 
n π a
u(x, t) = Bn sin exp − t .
n=1
L L2

At t = 0,

X  nπx  8H 
u(x, 0) = Bn sin = L3 x − 3L2 x2 + 4Lx3 − 2x4 .
n=1
L L4

This is a half-range Fourier sine expansion and


Z
16H L 3   nπx 
Bn = 5 L x − 3L2 x2 + 4Lx3 − 2x4 sin dx
L 0 L
 
96H 768H
= 3 3
− 5 5 [1 − (−1)n ],
n π n π
Worked Solutions 245

because
  nπx  Lx  nπx  L
16H L2
Bn = sin − cos
L2 n2 π 2 L nπ L 0
      nπx  L
48H 2xL2 nπx Lx2 2L3
− 3 sin − − cos
L n2 π 2 L nπ n3 π 3 L 0
 2 2 4
    3   nπx  L
64H 3L x 6L nπx Lx 6xL3
+ 4 − 4 4 sin − − 3 3 cos
L n2 π 2 n π L nπ n π L 0
 2 3 4
  
32H 4L x 24xL nπx
− 5 2 2
− 4 4 sin
L n π n π L
 4 2 3
  nπx  L
Lx 12x L 24L5
− − 3 3 + 5 5 cos .
nπ n π n π L 0

Thus, the final solution is


∞  
192H X [(2m − 1)2 π 2 − 8] (2m − 1)πx
u(x, t) = sin
π 5 m=1 (2m − 1)5 L
 
(2m − 1)2 π 2 a2
× exp − t .
L2

21. We begin by letting u(x, t) = h0 + v(x, t). Then we must solve

∂v ∂2v
= a2 2 , 0 < x < L, t > 0,
∂t ∂x
with the boundary conditions v(0, t) = vx (L, t) = 0, t > 0 and the initial
condition v(x, 0) = −h0 for 0 < x < L. We can now use separation of
variables and find that
X∞    2 
(2n − 1)πx a (2n − 1)2 π 2 t
v(x, t) = Bn sin exp − .
n=1
2L 4L2

Using the initial condition,



X  
(2n − 1)πx
v(x, 0) = Bn sin = −h0 .
n=1
2L

This is a generalized Fourier series and


RL
−h0 sin [(2n − 1)πx/(2L)] dx
Bn = 0R L
0
sin2 [(2n − 1)πx/(2L)] dx
 L
4h0 (2n − 1)πx 4h0
= cos =− .
(2n − 1)π 2L 0 (2n − 1)π
246 Advanced Engineering Mathematics with MATLAB

Thus, the final solution is


∞    2 
4h0 X 1 (2n − 1)πx a (2n − 1)2 π 2 t
u(x, t) = h0 − sin exp − .
π n=1 2n − 1 2L 4L2

22. We first find the steady-state solution. We find it by solving −a2 w′′ =
e−x with w(0) = 0 and w′ (π) = 0. The steady-state solution is w(x) =
(1 − e−x − e−π x) /a2 . To find the transient solution, u(x, t) = w(x) + v(x, t).
Then we must solve

∂v ∂2v
= a2 2 , 0 < x < π, t < 0,
∂t ∂x

with the boundary conditions v(0, t) = vx (π, t) = 0, t < 0 and the initial
condition v(x, 0) = f (x) + (e−x + e−π x − 1)/a2 for 0 < x < π. We can now
use separation of variables and find that

X  
(2n − 1)x −a2 (2n−1)2 t/4
v(x, t) = Bn sin e .
n=1
2

Using the initial condition,



X  
(2n − 1)x e−x + e−π x − 1
v(x, 0) = Bn sin = f (x) − .
n=1
2 a2

This is a generalized Fourier expansion and



0
[f (x) − (e−x + e−π x − 1)/a2 ] sin[(2n − 1)x/2] dx
Bn = Rπ 2
0
sin [(2n − 1)x/2] dx
Z π
2
= [f (x) − (e−x + e−π x − 1)/a2 ] sin[(2n − 1)x/2] dx.
π 0

Thus, the final solution is


∞  
1 − e−x − e−π x X (2n − 1)x −a2 (2n−1)2 t/4
u(x, t) = + Bn sin e .
a2 n=1
2

23. Let us define u(x, t) = −t + v(x, t). Then the problem to be solved
becomes
∂v ∂2v
= a2 2 , 0 < x < 1, t > 0,
∂t ∂x
Worked Solutions 247

with the boundary conditions vx (0, t) = vx (1, t) = 0, t > 0 and the initial
condition v(x, 0) = 21 (1 − x2 ) for 0 < x < 1. We can now use separation of
variables and find that

A0 X 2 2 2
v(x, t) = + An cos(nπx)e−a n π t .
2 n=1

Using the initial condition,



A0 X
v(x, 0) = + An cos(nπx) = 21 (1 − x2 ).
2 n=1

This is a half-range cosine Fourier expansion and


Z
2 11 1 1
A0 = (1 − x2 ) dx = x|0 − 13 x3 = 2
1 0 2 0 3

and
Z 1
2 1
An = 2 (1 − x2 ) cos(nπx) dx
1 0
1   1
sin(nπx) 2x n2 π 2 x2 − 2 −2(−1)n
= − 2 2
cos(nπx) + sin(nπx) = .
nπ 0 n π n3 π 3 0 n2 π 2

Thus, the final solution is



1 2 X (−1)n 2 2 2
u(x, t) = −t− 2 cos(nπx)e−a n π t .
3 π n=1 n2

24. Let us define u(x, t) = A sin(ωt)/ω + v(x, t). Then the problem to be
solved becomes
∂v ∂2v
= a2 2 , 0 < x < π, 0 < t,
∂t ∂x
with the boundary conditions vx (0, t) = vx (π, t) = 0, t < 0 and the initial
condition v(x, 0) = f (x) for 0 < x < π. We can now use separation of
variables and find that

A0 X 2 2
v(x, t) = + An cos(nx)e−a n t .
2 n=1

Using the initial condition,



A0 X
v(x, 0) = + An cos(nx) = f (x).
2 n=1
248 Advanced Engineering Mathematics with MATLAB

This is a half-range cosine Fourier expansion and


Z π Z π
2 2
A0 = f (x) dx and An = f (x) cos(nx) dx.
π 0 π 0

Thus, the final solution is



A A0 X 2 2
u(x, t) = sin(ωt) + + An cos(nx)e−a n t .
ω 2 n=1

25. We can expand the right side of the partial differential equation in a
half-range sine expansion:

X
f (x) = bn sin(nx), 0 < x < π,
n=1

where Z Z
π/2 π
2 2
bn = x sin(nx) dx + (π − x) sin(nx) dx
π 0 π π/2
π/2 π
2 2 cos(nx)
= [sin(nx) − nx cos(nx)] −
n2 π 0 n π/2

2
π
4  nπ 
− 2 [sin(nx) − nx cos(nx)] = 2 sin .
n π π/2 n π 2

Thus,

4 X (−1)n+1
f (x) = sin[(2n − 1)x].
π n=1 (2n − 1)2

To find the steady-state solution we solve the differential equation



4 X (−1)n+1
−w′′ = sin[(2n − 1)x]
π n=1 (2n − 1)2

with w(0) = w(π) = 0. Integrating twice and applying the boundary condi-
tions,

4 X (−1)n+1
w(x) = sin[(2n − 1)x].
π n=1 (2n − 1)4

To find the transient solution, u(x, t) = w(x) + v(x, t). Then we must solve

∂v ∂2v
= , 0 < x < π, t > 0,
∂t ∂x2
Worked Solutions 249

with the boundary conditions v(0, t) = v(π, t) = 0, t > 0 and the initial
condition v(x, 0) = −w(x) for 0 < x < π. We can now use separation of
variables and find that

X 2
n2 t
v(x, t) = Bn sin(nx)e−a .
n=1

Using the initial condition,



X 2
n2 t
v(x, 0) = Bn sin (nx) e−a = −w(x).
n=1

Because we already have w(x) expressed as a half-range sine expansion Bn =


−4 sin(nπ/2)/(n4 π). Thus, the final solution is

4 X (−1)n+1 h i
−(2n−1)2 t
u(x, t) = sin[(2n − 1)x] 1 − e .
π n=1 (2n − 1)4

26. We first find the steady-state solution. We find it by solving −a2 w′′ = P
with w(0) = 0 and w(L) = 0. The steady-state solution is w(x) = P (Lx −
x2 )/(2a2 ). To find the transient solution, u(x, t) = w(x) + v(x, t). Then we
must solve
∂v ∂2v
= a2 2 , 0 < x < L, 0 < t,
∂t ∂x
with the boundary conditions v(0, t) = v(L, t) = 0, t < 0 and the initial
condition v(x, 0) = −w(x) for 0 < x < L. We can now use separation of
variables and find that

X  nπx  2
n2 π 2 t/L2
v(x, t) = Bn sin e−a .
n=1
L

Using the initial condition,



X  nπx 
v(x, 0) = Bn sin = −w(x).
n=1
L

This is a half-range sine expansion and


Z  nπx 
2 L P (x2 − Lx)
Bn = sin dx
L 0 2a2 L
  nπx   Lx2   nπx  L
P 2xL2 2L3
= 2 sin − − 3 3 cos
a L n2 π 2 L nπ n π L 0
 2      L
P L nπx Lx nπx 2P L [(−1)n − 1]
2
− 2 2 2 sin − cos = .
a n π L nπ L 0 a2 n3 π 3
250 Advanced Engineering Mathematics with MATLAB

Thus, the final solution is



P (Lx − x2 ) 4P L2 X sin[(2m − 1)πx/L] −a2 (2m−1)2 π2 t/L2
u(x, t) = − e .
2a2 a2 π 3 m=1 (2m − 1)3

27. Assuming that u(x, t) = w(x) + v(x, t), the steady-state solution is gov-
erned by a2 w′′ = −A0 /(cρ) with w′ (0) = κw′ (L) + hw(L) = 0. The general
solution to this differential equation is w(x) = Ax + B − A0 x2 /(2κ). Because
w′ (0) = 0, A = 0. The other boundary condition gives B = A0 L2 /(2κ) +
A0 L/h. Thus, the steady-state solution is w(x) = A0 (L2 − x2 )/(2κ) + A0 L/h.
To find the transient solution, we must solve
∂v ∂2v
= a2 2 , 0 < x < L, t > 0,
∂t ∂x
with the boundary conditions vx (0, t) = κvx (L, t)+hv(L, t) = 0, t > 0 and the
initial condition v(x, 0) = −w(x) for 0 < x < L. We can now use separation
of variables and find that
X∞    2 2 
βn x a β t
v(x, t) = An cos exp − 2n ,
n=1
L L
where βn tan(βn ) = hL/κ. Using the initial condition,
X∞  
βn x
v(x, 0) = An cos = −w(x).
n=1
L
This is a generalized Fourier series and
RL
−w(x) cos(βn x/L) dx
An = 0 R L
0
cos2 (βn x/L) dx
RL 2
A0 0 [(L − x2 ) + 2κL/h] cos(βn x/L) dx
=− 1 L
2κ 2 [x + L sin(2βn x/L)/(2βn )]|0
RL 2
2A0 βn 0 [(L − x2 ) + 2κL/h] cos(βn x/L) dx
=−
κL 2βn + sin(2βn )
RL 2 2
A0 0 [(L − x ) + 2κL/h] cos(βn x/L) dx
=− .
κL 1 + κ sin2 (βn )/hL
Now,
Z L   
2κL βn x
(L2 − x2 ) + cos dx
0 h L
 L  L
L3 βn x 2κL2 βn x
= sin + sin
βn L 0 hβn L 0
3
    2 2    L
L 2βn x βn x βn x βn x
− 3 cos + − 2 sin
βn L L L2 L 0
2L3 2κL2 2L3 sin(βn )
= 3 [sin(βn ) − βn cos(βn )] + sin(βn ) = .
βn hβn βn3
Worked Solutions 251

Thus, the final answer is

A0 (L2 − x2 ) A0 L
u(x, t) = +
2κ h
∞    2 2 
2L2 A0 X sin(βn ) βn x a β t
− 2 cos exp − 2n .
κ n=1 βn [1 + κ sin (βn )/hL]
3 L L

28. We first find the steady-state solution. We find it by solving w′′ − w = 0


with w(0) = 1 and w(L) = 0. The steady-state solution is

sinh(L − x) exp(L − x) − exp(x − L)


w(x) = = .
sinh(L) exp(L) − exp(−L)

To find the transient solution, u(x, t) = w(x) + v(x, t). Then we must solve

∂v ∂2v
= − v, 0 < x < L, t < 0,
∂t ∂x2

with the boundary conditions v(0, t) = v(L, t) = 0, t < 0 and the initial
condition v(x, 0) = −w(x) for 0 < x < L. We can now use separation of
variables and find that

X  nπx    2 2  
n π
v(x, t) = Bn sin exp − + 1 t .
n=1
L L2

Using the initial condition,



X  nπx 
v(x, 0) = Bn sin = −w(x).
n=1
L

This is a half-range sine expansion and


Z L  nπx 
2 exp(L)
Bn = e−x sin dx
L[exp(L) − exp(−L)] 0 L
Z L  nπx 
2 exp(−L)
− ex sin dx
L[exp(L) − exp(−L)] 0 L
L
2 exp(L) e−x [− sin(nπx/L) − nπ cos(nπx/L)/L]
=
L[exp(L) − exp(−L)] 1 + n2 π 2 /L2 0
L
2 exp(−L) ex [sin(nπx/L) − nπ cos(nπx/L)/L]

L[exp(L) − exp(−L)] 1 + n2 π 2 /L2 0
2nπ
= 2 .
L + n2 π 2
252 Advanced Engineering Mathematics with MATLAB

Thus, the final solution is


sinh(L − x)
u(x, t) =
sinh(L)
X∞  nπx    2 2  
n n π
+ 2π sin exp − + 1 t
n=1
L2 + n2 π 2 L L2
X∞
n  nπx     2 2
n π
  
= 2π sin exp − +1 t −1 .
n=1
L2 + n2 π 2 L L2

29. Assuming that u(x, t) = X(x)T (t), we find that


 
1 T′ X ′′
2
+ k 1 = = −k 2 ,
a T X
or
X ′′ + k 2 X = 0, X ′ (0) = 0, a2 X ′ (L) = −k2 X(L).
The solution X(x) = cos(kx) satisfies the differential equation and the bound-
ary condition X ′ (0) = 0. Substituting into the other boundary condition,
k tan(kL) = k2 /a2 . If kn denotes the nth root of k tan(kL) = k2 /a2 , then the
T (t) equation is
 
Tn′ + (k1 + a2 kn2 )Tn = 0, or Tn (t) = An exp −(k1 + a2 kn2 )t .

Therefore, the general solution is



X  
u(x, t) = An cos(kn x) exp −(k1 + a2 kn2 )t .
n=1

Our final task is to compute An . Applying the initial condition,



X
u0 = u(x, 0) = An cos(kn x).
n=1

The coefficient for this generalized Fourier series is


RL L
u0 cos(kn x) dx u0 sin(kn x)/kn |0
An = R0 L = RL
1
0
cos2 (kn x) dx 2 0 [1 + cos(2kn x)] dx
2u0 sin(kn L) 4u0 sin(kn L)
= =
kn [L + sin(2kn L)/(2kn )] 2kn L + sin(2kn L)
Therefore, the final solution is
X∞
sin(kn L) cos(kn x)  
u(x, t) = 4u0 cos(kn x) exp −(k1 + a2 kn2 )t .
n=1
2kn L + sin(2kn L)
Worked Solutions 253

30. Assuming that v(x, t) = X(x)T (t), we find that

1 T′ X ′′
= = −k 2 ,
a2 T X
or
X ′′ + k 2 X = 0, 2a2 X ′ (0) = X(0), 2a2 X ′ (1) = −X(1).
The solution X(x) = sin(kx) + 2a2 k cos(kx) satisfies the differential equation
and the boundary condition 2a2 X ′ (0) = X(0). Substituting into the boundary
condition at x = 1, tan(k) = 4a2 k/(4a4 k 2 − 1). If kn denotes the nth root of
4a2 k cos(k) = (4a4 k 2 − 1) sin(k), then the T (t) equation is
2 2
Tn′ + a2 kn2 Tn = 0, or Tn (t) = Cn e−a kn t
.

Therefore, the general solution is



X   2 2
v(x, t) = Cn sin(kn x) + 2a2 kn cos(kn x) e−a kn t .
n=1

Our final task is to compute Cn . Applying the initial condition,



X
2  
e−x/(2a )
= v(x, 0) = Cn sin(kn x) + 2a2 kn cos(kn x) .
n=1

The coefficient for this generalized Fourier series is


R1 2  
0
e−x/(2a ) sin(kn x) + 2a2 kn cos(kn x) dx
Cn = R1 .
[sin(k x) + 2a 2 k cos(k x)]2 dx
0 n n n

Now Z 1
2   8a4 kn
e−x/(2a )
sin(kn x) + 2a2 kn cos(kn x) dx = ,
0 1 + 4a4 kn2
and Z 1  2
sin(kn x) + 2a2 kn cos(kn x) dx = 12 (1 + 4a2 + 4a4 kn2 ).
0

To obtain these expression, we have used the relationship 4a2 kn cos(kn ) =


(4a4 kn2 − 1) sin(kn ). Squaring this relationship and using cos2 (kn ) = 1 −
sin2 (kn ), we also have that (1 + 4a4 kn2 )2 sin2 (kn ) = 16a4 kn2 . Therefore, the
final solution is
∞  
X kn sin(kn x) + 2a2 kn cos(kn x) −a2 k2 t
4
v(x, t) = 16a 4 k 2 )(1 + 4a2 + 4a4 k 2 )
e n .

n=1
(1 + 4a n n

u(x, t) equals v(x, t) multiplied by exp[(2x − t)/(4a2 )].


254 Advanced Engineering Mathematics with MATLAB

31. We begin by introducing the new variable v(r, t) = r u(r, t) and find that

∂v ∂2v
= 2, 0 ≤ r < 1, 0 < t,
∂t ∂r

with the boundary conditions v(0, t) = v(1, t) = 0, t > 0, and the initial
condition v(r, 0) = r, 0 ≤ r < 1. We can now use separation of variables and
find that

X 2 2 2
v(r, t) = Bn sin(nπr)e−a n π t .
n=1

Using the initial condition,



X
v(r, 0) = Bn sin(nπr) = r.
n=1

This is a half-range sine expansion and


Z 1   1
2 sin(nπr) r cos(nπr) 2(−1)n
Bn = r sin(nπr) dr = 2 − =− .
1 0 n2 π 2 nπ 0 nπ

Thus, the final solution is



2 X (−1)n+1 2 2 2
u(r, t) = sin(nπr)e−a n π t .
πr n=1 n

32. Let us introduce a new dependent variables v(r, t) = ru(r, t) so that the
problem now becomes

∂v ∂2v
= a2 2 , α < r < β, 0 < t,
∂t ∂r
with the boundary conditions

∂v(β, t)
v(α, t) = 0, and β = v(β, t), 0 < t,
∂r

and the initial condition v(r, 0) = ru0 , α < r < β.


We now assume that v(r, t) = R(r)T (t) which yields

R′′ T′
= 2 = −k 2 ,
R a T
or
R′′ + k 2 R = 0, R(α) = 0, βR′ (β) = R(β).
Worked Solutions 255

The solution R(r) = sin[k(r − α)] satisfies the differential equation and the
boundary condition R(α) = 0. Substituting into the other boundary condi-
tion, tan[k(β − α)] = βk. If kn denotes the nth root of tan[k(β − α)] = βk,
then the T (t) equation is
2 2
Tn′ + a2 kn2 Tn = 0, or Tn (t) = An e−a kn t
.

Therefore, the general solution is



X 2 2
v(r, t) = An sin[kn (r − α)]e−a kn t
.
n=1

Our final task is to compute An . Applying the initial condition,



X
u0 r = v(x, 0) = An sin[kn (r − α)].
n=1

The coefficient for this generalized Fourier series is



u0 α r sin[kn (r − α)] dr
An = R β .
α
sin2 [kn (r − α)] dr

Now
Z β Z β−α Z β−α
r sin[kn (r − α)] dr = u sin(kn u) du + α sin(kn u) du
α 0 0
β−α β−α β−α
sin(kn u) u cos(kn u) α cos(kn u)
= − −
kn2 0 k n 0 kn 0
sin[kn (β − α)] (β − α) cos[kn (β − α)]
= −
kn2 kn
α{cos[kn (β − α)] − 1} α
− = ,
kn kn
and Z Z
β β
2 1
sin [kn (r − α)] dr = 2 {1 − cos[2kn (r − α)]} dr
α
α 
1 sin[2kn (β − α)]
= 2 β−α−
2kn
1
 2
= 2 β − α − β cos [kn (β − α)]

= 21 β sin2 [kn (β − α)] − α .
Substituting these integrals into An , we obtain the final answer

αu0 X sin[kn (r − α)] −a2 kn2 t
u(r, t) = e ,
r n=1 kn c n
256 Advanced Engineering Mathematics with MATLAB

where 2cn = β sin2 [kn (β − α)] − α.

33. Introducing the new variable v(r, t) = r u(r, t), the problem becomes

∂v ∂2v
= a2 2 , 0 ≤ r < b, 0 < t,
∂t ∂r

with the boundary conditions


 
∂v v ∂v(b, t) 1−A
lim − → 0, = v(b, t),
r→0 ∂r r ∂r b

and the initial condition v(r, 0) = ru0 , 0 ≤ r < b.


We now use separation of variables with v(r, t) = R(r)T (t). The equa-
tions governing R(r) are
 
′′ 2 ′R(r) 1−A
R + k R = 0, lim R (r) − → 0, R′ (b) = R(b).
r→0 r b

The general solution is

R(r) = A cos(kr/b) + B sin(kr/b).

The boundary condition at r = 0 forces A = 0. The boundary condition at


r = b yields

kn cot(kn ) = 1 − A, nπ < kn < (n + 1)π.

Therefore, the eigenfunction solution is Rn (r) = sin(kn r/b).


The temporal part is governed by

Tn′ kn2
= − .
a2 Tn b2
2 2
kn t/b2
The general solution to this equation is Tn (t) = Cn e−a . Therefore, the
general production solution is

X 2 2
kn t/b2
v(r, t) = Cn sin(kn r/b)e−a .
n=1

Using the initial condition,



X
v(r, 0) = u0 r = Cn sin(kn r/b).
n=1
Worked Solutions 257

The Fourier coefficients for this generalized Fourier series is


Rb
0
u0 r sin(kn r/b) dr
Cn = Rb 2 .
0
sin (k n r/b) dr

However,  
Z b
kn r b2
u0 r sin dr = [sin(kn ) − kn cos(kn )] .
0 b kn2
and Z  
b
2 kn r b
sin dr = [2kn − sin(2kn )] .
0 b 4kn
Therefore,
4bu0 sin(kn ) − kn cos(kn )
Cn = ,
kn 2kn − sin(2kn )
and  

4bu0 X sin(kn ) − kn cos(kn ) kn r 2 2 2
u(r, t) = sin e−a kn t/b .
r n=1 kn [2kn − sin(2kn )] b

34. We first find the steady-state solution by solving


 
d dw
r = 0, lim |w(r)| < ∞, w(b) = u0 .
dr dr r→0

The steady-state solution is w(r) = u0 . To find the transient solution, u(r, t) =


w(r) + v(r, t). Then we must solve
 
∂v a2 ∂ ∂v
= r , 0 ≤ r < b, t < 0,
∂t r ∂r ∂r

with the boundary conditions limx→0 |v(x, t)| < ∞, v(b, t) = 0, t < 0 and
the initial condition v(r, 0) = −u0 for 0 ≤ r < b. We now use separation of
variables and find that
X∞    2 2 
kn r a k t
v(r, t) = An J0 exp − 2n ,
n=1
b b

where J0 (kn ) = 0. Using the initial condition,



X  
kn r
v(r, 0) = An J0 = −u0 ,
n=1
b

where Z  
b
2u0 kn r 2u0
An = − r J0 dr = − .
b2 J12 (kn ) 0 b kn J1 (kn )
258 Advanced Engineering Mathematics with MATLAB

The final solution is


" ∞  2 2 #
X J0 (kn r/b) a k t
u(r, t) = u0 1−2 exp − 2n .
k J (k )
n=1 n 1 n
b

35. We first find the steady-state solution. We find it by solving


 
d dw
r = 0, lim |w(r)| < ∞, w(b) = θ.
dr dr r→0

The steady-state solution is w(r) = θ. To find the transient solution, u(r, t) =


w(r) + v(r, t). Then we must solve
 
∂v a2 ∂ ∂v
= r , 0 ≤ r < b, t < 0,
∂t r ∂r ∂r

with the boundary conditions limx→0 |v(x, t)| < ∞, v(b, t) = 0, t < 0 and the
initial condition v(r, 0) = 1 − θ for 0 ≤ r < b. We can now use separation of
variables and find that

X    2 2 
kn r a k
v(r, t) = An J0 exp − 2 n t ,
n=1
b b

where J0 (kn ) = 0. Using the initial condition,


X  
kn r
v(r, 0) = An J0 = 1 − θ,
n=1
b

where Z  
b
2(1 − θ) kn r 2(1 − θ)
An = rJ0 dr = .
J12 (kn )b2 0 b kn J1 (kn )
The final solution is

X∞  2 2 
J0 (kn r/b) a k
u(r, t) = θ + 2(1 − θ) exp − 2 n t .
n=1
k n J 1 (k n ) b

36. Separation of variables yields



X 2 2
u(r, t) = An J0 (kn r)e−a kn t
,
n=1
Worked Solutions 259

where kn is the nth root of J0 (k) = 0. Using the initial condition,



X 
A, 0 ≤ r < b,
u(r, 0) = An J0 (kn r) =
B, b < r < 1,
n=1

where
Z b Z 1
2 2
An = 2 Ar J0 (kn r) dr + 2 Br J0 (kn r) dr
J1 (kn ) 0 J1 (kn ) b
Z kn b Z 1
2A 2B
= 2 2 u J0 (u) du + 2 2 u J0 (u) du
kn J1 (kn ) 0 kn J1 (kn ) kn b
2Ab J1 (kn b) 2B[J1 (kn ) − bJ1 (kn b)]
= +
kn J12 (kn ) kn J12 (kn )
2B 2b(A − B)J1 (kn b)
= + .
kn J1 (kn ) kn J12 (kn )

Therefore, the final solution is

X∞
BJ1 (kn ) + b(A − B)J1 (kn b) 2 2
u(r, t) = 2 2 J0 (kn r)e−a kn t .
n=1
kn J1 (kn )

37. We first find the steady-state solution. We find it by solving


 2 
d w 1 dw G
ν 2
+ =− , lim |w(r)| < ∞, w(b) = 0.
dr r dr ρ r→0

The steady-state solution is w(r) = G(b2 − r2 )/(4ρν). To find the transient


solution, u(r, t) = w(r) + v(r, t). Then we must solve
 
∂v ∂ 2 v 1 ∂v
=ν + , 0 ≤ r < b, t > 0,
∂t ∂r2 r ∂r

with the boundary conditions limx→0 |v(x, t)| < ∞, v(b, t) = 0, t > 0, and the
initial condition v(r, 0) = G(r2 − b2 )/(4ρν) for 0 ≤ r < b. We can now use
separation of variables and find that

X    
kn r νk 2
v(r, t) = An J0 exp − 2n t ,
n=1
b b

where kn is the nth root of J0 (k) = 0. Using the initial condition,



X  
kn r G 2
v(r, t) = An J0 = (r − b2 ),
n=1
b 4ρν
260 Advanced Engineering Mathematics with MATLAB

where
Z b  
2 G kn r
An = r(r2 − b2 )J0 dr
J12 (kn )b2
0 4ρν b
 Z 1 Z 1 
G 4 3 4
= b x J0 (kn x) dx − b xJ0 (kn x) dx
2ρνJ12 (kn )b2 0 0
  2  
G 4 kn − 4 2b4 4 J1 (kn )
= b J1 (kn ) + 2 J0 (kn ) − b
2ρνJ12 (kn )b2 kn3 kn kn
2
2Gb
=− .
ρνJ1 (kn )kn3

The final solution is


∞  
G 2 2Gb2 X J0 (kn r/b) νkn2
u(r, t) = (b − r2 ) − exp − t .
4ρν ρν n=1 kn3 J1 (kn ) b2

38. From separation of variables, we have that



X    2 2 
kn r a k
u(r, t) = An J0 exp − 2 n t ,
n=1
b b

where bJ0 (kn ) − hkn J1 (kn ) = 0. Using the initial condition,



X  
kn r
u(r, 0) = An J0 = b2 − r 2 ,
n=1
b

where
Rb
2kn2 r(b2 − r2 )J0 (kn r/b) dr
0
An =
+ b2 /h2 )J02 (kn )
b2 (kn2
 Z 1 Z 1 
2 4 4 3
= 2 2 b xJ (k
0 n x) dx − b x J (k
0 n x) dx
b [J0 (kn ) + J12 (kn )] 0 0
   
2b2 J1 (kn ) kn2 − 4 2
= 2 − J (k
1 n ) + J (k
0 n )
J0 (kn ) + J12 (kn ) kn kn3 kn2
4b2 [2J1 (kn ) + kn J0 (kn )]
=
kn3 [J02 (kn ) + J12 (kn )]

from Equation 6.5.31, Equation 6.5.35 and Equation 6.5.45. The final solution
is    2 2 
X∞
2J1 (kn ) + kn J0 (kn ) kn r a k
u(r, t) = 4b2 3 2 2 J 0 exp − 2n t .
k [J (kn ) + J1 (kn )]
n=1 n 0
b b
Worked Solutions 261

39. From separation of variables, we have that


 
1 T′ R′′ R′
+κ = + = −k 2 .
a2 T R rR

Therefore, a superposition of the product solutions yields



X 2 2
u(r, t) = e−κt An J0 (kn r)e−a kn t
,
n=1

where kn J1 (kn L) = hJ0 (kn L). Using the initial condition,



X 
0, 0 ≤ r < b,
u(r, 0) = An J0 (kn r) =
T0 , b < r ≤ L.
n=1

where
Z L
(kn2 L2 +h L 2 2
)J02 (kn L)An = 2kn2 T0 rJ0 (kn r) dr
b
Z kn L
kn2 L2 [J02 (kn L) + J12 (kn L)]An = 2T0 ηJ0 (η) dη
kn b
= 2T0 kn [LJ1 (kn L) − bJ1 (kn b)]

from Equation 6.5.31, Equation 6.5.35 and Equation 6.5.45. Therefore,

2T0 [LJ1 (kn L) − bJ1 (kn b)]


An = .
L2 kn [J02 (kn L) + J12 (kn L)]

The final solution is



2T0 −κt X [LJ1 (kn L) − bJ1 (kn b)]J0 (kn r) −a2 kn2 t
u(r, t) = e e .
L2 n=1
kn [J02 (kn L) + J12 (kn L)]

40. For the steady-state solution, the heat equations becomes the second-order
ordinary differential equation −a2 w′′ = J − P δ(x − b) or a2 w′′ = P δ(x − b) − J
with the boundary conditions w(0) = w(L) = 0. The general solution to the
differential equation can be written w(x) = Jx(L − x)/(2a2 ) + Ax + B(L −
x), where A and B are arbitrary constants needed to satisfy the boundary
conditions. For the solution valid between 0 < x < b, B = 0 because w(0) = 0.
For the solution valid between b < x < L, A = 0 because w(L) = 0. Therefore,

Jx(L − x)/2a2 + Ax, 0 < x < b,
w(x) =
Jx(L − x)/2a2 + B(L − x), b < x < L.
262 Advanced Engineering Mathematics with MATLAB

If the temperature is continuous, w(b+ ) = w(b− ) and

Jb(L − b)/2a2 + Ab = Jb(L − b)/2a2 + B(L − b) or Ab = B(L − b).

Integrating the ordinary differential equation,


Z b+ǫ Z b+ǫ Z b+ǫ
−a2 w′′ dx = J dx − P δ(x − b) dx
b−ǫ b−ǫ b−ǫ

or
b+ǫ
− a2 w ′ b−ǫ
= 2ǫJ − P.
b+ǫ
In the limit of ǫ → 0, limǫ→0 a2 w′ b−ǫ
= P. Substituting w(x) into this equa-
tion,

J(L − 2b)/2 + a2 A − J(L − 2b)/2 + a2 B = −P or A + B = −P/a2 .

Using this equation along with Ab = B(L − b), we find that B = −P b/(a2 L)
or A = −P (L − b)/(a2 L). Thus, w(x) is

Jx(L − x)/2a2 − P x(L − b)/a2 L, 0 < x < b,
w(x) =
Jx(L − x)/2a2 − P b(L − x)/a2 L, b < x < L.

For later calculations, we need to re-express w(x) as a half-range Fourier sine


series,
X∞  nπx 
w(x) = Bn sin ,
n=1
L

where
Z L  nπx  Z  nπx 
2 Jx(L − x) 2 b
Bn = 2
sin dx + Ax sin dx
L 0 2a L L 0 L
Z  nπx 
2 L 2JL2 [1 − (−1)n ] 2LP sin(nπb/L)
+ B(L − x) sin dx = − 2 2 ,
L b L a2 π 3 n3 a π n2
or
∞ ∞
4JL2 X sin[(2m − 1)πx/L] 2LP X sin(nπb/L) sin(nπx/L)
w(x) = − .
a2 π 3 m=1 (2m − 1)3 a2 π 2 n=1 n2

To find the transient part, we have that u(x, t) = w(x) + v(x, t). Substitution
into the partial differential equation yields

∂v ∂2v
= a2 2 , 0 < x < L, 0 < t,
∂t ∂x
Worked Solutions 263

while the boundary conditions are v(0, t) = v(L, t) = 0 with the initial condi-
tion v(x, 0) = −w(x). Separation of variables yields


X  nπx   
a2 n2 π 2 t
v(x, t) = −Bn sin exp − .
n=1
L L2

The initial condition gives



X  nπx 
−w(x) = v(x, 0) = −Bn sin ,
n=1
L

where we have already found Bn . Combining w(x) and v(x, t) gives u(x, t) or

4JL2 X sin[(2m − 1)πx/L] h i



−a2 (2m−1)2 π 2 t/L2
u(x, t) = 1 − e
a2 π 3 m=1 (2m − 1)3
2LP X sin(nπb/L) sin(nπx/L) h i

−a2 n2 π 2 t/L2
− 1 − e .
a2 π 2 n=1 n2

41. Because
∂u ∂v
= e−ax − ae−ax v,
∂x ∂x
∂2u 2
−ax ∂ v ∂v
2
= e 2
− 2ae−ax + a2 e−ax v,
∂x ∂x ∂x
and
∂u ∂v
= e−ax ,
∂t ∂t
∂u ∂v ∂2v ∂v ∂v
= e−ax = e−ax 2 − 2ae−ax + a2 e−ax v + 2ae−ax − 2a2 e−ax v
∂t ∂t ∂x
 2  ∂x ∂x
∂ v
= e−ax − a 2
v
∂x2
or
∂v ∂2v
= − a2 v.
∂t ∂x2
Similarly,

∂u(0, t) ∂v(0, t)
+ 2au(0, t) = − av(0, t) + 2av(0, t) = 0,
∂x ∂x
or
∂v(0, t)
+ av(0, t) = 0,
∂x
264 Advanced Engineering Mathematics with MATLAB

and
 
∂u(1, t) ∂v(1, t)
+ 2au(1, t) = e−a − av(1, t) + 2av(1, t) = 0,
∂x ∂x
or
∂v(1, t)
+ av(1, t) = 0.
∂x
Finally,
u(x, 0) = e−ax v(x, 0) = 1, =⇒ v(x, 0) = eax .
Let v(x, t) = X(x)T (t). Then separation of variables leads to
T′ X ′′
= − a2 = −λ,
T X
along with

T (t) [X ′ (0) + aX(0)] = 0 or X ′ (0) + aX(0) = 0,

and
T (t) [X ′ (1) + aX(1)] = 0 or X ′ (1) + aX(1) = 0.
The X(x) equation is solved in Section 6.3, Problem 5. For λ0 = 0, T0′ (t) = 0
or T0 (t) = A0 . When λn = a2 + n2 π 2 , we have Tn′ = −λn Tn , or Tn =
2 2 2
An e−(a +n π )t . From the principle of linear superposition,

X 2
+n2 π 2 )t
v(x, t) = A0 e−ax + An [a sin(nπx) − nπ cos(nπx)] e−(a .
n=1

To evaluate A0 and An , we use the initial condition or



X
eax = A0 e−ax + An [a sin(nπx) − nπ cos(nπx)] .
n=1

Therefore, R1
eax e−ax dx 2a
A0 = 0R 1 = ,
e −2ax dx 1 − e−2a
0
and
R1
eax [a sin(nπx) − nπ cos(nπx)] dx 4anπ [1 − (−1)n ea ]
An = 0R 1 = .
[a sin(nπx) − nπ cos(nπx)]2 dx (a2 + n2 π 2 )2
0

Therefore,
2ae−ax
v(x, t) =
1 − e−2a
X∞
n [1 − (−1)n ea ] 2 2 2
+ 4aπ 2 2 2 2
[a sin(nπx) − nπ cos(nπx)] e−(a +n π )t .
n=1
(a + n π )
Worked Solutions 265

To obtain u(x, t), just multiply v(x, t) by e−ax .

42. Let u(x, t) = X(x)T (t). Then separation of variables leads to

X ′′′′ T′
′′
= = −k 2 ,
X T

along with

X(0)T (t) = X ′ (0)T (t) = X(1)T (t) = X ′ (1)T (t) = 0.

This gives the ordinary differential equations

X ′′′′ + k 2 X ′′ = 0, and T ′ + k 2 T = 0,

subject to the boundary conditions X(0) = X ′ (0) = X(1) = X ′ (1) = 0. The


solution for X(x) is given in Problem 5 in Section 6.3. For Tn (t), we have that
2 2
Tn (t) = An e−kn t when Xn (x) = 1 − cos(2nπx) and Tn (t) = Bn e−kn t when
Xn (x) = 1 − cos(κn x) − 2[sin(κn x) − κn x]/κn . Therefore, linear superposition
yields

X 2
π2 t
u(x, t) = An [1 − cos(2nπx)]e−4n
n=1

X  
2 2
+ Bn 1 − cos(κn x) − [sin(κn x) − κn x] e−κn t ,
n=1
κn

where R1
0
f ′ (x)Xn′ (x) dx
An = R1
0
[Xn′ (x)]2 dx
with Xn (x) = 1 − cos(2nπx) and
R1
0
f ′ (x)Xn′ (x) dx
Bn = R1
0
[Xn′ (x)]2 dx

with Xn (x) = 1 − cos(κn x) − 2[sin(κn x) − κn x]/κn . In both cases,

f (x) = 21 A + 3(1 − A)x(x − 1).

Turning to the evaluation of An and Bn , we have


Z 1 Z 1   1
sin(4nπx)
[Xn′ (x)]2 dx = 4n2 π 2 sin2 (2nπx) dx = 2n2 π 2 x − = 2n2 π 2
0 0 4nπ 0
266 Advanced Engineering Mathematics with MATLAB

for Xn (x) = 1 − cos(2nπx). On the other hand, for Xn (x) = 1 − cos(κn x) −


2[sin(κn x) − κn x]/κn ,
Z 1 Z 1
2
[Xn′ (x)]2 dx = [κn sin(κn x) + 2 cos(κn x) − 2] dx
0 0
Z 1 
= dx κ2n sin2 (κn x) + 4κn sin(κn ) cos(κn x)
0

2
+ 4 cos (κn x) − 4κn sin(κn x) − 8 cos(κn x) + 4
 1
x sin(2κn x) 1 1
= κ2n − + 2 sin2 (κn x) 0 + 4x|0
2 4κn 0
 1 1
x sin(2κn x) 1 8
+4 + + 4 cos(κn x)|0 − sin(κn x) .
2 4κn 0 κn 0

Substituting in the limits,


Z 1  
2 1 sin(2κn )
′ 2
[Xn (x)] dx = κn − + 2 sin2 (κn )
0 2 4κ n
 
1 sin(2κn ) 8
+4 + + 4 cos(κn ) − sin(κn )
2 4κn κn
κ2 κn sin(κn ) cos(κn )
= n− + 2 sin2 (κn ) + 2
2 2
2 sin(κn ) cos(κn ) 8 κ2
+ + 4 cos(κn ) − sin(κn ) = n .
κn κn 2
Because
Z 1 
κn sin(κn x)+2 cos(κn x) − 2 dx
0
  1
sin(κn x)
= − cos(κn x) + 2 − 2x = 0,
κn 0

and
Z 1
x(x − 1) [κn sin(κn x) + 2 cos(κn x) − 2] dx
0
 1
2x − 1 κ2n x2 − κ2n x − 2
= κn sin(κ n x) − cos(κ n x)
κ2n κ3n 0
 1
2x − 1 κ2n x2 − κ2n x − 2
+2 cos(κn x) + sin(κn x)
κ2n κ3n 0
 3 1
x x2 2 cos(κn ) − 2 1 + cos(κn ) 1 1
−2 − = + + = ,
3 2 0 κ2n 2 3 3
Worked Solutions 267

3(1 − A) 13 2(1 − A)
Bn = 1 2 = .
κ
2 n
κ2n
On the other hand, An = 0 because
Z 1
1 
2 A + 3(1 − A)x(x − 1) sin(2nπx) dx
0
1
A
= cos(2nπx)
4nπ 0
  1
2x 4n2 π 2 x2 − 1
+ 3(1 − A) sin(2nπx) − cos(2nπx)
4n2 π 2 8n3 π 3 0
 1
sin(2nπx) x cos(2nπx)
− 3(1 − A) − = 0.
4n2 π 2 2nπ 0

43. Because
∂u ∂v ∂2u ∂2v
= , 2
= 2,
∂t ∂t ∂r ∂r
1 ∂u K 1 ∂v u K v
= + , and 2
= + 2,
r ∂r r r ∂r r r r
direct substitution into the partial differntial equation gives
 2 
∂v 2 ∂ v 1 ∂v v
=a + − 2 .
∂t ∂r2 r ∂r r
Now,
lim |u(r, t)| = lim |v(r, t)| < ∞,
r→0 r→0

u(1, t) = K = K + v(1, t), or v(1, t) = 0,


and
u(r, 0) = g(r) = Kr + v(r, 0), or v(r, 0) = g(r) − Kr.
Let u(r, t) = R(r)T (t). Then separation of variables leads to
T′ R′′ R′ 1
= + − 2 = −k 2 ,
T R rR r
along with
lim |R(r)| < ∞, R(1) = 0.
r→0

The solution to the radial part is Rn (r) = J1 (kn r), where kn is the nth solution
2 2
of J1 (k) = 0 and n = 1, 2, 3, . . .. For Tn (t), we have that Tn (t) = An e−a kn t .
Therefore, linear superposition yields

X 2 2
u(r, t) = An J1 (kn )e−a kn t
,
n=1
268 Advanced Engineering Mathematics with MATLAB

where
Z 1
2
An = [g(r) − Kr] J1 (kn r) r dr
J22 (kn ) 0
Z 1 Z 1 
2 2
= 2 g(r)J1 (kn r) r dr − K r J1 (kn r) dr
J0 (kn ) 0 0
 Z 1 
2 K J2 (kn )
= 2 + g(r)J1 (kn r) r dr
J0 (kn ) kn 0
 Z 1 
2 K J2 (kn )
= 2 − + g(r)J1 (kn r) r dr
J0 (kn ) kn 0
 Z 1 
2 kn
= K+ g(r)J1 (kn r) r dr ,
kn J0 (kn ) J0 (kn ) 0

since from Equation 6.5.30, J0 (kn ) + J2 (kn ) = 2J1 (kn )/kn = 0 or J2 (kn ) =
−J0 (kn ). Therefore, the solution is

X∞  Z 1 
J1 (kn r) kn 2 2
u(r, t) = Kr + 2 K+ g(r)J1 (kn r) r dr e−a kn t .
k J (k )
n=1 n 0 n
J0 (kn ) 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Crank-Nicholson Scheme
% for the Heat Equation Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; ncount = 1; dx = 0.05; dt = 0.005; coeff = dt / (dx*dx);


% coeff = a2 ∆t/∆x2
coeff = dt / (dx*dx); coeff2 = 0.5*coeff;
center1 = 1 + coeff; center2 = 1 - coeff;
N = 21; x = 0:dx:1; M = 1/dx + 1;
MM = M-2; % M = number of spatial grid points

% introduce the initial conditions

uold(1:M) = zeros(M,1); u(1:M) = zeros(M,1);


for m = 1:M
if x(m) > 0.5; uold(m) = 1; end; end

% create coefficients of the tridiagonal matrix

a(1:MM) = coeff2; b(1:MM) = -center1;


Worked Solutions 269

c(1:MM) = coeff2; r(1:MM) = zeros(MM,1);

% integrate forward in time

for n = 1:N
tplot(n) = dt * (n-1);

% set up right column vector

r(1) = - coeff2 * uold(3) - center2 * uold(2);


for m=2:MM-1
jj = m+1;
r(m) = - coeff2
* (uold(jj-1) + uold(jj+1)) - center2 * uold(jj);
end
r(MM) = - coeff2 * uold(M-2) - center2 * uold(M-1);

% solve the tridiagonal matrix for new temperatures

bet = b(1); uu(1) = r(1) / bet;


for j = 2:MM
gamma(j) = c(j-1) / bet;
bet = b(j) - a(j) * gamma(j);
uu(j) = (r(j) - a(j) * uu(j-1)) / bet;
end

for j = MM-1:-1:1
uu(j) = uu(j) - gamma(j+1) * uu(j+1);
end

u(1:M) = zeros(M,1); u(2:M-1) = uu(1:MM);


for m=1:M; solution(m,n) = uold(m); end
uold(1:M) = u(1:M);
end

% plot the results

X = x’ * ones(1,length(tplot)); T = ones(M,1) * tplot;


surf(X,T,solution), axis([0 1 0 0.1])
xlabel(’DISTANCE’,’Fontsize’,20); ylabel(’TIME’,’Fontsize’,20)
zlabel(’TEMPERATURE’,’Fontsize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 Advanced Engineering Mathematics with MATLAB

Section 9.3

1. Let u(x, y) = X(x)Y (y). Then −X ′′ /X = Y ′′ /Y = −λ with Y (0) =


Y (b) = X(a) = 0. The solution to the Sturm-Liouville problem Y ′′ + λY = 0
with Y (0) = Y (b) = 0 is Yn (y) = sin(nπy/b). The most convenient solution
for Xn (x) is
   
nπ(a − x) nπ(a − x)
Xn (x) = An cosh + Bn sinh .
b b

Because X(a) = 0, An = 0. Therefore,


  
nπy 

X nπ(a − x)
u(x, y) = Bn sinh sin .
n=1
b b

From the boundary condition,



X  nπa   nπy 
u(0, y) = 1 = Bn sinh sin .
n=1
b b

Then,
 nπa  Z b  nπy 
2 2[1 − (−1)n ]
sinh Bn = 1 sin dy = .
b b 0 b nπ
Thus, the final answer is

4 X sinh[(2m − 1)π(a − x)/b] sin[(2m − 1)πy/b]
u(x, y) = .
π m=1 (2m − 1) sinh[(2m − 1)πa/b]

2. Let u(x, y) = X(x)Y (y). Then X ′′ /X = −Y ′′ /Y = −λ with X(0) =


X(a) = Y (0) = 0. The solution to the Sturm-Liouville problem X ′′ + λX = 0
with X(0) = X(a) = 0 is Xn (x) = sin(nπx/a). The most convenient solution
for Yn (y) is  nπy   nπy 
Yn (y) = An cosh + Bn sinh .
a a
Because Y (0) = 0, An = 0. Therefore,

X  nπy   nπx 
u(x, y) = Bn sinh sin .
n=1
a a

From the boundary condition,



X    nπx 
nπb
u(x, b) = x = Bn sinh sin .
n=1
a a
Worked Solutions 271

Then,
  Z  nπx 
nπb 2 a
sinh Bn = x sin dx
a a 0 a
 2  nπx  ax  nπx  a
2 a
= sin − cos
a n2 π 2 a nπ a 0
2a(−1)n+1
= .

Thus, the final answer is

2a X sinh(nπy/a) sin(nπx/a)
u(x, y) = (−1)n+1 .
π n=1 n sinh(nπb/a)

3. Let u(x, y) = X(x)Y (y). Then X ′′ /X = −Y ′′ /Y = −λ with X(0) =


X(a) = Y (0) = 0. The solution to the Sturm-Liouville problem X ′′ + λX = 0
with X(0) = X(a) = 0 is Xn (x) = sin(nπx/a) . The most convenient solution
for Yn (y) is  nπy   nπy 
Yn (y) = An cosh + Bn sinh .
a a
Because Y (0) = 0, An = 0. Therefore,

X  nπy   nπx 
u(x, y) = Bn sinh sin .
n=1
a a

From the boundary condition,



X    nπx 
nπb
u(x, b) = x − a = Bn sinh sin .
n=1
a a

Then,
  Z  nπx 
nπb 2 a
sinh Bn = (x − a) sin dx
a a 0 a
 2  nπx  ax  nπx  a  nπx  a
2 a 2a
= sin − cos + cos
a n2 π 2 a nπ a 0 nπ a 0
n n
2a(−1) 2a[(−1) − 1] 2a
=− + =− .
nπ nπ nπ
Thus, the final answer is

2a X sinh(nπy/a) sin(nπx/a)
u(x, y) = − .
π n=1 n sinh(nπb/a)
272 Advanced Engineering Mathematics with MATLAB

4. Let u(x, y) = X(x)Y (y). Then X ′′ /X = −Y ′′ /Y = −λ with X(0) =


X(a) = Y (0) = 0. The solution to the Sturm-Liouville problem X ′′ + λX = 0
with X(0) = X(a) = 0 is Xn (x) = sin(nπx/a). The most convenient solution
for Yn (y) is  nπy   nπy 
Yn (y) = An cosh + Bn sinh .
a a
Because Y (0) = 0, An = 0. Therefore,

X  nπy   nπx 
u(x, y) = Bn sinh sin .
n=1
a a

From the boundary condition,



X    nπx 
nπb
u(x, b) = f (x) = Bn sinh sin .
n=1
a a

Then,
  Z  nπx  Z  nπx 
nπb 2 a/2 2x 2 a 2(a − x)
sinh Bn = sin dx + sin dx
a a 0 a a a a/2 a a
8  nπ 
= 2 2 sin .
n π 2
Thus, the final answer is

8 X sinh[(2m − 1)πy/a] sin[(2m − 1)πx/a]
u(x, y) = 2
(−1)m+1 .
π m=1 (2m − 1)2 sinh[(2m − 1)πb/a]

5. Let u(x, y) = X(x)Y (y). Then X ′′ /X = −Y ′′ /Y = −λ with X ′ (0) =


X(a) = Y (0) = 0. The solution to the Sturm-Liouville problem X ′′ + λX = 0
with X ′ (0) = X(a) = 0 is Xn (x) = cos[(2n−1)πx/(2a)]. The most convenient
solution for Yn (y) is
   
(2n − 1)πy (2n − 1)πy
Yn (y) = An cosh + Bn sinh .
2a 2a

Because Y (0) = 0, An = 0. Therefore,



X    
(2n − 1)πy (2n − 1)πx
u(x, y) = Bn sinh cos .
n=1
2a 2a

From the boundary condition,



X    
(2n − 1)πb (2n − 1)πx
u(x, b) = 1 = Bn sinh cos .
n=1
2a 2a
Worked Solutions 273

Then,   Ra
(2n − 1)πb cos[(2n − 1)πx/2a] dx
sinh Bn = a0
R
2a 0
cos 2 [(2n − 1)πx/2a] dx
 
4 (2n − 1)π
= sin .
(2n − 1)π 2
Thus, the final answer is

4X sinh[(2n − 1)πy/2a] cos[(2n − 1)πx/2a]
u(x, y) = (−1)n+1 .
π n=1 (2n − 1) sinh[(2n − 1)πb/2a]

6. Let u(x, y) = X(x)Y (y). Then −X ′′ /X = Y ′′ /Y = −λ with Y ′ (0) =


Y (b) = X(a) = 0. The solution to the Sturm-Liouville problem Y ′′ + λY = 0
with Y ′ (0) = Y (b) = 0 is Yn (y) = cos[(2n − 1)πy/(2b)] . The most convenient
solution for Xn (x) is
   
(2n − 1)π(x − a) (2n − 1)π(x − a)
Xn (x) = An cosh + Bn sinh .
2b 2b

Because X(a) = 0, An = 0. Therefore,



X    
(2n − 1)π(x − a) (2n − 1)πy
u(x, y) = Bn sinh cos .
n=1
2b 2b

From the boundary condition,



X    
(2n − 1)πa (2n − 1)πy
u(0, y) = 1 = −Bn sinh cos .
n=1
2b 2b

Then,
  Rb
(2n − 1)πa cos[(2n − 1)πy/2b] dy 4(−1)n
sinh Bn = − R b0 = .
2b cos2 [(2n − 1)πy/2b] dy (2n − 1)π
0

Thus, the final answer is



4X sinh[(2n − 1)π(x − a)/2b] cos[(2n − 1)πy/2b]
u(x, y) = (−1)n .
π n=1 (2n − 1) sinh[(2n − 1)πa/2b]

7. Let u(x, y) = X(x)Y (y). Then −X ′′ /X = Y ′′ /Y = −λ with Y ′ (0) =


Y ′ (b) = 0. The solution to the Sturm-Liouville problem Y ′′ + λY = 0 with
274 Advanced Engineering Mathematics with MATLAB

Y ′ (0) = Y ′ (b) = 0 is Y0 (y) = 1 and Yn (y) = cos(nπy/b). The most convenient


solution for Xn (x) is
 nπx   nπx 
X0 (x) = 21 A0 + 21 B0 x, Xn (x) = An cosh + Bn sinh .
b b
Therefore,
∞ 
X  nπx   nπx   nπy 
1 1
u(x, y) = 2 A0 + 2 B0 x + An cosh + Bn sinh cos .
n=1
b b b

From the boundary condition at x = 0,



X  nπy 
u(0, y) = 21 A0 + An cos = 1.
n=1
b

Consequently,
Z b Z b  nπy 
2 2
A0 = 1 dy = 2 and An = cos dy = 0.
b 0 b 0 b
Therefore,

X  nπx   nπy 
u(x, y) = 1 + 21 B0 x + Bn sinh cos .
n=1
b b

From the boundary condition at x = a,



X  nπa   nπy 
u(a, y) = 1 + 21 B0 a + Bn sinh cos =1
n=1
b b

so that B0 = Bn = 0. The final answer is u(x, y) = 1.

8. Let u(x, y) = v(x, y) + w(x, y). Then, we must solve

vxx + vyy = 0, v(0, y) = vx (a, y) = vy (x, b) = 0, v(x, 0) = 1

and

wxx + wyy = 0, w(x, 0) = wy (x, b) = wx (a, y) = 0, w(0, y) = 1.

Solving for v(x, y) first, v(x, y) = X(x)Y (y) and X ′′ /X = −Y ′′ /Y = −λ with


X(0) = X ′ (a) = Y ′ (b) = 0. The solution to the Sturm-Liouville problem
X ′′ + λX = 0 with X(0) = X ′ (a) = 0 is Xn (x) = sin[(2n − 1)πx/(2a)]. The
most convenient solution for Yn (y) is
   
(2n − 1)π(y − b) (2n − 1)π(y − b)
Yn (y) = An cosh + Bn sinh .
2a 2a
Worked Solutions 275

Because Y ′ (b) = 0, Bn = 0. Therefore,



X    
(2n − 1)π(y − b) (2n − 1)πx
v(x, y) = An cosh sin .
n=1
2a 2a

From the boundary condition,



X    
(2n − 1)πb (2n − 1)πx
v(x, 0) = 1 = An cosh sin .
n=1
2a 2a

Then,
  Ra
(2n − 1)πb sin[(2n − 1)πx/2a] dx 4
cosh An = R a0 2 = .
2a 0
sin [(2n − 1)πx/2a] dx (2n − 1)π

Thus, the v(x, y) component is



4 X cosh[(2n − 1)π(y − b)/2a] sin[(2n − 1)πx/2a]
v(x, y) = .
π n=1 (2n − 1) cosh[(2n − 1)πb/2a]

Solving for w(x, y), we assume that w(x, y) = X(x)Y (y) and −X ′′ /X =
Y ′′ /Y = −λ with Y (0) = Y ′ (b) = X ′ (a) = 0. The solution to the Sturm-
Liouville problem Y ′′ + λY = 0 with Y (0) = Y ′ (b) = 0 is Yn (y) = sin[(2n − 1)
πy/(2b)]. The most convenient solution for Xn (x) is
   
(2n − 1)π(x − a) (2n − 1)π(x − a)
Xn (x) = An cosh + Bn sinh .
2b 2b

Because X ′ (a) = 0, Bn = 0. Therefore,



X    
(2n − 1)π(x − a) (2n − 1)πy
w(x, y) = An cosh sin .
n=1
2b 2b

From the boundary condition,



X    
(2n − 1)πa (2n − 1)πy
w(0, y) = 1 = An cosh sin .
n=1
2b 2b

Then,
  Rb
(2n − 1)πa sin[(2n − 1)πy/2b] dy 4
cosh An = R b0 = .
2b 2
sin [(2n − 1)πy/2a] dy (2n − 1)π
0
276 Advanced Engineering Mathematics with MATLAB

Thus, the w component is



4 X cosh[(2n − 1)π(x − a)/2b] sin[(2n − 1)πy/2b]
w(x, y) = .
π n=1 (2n − 1) cosh[(2n − 1)πa/2b]

Thus, the final solution is



4 X cosh[(2n − 1)π(y − b)/2a] sin[(2n − 1)πx/2a]
u(x, y) =
π n=1 (2n − 1) cosh[(2n − 1)πb/2a]

4 X cosh[(2n − 1)π(x − a)/2b] sin[(2n − 1)πy/2b]
+ .
π n=1 (2n − 1) cosh[(2n − 1)πa/2b]

9. Let u(x, y) = 1 + v(x, y). Then we have to solve the problem:

vxx + vyy = 0, v(0, y) = v(a, y) = vy (x, 0) = 0, v(x, b) = −1.

To find v(x, y), v(x, y) = X(x)Y (y). Then X ′′ /X = −Y ′′ /Y = −λ with


X(0) = X(a) = Y ′ (0) = 0. The solution to the Sturm-Liouville problem
X ′′ + λX = 0 with X(0) = X(a) = 0 is Xn (x) = sin(nπx/a). The most
convenient solution for Yn (y) is
 nπy   nπy 
Yn (y) = An cosh + Bn sinh .
a a
Because Y ′ (0) = 0, Bn = 0. Therefore,

X  nπy   nπx 
v(x, y) = An cosh sin .
n=1
a a

From the boundary condition u(x, b) = 0,



X    nπx 
nπb
v(x, b) = −1 = An cosh sin .
n=1
a a

Then,
  Z a  nπx 
nπb 2 2
cosh An = − sin dx = [(−1)n − 1].
a a 0 a nπ

Thus, the final answer is



4 X cosh[(2m − 1)πy/a] sin[(2m − 1)πx/a]
u(x, y) = 1 − .
π m=1 (2m − 1) cosh[(2m − 1)πb/a]
Worked Solutions 277

10. Let u(x, y) = v(x, y) + w(x, y). Then, we must solve

vxx + vyy = 0, v(0, y) = v(a, y) = v(x, b) = 0, v(x, 0) = 1

and

wxx + wyy = 0, w(x, 0) = w(x, b) = w(a, y) = 0, w(0, y) = 1.

Solving for v(x, y) first, v(x, y) = X(x)Y (y) and X ′′ /X = −Y ′′ /Y = −λ


with X(0) = X(a) = Y (b) = 0. The solution to the Sturm-Liouville problem
X ′′ + λX = 0 with X(0) = X(a) = 0 is Xn (x) = sin(nπx/a). The most
convenient solution for Yn (y) is
   
nπ(y − b) nπ(y − b)
Yn (y) = An cosh + Bn sinh .
a a

Because Y (b) = 0, An = 0. Therefore,


  
nπx 

X nπ(y − b)
v(x, y) = Bn sinh sin .
n=1
a a

From the boundary condition,



X    nπx 
nπb
v(x, 0) = 1 = −Bn sinh sin .
n=1
a a

Then,
  Z a  nπx 
nπb 2 2[1 − (−1)n ]
− sinh Bn = sin dx = .
a a 0 a nπ

Thus, the v component is



4 X sinh[(2m − 1)π(y − b)/a] sin[(2m − 1)πx/a]
v(x, y) = − .
π m=1 (2m − 1) sinh[(2m − 1)πb/a]

Solving for w(x, y), we assume that w(x, y) = X(x)Y (y) and −X ′′ /X =
Y ′′ /Y = −λ with Y (0) = Y (b) = X(a) = 0. The solution to the Sturm-
Liouville problem Y ′′ + λY = 0 with Y (0) = Y (b) = 0 is Yn (y) = sin(nπy/b).
The most convenient solution for Xn (x) is
   
nπ(x − a) nπ(x − a)
Xn (x) = An cosh + Bn sinh .
b b
278 Advanced Engineering Mathematics with MATLAB

Because X(a) = 0, An = 0. Therefore,


  
nπy 

X nπ(x − a)
w(x, y) = Bn sinh sin .
n=1
b b

From the boundary condition,



X  nπa   nπy 
w(0, y) = 1 = −An sinh sin .
n=1
b b

Then,
 nπa  Z b  nπy 
2 2[1 − (−1)n ]
− sinh Bn = sin dy = .
b b 0 b nπ
Thus, the w component is

4 X sinh[(2m − 1)π(x − a)/b] sin[(2m − 1)πy/b]
w(x, y) = − .
π m=1 (2m − 1) sinh[(2m − 1)πa/b]

The final solution is



4 X sinh[(2m − 1)π(y − b)/a] sin[(2m − 1)πx/a]
u(x, y) = −
π m=1 (2m − 1) sinh[(2m − 1)πb/a]

4 X sinh[(2m − 1)π(x − a)/b] sin[(2m − 1)πy/b]
− .
π m=1 (2m − 1) sinh[(2m − 1)πa/b]

11. Let u(x, y) = 1 + v(x, y). Then we have to solve the problem:

vxx + vyy = 0, vx (0, y) = v(a, y) = v(x, 0) = v(x, b) = 0.

Thus, v(x, y) = 0 and the final solution is u(x, y) = 1.

12. Let u(x, y) = u1 + v(x, y). Then we have to solve the problem:

vxx + vyy = 0, vx (0, y) = vx (a, y) = v(x, b) = 0,



f (x) − u1 , 0 < x < α,
v(x, 0) =
−u1 , α < x < a.
To find v(x, y), v(x, y) = X(x)Y (y). Then X ′′ /X = −Y ′′ /Y = −λ with
X ′ (0) = X ′ (a) = Y (b) = 0. The solution to the Sturm-Liouville problem
X ′′ + λX = 0 with X ′ (0) = X ′ (a) = 0 is X0 (x) = 1 and Xn (x) = cos(nπx/a).
The most convenient solution for Yn (y) is Y0 (y) = 21 A0 + 21 B0 (y − b) and
   
nπ(y − b) nπ(y − b)
Yn (y) = An cosh + Bn sinh .
a a
Worked Solutions 279

Because Y (b) = 0, A0 = An = 0. Therefore,


X∞    nπx 
nπ(y − b)
v(x, y) = 12 B0 (y − b) + Bn sinh cos .
n=1
a a

Then, at y = 0,

X    nπx 
nπb
v(x, 0) = − 21 B0 b − Bn sinh cos .
n=1
a a

Therefore, Z Z
α a
2 2
−bB0 = [f (x) − u1 ] dx − u1 dx
a 0 a α
or Z α
2u1 2
B0 = − f (x) dx;
b ab 0
and
  Z α  nπx  Z a  nπx 
nπb 2 2
− sinh Bn = f (x) cos dx − u1 cos dx,
a a 0 a a 0 a
or Z α  nπx 
2
Bn = − f (x) cos dx.
a sinh(nπb/a) 0 a

13. Assume a solution of the form u(x, y) = T0 + ∆T cos(2πx/λ)e−by , because


the solution must die away as we go down into the solid earth. Substituting
into the steady-state heat equation uxx + uyy = 0, we find that the final
solution is u(x, y) = T0 + ∆T cos(2πx/λ)e−2πy/λ .

14. Let u(x, y) = X(x)Y (y). Then X ′′ /X = −Y ′′ /Y = −λ with X ′ (0) =


X ′ (L) = 0. The solution to the Sturm-Liouville problem X ′′ + λX = 0
with X ′ (0) = X ′ (L) = 0 is X0 (x) = 1 and Xn (x) = cos(nπx/L). The most
convenient solution for Yn (y) is
 nπy   nπy 
Y0 (y) = 21 A0 + 21 B0 y, Yn (y) = An cosh + Bn sinh .
L L
From the boundary condition Y ′ (0) = 0, B0 = Bn = 0. Therefore,

X  nπy   nπx 
u(x, y) = 21 A0 + An cosh cos .
n=1
L L

From the boundary condition at y = z0 ,



X  nπz   nπx 
0
u(x, z0 ) = 21 A0 + An cosh cos .
n=1
L L
280 Advanced Engineering Mathematics with MATLAB

Consequently,
Z L  
2 2g 1 2 a a
A0 = g[z0 + cx + a sin(bx)] dx = Lz0 + 2 cL + − cos(bL) ,
L 0 L b b

and
 nπz  Z L  nπx 
0 2
cosh An = g[z0 + cx + a sin(bx)] cos dx
L L 0 L
 nπz  2gz0  nπx  L
0
cosh An = sin
L nπ L 0
 2   nπx  L
2gc L nπx  Lx
+ cos + sin
L n2 π 2 L nπ L 0
 L
2ag cos[(b − nπ/L)x] cos[(b + nπ/L)x]
− +
L 2(b − nπ/L) 2(b + nπ/L) 0
2gcL n
= 2 2 [(−1) − 1]
n π 
[cos(bL − nπ) − 1] cos(bL + nπ) − 1]
− ga +
bL − nπ bL + nπ
2gcL 2abgL
= 2 2 [(−1)n − 1] − 2 2 [(−1)n cos(bL) − 1].
n π b L − n2 π 2

15. Using the new dependent variable, the problem becomes

∂2v ∂2v
+ = 0, 0 < x < 1, 0 < y < L,
∂x2 ∂y 2

subject to the boundary conditions

v(x, 0) = v(x, L) = 0, 0 < x < 1,

and
vx (0, y) = 0, vx (1, y) = −1, 0 < y < L.
Separation of variables leads to

X cosh(nπx/L)  nπy 
v(x, y) = An sin .
n=1
sinh(nπ/L) L

Using the boundary condition vx (1, y) = −1, we obtain

X∞
nπ  nπy 
−1 = An sin , 0 < y < L.
n=1
L L
Worked Solutions 281

Therefore,
Z L  nπy   nπy  L
nπ 2 2 2
An = (−1) sin dy = cos = [(−1)n − 1] ,
L L 0 L nπ L 0 nπ

and
2L
An = [(−1)n − 1] .
n2 π 2
The final solution is

4γL X cosh[(2m − 1)πx/L)  nπy 
u(x, y) = L − y − 2 2
sin .
π m=1 (2m − 1) sinh[(2m − 1)π/L] L

16. Let u(r, z) = R(r)Z(z). Then


 
1 1 Z ′′ k2
′′
R + R′ =− =− 2
R r Z a

with R(a) = 0. The solution to this singular Sturm-Liouville problem is


Rn (r) = J0 (kn r/a) with J0 (kn ) = 0. The most convenient solution for Zn (z)
is    
kn z kn z
Zn (z) = An sinh + Bn cosh .
a a
Because Zn′ (z) must be an even function, Bn = 0. Therefore,

X    
kn z kn r
u(r, z) = An sinh J0 .
n=1
a a

Applying the boundary conditions uz (r, −L) = uz (r, L) = 1,

X∞    
kn kn L kn r
uz (r, −L) = uz (r, L) = 1 = An cosh J0 .
n=1
a a a

From Equation 6.5.31, Equation 6.5.35 and Equation 6.5.43,


  Z a  
kn An kn L 2 kn r 2
cosh = 2 2 rJ0 dr = .
a a a J1 (kn ) 0 a kn J1 (kn )

Thus, the final answer is

X∞
sinh(kn z/a) J0 (kn r/a)
u(r, z) = 2a .
k 2 cosh(kn L/a)J1 (kn )
n=1 n
282 Advanced Engineering Mathematics with MATLAB

17. Let u(r, z) = R(r)Z(z). Then


 
1 1 Z ′′
R′′ + R′ = − = −k 2
R r Z

with R′ (b) = 0. For the separation constant k = 0, R0 (r) = 1 and Z0 (z) =


A0 z. For k > 0, the solution in the radial direction is Rn (r) = J0 (kn r), where
kn is nth positive zero of J0′ (kb) = −J1 (kb) = 0. The corresponding solution
for Zn (z) is Zn (z) = An sinh(kn z) + Bn cosh(kn z). Because Zn′ (z) must be an
even function, Bn = 0. Therefore,

X
u(r, z) = A0 z + An sinh(kn z)J0 (kn r).
n=1

To find A0 and An , we take the z partial derivative of the solution or



X
uz (r, L) = uz (r, −L) = A0 + An kn cosh(kn L)J0 (kn r).
n=1

and apply the boundary conditions



∂u(r, −L) ∂u(r, L) A, 0 ≤ r < a,
= =
∂z ∂z 0, a < r < b.

From Equation 6.5.35, Equation 6.5.44, Equation 6.5.46, and Equation 6.5.47,
Z
2 a Aa2
A0 = 2 A r dr = 2 ,
b 0 b
and Z a
2A
kn cosh(kn L)An = rJ0 (kn r) dr
b2 J02 (kn b) 0
Z kn a
2A
= 2 2 2 ηJ0 (kn η) dη
kn b J0 (kn b) 0
2AaJ1 (kn a)
= 2 2 2 .
kn b J0 (kn b)
Thus, the final answer is

Aa2 z 2Aa X sinh(kn z) J1 (kn a) J0 (kn r)
u(r, z) = + .
b2 b2 n=1 kn2 cosh(kn L)J02 (kn b)

18. Let u(r, z) = R(r)Z(z). Then


 
1 ′′ 1 ′ Z ′′
R + R =− = −k 2 ,
R r Z
Worked Solutions 283

with R′ (b) = 0. The solution to this singular Sturm-Liouville problem is


R0 (r) = 1 and Rn (r) = J0 (kn r) with J0′ (kn b) = −J1 (kn b) = 0 or J1 (kn b) = 0.
The most convenient solution for Zn (z) that satisfies the boundary conditions
Z0 (L) = A and Zn (L) = 0 is Z0 (z) = A, and Zn (z) = An sinh[kn (L − z)].
Therefore,

X
u(r, z) = A + An sinh[kn (L − z)]J0 (kn r).
n=1

From the boundary condition at z = 0,



X 
B, 0 ≤ r < a,
uz (r, 0) = − kn An cosh(kn L)J0 (kn r) =
0, a < r < b.
n=1

From Equation 6.5.46, Equation 6.5.47, Equation 6.5.35 and Equation 6.5.44,
Z a
2B
kn An cosh(kn L) = − J0 (kn r) r dr
b J02 (kn b)
2
0
Z kn a
2B
=− J0 (ξ) ξ dξ
kn2 b2 J02 (kn b) 0
2aBJ1 (kn a)
=− .
kn b2 J02 (kn b)

or
2aBJ1 (kn a)
An = − .
kn2 b2 cosh(kn L)J02 (kn b)
Thus, the final answer is

2aB X J1 (kn a)J0 (kn r) sinh[kn (L − z)]
u(r, z) = A − .
b2 n=1 kn2 J02 (kn b) cosh(kn L)

19. Let u(r, z) = R(r)Z(z). Then


 
1 1 Z ′′ k2
R′′ + R′ =− =− 2
R r Z a

with R′ (a) = 0. The solution to this singular Sturm-Liouville problem is


R0 (r) = 1 and Rn (r) = J0 (kn r/a) with J0′ (kn ) = −J1 (kn ) = 0 or J1 (kn ) = 0.
The most convenient solution for Zn (z) that satisfies the boundary condition
Zn (h) = 0 is Z0 (z) = A0 (z −h), and Zn (z) = An sinh[kn (z −h)/a]. Therefore,

X  
 
kn (z − h) kn r
u(r, z) = A0 (z − h) + An sinh J0 .
n=1
a a
284 Advanced Engineering Mathematics with MATLAB

From the boundary condition at z = 0,

X∞    
kn An kn h kn r
uz (r, 0) = A0 + cosh J0 .
n=1
a a a

From Equation 6.5.46, Equation 6.5.47, Equation 6.5.35 and Equation 6.5.44,
Z r0
2 r2
A0 = 2 r dr = 02 ;
a 0 a

and
  Z r0  
kn An kn h 2 kn r 2r0 J1 (kn r0 /a)
cosh = 2 2 rJ0 dr = ,
a a a J0 (kn ) 0 a akn J02 (kn )
or
2r0 J1 (kn r0 /a)
An = .
kn2 cosh(kn h/a)J02 (kn )
Thus, the final answer is

X∞
(z − h)r02 sinh[kn (z − h)/a]J1 (kn r0 /a)J0 (kn r/a)
u(r, z) = + 2r0 .
a2 n=1
kn2 cosh(kn h/a)J02 (kn )

20. Let u(r, z) = R(r)Z(z). Then


 
1 1 Z ′′
R′′ + R′ = − = −k 2
R r Z

with R′ (1) = 0. The solution to this singular Sturm-Liouville problem is


R0 (r) = 1 and Rn (r) = J0 (kn r) with J0′ (kn ) = −J1 (kn ) = 0 or J1 (kn ) = 0.
The most convenient solution for Zn (z) that satisfies the boundary condition
Zn′ (0) = 0 is Z0 (z) = A0 and Zn (z) = An cosh(kn z). Therefore,

X
u(r, z) = A0 + An cosh(kn z)J0 (kn r).
n=1

From the boundary condition at z = d,



X
u(r, d) = A0 + An cosh(kn d)J0 (kn r).
n=1

From Equation 6.5.46, Equation 6.5.47, Equation 6.5.35 and Equation 6.5.44,
Z b Z 1
r
A0 = 2 dr − 2 r dr = 0,
a b − a2
2
0
Worked Solutions 285

and
Z b Z 1
2 J0 (kn r) 2
An cosh(kn d) = r dr − J0 (kn r) r dr
J02 (kn ) a b2 − a2 J02 (kn ) 0
2[bJ1 (kn b) − aJ1 (kn a)] 2J1 (kn )
= −
(b2 − a2 )kn J02 (kn ) kn J02 (kn )
2[bJ1 (kn b) − aJ1 (kn a)]
= ,
(b2 − a2 )kn J02 (kn )

because J1 (kn ) = 0. Thus, the final answer is


X∞
2 [bJ1 (kn b) − aJ1 (kn a)]J0 (kn r) cosh(kn z)
u(r, z) = .
b2 − a2 n=1 kn cosh(kn d)J02 (kn )

21. For case (a), we assume u(r, z) = R(r)Z(z). Then,


 
1 ′′ 1 ′ R Z ′′
R + R − 2 =− = k2 .
R r r Z

We have Z ′ (0) = Z(1) = 0. The corresponding Sturm-Liouville problem


yields

Zn (z) = sin[(2n − 1)π(z − 1)/2] and Rn (r) = I1 [(2n − 1)πr/2],

where n = 0, 1, 2, . . .. Therefore,

X I1 [(2n − 1)πr/2]
u(r, z) = An sin[(2n − 1)π(z − 1)/2].
n=1
I1 [(2n − 1)π/2]

Using the boundary condition u(1, z) = −1, then



X
−1 = An sin[(2n − 1)π(z − 1)/2], 0 < z < 1.
n=1

From this generalized Fourier series,


Z 1 Z 1
An = − sin[(2n − 1)π(z − 1)/2] dz sin2 [(2n − 1)π(z − 1)/2] dz
0 0
4
= .
(2n − 1)π

Therefore, the final answer for case (a) is



4 X I1 [(2n − 1)πr/2] sin[(2n − 1)π(z − 1)/2]
u(r, z) = .
π n=1 I1 [(2n − 1)π/2] 2n − 1
286 Advanced Engineering Mathematics with MATLAB

Turning to case (b), we again assume u(r, z) = R(r)Z(z). However, now


 
1 1 R Z ′′
′′
R + R′ − 2 =− = −k 2 .
R r r Z

However, the Sturm-Liouville problem now involves R(r) with limr→0 |R(r)| <
∞ and R(1) = 0. This gives Rn (r) = J1 (kn r) with n = 1, 2, 3, . . ., where kn
is the nth root of J1 (k) = 0. Therefore,

X cosh(kn z)
u(r, z) = An J1 (kn r).
n=1
cosh(kn )

Using the boundary condition u(r, 1) = r, then



X
r= An J1 (kn r), 0 < r < 1.
n=1

For this Fourier-Bessel series,


Z 1 Z kn
2 2 2 2
An = 2 r J1 (kn r) dr = 3 2 τ 2 J1 (τ ) dτ = − .
J0 (kn ) 0 kn J0 (kn ) 0 kn J0 (kn )

Therefore, the final answer for case (b) is

X∞
cosh(kn z) J1 (kn r)
u(r, z) = −2 .
n=1
cosh(kn ) kn J0 (kn )

22. Let u(r, z) = R(r)Z(z). Then


 
1 1 R Z ′′ k2
R′′ + R′ − 2 =− =− 2
R r r Z a

with R(a) = 0. The solution to this singular Sturm-Liouville problem is


Rn (r) = J1 (kn r/a) with J1 (kn ) = 0. The most convenient solution for Zn (z)
that satisfies the boundary condition Zn (0) = 0 is Zn (z) = An sinh(kn z/a).
Therefore,
X∞    
kn z kn r
u(r, z) = An sinh J1 .
n=1
a a

From the boundary condition at z = h,

X∞    
kn An kn h kn r
uz (r, h) = cosh J1 .
n=1
a a a
Worked Solutions 287

From Equation 6.5.31, Equation 6.5.35 and Equation 6.5.43,


  Z a  
kn An kn h 2 2 kn r 2aA
cosh = 2 2 Ar J1 dr = ,
a a a J2 (kn ) 0 a kn J2 (kn )
or
2a2 A
An = .
kn2 cosh(kn h/a)J2 (kn )
Thus, the final answer is

X∞
sinh(kn z/a)J1 (kn r/a)
u(r, z) = −2a2 A
k 2 cosh(kn h/a)J0 (kn )
n=1 n

because J2 (kn ) = −J0 (kn ) since J1 (kn ) = 0 in Equation 6.5.29.

23. Let u(r, z) = R(r)Z(z). Then


 
1 ′′ 1 ′ R Z ′′
R + R − 2 =− = k2
R r r Z

with Z(0) = Z(1) = 0. The solution to this Sturm-Liouville problem is


Zn (z) = sin(nπz). The solution for Rn (r) is Rn (r) = An I1 (nπr). Therefore,

X
u(r, z) = An I1 (nπr) sin(nπz).
n=1

From the boundary condition at r = a,



X
u(a, z) = z = An I1 (nπa) sin(nπz), 0 < z < 1.
n=1

For this half-range Fourier sine series,


Z 1   1
sin(nπz) z cos(nπz) 2(−1)n
An I1 (nπa) = 2 z sin(nπz) dz = 2 − =− .
0 n2 π 2 nπ 0 nπ

Thus, the final answer is



2 X (−1)n I1 (nπr) sin(nπz)
u(r, z) = − .
π n=1 n I1 (nπa)

24. Let u(r, z) = R(r)Z(z). Then


 
1 1 R Z ′′ k2
R′′ + R′ − 2 = − =− 2
R r r Z a
288 Advanced Engineering Mathematics with MATLAB

with R′ (a) = 0. The solution to this singular Sturm-Liouville problem is


Rn (r) = J1 (kn r/a) with J1′ (kn ) = 0. The most convenient solution for Zn (z)
that satisfies the boundary condition Zn (0) = 0 is Zn (z) = An sinh(kn z/a).
Therefore,
X∞    
kn z kn r
u(r, z) = An sinh J1 .
n=1
a a

From the boundary condition at z = h,

X∞    
kn An kn h kn r
uz (r, h) = r = cosh J1 .
n=1
a a a

From Equation 6.5.31, Equation 6.5.35 and Equation 6.5.44,


  Z a  
kn An kn h 2kn2 2 kn r 2akn J2 (kn )
cosh = 2 2 r J1 dr = 2 ,
a a a (kn − 1)J12 (kn ) 0 a (kn − 1)J12 (kn )

or
2a2
An =
kn (kn2 − 1) cosh(kn h/a)J1 (kn )
because J0 (kn ) + J2 (kn ) = 2J1 (kn )/kn and J0 (kn ) = J2 (kn ). Thus, the final
answer is
X∞
sinh(kn z/a)J1 (kn r/a)
u(r, z) = 2a2 .
k (k 2 − 1) cosh(kn h/a)J1 (kn )
n=1 n n

25. Let u(r, z) = R(r)Z(z). Then


 
1 1 R Z ′′
′′
R + R′ − 2 =− = −k 2 ,
R r r Z

with limr→0 |R(r)| < 0, and R′ (1) = −R(1). The solution to this singular
Sturm-Liouville problem is Rn (r) = J1 (kn r) with kn J1′ (kn ) = −J1 (kn ) or
kn J0 (kn ) = J1 (kn ). The most convenient solution for Zn (z) that satisfies
the boundary conditions at z = ±a is Zn (z) = An sinh(kn z). Therefore, a
superposition of the product solutions yields

X
u(r, z) = An sinh(kn z)J1 (kn r).
n=1

From the boundary condition at z = a,



X
u(r, a) = r = An kn cosh(kn a)J1 (kn r).
n=1
Worked Solutions 289

From Equation 6.5.31, Equation 6.5.35 and Equation 6.5.43,


Z 1
kn cosh(kn a)J12 (kn )An =2 r2 J1 (kn r) dr
0

or
Z kn
kn4 cosh(kn a)J12 (kn )An =2 η 2 J1 (η) dη
0
kn
= 2η 2 J2 (η) 0
= 2kn2 J2 (kn ) = 2kn J1 (kn ),

because J2 (kn ) = 2J1 (kn )/kn − J0 (kn ) and kn J0 (kn ) = J1 (kn ). Thus, the
final answer is
X∞
sinh(kn z)J1 (kn r)
u(r, z) = 2 3 cosh(k a)J (k )
.
k
n=1 n n 1 n

26. Substituting the Fourier-Bessel series into the partial differential equa-
tions, we find that Zn (z) is governed by the ordinary differential equation

Zn′′ (z) − (1 + kn2 )Zn (z) = 0, Z(0) = 1, Z(L) = 0.

The solution to this ordinary differential equation is


h p i.  p 
Zn (z) = sinh (L − z) 1 + kn2 sinh L 1 + kn2 .

From the boundary condition u(r, 0) = u0 ,


X
u0 = An J0 (kn r), 0 < r < 1.
n=1

From the theory of Fourier-Bessel series, we have


Z 1 Z kn
2kn2 u0 2u0
An = 2 rJ0 (kn r) dr = 2 τ J0 (τ ) dτ
(kn + h2 )J02 (kn ) 0 (kn + h2 )J02 (kn ) 0
2u0 kn J1 (kn ) 2kn u0 J1 (kn )
= 2 = 2 .
kn + h2 J02 (kn ) kn + h2 J02 (kn )

Therefore,
h p i
∞ sinh (L − z) 1 + k 2
X kn J1 (kn ) n
u(r, z) = 2u0 2 + h2 )J 2 (k )
 p  J0 (kn r),
n=1
(k n 0 n sinh L 1 + kn 2
290 Advanced Engineering Mathematics with MATLAB

or h p i

X J0 (kn r) sinh (L − z) 1 + kn2
u(r, z) = 2u0 h   ,
n=1
(kn2 + h2 )J0 (kn ) sinh Lp1 + k 2
n

where we used kn J1 (kn ) = hJ0 (kn ).

27. Assuming that u(r, z) = R(r)Z(z), we have that


 
1 d dR Z ′′
r =− = −k 2 ,
R dr dr Z

with the boundary conditions

lim |R(r)| < ∞, −DR′ (a) = KR(a), Z ′ (L) = 0.


r→0

Turning to the radial portion first, the solution is Rn (r) = J0 (µn r/a)
with
−µn J0′ (µn ) = µn J1 (µn ) = βJ0 (µn ),
where β = aK/D and n = 1, 2, 3, . . .. On the other hand, the solution in the
z-direction is
cosh[µn (L − z)/a]
Zn (z) = An
cosh(µn L/a)
because Zn′ (L) = 0. Therefore, the general solution which satisfies most of
the boundary conditions is

X cosh[µn (L − z)/a]
u(r, z) = An J0 (µn r/a) .
n=1
cosh(µn L/a)

Finally, using the boundary condition at z = 0, we have that



X
u0 = An J0 (µn r/a).
n=1

Therefore, from Equation 6.5.50,


Z a
2u0 µ2n
An = J0 (µn r/a) r dr
(a2 µ2n + a2 β 2 )J02 (µn ) 0
Z a
2u0 µ2n
= J0 (µn r/a) r dr
a2 [µ2n J02 (µn ) + β 2 J02 (µ)] 0
Z 1
2u0
= J0 (µn ξ) ξ dξ
[J02 (µn ) + J12 (µn )] 0
2u0 J1 (µn )
= ,
µn [J0 (µn ) + J12 (µn )]
2
Worked Solutions 291

because β 2 J02 (µn ) = µ2n J12 (µn ). Consequently, the final solution is

X J1 (µn )J0 (µn r/a) cosh[µn (L − z)/a]
u(r, z) = 2u0 ,
µ [J 2 (µn ) + J12 (µn )] cosh(µn L/a)
n=1 n 0

where µn J1 (µn ) = βJ0 (µn ).

28. If u1 (r, z) = R1 (r)Z1 (z), then


 
1 d dR1 Z”
− r − a2 = 1 = −k 2 ,
r dr dr Z1

with the boundary conditions

lim |R1 (r)| < ∞, Z1 (0) = Z1 (1) = 0.


r→0

Turning to the z-dependence first, Z1n = sin(kn z) with kn = nπ. On the other
hand, the radial part is given by R1n = I0 (γn r)/I0 (γn ) where γn2 = a2 + n2 π 2 .
Therefore, the general solution is

X I0 (γn r)
u1 (r, z) = An sin(nπz).
n=1
I0 (γn )

Using the boundary condition at r = 1, we have that



X
1= An sin(nπz),
n=1

a Fourier sine series. The Fourier coefficient An is given by


Z 1 1
2 2
An = 2 (1) sin(nπx) dx = − cos(nπz) = [1 − (−1)n ] .
0 nπ 0 nπ

Consequently, the solution for the first part is



4 X sin[(2m + 1)πz] I0 (γm r)
u1 (r, z) = ,
π m=0 2m + 1 I0 (γm )

2
where γm = a2 + (2m + 1)2 π 2 .
For the second part, if u2 (r, z) = R2 (r)Z2 (z), then
 
1 d dR2 Z”
r = − 2 + a2 = −k 2 ,
r dr dr Z2
292 Advanced Engineering Mathematics with MATLAB

with the boundary conditions

lim |R2 (r)| < ∞, R2 (1) = Z2 (1) = 0.


r→0

Turning to the r-dependence first, R2n (r) = J0 (kn r) where kn is the nth root
of J0 (k) = 0. On the other hand, the z-dependence is given by

sinh[γn (1 − z)]
Z2n (z) = An ,
sinh(γn )

where γn2 = a2 + kn2 now. Therefore, the general solution is



X sinh[γn (1 − z)]
u2 (r, z) = An J0 (kn r).
n=1
sinh(γn )

Using the boundary condition at z = 0, we have that



X
1 = u2 (r, 0) = An J0 (kn r).
n=1

a Fourier-Bessel series. The Fourier coefficient An is given by


Z 1
2 2kn J1 (kn ) 2
An = (1)rJ0 (kn r) dr = = .
J12 (kn ) 0 kn2 J12 (kn ) kn J1 (kn )

Consequently, the solution for the second part is

X∞
J0 (kn r) sinh[γn (1 − z)]
u2 (r, z) = 2 ,
k J (k )
m=0 n 1 n
sinh(γn )

where kn is the nth root of J0 (k) = 0.


For the third part, if u3 (r, z) = R3 (r)Z3 (z), then
 
1 d dR3 Z”
r = − 3 + a2 = −k 2 ,
r dr dr Z3

with the boundary conditions

lim |R3 (r)| < ∞, R3 (1) = Z3 (0) = 0.


r→0

Turning to the r-dependence first, R3n (r) = J0 (kn r) where kn is the nth root
of J0 (k) = 0. On the other hand, the z-dependence is given by

sinh(γn z)
Z3n (z) = An ,
sinh(γn )
Worked Solutions 293

where γn2 = a2 + kn2 now. Therefore, the general solution is



X sinh(γn z)
u3 (r, z) = An J0 (kn r).
n=1
sinh(γn )

Using the boundary condition at z = 1, we have that



X
1 = u3 (r, 1) = An J0 (kn r).
n=1

a Fourier-Bessel series. The Fourier coefficient An is given by


Z 1
2 2kn J1 (kn ) 2
An = 2 (1)rJ0 (kn r) dr = 2 2 = .
J1 (kn ) 0 kn J1 (kn ) kn J1 (kn )
Consequently, the solution for the third part is
X∞
J0 (kn r) sinh(γn z)
u3 (r, z) = 2 ,
k J (k ) sinh(γn )
m=0 n 1 n

where kn is the nth root of J0 (k) = 0 and γn2 = a2 + kn2 .


The final answer is then

4 X sin[(2m + 1)πz] I0 (γm r)
u(r, z) =
π m=0 2m + 1 I0 (γm )
X∞
J0 (kn r) sinh[βn (1 − z)]
+2
k J (k )
m=0 n 1 n
sinh(βn )
X∞
J0 (kn r) sinh(βn z)
+2 ,
k J (k ) sinh(βn )
m=0 n 1 n

where kn is the nth root of J0 (k) = 0, βn2 = a2 +kn2 , and γm


2
= a2 +(2m+1)2 π 2 .

29. If you substitute the given solutions into differential equation and bound-
ary conditions, they satisfy these conditions provided
   
kn d kn d
Bn = Cn sinh and An = −Cn exp − .
2a 2a

From the continuity equation u(r, d− /2) = u(r, d+ /2), we now have

X      
kn d kn d kn r
−V − Cn exp − cosh J0
n=1
2a 2a a
X∞      
kn d kn d kn r
= Cn exp − sinh J0 ,
n=1
2a 2a a
294 Advanced Engineering Mathematics with MATLAB

or  

X kn r
−V = Cn J0 .
n=1
a
Computing the cofficients Cn ,
Z a  
2V kn r
Cn = − rJ0 dr
a J12 (kn )
2
0 a
Z kn
2V 2V
=− τ J0 (τ ) dτ = − .
kn2 J12 (kn ) 0 kn J1 (kn )

Subsituting for An , Bn and Cn , the final answer is


( ∞    )
X cosh(kn z/a) kn d kn r
u(r, z) = −V 1 − 2 exp − J0
n=1
kn J1 (kn ) 2a a

if |z| < d/2, and

X∞    
sinh[kn d/(2a)] kn |z| kn r
u(r, z) = −2V exp − J0
n=1
kn J1 (kn ) a a

if |z| > d/2.

30. Let u(r, z) = R(r)Z(z). Then


 
1 1 Z ′′
R′′ + R′ = − = −k 2 ,
R r Z

with R′ (b) = 0. If k > 0, the solution to this singular Sturm-Liouville problem


is Rn (r) = J0 (kn r) with kn J0′ (kn ) = 0 or kn J1 (kn ) = 0. The most convenient
solution for Zn (z) that satisfies the boundary conditions at infinity is Zn (z) =
An e−kn z . If k = 0, the eigenfunction is R0 (r) = 1 and Zn (z) = A0 . Therefore,
by the principle of superpositions,

X
u(r, z) = A0 + An J0 (kn r)e−kn z .
n=1

From the boundary condition at z = 0,



X 
A, 0 ≤ r < a,
u(r, 0) = A0 + An J0 (kn r) =
0, a < r < b.
n=1

From Equation 6.5.35, Equation 6.5.44, Equation 6.5.46 and Equation 6.5.47,
Z
2 a a2 A
A0 = 2 A r dr = 2 ,
b 0 b
Worked Solutions 295

and Ra
A 0
rJ0 (kn r) dr 2aAJ1 (kn a)
An = = .
b J02 (kn b)/2
2 b2 kn J02 (kn b)
Thus, the final answer is

a2 A 2aA X J1 (kn a)J0 (kn r) −kn z
u(r, z) = + e .
b2 b2 n=1 kn J02 (kn b)

31. Let u(r, z) = R(r)Z(z). Then


 
1 1 Z ′′ − Z ′
R′′ + R′ = − = −k 2 ,
R r Z

with R′ (1) = −BR(1). The solution to this singular Sturm-Liouville problem


is Rn (r) = J0 (kn r) with kn J0′ (kn ) = −BJ0 (kn ) or kn J1 (kn ) = BJ0 (kn ). The
most convenient solution for √ Zn (z) that satisfies the boundary conditions at
z(1− 1+4kn 2 )/2
infinity is Zn (z) = An e . Therefore,

X √ 2 )/2
u(r, z) = An ez(1− 1+4kn
J0 (kn r).
n=1

From the boundary condition at z = 0,



X
u(r, 0) = 1 = An J0 (kn r).
n=1

From Equation 6.5.31, Equation 6.5.35 and Equation 6.5.45,


R1
2kn2 0 rJ0 (kn r) dr 2kn J1 (kn ) 2B
An = = 2 = 2 ,
(kn2 + B 2 )J02 (kn ) (kn + B 2 )J02 (kn ) (kn + B 2 )J0 (kn )

because kn J1 (kn ) = BJ0 (kn ). Thus, the final answer is


∞ p
X exp[z(1 − 1 + 4kn2 )/2]J0 (kn r)
u(r, z) = 2B .
n=1
(kn2 + B 2 )J0 (kn )

32. Let u(r, z) = R(r)Z(z). Then


 
1 1 Z ′′ − Z ′ /H k2
R′′ + R′ =− =− 2,
R r Z b
296 Advanced Engineering Mathematics with MATLAB

with R′ (b) = −hR(b). The solution to this singular Sturm-Liouville problem


is Rn (r) = J0 (kn r/b) with kn J0′ (kn )/b+hJ0 (kn ) = 0, or kn J1 (kn ) = hbJ0 (kn ).
The most convenient solution for√Zn (z) that satisfies the boundary condition
2 2
at infinity is Zn (z) = An eκz/b e−z kn +κ /b , where κ = b/(2H). Therefore, the
superposition of the product solutions yields

X √ 2 +κ2 /b
u(r, z) = eκz/b An J0 (kn r/b)e−z kn
.
n=1

From the boundary condition at z = 0,


∞ 
X  
p Qb, 0 ≤ r < a,
κ+ kn2 + κ2 An J0 (kn r/b) =
0, a < r < b.
n=1

From Equation 6.5.31, Equation 6.5.35 and Equation 6.5.45,


  Ra
p 2k 2 QbJ0 (kn r) r dr 2Qakn J1 (kn a/b)
κ + kn2 + κ2 An = 2n 20 = 2
b (kn + h2 b2 )J02 (kn ) (kn + h2 b2 )J02 (kn )
2QaJ1 (kn a/b)
= ,
kn [J02 (kn ) + J12 (kn )]

because kn J1 (kn ) = hbJ0 (kn ). Thus, the final answer is



√ 2 2
X J1 (kn a/b)J0 (kn r/b) e−z kn +κ /b
κz/b
u(r, z) = 2Qae p .
k [J 2 (kn ) + J12 (kn )] κ + kn2 + κ2
n=1 n 0

33. Let u(r, z) = R(r)Z(z). Then separation of variables yields

R′′ R′ Z ′′
+ =− = −k 2 .
R rR Z
If k = 0, Z0 (z) = u∞ = constant and R0 (r) = 1. If k > 0, then Zn (z) =
−A(k)e−kz and Rn (r) = J0 (kr). From the principle of linear superposition,
Z ∞
u(r, z) = u∞ − A(k)e−kz J0 (kr) dk,
0

since k can take on any any value from 0 to ∞. Now


Z ∞
lim |u(r, z)| = lim u∞ − A(k)e−kz J0 (kr) dk < ∞,
r→0 r→0 0

because the integrand oscillates and decays as k increases. Similarly,


Z ∞
lim |u(r, z)| = lim u∞ − A(k)e−kz J0 (kr) dk < ∞
r→∞ r→∞ 0
Worked Solutions 297

for the same reason. Finally, as z → ∞, the integral vanishes and

lim u(r, z) = u∞ .
z→∞

Therefore, our solution satisfies the differential equation and the boundary
conditions as r → 0, r → ∞, and z → ∞.
Because Z ∞
uz (r, z) = k A(k)e−kz J0 (kr) dk,
0
the boundary condition for the region a < r < ∞ yields
Z ∞
uz (r, 0) = k A(k)J0 (kr) dk = 0.
0

Since Z ∞
sin(ka)J0 (kr) dk = 0 if a < r < ∞,
0

a direct comparsion with the previous equation shows that kA(k) = C sin(ka).
Finally, because Z ∞
dk π
sin(ka)J0 (kr) = ,
0 k 2
Z ∞
dk Cπ
u(r, 0) = u∞ − C sin(ka)J0 (kr) = u∞ − = u∞ − ∆u.
0 k 2
Therefore, C = 2∆u/π. Substitution of C into the equation for u(r, z) com-
pletes the demonstration.

34. Let u(x, y) = X(x)Y (y). Then separation of variables yields

X ′′ Y ′′
=− = −k 2 .
X Y
The only nontrival solutions exist if k 2 > 0. If k > 0, then Y (y) = A(k)e−ky
and X(x) = cos(kx). The first solution satisfies the solution as y → ∞
and then second one satisfies the symmetry condition given by the boundary
condition along y = 0. From the principle of linear superposition,
Z ∞
u(x, y) = A(k)e−ky cos(kx) dk,
0

since k can take on any any value from 0 to ∞. Direct substitution of this
solution into boundary condition (1) leads to the dual integral equations given
in Step 2.
Substituting A(k) = −πJ1 (k)/(2k) into the dual integral equations yields
Z
π ∞ π
− cos(kx)J1 (k) dk = − , 0 ≤ |x| < 1,
2 0 2
298 Advanced Engineering Mathematics with MATLAB

and Z ∞
J1 (k)
cos(kx) dk = 0, 1 < |x| < ∞.
0 k
Integral tables confirm the truth of both of these equations. Substituting
√ A(k)
into the solution u(x, y) gives the final result. The result u(x, 0) = − 1 − x2
if |x| < 1 follows by setting y = 0 in the solution and using integral tables.

35. Because

X  r n
u(r, θ) = An Pn [cos(θ)],
n=0
a

X
u(a, µ) = An Pn (µ) = 100(µ − µ5 ).
n=0

Therefore, we only need P1 (µ), P3 (µ) and P5 (µ) and

A1 P1 (µ) + A3 P3 (µ) + A5 P5 (µ) = 100(µ − µ5 )


A1 µ + 21 A3 (5µ3 − 3µ) + 81 A5 (63µ5 − 70µ3 + 15µ) = 100(µ − µ5 ).

Setting the coefficients of equal powers of µ,

A1 − 23 A3 + 15
8 A5 = 100, 52 A3 − 70
8 A5 =0 and 63
8 A5 = −100.

Solving for A1 , A3 , and A5 , we find that A1 = 400/7, A3 = −400/9 and


A5 = −800/63. The final solution is
 
r 1  r 3 2  r 5
u(r, θ) = 400 P1 [cos(θ)] − P3 [cos(θ)] − P5 [cos(θ)] .
7a 9 a 63 a

36. Because

X  r n
u(r, θ) = An Pn [cos(θ)],
n=0
a

X 
100, 0 < µ < 1,
u(a, µ) = An Pn (µ) =
0, −1 < µ < 0.
n=0

Therefore, Z 1
1
A0 = 100 P0 (µ) dµ = 50,
2 0

and Z 1
2n + 1
An = 100 Pn (µ) dµ
2 0
Z 1
= 50(2n + 1) Pn (µ) dµ = 50[Pn−1 (0) − Pn+1 (0)]
0
Worked Solutions 299

for n ≥ 1. The final solution is



X  r n
u(r, θ) = 50 + 50 [Pn−1 (0) − Pn+1 (0)] Pn [cos(θ)]
n=1
a
X∞  r 2m−1
= 50 + 50 [P2m−2 (0) − P2m (0)] P2m−1 [cos(θ)].
m=1
a

37. Because

X  r n
u(r, θ) = An Pn [cos(θ)],
n=0
a

X 
T0 , cos(α) < µ < 1,
u(a, µ) = An Pn (µ) =
0, −1 < µ < cos(α).
n=0

Therefore,
Z 1
T0 [1 − cos(α)]T0
A0 = T0 Pn (µ) dµ = ,
2 cos(α) 2
and
Z 1
2n + 1
An = T0 Pn (µ) dµ = 12 T0 {Pn−1 [cos(α)] − Pn+1 [cos(α)]}
2 cos(α)

for n ≥ 1. The final solution is



X  r n
u(r, θ) = 12 T0 {Pn−1 [cos(α)] − Pn+1 [cos(α)]} Pn [cos(θ)].
n=0
a

38. Z π
T0 1 − r2
u(r, ϕ) = 2


−π 1 + r − 2r cos(θ − ϕ)
 Z π
T0 1 − r 2 dη
= 2 2
2π 1 + r −π 1 − 2r cos(η)/(1 + r )
  Z 2π
T0 1 − r 2 dτ
= 2
2π 1 + r 0 1 + 2r cos(τ )/(1 + r2 )
 
1 − r2 1
= T0 p = T0
1 + r2 1 − 4r /(1 + r2 )2
2

Section 9.4
300 Advanced Engineering Mathematics with MATLAB

1. When the analysis is redone with the new Sturm-Liouville problem, the
solution to Poisson’s equation is
∞ X
X ∞
4anm
u(x, y) = − 2 π 2 /a2 + (2m − 1)2 π 2 /b2
n=1 m=1
(2n − 1)
   
(2n − 1)πx (2m − 1)πy
× cos cos ,
2a 2b
where
Z bZ a     
4 R (2n − 1)πx (2m − 1)πy
anm = − cos cos dx dy
ab 0 0 T 2a 2b
   a
4R 2 (2n − 1)πx
=− sin
T (2n − 1)π 2a 0
   b
2 (2m − 1)πy
× sin
(2m − 1)π 2b 0
16 R (−1)n+1 (−1)m+1
=− .
π 2 T (2n − 1)(2m − 1)
Thus, the final answer is
∞ ∞
64 R X X (−1)n+1 (−1)m+1
u(x, y) = 4
π T n=1 m=1 (2n − 1)(2m − 1)
cos[(2n − 1)πx/2a] cos[(2m − 1)πy/b]
× .
(2n − 1)(2m − 1)[(2n − 1)2 /a2 + (2m − 1)2 /b2 ]

2. Separation of variables leads to


 
1 d dR Z ′′
r + = λ.
rR dr dr Z
The eigenfunctions that satisfy the boundary conditions are

Rn (r) = J0 (kn r/a),

with n = 1, 2, 3, . . ., and
  
1
Zm (z) = cos m + πz/b ,
2
with m = 0, 1, 2, . . . Thus, the product solution unm (r, z) follows by multiply-
ing Rn (r) and Zm (z) together. Let

X  r
f (r, z) = An (z)J0 kn ,
n=1
a
Worked Solutions 301

then Z a  r
2
An (z) = 2 2 f (r, z)J0 kn r dr.
a J1 (kn ) 0 a
Now, we also have that

"  #
X m + 21 πz
An (z) = anm cos ,
m=0
b

where Z "  #
1 b
m + 12 πz
anm = An (z) cos dz.
b −b b

Substitution of An (z) into the first summation leads to


"  #
∞ X
X ∞  r m + 21 πz
f (r, z) = anm J0 kn cos
n=1 m=0
a b

with
Z Z "  #
2 b a  r m + 21 πz
anm = 2 2 f (r, z)J0 kn cos r dr dz.
a bJ1 (kn ) −b 0 a b

Finally, because
  2
λnm = −(kn /a)2 − m+ 1
2 π/b ,
and   
λnm unm (r, z) = anm J0 (kn r/a) cos m + 12 πz/b ,
we can find u(r, z) by summing unm (r, z) over all of the n’s and m’s.

Section 9.5

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Test
% of the Successive Over-Relaxation
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear
error = 1.e-3; % allowable error
% M = number of x grid points
dx = 0.05; M = 1/dx + 1; x = 0:dx:1;
% N = number of y grid points
dy = 0.05; N = 1/dy + 1; y = 0:dy:1;
302 Advanced Engineering Mathematics with MATLAB

diff = zeros(M,N); R = zeros(M,N);

%*************************************************************
%
% find the "answer" using the Gauss-Seidel method
%
%*************************************************************

% create initial guess for the Gauss-Seidel solution


answ = zeros(M,N);
% introduce boundary conditions
for m = 1:M; answ(m,1) = 0; answ(m,N) = 1 + x(m); end
for n = 1:N; answ(1,n) = y(n); answ(M,n) = 2*y(n); end

maxdiff = 1;

while (maxdiff > 1.e-6)

maxdiff = 0; saveit = answ;


for n = 2:N-1; for m = 2:M-1;
answ(m,n) = (answ(m+1,n) + answ(m-1,n)
+ answ(m,n+1) + answ(m,n-1)) / 4;
diff(m,n) = abs(answ(m,n) - saveit(m,n));
if (diff(n,m) > maxdiff) maxdiff = diff(n,m); end
end; end

end

%*************************************************************
%
% find the number of iteration needed by successive
% over-relaxation (SOR) to yield an |absolute error| < error
%
%*************************************************************

for iomega = 1:19

omega(iomega) = 1 + 0.05 * iomega; icount(iomega) = 0

% set up initial guess and initialize values


icount(iomega) = 0; maxdiff = 1; u = zeros(M,N);
% introduce boundary conditions
for m = 1:M; u(m,1) = 0; u(m,N) = 1 + x(m); end
for n = 1:N; u(1,n) = y(n); u(M,n) = 2*y(n); end
Worked Solutions 303

while (maxdiff > error)

icount(iomega) = icount(iomega) + 1; maxdiff = 0;


for n = 2:N-1; for m = 2:M-1;
R(m,n) = (u(m+1,n)+u(m-1,n)+u(m,n+1)+u(m,n-1)) / 4;
u(m,n) = omega(iomega) * R(m,n) + (1-omega(iomega))*u(m,n);
diff(m,n) = abs(u(m,n) - answ(m,n));
if (diff(n,m) > maxdiff) maxdiff = diff(n,m); end

end; end

end

end

% display results

plot(omega,icount); xlabel(’\omega’,’Fontsize’,20);
ylabel(’ITERATIIONS’,’Fontsize’,20)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 9.6

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Finite Element Solution
% of Laplace’s Equation
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function fem 50 ( )

% FEM 50 applies the finite element method to Laplace’s


% equation.
%
% Discussion:
%
% FEM 50 is a set of MATLAB routines to apply the finite
% element method to solving Laplace’s equation in an arbitrary
% region, using about 50 lines of MATLAB code.
%
% FEM 50 is partly a demonstration, to show how little it
% takes to implement the finite element method (at least using
% every possible MATLAB shortcut.) The user supplies datafiles
% that specify the geometry of the region and its arrangement
304 Advanced Engineering Mathematics with MATLAB

% into triangular and quadrilateral elements, and the location


% and type of the boundary conditions, which can be any mixture
% of Neumann and Dirichlet.
%
% The unknown state variable U(x,y) is assumed to satisfy
% Laplace’s equation:
% -Uxx(x,y) - Uyy(x,y) = F(x,y) in Omega
% with Dirichlet boundary conditions
% U(x,y) = U D(x,y) on Gamma D
% and Neumann boundary conditions on the outward normal
% derivative: Un(x,y) = G(x,y) on Gamma N
% If Gamma designates the boundary of the region Omega,
% then we presume that
% Gamma = Gamma D + Gamma N
% but the user is free to determine which boundary conditions
% to apply. Note, however, that the problem will generally be
% singular unless at least one Dirichlet boundary condition is
% specified.
%
% The code uses piecewise linear basis functions for triangular
% elements, and piecewise isoparametric bilinear basis functions
% for quadrilateral elements.
%
% The user is required to supply a number of data files and
% MATLAB functions that specify the location of nodes, the
% grouping of nodes into elements, the location and value of
% boundary conditions, and the right hand side function in
% Laplace’s equation. Note that the fact that the geometry is
% completely up to the user means that just about any two
% dimensional region can be handled, with arbitrary shape,
% including holes and islands.
%
% Author:
% Jochen Alberty, Carsten Carstensen, Stefan Funken.
%
% Reference:
%
% Jochen Alberty, Carsten Carstensen, Stefan Funken,
% Remarks Around 50 Lines of MATLAB:
% Short Finite Element Implementation,
% Numerical Algorithms,
% Volume 20, pages 117-137, 1999.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Worked Solutions 305

clear

% Read the nodal coordinate data file.

load coordinates.dat;

% Read the triangular element data file.

load elements3.dat;

% Read the quadrilateral element data file.

load elements4.dat;

% Read the Neumann boundary condition data file.


% I THINK the purpose of the EVAL command is to create
% an empty NEUMANN array if no Neumann file is found.

eval ( ’load neumann.dat;’, ’neumann=[];’ );

% Read the Dirichlet boundary condition data file.

load dirichlet.dat;

A = sparse ( size(coordinates,1), size(coordinates,1) );


b = sparse ( size(coordinates,1), 1 );

% Assembly.

for j = 1 : size(elements3,1)
A(elements3(j,:),elements3(j,:)) ...
= A(elements3(j,:),elements3(j,:)) ...
+ stima3(coordinates(elements3(j,:),:));
end

for j = 1 : size(elements4,1)
A(elements4(j,:),elements4(j,:)) ...
= A(elements4(j,:),elements4(j,:)) ...
+ stima4(coordinates(elements4(j,:),:));
end

% Volume Forces.

for j = 1 : size(elements3,1)
b(elements3(j,:)) = b(elements3(j,:)) ...
306 Advanced Engineering Mathematics with MATLAB

+ det( [1,1,1; coordinates(elements3(j,:),:)’] ) * ...


f(sum(coordinates(elements3(j,:),:))/3)/6;
end

for j = 1 : size(elements4,1)
b(elements4(j,:)) = b(elements4(j,:)) ...
+ det([1,1,1; coordinates(elements4(j,1:3),:)’] ) * ...
f(sum(coordinates(elements4(j,:),:))/4)/4;
end

% Neumann conditions.

if ( isempty(neumann) )
for j = 1 : size(neumann,1)
b(neumann(j,:)) = b(neumann(j,:)) ...
+ norm(coordinates(neumann(j,1),:) ...
- coordinates(neumann(j,2),:)) * ...
g(sum(coordinates(neumann(j,:),:))/2)/2;
end
end

% Determine which nodes are associated with Dirichlet


% conditions. Assign the corresponding entries of U, and
% adjust the right hand side.

u = sparse ( size(coordinates,1), 1 );
BoundNodes = unique ( dirichlet );
u(BoundNodes) = u d ( coordinates(BoundNodes,:) );
b = b - A * u;

% Compute the solution by solving A * U = B for the


% remaining unknown values of U.

FreeNodes = setdiff ( 1:size(coordinates,1), BoundNodes );

u(FreeNodes) = A(FreeNodes,FreeNodes) b(FreeNodes);

% Graphic representation.

show ( elements3, elements4, coordinates, full ( u ) );

return; end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Worked Solutions 307

%%%%%%%%%%% dirichlet.dat

1 1 2
2 2 3
3 3 4
4 4 5
5 5 6
6 6 7
7 7 8
8 8 9
9 9 10
10 10 11
11 11 12
12 12 13
13 13 14
14 14 15
15 15 16
16 16 17
17 17 18
18 18 19
19 19 20
20 20 21
21 21 22
22 22 23
23 23 24
24 24 25
25 25 26
26 26 27
27 27 28
28 28 29
29 29 30
30 30 31
31 31 32
32 32 33
33 33 34
34 34 35
35 35 36
36 36 37
37 37 38
38 38 39
39 39 40
40 40 41
41 41 42
42 42 43
43 43 44
308 Advanced Engineering Mathematics with MATLAB

44 44 45
45 45 46
46 46 47
47 47 48
48 48 49
49 49 50
50 50 51
51 51 52
52 52 53
53 53 54
54 54 55
55 55 56
56 56 57
57 57 58
58 58 59
59 59 1

%%%%%%%%%%% elements3.dat

12 13 88
14 97 96
14 15 97
16 107 106
16 17 107
18 118 117
18 19 118

%%%%%%%%%%% elements4.dat

1 2 60 59
2 3 61 60
3 4 62 61
4 5 63 62
5 6 64 63
6 7 65 64
7 8 66 65
8 9 10 66
59 60 67 58
60 61 68 67
61 62 69 68
62 63 70 69
63 64 71 70
64 65 72 71
65 66 73 72
66 10 11 73
Worked Solutions 309

58 67 74 57
67 68 75 74
68 69 76 75
69 70 77 76
70 71 78 77
71 72 79 78
72 73 80 79
73 11 12 80
57 74 81 56
74 75 82 81
75 76 83 82
76 77 84 83
77 78 85 84
78 79 86 85
79 80 87 86
80 12 88 87
56 81 89 55
81 82 90 89
82 83 91 90
83 84 92 91
84 85 93 92
85 86 94 93
86 87 95 94
87 88 96 95
88 13 14 96
55 89 98 54
89 90 99 98
90 91 100 99
91 92 101 100
92 93 102 101
93 94 103 102
94 95 104 103
95 96 105 104
96 97 106 105
97 15 16 106
54 98 108 53
98 99 109 108
99 100 110 109
100 101 111 110
101 102 112 111
102 103 113 112
103 104 114 113
104 105 115 114
105 106 116 115
106 107 117 116
310 Advanced Engineering Mathematics with MATLAB

107 17 18 117
53 108 119 52
108 109 120 119
109 110 121 120
110 111 122 121
111 112 123 122
112 113 124 123
113 114 125 124
114 115 126 125
115 116 127 126
116 117 128 127
117 118 129 128
118 19 130 129
19 20 131 130
20 21 132 131
21 22 23 132
52 119 133 51
119 120 134 133
120 121 135 134
121 122 136 135
122 123 137 136
123 124 138 137
124 125 139 138
125 126 140 139
126 127 141 140
127 128 142 141
128 129 143 142
129 130 144 143
130 131 145 144
131 132 146 145
132 23 24 146
51 133 147 50
133 134 148 147
134 135 149 148
135 136 150 149
136 137 151 150
137 138 152 151
138 139 153 152
139 140 154 153
140 141 155 154
141 142 156 155
142 143 157 156
143 144 158 157
144 145 159 158
145 146 160 159
Worked Solutions 311

146 24 25 160
50 147 161 49
147 148 162 161
148 149 163 162
149 150 164 163
150 151 165 164
151 152 166 165
152 153 167 166
153 154 168 167
154 155 169 168
155 156 170 169
156 157 171 170
157 158 172 171
158 159 173 172
159 160 174 173
160 25 26 174
49 161 175 48
161 162 176 175
162 163 177 176
163 164 178 177
164 165 179 178
165 166 180 179
166 167 181 180
167 168 182 181
168 169 183 182
169 170 184 183
170 171 185 184
171 172 186 185
172 173 187 186
173 174 188 187
174 26 27 188
48 175 189 47
175 176 190 189
176 177 191 190
177 178 192 191
178 179 193 192
179 180 194 193
180 181 195 194
181 182 196 195
182 183 197 196
183 184 198 197
184 185 199 198
185 186 200 199
186 187 201 200
187 188 202 201
312 Advanced Engineering Mathematics with MATLAB

188 27 28 202
47 189 203 46
189 190 204 203
190 191 205 204
191 192 206 205
192 193 207 206
193 194 208 207
194 195 209 208
195 196 210 209
196 197 211 210
197 198 212 211
198 199 213 212
199 200 214 213
200 201 215 214
201 202 216 215
202 28 29 216
46 203 44 45
203 204 43 44
204 205 42 43
205 206 41 42
206 207 40 41
207 208 39 40
208 209 38 39
209 210 37 38
210 211 36 37
211 212 35 36
212 213 34 35
213 214 33 34
214 215 32 33
215 216 31 32
216 29 30 31

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 10.1

1.
5i 5i 2−i 5 + 10i
= × = = 1 + 2i
2+i 2+i 2−i 4+1
2.
5 + 5i 20 5 + 5i 3 + 4i 20 4 − 3i
+ = × + ×
3 − 4i 4 + 3i 3 − 4i 3 + 4i 4 + 3i 4 − 3i
−1 + 7i 16 − 12i
= + =3−i
5 5
Worked Solutions 313

3.
1 + 2i 2 − i 1 + 2i 3 + 4i 2 − i −5i −1 + 2i 1 + 2i 2
+ = × + × = − =−
3 − 4i 5i 3 − 4i 3 + 4i 5i −5i 5 5 5

4.
(1 − i)4 = (1 − i)2 (1 − i)2 = (−2i)2 = −4
5. √ √ √ √ √
i(1 − i 3 )( 3 + i) = i( 3 − 3i + i + 3) = 2 + 2i 3
6. p
r= 02 + (−1)2 = 1
θ = tan−1 (−1/0) = π/2 or 3π/2
Because −i lies below the real axis, θ = 3π/2 and z = e3πi/2 .

7. p
r= 42 + 02 = 4 and θ = tan−1 (0/ − 4) = 0 or π
Because −4 lies in the left side of the complex plane, θ = π and z = 4eπi .

8. √
r= 4 + 12 = 4
√ √
θ = tan−1 (2 3/2) = tan−1 ( 3) = π/3 or 4π/3

Because 2 + 2 3i lies in the first quadrant, z = 4eπi/3 .

9. √ √
r= 25 + 25 = 5 2
θ = tan−1 [5/(−5)] = tan−1 (−1) = 3π/4 or 7π/4

Because −5 + 5i lies in the second quadrant, z = 5 2e3πi/4 .

10. √ √
r= 4+4=2 2
θ = tan−1 (−2/2) = tan−1 (−1) = 3π/4 or 7π/4

Because 2 − 2i lies in the fourth quadrant, z = 2 2e7πi/4 .

11. √
r= 1+3=2
√ √
θ = tan−1 [ 3/(−1)] = tan−1 (− 3) = 2π/3 or 5π/3

Because −1 + 3i lies in the second quadrant, z = 2e2πi/3 .
314 Advanced Engineering Mathematics with MATLAB

12.

e(α+β)i = eαi eβi


cos(α + β) + i sin(α + β) = [cos(α) + i sin(α)][cos(β) + i sin(β)]
= cos(α) cos(β) − sin(α) sin(β)
+ i cos(α) sin(β) + i sin(α) cos(β)

Taking the real and imaginary parts,

cos(α + β) = cos(α) cos(β) − sin(α) sin(β)

and
sin(α + β) = cos(α) sin(β) + sin(α) cos(β).

13.
N
X 1 − exp[i(N + 1)t]
eint =
n=0
1 − exp(it)
exp[i(N + 1)t/2] − exp[−i(N + 1)t/2]
= exp(iN t/2)
exp(it/2) − exp(−it/2)
sin[(N + 1)t/2]
= eiN t/2 .
sin(t/2)
To obtain the final answer, take the real and imaginary parts of the last
equation.

14. (a)

X 1 1
ǫn eint = =
n=0
1 − ǫ exp(it) 1 − ǫ cos(t) − iǫ sin(t)
1 − ǫ cos(t) + iǫ sin(t)
= .
1 + ǫ2 − 2ǫ cos(t)
To obtain the final answer, take the real and imaginary parts of the last
equation.

(b)


X e−a sin(t) sin(t)
e−na sin(nt) = = .
n=1
1 + e−2a − 2e−a cos(t) 2 cosh(a) − 2 cos(t)

Now multiply both sides of the equation by 2.


Worked Solutions 315

Section 10.2

1.
8 = 23 e0i+2kπi .
Therefore, √
zk = 2ekπi/3 , k = 0, 1, 2, 3, 4, 5
or " #
√ √ h π   π i √ 1 √3i
z0 = 2, z1 = 2 cos + i sin = 2 + ,
3 3 2 2
     " √ #
√ 2π 2π √ 1 3i
z2 = 2 cos + i sin = 2 − + ,
3 3 2 2
√ √
z3 = 2eπi = − 2,
     " √ #
√ 4π 4π √ 1 3i
z4 = 2 cos + i sin = 2 − −
3 3 2 2
and      " √ #
√ 5π 5π √ 1 3i
z5 = 2 cos + i sin = 2 − .
3 3 2 2

2.
−1 = eπi+2kπi .
Therefore,
zk = e(π+2kπ)i/3 , k = 0, 1, 2
or √
π π 1 3
πi/3
z0 = e = cos + i sin = + i, z1 = eπi = −1
3 3 2 2
and     √
5πi/3 5π 5π 1 3
z2 = e = cos + i sin = − i.
3 3 2 2

3.
−i = e3πi/2+2kπi .
Therefore,
zk = eπi/2+2kπi/3 , k = 0, 1, 2
or
z0 = eπi/2 = i,
    √
7π 7π 3 i
z1 = e7πi/6 = cos + i sin =− −
6 6 2 2
316 Advanced Engineering Mathematics with MATLAB

and     √
11πi/6 11π 11π 3 i
z2 = e = cos + i sin = − .
6 6 2 2

4.
−27i = 33 e3πi/2+2kπi .
Therefore, √ πi/4+kπi/3
zk = 3e , k = 0, 1, 2, 3, 4, 5
or
    
√ h π  π i √ 7π 7π
z0 = 3 cos + i sin , z1 = 3 cos + i sin ,
4 4 12 12
    
√ 11π 11π
z2 = 3 cos + i sin ,
12 12
    
√ 5π 5π
z3 = 3 cos + i sin ,
4 4
    
√ 19π 19π
z4 = 3 cos + i sin ,
12 12
and     
√ 23π 23π
z5 = 3 cos + i sin .
12 12

5. If√we find one root w1 , then the other root is −w1 . Let z = reθi , where
r = a2 + b2 and θ = tan−1 (−b/a). The value of θ lies between 3π/2 and 2π
because z lies in the fourth quadrant. We know that
√ √
w1 = reθi/2 = r [cos(θ/2) + i sin(θ/2)].
p p
√ = ± [1 + cos(θ)]/2 and sin(θ/2) = ± [1 − cos(θ)]/2, where
But cos(θ/2)
cos(θ) = a/ a2 + b2 . Therefore,
 s√ s√ 
(a2 + b2 )1/4  a 2 + b2 + a a 2 + b2 − a 
w1 = √ − √ +i √
2 a 2 + b2 a 2 + b2
 qp qp 
1 2 2 2 2
=√ − a +b +a+i a +b +a .
2

Our choice of signs for cos(θ/2) and sin(θ/2) is determined by the fact that
3π/4 < θ/2 < π.
Worked Solutions 317

6. From the quadratic formula, z 2 = (3i ± −9 + 8)/2 = 2i, i. Therefore,
 
√ 1 i
z1,2 = ± 2eπi/4 = ±(1 + i) and z3,4 = ±e πi/4
=± √ +√ .
2 2

7. From the quadratic formula,



2 −6i ± −36 − 64
z = = −8i, 2i.
2
Therefore,
√ √
z1,2 = ± 2eπi/4 = ±(1 + i) and z3,4 = ±2 2e−πi/4 = ±2(1 − i).

Section 10.3

1.
w = u + iv = i(x + iy) + 2 = 2 − y + xi
Therefore, u = 2 − y and v = x. Then, ux = 0, vy = 0, vx = 1 and uy = −1.
Thus, ux = vy and vx = −uy for all x and y. Therefore, iz + 2 is an entire
function because the derivatives are continuous.

2. w = u + iv = e−(x+iy) = e−x [cos(y) − i sin(y)]. Therefore, u = e−x cos(y)


and v = −e−x sin(y). Then, vx = e−x sin(y), ux = −e−x cos(y), vy =
−e−x cos(y) and uy = −e−x sin(y). Thus, ux = vy and vx = −uy for all
x and y. Therefore, e−z is an entire function because the derivatives are
continuous.

3.
w = u + iv = (x + iy)3 = x3 − 3xy 2 + i(3x2 y − y 3 )
Therefore, u = x3 − 3xy 2 and v = 3x2 y − y 3 . Then, ux = 3x2 − 3y 2 , vy =
3x2 − 3y 2 , vx = 6xy and uy = −6xy. Thus, ux = vy and vx = −uy for
all x and y. Therefore, z 3 is an entire function because the derivatives are
continuous.

4. w = u + iv = cosh(x + iy) = cosh(x) cos(y) + i sinh(x) sin(y). Therefore,


u = cosh(x) cos(y) and v = sinh(x) sin(y). Then, ux = sinh(x) cos(y), vy =
sinh(x) cos(y), vx = cosh(x) sin(y) and uy = − cosh(x) sin(y). Thus, ux = vy
and vx = −uy for all x and y. Therefore, cosh(z) is an entire function because
the derivatives are continuous.

5.
3
f ′ (z) = (1 + z 2 )1/2 (2z) = 3z(1 + z 2 )1/2
2
318 Advanced Engineering Mathematics with MATLAB

6.
f ′ (z) = 31 (z + 2z 1/2 )−2/3 (1 + z −1/2 )

7.
f ′ (z) = 2(1 + 4i)z − 3

8.
2 2z − i 5i
f ′ (z) = − 2
=
z + 2i (z + 2i) (z + 2i)2

9.
f ′ (z) = −3i(iz − 1)−4

10.
z 2 − 2iz − 1 2z − 2i 2 1
lim = lim 3 = lim =−
z→i z 4 + 2z 2 + 1 z→i 4z + 4z z→i 12z 2 + 4 4

11.
z − sin(z) 1 − cos(z) sin(z) cos(z) 1
lim = lim = lim = lim =
z→0 z3 z→0 3z 2 z→0 6z z→0 6 6

12. Because u = x and v = −y, we have ux = 1 and vy = −1. Therefore,


ux 6= vy for any x and y and f (z) is not differentiable anywhere on the complex
plane.

13. Because uxx = 2 and uyy = −2, we have uxx + uyy = 0 and u(x, y) is
harmonic. To find v(x, y), we use the Cauchy-Riemann equations: vy = ux =
2x or v(x, y) = 2xy + f (x). To find f (x) we use vx = 2y + f ′ (x) = −uy = 2y
or f ′ (x) = 0. Therefore, the final answer is v(x, y) = 2xy + constant.

14. Because uxx = 12x2 − 12y 2 and uyy = −12x2 + 12y 2 , we have that uxx +
uyy = 0 and u(x, y) is harmonic. To find v(x, y), we use the Cauchy-Riemann
equations: vy = ux = 4x3 − 12xy 2 + 1 or v(x, y) = 4x3 y − 4xy 3 + y + f (x). To
find f (x) we use vx = 12x2 y − 4y 3 + f ′ (x) = −uy = 12x2 y − 4y 3 or f ′ (x) = 0.
Therefore, the final answer is v(x, y) = 4x3 y − 4xy 3 + y + constant.

15. Because

uxx = [−2 sin(x) − x cos(x)]e−y + ye−y sin(x)

and
uyy = x cos(x)e−y + 2e−y sin(x) − ye−y sin(x),
Worked Solutions 319

we have uxx + uyy = 0 and u(x, y) is harmonic. To find v(x, y), we use the
Cauchy-Riemann equations:

vy = ux = [cos(x) − x sin(x)]e−y − ye−y cos(x)

or
v(x, y) = x sin(x)e−y + ye−y cos(x) + f (x).

To find f (x) we use

vx = sin(x)e−y + x cos(x)e−y − sin(x)ye−y + f ′ (x)


= −uy = x cos(x)e−y + sin(x)[e−y − ye−y ]

or f ′ (x) = 0. Therefore, the final answer is

v(x, y) = x sin(x)e−y + ye−y cos(x) + constant.

16. Because

uxx = 2 cos(y)ex + 4x cos(y)ex + (x2 − y 2 ) cos(y)ex − 4y sin(y)ex − 2xy cos(y)ex

and

uyy = −2 cos(y)ex +4y sin(y)ex −(x2 −y 2 ) cos(y)ex −4x cos(y)ex +2xy sin(y)ex ,

we have that uxx + uyy = 0 and u(x, y) is harmonic. To find v(x, y), we use
the Cauchy-Riemann equations:

vy = ux = 2x cos(y)ex + (x2 − y 2 ) cos(y)ex − 2y sin(y)ex − 2xy sin(y)ex

or
v(x, y) = 2xy cos(y)ex + (x2 − y 2 ) sin(y)ex + f (x).

To find f (x) we use

vx = 2y cos(y)ex + 2xy cos(y)ex + 2x sin(y)ex + (x2 − y 2 ) sin(y)ex + f ′ (x)


= −uy = 2y cos(y)ex + (x2 − y 2 ) sin(y)ex + 2x sin(y)ex + 2xy cos(y)ex

or f ′ (x) = 0. Therefore, the final answer is

v(x, y) = 2xy cos(y)ex + (x2 − y 2 ) sin(y)ex + constant.


320 Advanced Engineering Mathematics with MATLAB

Section 10.4

1. Because z = eθi , z ∗ = e−θi and dz = ieθi dθ. Then


I Z 2π Z 2π 2π
(z ∗ )2 dz = e−2θi ieθi dθ = e−θi i dθ = −e−θi = 0.
C 0 0 0

2. I I
2
|z| dz = (x2 + y 2 )(dx + i dy)
C C
Z Z Z Z
= |z|2 dz + |z|2 dz + |z|2 dz + |z|2 dz
C1 C2 C3 C4

Then
Z Z 1 Z Z 1
2 2 2 2
|z| dz = (x + 0 ) dx = 1
3, |z| dz = (12 + y 2 )i dy = i(1 + 13 ),
C1 0 C2 0
Z Z 0 Z Z 0
2 2 2 2
|z| dz = (x + 1 ) dx = − 31 − 1, |z| dz = (02 + y 2 )i dy = − 3i .
C3 1 C4 1

Finally, I
|z|2 dz = −1 + i.
C

3. We have z = eθi and dz = ieθi dθ with −π/2 < θ < π/2. Then
Z Z π/2
π/2
|z| dz = 1 × ieθi dθ = eθi −π/2
= 2i.
C −π/2

4. Because y = x, z = x + ix and dz = dx + i dx. Then


Z Z 1 1
ez dz = e(1+i)x (1 + i) dx = e(1+i)x
C −1 −1
1+i −1−i
=e −e = 2 sinh(1) cos(1) + 2i cosh(1) sin(1).

5. Because y = x2 , z = x + x2 i and dz = (1 + 2ix) dx. Then


Z Z 1
∗ 2
(z ) dz = (x − ix2 )2 (1 + 2ix) dx
C 0
Z 1
= (x2 − x4 − 2ix3 )(1 + 2ix) dx
0
Z 1
= (x2 + 3x4 − 2ix5 ) dx = 14
15 − 3i .
0
Worked Solutions 321

6. For (a), z = eθi and dz = ieθi dθ. Then


Z Z π Z π
dz i exp(θi) π
√ = dθ = ieθi/2 dθ = 2eθi/2 = −2 + 2i.
C z 0 exp(θi/2) 0 0

For (b)
Z Z 0 0
dz
√ = ieθi/2 dθ = 2eθi/2 = 2 + 2i.
C z −π −π

Note the jump in eθi/2 as we move across the negative real axis. Just above
the negative real axis, eθi/2 = i while below this axis we have eθi/2 = −i. This
jump occurs because of the presence of the branch cut along the negative real
axis associated with our multivalued, complex square root function.

Section 10.5

1. Because u = e−2x cos(2y) and v = −e−2x sin(2y), ux = −2e−2x cos(2y) =


vy and vx = 2e−2x sin(2y) = −uy for all x and y. Therefore, any integration
between two points is path independent. Thus,
Z 2+3πi
2+3πi    
e−2z dz = − 21 e−2z 1−πi
= − 12 e−4−6πi − e−2+2πi = 1
2 e−2 − e−4 .
1−πi

2. Because u = ex cos(y) − cos(x) cosh(y) and v = ex sin(y) + sin(x) sinh(y),


ux = ex cos(y) + sin(x) cosh(y) = vy and vx = ex sin(y) + cos(x) sinh(y) =
−uy for all x and y. Therefore, any integration between two points is path
independent. Thus,
Z 2π

[ez − cos(z)] dz = [ez − sin(z)] 0
= e2π − 1.
0

3. Because u = 21 − 12 cos(2x) cosh(2y) and v = 21 sin(2x) sinh(2y), ux =


sin(2x) cosh(2y) = vy and vx = cos(2x) sinh(2y) = −uy for all x and y.
Therefore, any integration between two points is path independent. Thus,
Z π
Rπ π
sin2 (z) dz = 12 0 [1 − cos(2z)] dz = 21 [z − 12 sin(2z)] 0 = π/2.
0

4. Because u = x + 1 and v = y, ux = 1 = vy and vx = 0 = −uy for all x and


y. Therefore, any integration between two points is path independent. Thus,
Z 2i
1 2
 2i
(z + 1) dz = 2z +z −i
= − 32 + 3i.
−i
322 Advanced Engineering Mathematics with MATLAB

Section 10.6

1. I
sin6 (z) πi
dz = 2πi sin6 (π/6) =
|z|=1 z − π/6 32

2. I
sin6 (z) 2πi d2 [sin6 (z)]
dz =
|z|=1 (z − π/6)3 2! dz 2 z=π/6
 
= πi 30 sin (π/6) cos2 (π/6) − 6 sin6 (π/6)
4

= 21πi/16

3. I I
dz 1/(z 2 + 4) 1 πi
2
= dz = 2πi 2 =
|z|=1 z(z + 4) |z|=1 z z +4 z=0 2

4. I
tan(z)
dz = 2πi tan(z) z=0
=0
|z|=1 z

5.
I I
dz 1/(z − 2) 1
= dz = 2πi = −2πi
|z−1|=1/2 (z − 1)(z − 2) |z−1|=1/2 z−1 z−2 z=1

6.
I 2  
exp(z 2 ) 2πi d2 (ez ) 2 2
dz = = πi 4z 2 ez + 2ez = 2πi
|z|=5 z3 2! dz 2 z=0 z=0

7.
I I
z2 + 1 (z 2 + 1)/(z + 1) z2 + 1
dz = dz = 2πi = 2πi
|z−1|=1 z2 − 1 |z−1|=1 z−1 z+1 z=1

8. I
z2 2πi d3 (z 2 )
dz = =0
|z|=2 (z − 1)4 3! dz 3 z=1

9. I
z3 2πi d2 (z 3 )
dz = = 6πiz|z=i = −6π
|z|=2 (z + i)3 2! dz 2 z=i
Worked Solutions 323

10. I
cos(z) 2πi d2n [cos(z)] 2πi
dz = = (−1)n
|z|=1 z 2n+1 (2n)! dz 2n z=0 (2n)!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Complex Variables Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% initialize parameters
clear
n = 11; R = 1; x 0 = 2; y 0 = 0;

% load in values for Gaussian-Legendre quadrature

x gauss(1) = -0.906179845938664; A(1) = 0.236926885056189;


x gauss(2) = -0.538469310105683; A(2) = 0.478628670499366;
x gauss(3) = 0.000000000000000; A(3) = 0.568888888888889;
x gauss(4) = 0.538469310105683; A(4) = 0.478628670499366;
x gauss(5) = 0.906179845938664; A(5) = 0.236926885056189;

% compute n!

factorial = 1; radius = 1; answer ave = 0;


for j = 1:n
factorial = j * factorial; radius = R * radius;
end

% test out various resolutions

for m = 1:85

M = m+15; m plot(m) = M; dtheta = 2 * pi / M;


answer1 = 0; answer2 = 0;

% now do the integration the circle

for j = 1:M

a = (j-1)*dtheta; b = j*dtheta; h = 0.5*(b-a); ave = 0.5*(b+a);

for k = 1:5
theta = ave + h * x gauss(k);
324 Advanced Engineering Mathematics with MATLAB

x = x 0 + R * cos(theta);
y = y 0 + R * sin(theta);
z = x + i*y;
f = 8 * z / (z * z+4);
u = real(f);
v = imag(f);
cosine = cos(n * theta);
sine = sin(n * theta);
integrand1 = u * cosine + v * sine;
integrand2 = v * cosine - u * sine;
answer1 = answer1 + h * A(k) * integrand1;
answer2 = answer2 + h * A(k) * integrand2;
end
end

% nth derivative = answer1 + i * answer2

format long
answer1 = factorial * answer1 / (2 * pi * radius);
answer2 = factorial * answer2 / (2 * pi * radius);
derivative plot(m) = answer1;
answer ave = answer ave + derivative plot(m);
end

% plot difference in the answer as a function of order of scheme

answer ave = answer ave / m;


plot(m plot,derivative plot-answer ave)
xlabel(’number of Gaussian intervals’,’Fontsize’,20)
ylabel(’the eleventh derivative of f(z)’,’Fontsize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 10.7

1.
X∞
1 f (n) (0) n
2
= z
(1 − z) n=0
n!

Because f (n) (z) = (n + 1)!/(1 − z)n+2 , f (n) (0) = (n + 1)! Then

X∞ ∞
1 (n + 1)! n X
= z = (n + 1)z n .
(1 − z)2 n=0
n! n=0
Worked Solutions 325

2.
f (z) = e(z − 1)e(z−1)
 
z − 1 (z − 1)2 (z − 1)3
= e(z − 1) 1 + + + + ···
1! 2! 3!
= e(z − 1) + e(z − 1)2 + 12 e(z − 1)3 + 16 e(z − 1)4 + · · ·

3.  
10 1 1 1 1
f (z) = z 1 − + 2 − 3 + ··· − + ···
z 2z 6z 11!z 11
= z 10 − z 9 + 12 z 8 − 61 z 7 + · · · − 1
11!z + ···

We have an essential singularity and the residue equals −1/11!

4.
f (z) = z −3 sin2 (z) = 12 z −3 [1 − cos(2z)]
 2

(2z)4 (2z)6
= 21 z −3 1 − 1 + (2z)2! − 4! + 6! − · · ·
1 23 z 25 z 3
= − + − ···
z 4! 6!
We have a simple pole with a residue that equals 1.

5.  
cosh(z) − 1 1 z2 z4 z6
f (z) = = 1 + + + + · · · − 1
z2 z2 2! 4! 6!
2 4
1 z z
= + + + ···
2! 4! 6!
We have a removable singularity where the value of the residue equals zero.

6.
z+2−2 2 1
f (z) = =− +
(z + 2)2 (z + 2)2 z+2
We have a second-order pole where the residue equals one.

7.
ez + 1 2 + z + 21 z 2 + 61 z 3 + · · ·
=
e−z − 1 1 − z + 12 z 2 − 61 z 3 + · · · − 1
= − z1 (2 + z + 21 z 2 + 61 z 3 + · · ·)(1 + 12 z + 1 2
12 z + · · ·)
= − z2 − 2 − 76 z − 21 z 2 − · · ·

We have a simple pole and the residue equals −2.


326 Advanced Engineering Mathematics with MATLAB

8.

eiz ei(z−bi) e−b


=
z2 +b 2 (z − bi)[2bi + (z − bi)]
 
e−b 1 z − bi (z − bi)2
= 1− + − · · ·
2bi z − bi 2bi (2bi)2
 
× 1 + i(z − bi) + 12 i2 (z − bi)2 + · · ·
e−b 1 e−b e−b
= + 2 (1 + 2b) − 3 (1 + 2b + 2b2 )(z − bi) + · · ·
2bi z − bi 4b 8b i

We have a simple pole and the residue equals e−b /(2bi).

9.
 
1 1 1 z − 2 (z − 2)2
f (z) = = 1− + − ···
[2 + (z − 2)](z − 2) 2 z−2 2 4
1 1 1 1
= − + (z − 2) − · · ·
2z−2 4 8

We have a simple pole and the residue equals 1/2.

10.
 
1 z4 z6 1 1 1 z2
f (z) = 1 + z2 + + + ··· = + 2+ + + ···
z4 2! 3! z 4 z 2 6

We have a fourth-order pole and the residue equals zero.

Section 10.8

1. I  
z+1 z+1 3πi
dz = 2πi Res ;0 = − ,
|z|=1 z − 2z 3
4 4
z − 2z 3 4
because
   
z+1 1 d2 3 z+1
Res ; 0 = lim z 3
z 4 − 2z 3 z→0 2! dz 2 z (z − 2)
 
1 z+1 3
= lim − 2
+ 3
=− .
z→0 (z − 2) (z − 2) 8

2.
I  
(z + 4)3 (z + 4)3 16πi
dz = 2πi Res 4 ;0 = −
|z|=1 z 4 + 5z 3 + 6z 2 z + 5z 3 + 6z 2 9
Worked Solutions 327

because
   
(z + 4)3 d 2 (z + 4)3
Res ; 0 = lim z 2 2
z 4 + 5z 3 + 6z 2 z→0 dz z (z + 5z + 6)
 
3(z + 4)2 (z + 4)3 (2z + 5) 8
= lim 2 − =− .
z→0 z + 5z + 6 (z 2 + 5z + 6)2 9

3. Because
 
1 1 1 1
= =−
1 − ez 1 − 1 − z − 21 z 2 − · · · z 1 + 21 z + · · ·
 
1 1
=− 1 − z − ··· ,
z 2

we have a simple pole at z = 0 with Res = −1. Therefore,


I
1
z
dz = −2πi.
|z|=1 1 − e

4. I  2 
z2 − 4 z −4
dz = 2πi Res ; 1 =0
|z|=2 (z − 1)4 (z − 1)4
because
   
z2 − 4 1 d3 2
4 z −4
Res ;1 = lim (z − 1) = 0.
(z − 1)4 3! z→1 dz 3 (z − 1)4

5. The singularities are located where z 4 = 1 or zn = ±1 and ±i. The


corresponding residues are
    
z3 (z − 1)z 3 3 1 1
Res ; 1 = lim = lim z lim = ,
z4 − 1 z→1 z 4 − 1 z→1 z→1 4z 3 4
    
z3 (z + 1)z 3 3 1 1
Res ; −1 = lim = lim z lim = ,
z4 − 1 z→−1 z 4 − 1 z→−1 z→−1 4z 3 4
 3    
z (z − i)z 3 3 1 1
Res ; i = lim 4 = lim z lim =
z4 − 1 z→i z − 1 z→i z→i 4z 3 4
and
    
z3 (z + i)z 3 1 1
Res 4
; −i = lim = lim z 3 lim = .
z −1 z→−i z 4 − 1 z→−i z→−i 4z 3 4
328 Advanced Engineering Mathematics with MATLAB

Therefore, I
z3
dz = 2πi.
|z|=2 z4 − 1

6. Because the Laurent expansion of the integrand is

1 2n+1
f (z) = z n + 2z n−1 + · · · + + ···,
(n + 1)! z

we have an essential singularity and the residue equals 2n+1 /(n+1)! Therefore,
I
2n
z n e2/z dz = 4πi .
|z|=1 (n + 1)!

7. Because
1 h (1+i)/z i 1 0
e1/z cos(1/z) = e + e(1−i)/z = 1 + + 2 + · · · ,
2 z z
we have an essential singularity and the residue equals one. Then
I
e1/z cos(1/z) dz = 2πi.
|z|=1

8. I   
2 + 4 cos(πz) 2 + 4 cos(πz)
dz = 2πi Res ;0
|z|=2 z(z − 1)2 z(z − 1)2
 
2 + 4 cos(πz)
+ Res ; 1 = 16πi
z(z − 1)2
because  
2 + 4 cos(πz) 2 + 4 cos(πz)
Res 2
; 0 = lim z =6
z(z − 1) z→0 z(z − 1)2
and
   
2 + 4 cos(πz) d 2 2 + 4 cos(πz)
Res ; 1 = lim (z − 1) = 2.
z(z − 1)2 z→1 dz z(z − 1)2

Section 10.9

1. Z ∞ Z ∞ I
dx 1 dx 1 dz
= = ,
0 x4 + 1 2 −∞ x4 + 1 2 C z4 + 1
Worked Solutions 329

where C denotes a semicircle of infinite radius in the upper half-plane. This


contour encloses two simple poles at z = eπi/4 and z = e3πi/4 . Therefore,
I    
dz 1 πi/4 1 3πi/4
4
= 2πi Res 4 ;e + 2πi Res 4 ;e
C z +1 z +1 z +1
z − eπi/4 z − e3πi/4
= 2πi lim + 2πi lim
z→eπi/4 z 4 + 1 z→e3πi/4 z4 + 1
h i √
πi −3πi/4 π 2
= e + e−9πi/4 = .
2 2
The final result follows by substitution into the first equation.

2. Z ∞ I
dx dz
= ,
−∞ (x + 4x + 5)2
2
C (z 2 + 4z + 5)2
where C denotes a semicircle of infinite radius in the upper half-plane. This
contour encloses a second-order pole at z = −2 + i. Therefore,
I  
dz 1
2 2
= 2πi Res ; −2 + i
C (z + 4z + 5) (z 2 + 4z + 5)2
 
d (z + 2 − i)2
= 2πi lim
z→−2+i dz (z + 2 − i)2 (z + 2 + i)2
−2 π
= 2πi lim 3
= .
z=−2+i (z + 2 + i) 2

The final result follows by substitution into the first equation.

3. Z ∞ I
x dx z dz
= ,
−∞ (x2 + 1)(x2 + 2x + 2) C (z 2 + 1)(z 2 + 2z + 2)
where C denotes a semicircle of infinite radius in the upper half-plane. This
contour encloses simple poles at z = i and z = −1 + i. Therefore,
I  
z dz z
2 2
= 2πi Res ;i
C (z + 1)(z + 2z + 2) (z 2 + 1)(z 2 + 2z + 2)
 
z
+ 2πi Res ; −1 + i
(z 2 + 1)(z 2 + 2z + 2)
(z − i)z
= 2πi lim
z→i (z − i)(z + i)(z 2 + 2z + 2)

(z + 1 − i)z
+ 2πi lim
z→−1+i (z 2 + 1)(z + 1 − i)(z + 1 + i)
 
i −1 + i π
= 2πi + =− .
(2i)(1 + 2i) (2i)(1 − 2i) 5
330 Advanced Engineering Mathematics with MATLAB

The final result follows by substitution into the first equation.

4.
Z ∞ Z ∞ I
x2 dx 1 x2 dx 1 z 2 dz
6
= 6
= ,
0 x +1 2 −∞ x +1 2 C z6 + 1

where C denotes a semicircle of infinite radius in the upper half-plane. This


contour encloses three simple poles at z = eπi/6 , z = eπi/2 and z = e5πi/6 .
Therefore,
I    2 
z 2 dz z2 πi/6 z πi/2
= 2πi Res ; e + 2πi Res ; e
C z6 + 1 z6 + 1 z6 + 1
 2 
z
+ 2πi Res 6
; e5πi/6
z +1
(z − eπi/6 )z 2 (z − eπi/2 )z 2
= 2πi 6
lim + 2πi lim
z→eπi/6 z +1 z→eπi/2 z6 + 1
 
(z − e5πi/6 )z 2 1 1 1 π
+ 2πi lim = 2πi + + = .
z→e5πi/6 z6 + 1 6i −6i 6i 3

The final result follows by substitution into the first equation.

5. Z Z I
∞ ∞
dx 1 dx 1 dz
2 2
= 2 2
= ,
0 (x + 1) 2 −∞ (x + 1) 2 C (z 2 + 1)2

where C denotes a semicircle of infinite radius in the upper half-plane. This


contour encloses a second-order pole at z = i. Therefore,
I    
dz 1 d (z − i)2
= 2πi Res ; i = 2πi lim
C (z 2 + 1)2 (z 2 + 1)2 z→i dz (z − i)2 (z + i)2
−2 π
= 2πi lim = .
z→i (z + i)3 2

The final result follows by substitution into the first equation.

6.
Z ∞ Z ∞ I
dx 1 dx 1 dz
2 2 2
= 2 2 2
= ,
0 (x + 1)(x + 4) 2 −∞ (x + 1)(x + 4) 2 C (z 2 + 1)(z 2 + 4)2

where C denotes a semicircle of infinite radius in the upper half-plane. This


contour encloses simple poles at z = i and a second-order pole at z = 2i.
Worked Solutions 331

Therefore,
I  
dz 1
2 2 2
= 2πi Res ; i
C (z + 1)(z + 4) (z 2 + 1)(z 2 + 4)2
 
1
+ 2πi Res ; 2i
(z 2 + 1)(z 2 + 4)2
z−i
= 2πi lim
z→i (z + i)(z − i)(z 2 + 4)2
 
d (z − 2i)2
+ 2πi lim
z→2i dz (z 2 + 1)(z − 2i)2 (z + 2i)2

2πi (2πi)(−2) (2πi)(−1)(4i) 5π


= + 3
+ 2 2
= .
(2i)(9) (4i) (−3) (4i) (−3) 144
The final result follows by substitution into the first equation.

7. Z ∞ I
x2 z2
2 2 2 2 2
dx = 2 2 2 2 2
dz,
−∞ (x + a )(x + b ) C (z + a )(z + b )
where C denotes a semicircle of infinite radius in the upper half-plane. This
contour encloses a simple pole at z = ai and a second-order pole at z = bi.
Therefore,
I  
z2 z2
2 2 2 2 2
dz = 2πi Res ; ai
C (z + a )(z + b ) (z 2 + a2 )(z 2 + b2 )2
 
z2
+ 2πi Res ; bi .
(z 2 + a2 )(z 2 + b2 )2
At z = ai,
 
z2 (z − ai) z2
Res ; ai = lim lim
(z 2 + a2 )(z 2 + b2 )2 z→ai (z − ai)(z + ai) z→ai (z 2 + b2 )2
ai
= .
2(a2 − b2 )2
At z = bi,
   
z2 d z2
Res ; bi = lim
(z 2 + a2 )(z 2 + b2 )2 z→bi dz (z 2 + a2 )(z + bi)2
i bi i
=− − + .
2b(a2 − b2 ) 2(a2 − b2 )2 4b(a2 − b2 )
Therefore,
Z ∞ 
x2 ai i
2 + a2 )(x2 + b2 )2
dx = 2πi 2 − b2 ) 2
− 2 − b2 )
−∞ (x 2(a 2b(a

bi i
− +
2(a2 − b2 )2 4b(a2 − b2 )
π
= .
2b(a + b)2
332 Advanced Engineering Mathematics with MATLAB

8. Z ∞
t2
dt
0 (t2 + 1)[t2 (a/h+ 1) + (a/h − 1)]
Z
1 ∞ t2
= 2 2
dt
2 −∞ (t + 1)[t (a/h + 1) + (a/h − 1)]
I
1 z2
= dz
2(1 + a/h) C (z + 1)(z 2 + b2 )
2

where b2 = [(1 − h/a)/(1 + h/a)]. We have a simple pole at z = i and z = bi.


Then
I  
z2 z2
2 2 2
dz = 2πi Res ;i
C (z + 1)(z + b ) (z 2 + 1)(z 2 + b2 )
 
z2
+ 2πi Res ; bi
(z 2 + 1)(z 2 + b2 )
(z − i)z 2
= 2πi lim
z→i (z − i)(z + i)(z 2 + b2 )

(z − bi)z 2
+ 2πi lim 2
z→bi (z + 1)(z − bi)(z + bi)

−1 −b2 π(1 − b)
= 2πi 2
+ 2πi 2
=
(2i)(b − 1) (2bi)(1 − b ) 1 − b2

and
I s !
z2 π 1 − h/a
dz = 1− .
C (z + 1)(z 2 + b2 )
2 1 − [(1 − h/a)/(1 + h/a)] 1 + h/a

Substitution into the first equation yields the desired result.

9. We begin by converting the real integral into a closed contour integration:


Z π/2 Z 2π I
dθ 1 dθ z
= =i dz,
0 a + sin2 (θ) 4 0 a + sin2 (θ) |z|=1 (z 2 − 1)2 − 4az 2
√ √
where z = eθi . The integrand has four poles: z = ± a ± 1 + a. Only two
are located inside the contour:
√ √ √ √
z1 = − a + 1 + a and z2 = a − 1 + a.

The corresponding residues are


 
z (z − z1 )z 1
Res 2 2 2
; z1 = lim 2 2 2
=− √
(z − 1) − 4az z→z 1 (z − 1) − 4az 8 a + a2
Worked Solutions 333

and
 
z (z − z2 )z 1
Res ; z 2 = lim ; z1 = − √ .
(z 2 − 1)2 − 4az 2 z→z2 (z 2 − 1)2 − 4az 2 8 a + a2

Employing the residue theorem and substituting into the top line, we have
that Z π/2
dθ π
2 = √ .
0 a + sin (θ) 2 a + a2

10. We begin by converting the real integral into a closed contour integration:
Z π/2 Z 2π
dθ 1 dθ
2 =
0
2 2 2
a cos (θ) + b sin (θ) 4 0 a2 + b2 sin2 (θ)
cos2 (θ)
I
z
= −i dz,
|z|=1 a (z + 1) − b2 (z 2 − 1)2
2 2 2

where z = eθi . The integrand has four simple poles located at

2 b+a 2 b−a
z+ = , and z− = .
b−a b+a
Only two are located inside the contour:
r r
(1) b−a (2) b−a
z− = , and z− = − .
b+a b+a
The corresponding residues are
  (1)
z (1) z(z − z− )
Res ; z = lim
a2 (z 2 + 1)2 − b2 (z 2 − 1)2 − 2 2 2 2 2
z→z− a (z + 1) − b (z − 1)
(1) 2

1
= lim
(1)
z→z− 4a2 (z 2 + 1) − 4b2 (z 2 − 1)
1
= ,
8ab
and
  (2)
z (2) z(z − z− )
Res ; z − = lim
a2 (z 2 + 1)2 − b2 (z 2 − 1)2 2 2 2 2 2
z→z− a (z + 1) − b (z − 1)
(2) 2

1
= lim
(2)
z→z− 4a2 (z 2 + 1) − 4b2 (z 2 − 1)
1
= .
8ab
334 Advanced Engineering Mathematics with MATLAB

Employing the residue theorem and substituting into the top line, we have
that Z π/2
dθ π
2 cos2 (θ) + b2 sin2 (θ)
= .
0 a 2ab

11. We begin by converting the real integral into a closed contour integration:
Z π Z
sin2 (θ) 1 2π sin2 (θ)
dθ = dθ
0 a + b cos(θ) 2 0 a + b cos(θ)
I
i (z 2 − 1)2
= dz,
4 |z|=1 [b(z 2 + 1) + 2az]z 2

where z = eθi . The integrand


√ has a second-order pole at z = 0 and simple
poles at z1,2 √= (−a ± a2 − b2 )/b. Only the poles located at z = 0 and
z1 = (−a + a2 − b2 )/b lie within the closed contour. The corresponding
residues are
   
(z 2 − 1)2 d (z 2 − 1)2 2a
Res 2 2
; 0 = lim 2
=− 2,
[b(z + 1) + 2az]z z→0 dz b(z + 1) + 2az b

and
 
(z 2 − 1)2 (z − z1 )(z 2 − 1)2
Res 2 2
; z 1 = lim
[b(z + 1) + 2az]z z→z1 [b(z 2 + 1) + 2az]z 2

(z 2 − 1)2 1
= lim lim
z→z1 z2 z→z1 2a + 2bz

2 a 2 − b2
= .
b2
Employing the residue theorem and substituting into the top line, we have
that Z π
sin2 (θ) π  p 
dθ = 2 a − a2 − b2 .
0 a + b cos(θ) b

12. We begin by converting the real integral into a closed contour integration:
Z 2π I
einθ zn
dθ = −i dz,
0 1 + 2r cos(θ) + r2 |z|=1 r(z 2 + 1) + (1 + r2 )z

where z = eθi . The integrand has two simple poles: z+ = −r, and z− = −1/r;
only the z+ pole lies inside the contour since |r| < 1. The corresponding
residue is
 
zn n z − z+ (−r)n
Res ; z + = lim z = .
r(z 2 + 1) + (1 + r2 )z z→z+ r(z 2 + 1) + (1 + r2 )z 1 − r2
Worked Solutions 335

Employing the residue theorem and substituting into the top line, we have
that Z 2π
einθ (−r)n
dθ = 2π .
0 1 + 2r cos(θ) + r2 1 − r2

13. We begin by converting the real integral into a closed contour integration:
Z 2π I
−i (z 2 − 1)2n
sin2n (θ) dθ = n 2n
dz,
0 (−1) 2 |z|=1 z 2n+1

where z = eθi . The integrand has a pole of order 2n + 1 at z = 0. To find the


residue, we first note that

(2n)!(−1)n 2n
(z 2 − 1)2n = z 4n − 2nz 4n−1 + · · · + z + ···.
n!n!
Therefore  
(z 2 − 1)2n (2n)!(−1)n
Res ; 0 = .
z 2n+1 n!n!
Using the residue theorem and substituting into the top line,
Z 2π
2π(2n)!
sin2n (θ) dθ = n 2 .
0 (2 n!)

14. We begin by converting the real integral into a closed contour integration:
Z π Z π I
cos(nθ) einθ + e−inθ 1 z n + z −n
dθ = iθ −iθ + 2α
dθ = dz,
−π cos(θ) + α −π e + e i |z|=1z 2 + 2αz + 1

where z = eθi . √ The integrand has a n-order pole at z = 0 and √ simple poles
at z1,2 = −α ± α2 − 1. Since α > 1, only the root z1 = −α + α2 − 1 lies
inside the contour.
To facilitate the calculation of the residues, we note that
 n 
z n + z −n 1 z + z −n z n + z −n
= √ − .
z 2 + 2αz + 1 2 α2 − 1 z − z1 z − z2

The simplest residue is


 n 
z + z −n  z 2n + 1
Res ; z1 = lim z n + z −n = 1 n .
z − z1 z→z1 z1

To compute the residue at z = 0, we first observe that


"    2  3 #
z n + z −n  1 z z z
= − z n + z −n 1+ + + + ··· .
z − z1 z1 z1 z1 z1
336 Advanced Engineering Mathematics with MATLAB

Therefore,  
z n + z −n 1
Res ;0 = − n.
z − z1 z1
Similarly,  n 
z + z −n 1
Res ; 0 = − n = −z1n .
z − z2 z2
Bringing everything together, we find that
Z π  2n 
cos(nθ) 2πi 1 z1 + 1 1 n 2πz1n
dθ = √ − + z 1 = √ .
−π cos(θ) + α i 2 α2 − 1 z1n z1n α2 − 1

Substituting for z1 , yields the final answer.


If n = 0, we only have the pole at z = z1 and
Z π
1 2πi 1 2π
dθ = √ ·2= √ .
−π cos(θ) + α i 2
2 α −1 α2 − 1

15. We begin by converting the real integral into a closed contour integration:
Z π Z
cos(nθ) 1 π cos(nθ)
dθ = − dθ
0 cosh(α) − cos(θ) 2 −π cos(θ) − cosh(α)
I
1 z n + z −n
=− 2
dz,
i |z|=1 z − 2z cosh(α) + 1

where z = eθi . The integrand has a n-order pole at z = 0 and simple poles at
z1,2 = eα , e−α . Because α can be taken as positive without loss of generality,
then only the poles located at z = 0 and z = e−α lie within the closed contour.
Because
 n 
z n + z −n 1 z + z −n z n + z −n
= − ,
z 2 − 2z cosh(α) + 1 2 sinh(α) z − eα z − eα

the corresponding residues are


 
z n + z −n sinh(nα)
Res 2 ;0 =
z − 2z cosh(α) + 1 sinh(α)

from Example 1.7.5 and


 
z n + z −n 1 cosh(nα)
Res 2 ; e−α = − lim z n + z −n = − .
z − 2z cosh(α) + 1 2 sinh(α) z→e−α sinh(α)

Therefore, I
1 z n + z −n 2πe−nα
dz = − .
i |z|=1 z 2 − 2z cosh(α) + 1 sinh(α)
Worked Solutions 337

Substitution of this result into the top line gives the final result.

16. As before,
Z ∞ Z ∞
x2 1 x2
dx = 2 dx
0 (1 − x2 )2 + a2 x2 −∞ (1 − x2 )2 + a2 x2
I
1 z2
= 2 dz,
C (1 − z 2 )2 + a2 z 2
where C denotes a semicircle of infinite radius in the upper half of the complex
plane. Now we must find the poles of the integrand. Solving (1−z 2 )2 +a2 z 2 =
0 for z 2 , we find that
√  √ 2
z 2 = 12 2 − a2 ± |a| a2 − 4 = − 14 |a| ± a2 − 4 .
Taking the square root of z 2 , gives the poles listed in the text. In general, the
residue for each simple poles zn is
z
Res[f (z); zn ] = lim .
z→zn 2a2 − 4(1 − z 2 )

Because we only need the poles in the upper half-plane, the simple poles are
1 √ 
 2 ± 4 − a2 + |a|i , if 0 < |a| < 2,
zn = √ 
 i
2 |a| ± a2 − 4 , if 2 < |a|.
If |a| = 2, we have second-order poles at zn = i. Upon substituting into the
residue formula, we have that

 1
√  (± 4 − a2 + |a|i)/2
2
Res f (z); 2 ± 4 − a + |a|i = ± √ ,
2|a|i 4 − a2

 √  i(|a| ± a2 − 4 )/2
Res f (z); 2i |a| ± a2 − 4 = ∓ √ ,
2|a| a2 − 4
and  
d z2 i
Res [f (z); i ] = lim =− .
z→i dz (z + i)2 4
When we sum the residues for the cases 0 < |a| < 2 and 2 < |a|, we find
−i/2|a|. Multiplying the residues by 2πi, we obtain the final result. The
special case for |a| = 2 is handled in the same manner.

17. We begin by evaluating eiaz / cosh2 (bz) around the closed contour:
I Z Z
eiaz eiaz eiaz
2 dz = 2 dz + 2 dz
C cosh (bz) C1 cosh (bz) C2 cosh (bz)
Z Z
eiaz eiaz
+ 2 dz + 2 dz
C3 cosh (bz) C4 cosh (bz)
338 Advanced Engineering Mathematics with MATLAB

Because the integrand behaves as e−2R as R → ∞, the integrals along C2 and


C4 vanish. On the other hand,
Z Z ∞
eiaz eiax
dz = dx,
C1 cosh2 (bz) −∞ cosh2 (bx)

and Z Z ∞
eiaz eiax
dz = −e−πa/b dx,
C3 cosh2 (bz) −∞ cosh2 (bx)
because cosh(x + πi) = − cosh(x).
Within the closed contour C, we have a second order pole at zs = πi/(2b)
because the Laurent expansion of eiaz / cosh2 (bz) is

eiaz eiazs ia eiazs


2 =− 2 − + ···.
cosh (bz) b (z − zs )2 b2 (z − zs )

Therefore, Z ∞
−πa/b eiax 2πae−πa/(2b)
(1 − e ) 2 dx =
−∞ cosh (bx) b2
and
Z ∞
cos(ax) 2πae−πa/(2b)
2 dx =
0 cosh2 (bx) b2 (1 − e−πa/b )
Z ∞
cos(ax) πa πa
2 dx = 2 πa/(2b) −πa/(2b)
= 2 .
0 cosh (bx) b [e −e ] 2b sinh[πa/(2b)]

18. Let
z
f (z) = .
cosh(z) cosh(z + a)
If a 6= 0, we have two simple poles, z1 = πi/2 and z2 = −a + πi/2, within the
closed contour. Therefore,
I
f (z) dz = 2πi Res[f (z); z1 ] + 2πi Res[f (z); z2 ].
C

Computing the residues,

z z − z1 πi
Res[f (z); z1 ] = lim lim =− ,
z→z1 cosh(z + a) z→z1 cosh(z) 2 sinh(a)

and
 
z z − z2 πi 1
Res[f (z); z2 ] = lim lim = −a .
z→z2 cosh(z) z→z2 cosh(z + a) 2 sinh(a)
Worked Solutions 339

On the other hand, if a = 0, we have a second-order pole located at z1 = πi/2


within the closed contour. Therefore,
I
f (z) dz = 2πi Res[f (z); z1 ].
C

The residue for this case is


   
d z(z − πi/2)2 d η 2 (η + πi/2)
Res[f (z); z1 ] = lim = − lim
z→πi/2 dz cosh2 (z) η→0 dη sinh2 (η)
 
d η + πi/2
= − lim
η→0 dη (1 + η 2 /6 + · · ·)2
 
(1 + η 2 /6 + · · ·) − (η + πi/2)(3η + · · ·)
= − lim = −1.
η→0 (1 + η 2 /6 + · · ·)4
Therefore, if a 6= 0,
I
z 2πai
dz = − ,
C cosh(z) cosh(z + a) sinh(a)
while I
z
dz = −2πi,
C cosh(z) cosh(z + a)
if a = 0.
Regardless of the value of a, let us denote the contour along and parallel
to the y-axis at x = ∞ as C2 and the contour along and parallel to the y-axis
at x = −∞ as C4 . Then,
Z
f (z) dz → 0 as x → ∞,
C2

and Z
f (z) dz → 0 as x → −∞,
C4

because |f (z)| tends rapidly to zero as x → ±∞. If C1 denotes the contour


along the real axis,
Z Z ∞
x
f (z) dz = dx,
C1 −∞ cosh(x) cosh(x + a)

while along the contour C3 , which runs parallel to the real axis but π units
above it,
Z Z −∞
x + πi
f (z) dz = dx
C3 ∞ cosh(x + πi) cosh(x + a + πi)
Z ∞
x + πi
=− dx.
−∞ cosh(x) cosh(x + a)
340 Advanced Engineering Mathematics with MATLAB

Therefore, if a 6= 0, we have that


Z ∞
dx 2πai
−πi =− ,
−∞ cosh(x) cosh(x + a) sinh(a)

while for a = 0, we have that


Z ∞
dx
−πi = −2πi.
−∞ cosh2 (x)

Simplification yields the final result.



19. The integrand has simple poles at z = σ and zn = ±i n + 21 . Computing
the residues, we have that
 
sinh(xz) sinh(xz) sinh(σx)
Res ; σ = lim =
cosh(πz) (z − σ) z→σ cosh(πz) cosh(σπ)

and
 
sinh(xz) sinh(xz) z − zn
Res ; zn = lim lim
cosh(πz) (z − σ) z→zn z − σ z→zn cosh(πz)
  
sin n + 21 x
=    
−σ ± i n + 21 π sin n + 21 π
  
(−1)n sin n + 12 x
=   .
−σ ± i n + 21 π

Summing the residues gives the desired result.


To show that the contour integral vanishes,

z sinh(xz) z (exz − e−xz )


= .
cosh(πz) (z − σ) (z − σ) (eπz + e−πz )

In the limit of |z| → ∞, the fraction goes to zero uniformly as long as |x| < π.
Therefore, by Equation 10.9.7 the contour integral vanishes.

∞    ∞   
X (−1)n sin n + 21 x X (−1)n sin n + 21 x
 = 2σ 2
n=−∞
σ − i n + 21 n=0 σ 2 + n + 12
∞   
X cos n + 21 (x − π)
= 2σ 2
n=0 σ 2 + n + 12
     
because cos n + 21 (x − π) = (−1)n sin n + 12 x . Equating this sum
with π sinh(σx)/ cosh(σπ) finishes the problem.
Worked Solutions 341

Section 10.10

1. Z Z
π θ−ǫ
dϕ dϕ
PV = lim
0 cos(ϕ) − cos(θ) ǫ→0 cos(ϕ) − cos(θ)
Z 0π

+ lim
ǫ→0 θ+ǫ cos(ϕ) − cos(θ)

1 sin(θ − ǫ/2)
= lim ln = 0.
sin(θ) ǫ→0 sin(θ + ǫ/2)

2. We begin by noting that


Z ∞  Z ∞ iπx/2 
cos(πx/2) e
dx = ℜ P V dx .
−∞ x2 − 1 2
−∞ x − 1

Consider now the integral


I
eiπz/2
dz,
C z2 − 1

where the closed contour C consists of the real axis from −R to R and a
semicircle in the upper half of the z-plane where this segment is its diameter.
See Figure 1.10.1. Because the integrand has poles at z = ±1, which lie on
this contour, we modify C by making an indentation of radius η at −1 and
another of radius ǫ at 1. The integrand is now analytic within and on C
and the closed contour integral equals zero by the Cauchy-Goursat theorem.
Evaluation of this contour integral along each segment yields
Z π iπR cos(θ)/2−Rπ sin(θ)/2 Z
e θi eiπz/2
lim iRe dθ + dz
R→∞ 0 R2 e2θi − 1 2
C1 z − 1
Z Z −1−η iπx/2
eiπz/2 e
+ 2−1
dz + lim 2−1
dx
C2 z η→0 −R x
Z 1−ǫ iπx/2 Z R iπx/2
e e
+ lim dx + lim dx = 0,
ǫ,η→0 −1+η x2 − 1 ǫ→0 1+ǫ x2 − 1

where C1 and C2 denote the integrals around the indentations at −1 and


1, respectively. The modulus of the first term on the left side is less than
πR/(R2 − 1) so that this term tends to zero as R → ∞. To evaluate C1 , we
observe that z = −1 + ηeθi along C1 , where θ decreases from π to 0. Hence,
Z Z 0  
eiπz/2 exp iπ(−1 + ηeθi )/2
2
dz = lim iηeθi dθ
C1 z − 1 η→0 π −2ηeθi + η 2 e2θi
Z π  
exp iπ(−1 + ηeθi )/2 π
= lim dθ = .
η→0 0 2 − ηeθi 2
342 Advanced Engineering Mathematics with MATLAB

Similarly,
Z Z 0
 
eiπz/2 exp iπ(1 + ǫeθi )/2
dz = lim iǫeθi dθ
C2 z2 − 1 ǫ→0 π 2ǫe θi + ǫ2 e2θi
Z π  
exp iπ(1 + ǫeθi )/2 π
= lim dθ = .
ǫ→0 0 −2 − ǫeθi 2
Substituting these results into the second equation, we find that
Z ∞ iπx/2
e
PV 2−1
dx = −π.
−∞ x

Using the first equation completes the proof.

3. Consider the integral I


eaz − ebz
dz,
C 1 − ez
where the closed contour C consists of the rectangular box with vertices
(−R, 0), (R, 0), (−R, π) and (R, π) with a semicircular indentation Cǫ at
the origin. Because the integrand is analytic within and on the contour C, it
equals zero. Breaking up the closed contour integral into a collection of line
integrals,
Z −R+πi az Z −R
e − ebz eaz − ebz
lim dz + lim dz
R→∞ R+πi 1 − ez R→∞ −R+πi 1 − ez
Z −ǫ az Z
e − ebz eaz − ebz
+ lim z
dz + z
dz
R→∞,ǫ→0 −R 1−e Cǫ 1 − e
Z R az Z R+πi az
e − ebz e − ebz
+ lim dz + lim dz = 0.
R→∞,ǫ→0 ǫ 1 − ez R→∞ R 1 − ez
Now,
Z
eaz − ebz
z
dz
Cǫ 1 − e
Z 0
1 + aǫeθi + a2 ǫ2 e2θi /2 + · · · − 1 − bǫeθi − b2 ǫ2 e2θi /2 − · · ·
= lim
ǫ→0 π 1 − 1 − ǫeθi − ǫ2 e2θi /2 − · · ·
× iǫeθi dθ = 0,
Z −R Z 0
eaz − ebz e−aR eayi − e−bR ebyi
lim dz = lim i dy = 0,
R→∞ −R+πi 1 − ez R→∞ π 1 − e−R eyi
and
Z R+πi Z π
eaz − ebz eaR eayi − ebR ebyi
lim dz = lim i dy = 0,
R→∞ R 1 − ez R→∞ 0 1 − eR eyi
Worked Solutions 343

because 0 < a, b < 1. The remaining terms yield


Z ∞ Z ∞ Z ∞
eax − ebx eax eaπi ebx ebπi
dx = dx − dx
−∞ 1 − ex −∞ 1 + ex −∞ 1 + ex
aπi bπi
πe πe
= − = π [cot(aπ) + i] − π [cot(bπ) + i]
sin(aπ) sin(bπ)
= π [cot(aπ) − cot(bπ)]

4. From the residue theorem,


Z Z Z Z !
−ζ−ǫ R
+ + + f (z) dz = 2πi Res[f (z); iα],
C∞ −R Cǫ −ζ+ǫ

where C∞ denotes the semicircular contour of infinite radius, Cǫ is the semi-


circular indentation at z = −ζ and

1 − e2ia(z+ζ)
f (z) = .
(z + ζ)2 (z 2 + α2 )

Taking the limit of R → ∞ and ǫ → 0,


Z ∞
f (x) dx = 2πi Res[f (z); iα] + πi Res[f (z); −ζ].
−∞

Now,

1 − e2ia(z+ζ) 1 − e−2aα e2iaζ


Res[f (z); iα] = lim 2
=
z→iα (z + ζ) (z + iα) (ζ + αi)2 (2iα)
ζ 2 − α2 − e−2aα [(ζ 2 − α2 ) cos(2aζ) + 2αζ sin(2aζ)]
=
2iα(ζ 2 + α2 )2
2αζ + e−2aα [(ζ 2 − α2 ) sin(2aζ) − 2αζ cos(2aζ)]

2α(ζ 2 + α2 )2

and  
d 1 − e2ia(z+ζ) 2ia
Res[f (z); −ζ] = lim =− 2 .
z→−ζ dz z 2 + α2 ζ + α2
Substituting into the integral and taking the real part completes the problem.

5. From the residue theorem,


Z Z Z Z !
a−ǫ R
eimz
+ + + dz = 0
C∞ −R Cǫ a+ǫ z−a
344 Advanced Engineering Mathematics with MATLAB

because the interior of the contour is analytic. Here C∞ denotes the semi-
circular contour of infinite radius and Cǫ is the semicircular indentation at
z = a. Taking the limit of R → ∞ and ǫ → 0,
Z ∞ imx  imz 
e e
PV dx = πi Res ; a = πieima .
−∞ x − a z−a

Taking the real and imaginary parts of the equation, we obtain the final
answer.

6. From the residue theorem,


Z Z Z Z Z Z !
−π−ǫ π−ǫ R
zeiz
+ + + + + dz = 0
C∞ −R Cǫ 1 −π+ǫ Cǫ 2 π+ǫ z2 − π2

because the interior of the contour is analytic. Here C∞ denotes the semicir-
cular contour of infinite radius and Cǫ1 and Cǫ2 are semicircular indentations
at z = −π and z = π. Taking the limit of R → ∞ and ǫ → 0,
Z ∞    
xeix z eiz z eiz
PV 2 2
dx = πi Res 2 ; −π + πi Res 2 ;π
−∞ x − π z − π2 z − π2
= 12 πie−πi + 12 πieπi = −πi

For the second part,


Z Z Z Z Z Z !
1−ǫ 3−ǫ R
eimz
+ + + + + dz = 0
C∞ −R Cǫ 1 1+ǫ Cǫ 2 3+ǫ (z − 1)(z − 3)

because the interior of the contour is analytic. Here C∞ denotes the semicir-
cular contour of infinite radius and Cǫ1 and Cǫ2 are semicircular indentations
at z = 1 and z = 3. Taking the limit of R → ∞ and ǫ → 0,
Z ∞  
eimx eimz
PV dx = πi Res ;1
−∞ (x − 1)(x − 3) (z − 1)(z − 3)
 
eimz
+ πi Res ;3
(z − 1)(z − 3)
πi 3mi 
= − 12 πiemi + 12 πie3mi = e − emi .
2

7. We only have to show that the integral of eiz /z along the sides and top
tends to zero. The integral along the real axis is the same for the square and
semicircle closed contours. Considering the left side first,
Z −R+Ri Z R Z R
eiz e−y 1 1 
dz ≤ p dy < e−y dy = 1 − e−R ,
−R z 0 R2 + y 2 R 0 R
Worked Solutions 345

which tends to zero as R → ∞. Similarly,


Z R+Ri Z R
eiz e−y
dz ≤ p dy,
R z 0 R2 + y 2

which also tends to zero as R → ∞. Finally,


Z R+Ri Z R  √ 
eiz dx
dz ≤ 2e−R √ = 2 ln 1 + 2 e−R ,
−R+Ri z 0 R 2 + x2

which tends to zero as R → ∞. Thus, just as in the case of the semicircle


close contour, we only have the integration along the real axis, which gives
the same result.

8. It follows from the definition of the transformation that


dz z2 + 1
2
=
2i dx = dz + dz;
z z2
 2    2
1 1 1
1 − x2 = 1 + 41 z − = 1 + 41 z 2 − 2 + 2 = 1
4 z+
z z z
or    
p 1 1 1 z2 + 1
1 − x2 = z+ = ;
2 z 2 z
and    
1 1 1 z 2 + 2iαz − 1
x+α= z− +α= .
2i z 2i z
Direct substitution into the original integral yields G(α) as a contour integra-
tion on the unit circle.
√ If |α| < 1, we have two singularities within the contours located at z =
± 1 − α2 − αi. In that case,
2πi 2πi
G(α) = √ + √ = 0.
2 1 − α − 2iα + 2iα −2 1 − α2 − 2iα + 2iα
2

If α >
√1, there is a single singularity within the contours and it is located at
z = i α2 − 1 − αi. Therefore,
2πi π
G(α) = √ =√ .
2
2 α − 1 − 2iα + 2iα 2
α −1
Finally, if α < −1,
√ there is a single singularity within the contours and it is
located at z = −i α2 − 1 − αi. Therefore,
2πi π
G(α) = √ = −√ .
−2 α2 − 1 − 2iα + 2iα α2 − 1
346 Advanced Engineering Mathematics with MATLAB

9. Because the point z = c is a simple pole, its Laurent expansion is

Res[f (z); c]
f (z) = + a0 + a1 (z − c) + · · · .
z−c

Therefore, the contour integration C1 around the indentation at z = c is


Z Z θ0  
Res[f (z); c] θi
f (z) dz = lim + a 0 + a 1 ǫe + · · · iǫeθi dθ
C1 ǫ→0 θ0 +α ǫeθi
= −Res[f (z); c]αi,

where we set z − c = ǫeθi .

Section 10.11

3. From Equation 10.11.6, we have

dz
= C ′ τ −1/2 ,

because α1 = π/2 and k1 = α1 − 1. Integrating this differential equation,


Z τ
dη √
z = C′ √ = C τ + K.
η

At τ = 0, z = −π + πi, or K = −π + πi. Because we did not specify any


further requirements, the most general transformation is

z = C τ − π + πi.

4. From Equation 10.11.6, we have

dz
= C ′ τ π/(3π)−1 ,

because α1 = π/3 and k1 = α1 − 1. Integrating this differential equation,


Z τ

z = C′ = Cτ 1/3 + K.
η 2/3

At τ = 0, z = 0 and K = 0. Because we did not specify any further require-


ments, the most general transformation is

z = Cτ 1/3 , or τ = Az 3 .
Worked Solutions 347

5. From Equation 10.11.6, we have

dz
= C ′ τ 7π/(4π)−1 ,

because α1 = 7π/4 and k1 = α1 − 1. Integrating this differential equation,
Z τ
z = C′ η 3/4 dη = Cτ 7/4 + K.

At τ = 0, z = 0, and K = 0. Furthermore, at τ = 1, z = 1, and C = 1.


Therefore,
z = τ 7/4 , or τ = z 4/7 .

6. From Equation 10.11.6, we have

dz
= C(τ + 1)−1/2 (τ − 1)−1/2 ,

because α1 = α2 = π/2 and kn = αn −1. Integrating this differential equation,
Z τ  p 

z=C p + K = C log τ + τ 2 − 1 + K.
η2 − 1

At x = −a, −a = C log(−1) + K while at x = a, a = C log(1) + K. Conse-


quently, K = a and C = 2ai/π. Therefore,

2ai  p   p 
z−a= log τ + τ 2 − 1 , −π/2 ≤ arg τ + τ 2 − 1 < 3π/2.
π
Solving for τ ,  
πi p
τ − exp − (z − a) = − τ 2 − 1.
2a
Squaring both sides and solving for τ ,
 πz  πz
τ = sin , or = arcsin(τ ).
2a 2a

7. From Equation 10.11.6, we have

dz
= C(τ + 1)−1/2 (τ − 1)−1/2 ,

because α1 = α2 = π/2 and kn = αn −1. Integrating this differential equation,
Z τ

z=C p + K = C cosh−1 (τ ) + K.
η2 − 1
348 Advanced Engineering Mathematics with MATLAB

Because (0, a) → (−1, 0) and (0, 0) → (1, 0), C = a/π and K = 0. Therefore,
a  
z= cosh−1 (τ ), 0 ≤ ℑ cosh−1 (τ ) ≤ π.
π

8. From Equation 10.11.6, we have


r r
dz τ −1 1−τ
= C ′ τ π/(2π)−1 (τ − 1)(3π)/(2π)−1 = C ′ =C ,
dτ τ τ

because α1 = π/2, α2 = 3π/2, and kn = αn − 1. Setting τ = sin2 (α),


Z Z
 
z = 2C cos2 (α) dα = C [1 + cos(2α)] dα = C α + 12 sin(2α) + K
h √ p i
= C arcsin( τ ) + τ (1 − τ ) + K.

Because (0, 0) → (0, 0), K = 0. Furthermore, (0, a) → (1, 0), C = 2ai/π.


Therefore,
2ai h √ p i
z= arcsin( τ ) + τ (1 − τ ) .
π

10. Because z = x + iy and τ = ρ + iσ,

ρ + iσ = exp(x + iy) = ex [cos(y) + i sin(y)] .

Taking the real and imaginary parts

ρ = ex cos(y), and σ = ex sin(y).

Therefore,

for z = ∞ + πi, ρ = e∞ cos(π) = −∞, and σ = e∞ sin(π) = 0;

for z = πi, ρ = e0 cos(π) = −1, and σ = e0 sin(π) = 0;


for z = −∞ + yi, ρ = e−∞ cos(y) = 0, and σ = e−∞ sin(y) = 0;
for z = 0, ρ = e0 cos(0) = 1, and σ = e0 sin(0) = 0;
and for z = ∞, ρ = e∞ cos(0) = ∞, and σ = e∞ sin(0) = 0.
Using the Fourier method from Section 11.7,
Z   
1 ∞ σ 1 π −1 1 − ρ
u(ρ, σ) = dt = − tan
π 1 (t − ρ)2 + σ 2 π 2 σ
 
1 σ
= 1 − tan−1 .
π ρ−1
Worked Solutions 349

Direct substitution for ρ and σ yields the final result.

11. Because z = reθi and τ = ρ + iσ,

ρ + iσ = rπ/α eπθi/α = rπ/α cos(πθ/α) + irπ/α sin(πθ/α).

Taking the real and imaginary parts

ρ = rπ/α cos(πθ/α), and σ = rπ/α sin(πθ/α).

If θ = 0,
ρ = rπ/α cos(0) > 0, σ = rπ/α sin(0) = 0.
If θ = α,
ρ = rπ/α cos(π) < 0, σ = rπ/α sin(π) = 0.
Using the Fourier method from Section 11.7,
Z     
1 1 σ 1 −1 1 − ρ −1 1 + ρ
u(ρ, σ) = dt = tan + tan
π 0 (t − ρ)2 + σ 2 π σ σ
 2 2

1 ρ +σ −ρ
= cot−1 .
π σ

Direct substitution for ρ and σ yields


 2π/α 
1 −1 r cos2 (πθ/α) + r2π/α sin2 (πθ/α) − rπ/α cos(πθ/α)
u(r, θ) = cot
π rπ/α sin(πθ/α)
 π/α 
1 r − cos(πθ/α)
= cot−1 .
π sin(πθ/α)

12. Because z = x + iy and τ = ρ + iσ,

ρ+iσ = − cos[π(x+iy)/a] = − cos(πx/a) cosh(πy/a)+i sin(πx/a) sinh(πy/a).

Taking the real and imaginary parts

ρ = − cos(πx/a) cosh(πy/a), and σ = sin(πx/a) sinh(πy/a).

Therefore,

for z = ∞i, ρ = − cos(0) cosh(∞) = −∞, and σ = sin(0) sinh(∞) = 0.

for z = 0, ρ = − cos(0) cosh(0) = −1, and σ = sin(0) sinh(0) = 0.


for z = a/2, ρ = − cos(π/2) cosh(0) = 0, and σ = sin(π/2) sinh(0) = 0.
for z = a, ρ = − cos(π) cosh(0) = 1, and σ = sin(π) sinh(0) = 0.
350 Advanced Engineering Mathematics with MATLAB

for z = a + ∞i, ρ = − cos(π) cosh(∞) = ∞, and σ = sin(π) sinh(∞) = 0.


Using the Fourier method from Section 11.7,
Z 1     
1 σ 1 −1 1 − ρ −1 1 + ρ
u(ρ, σ) = 2 2
dt = tan + tan
π −1 (t − ρ) + σ π σ σ
      2 2

1 −1 σ 1−ρ 1+ρ 1 −1 ρ + σ − 1
= cot 1− . = cot .
π 2 σ σ π 2σ

Direct substitution for ρ and σ yields


h    i   πx   πy 
1 −1 2 πy 2 πx
u(x, y) = cot sinh − sin 2 sin sinh
π a a a a
     
2 πx πy
= tan−1 sin sinh .
π a a

For Step 4, we note that 1 − u(x, y) satisfies both Laplace’s equation and the
boundary condition.

Section 11.1

1.
Z 0 Z ∞
1 1 2a
F (ω) = e(a−ωi)t dt + e−(a+ωi)t dt = + = 2 .
−∞ 0 a − ωi a + ωi ω + a2

2. Z Z
0 ∞
(a−ωi)t
F (ω) = te dt + te−(a+ωi)t dt
−∞ 0
1 1 4aωi
=− + =− 2 .
(a − ωi)2 (a + ωi)2 (ω + a2 )2

3.
Z ∞ Z ∞
r  
2 2 π ω2
F (ω) = e−at e−iωt dt = 2 e−at cos(ωt) dt = exp − .
−∞ 0 a 4a

4. Z Z
0 ∞
F (ω) = e(2−ωi)t dt + e−(1+ωi)t dt
−∞ 0
0 ∞
e(2−ωi)t e−(1+ωi)t 3
= − = .
2 − ωi −∞ 1 + ωi 0 (2 − iω)(1 + iω)
Worked Solutions 351

5.
Z ∞ Z 0
−(1+i+iω)t
F (ω) = e dt − e(1−i−iω)t dt
0 −∞
1 1 2i(ω + 1)
= − =− .
1 + (ω + 1)i 1 − (ω + 1)i (ω + 1)2 + 1

6.
Z 1 Z 1 h i
1
F (ω) = cos(at)e−iωt dt = ei(a−ω)t + e−i(a+ω)t dt
−1 2 −1
ei(a−ω) − e−i(a−ω) ei(a+ω) − e−i(a+ω)
= +
2i(a − ω) 2i(a + ω)
sin(ω − a) sin(ω + a)
= +
ω−a ω+a

7.
Z
1 1  i(1−ω)t 
F (ω) = e − e−i(1+ω)t dt
2i 0
 
1 1 − cos(ω − 1) + i sin(ω − 1) cos(ω + 1) − i sin(ω + 1) − 1
=− +
2 ω−1 ω+1
   
1 1 − cos(ω − 1) cos(ω + 1) − 1 i sin(ω − 1) sin(ω + 1)
=− + − −
2 ω−1 ω+1 2 ω−1 ω+1

8.
Z a a
t −iωt e−iωt
F (ω) = e dt = (1 + iωt)
−a a aω 2 −a
(1 + iωa)e−iωa (1 − iωa)eiωa 2i cos(ωa) 2i sin(ωa)
= 2
− 2
= −
aω aω ω aω 2

9.
Z a  2 a
t e−iωt
F (ω) = e−iωt dt = 2 3 (2 + 2iωt − ω 2 t2 )
−a a ia ω −a
e−iωa eiωa
= 2 3 (2 + 2iωa − ω 2 a2 ) − 2 3 (2 − 2iωa − ω 2 a2 )
ia ω ia ω
4 cos(ωa) 2 sin(ωa) 4 sin(ωa)
= + −
aω 2 ω a2 ω 3
352 Advanced Engineering Mathematics with MATLAB

10.
Z 2τ 2τ 2τ
e−iωt e−iωt
F (ω) = (1 − t/τ ) e−iωt dt = − + (−iωt − 1)
0 iω 0 ω2 τ 0
1  −2iωτ  e−2iωτ 1
=− e −1 − 2
(2iωτ + 1) + 2
ωi ω τ  ω τ 
1 e−2iωτ 1 − e−2iωτ 2e−iωτ sin(ωτ )
= + + = cos(ωτ ) −
ωi ωi ω2 τ ωi ωτ

11. "
Z a  2 #
t
F (ω) = 1− e−iωt dt
−a a
a
e−iωt 4 cos(ωa) 2 sin(ωa) 4 sin(ωa)
= − − +
−iω −a aω 2 ω a2 ω 3
4 sin(ωa) 4 cos(ωa)
= −
a2 ω 3 aω 2

12. Z Z
∞ 0
e−iωt e−iωt
F (ω) = dt + dt
0 (t + a2 )ν+1/2
2
−∞ (t2 + a2 )ν+1/2
Z ∞ Z ∞
e−iωt eiωt
= dt + dt
0 (t + a2 )ν+1/2
2
0 (t2
+ a2 )ν+1/2
Z 

cos(ωt) 2|ω|ν Γ 21 Kν (a|ω| )
=2 dt =  .
0 (t2 + a2 )ν+1/2 Γ ν + 12 (2a)ν

13. Let X(ω) = 2πKδ(ω), then


Z ∞
1
x(t) = 2πKδ(ω)eiωt dω = K
2π −∞

from Equation 11.20. Therefore, F[K] = 2πKδ(ω).

14.
Z b Z b Z b
′ b
τ δ(τ − t) dτ = τ H (τ − t) dτ = τ H(τ − t)|a − H(τ − t) dτ.
a a a

If t < a,
Z b
τ δ(τ − t) dτ = b − a − (b − a) = 0.
a
Worked Solutions 353

If a < t < b,
Z b
τ δ(τ − t) dτ = b − (b − t) = t.
a

Finally, if b < t,
Z b
τ δ(τ − t) dτ = 0 − 0 = 0.
a

We may express the final solution in terms of Heavisides as given in the text.

15. From the definition of the Fourier transform,


Z ∞ Z ∞
F (ω) = f (t) cos(ωt) dt + i f (t) sin(ωt) dt = P (ω) + iQ(ω)
−∞ −∞

and
Z ∞ Z ∞
F (−ω) = f (t) cos(ωt) dt − i f (t) sin(ωt) dt = P (ω) − iQ(ω).
−∞ −∞

Therefore, p
|F (ω)| = P 2 (ω) + Q2 (ω) = |F (−ω)|.
On the other hand, if F (ω) = |F (ω)|eiΦ(ω) ,

Φ(ω) = tan−1 [Q(ω)/P (ω)] = −Φ(ω).

Section 11.2

1.
Z Z
1 ∞ 1 ∞
F (ω) = H(t)e−i(ω−ω0 )t dt − H(t)e−i(ω+ω0 )t dt
2i −∞ 2i −∞
   
1 1 ′ 1 1 ′
= + πδ(ω ) − + πδ(ω )
2i iω ′ ω ′ =ω−ω0 2i iω ′ ω ′ =ω+ω0
ω0 πi
= 2 + [δ(ω + ω0 ) − δ(ω − ω0 )].
ω0 − ω 2 2

2.
Z Z
1 ∞ 1 ∞
F (ω) = H(t)e−i(ω−ω0 )t dt + H(t)e−i(ω+ω0 )t dt
2 −∞ 2 −∞
   
1 1 ′ 1 1 ′
= + πδ(ω ) + + πδ(ω )
2 iω ′ ω ′ =ω−ω0 2 iω ′ ω ′ =ω+ω0
iω π
= 2 + [δ(ω + ω0 ) + δ(ω − ω0 )].
ω0 − ω 2 2
354 Advanced Engineering Mathematics with MATLAB

3. From Equation 11.2.18,


Z ∞ Z ∞
1 i
H(t)e−iωt dt = πδ(ω) + , or e−iωt dt = πδ(ω) − .
−∞ ωi 0 ω

Replacing ω with −ω, we have


Z ∞
i i
eiωt dt = πδ(−ω) + = πδ(ω) + .
0 ω ω

4.
 Z 0
F[sgn(t) sin(ω0 t)] = lim − eǫt sin(ω0 t)e−iωt dt
ǫ→0 −∞
Z ∞ 
+ e−ǫt sin(ω0 t)e−iωt dt
0
 0 0
1 eǫt+iω0 t−iωt 1 eǫt−iω0 t−iωt
= lim − +
ǫ→0 2i ǫ + iω0 − iω −∞ 2i ǫ − iω0 − iω −∞
−ǫt+iω0 t−iωt ∞ −ǫt−iω0 t−iωt ∞
1 e 1 e
+ −
2i −ǫ + iω0 − iω 0 2i −ǫ − iω0 − iω 0
 
1 i i i i
= + + +
2i ω0 − ω ω0 + ω ω0 − ω ω0 + ω
1 1 2ω0
= + = 2
ω0 − ω ω0 + ω ω0 − ω 2
 Z 0
F[sgn(t) cos(ω0 t)] = lim − eǫt cos(ω0 t)e−iωt dt
ǫ→0 −∞
Z ∞ 
−ǫt −iωt
+ e cos(ω0 t)e dt
0
 0 0
1 eǫt+iω0 t−iωt 1 eǫt−iω0 t−iωt
= lim − −
ǫ→0 2 ǫ + iω0 − iω −∞ 2 ǫ − iω0 − iω −∞
∞ ∞
1 e−ǫt+iω0 t−iωt 1 e−ǫt−iω0 t−iωt
+ −
2 −ǫ + iω0 − iω 0 2 −ǫ − iω0 − iω 0
−i i 2ωi
= + = 2
ω0 − ω ω0 + ω ω0 − ω 2

Section 11.3

1. From the scaling property,


 
1 π −|ω/a|
F 2 2
= e .
1+a t |a|
Worked Solutions 355

2. Because
cos(at) eiat e−iat
= + ,
1 + t2 2(1 + t2 ) 2(1 + t2 )
we have that  
cos(at) π  −|ω−a| −|ω+a|

F = e + e .
1 + t2 2

3. From Parseval’s equality,


Z ∞ Z ∞ Z ∞
1 dω 1 dx π
= e−2at dt = or = .
2π −∞ a2 + ω 2 0 2a −∞ a2 + x 2 a

4. From Parseval’s equality,


Z ∞ Z ∞ Z 0 Z ∞ 
dx 1 2 −2|ω| π 2ω −2ω
2 2
= π e dω = e dω + e dω
−∞ (x + 1) 2π −∞ 2 −∞ 0
" #
0 ∞
π 2ω π
= e − e−2ω =
4 −∞ 0 2

5. Computing the Fourier transform,


Z ∞
F (ω) = sin(bt)e−(a+iω)t dt
0

e−(a+ωi)t
= [(a + iω) sin(bt) − b cos(bt)]
(a + iω)2 + b2 0
b
= 2 .
a + b2 − ω 2 + 2iaω
Therefore,
b
F ∗ (ω) = .
a2 + b2 − ω 2 − 2iaω
Consequently,
Z ∞ Z ∞
b2
|F (ω)|2 dω = dx.
−∞ −∞ (a2 + b2 − x2 )2 + 4a2 x2
On the other hand,
Z ∞ Z ∞ Z ∞
f 2 (t) dt = e−2at sin2 (bt) dt = 1
2 e−2at [1 − cos(2bt)] dt
−∞ 0 0
∞ ∞
1 −2at e−2at
=− e − [−2a cos(2bt) + 2b sin(2bt)]
4a 0 8a2 + 8b2 0
b2
= .
4a(a + b2 )
2
356 Advanced Engineering Mathematics with MATLAB

From Parseval’s theorem,


Z ∞
1 b2 b2
dx =
2π −∞ (x2 + a2 2 2 2
− b ) + 4a b 2 4a(a + b2 )
2

after a little algebra. Solving for the integral gives the final result.

6. 
F[e−bt sin(at)H(t)] = 1
2i F eiat e−bt − e−iat e−bt
 
1 1 1
= −
2i b + iω ′ ω′ =ω−a b + iω ′ ω′ =ω+a
 
1 1 1
= −
2i (b + iω) − ai (b + iω) + ai
a
=
(b + iω)2 + a2

7. Because the Fourier transform of f (t) = e−|t| is F (ω) = 2/(ω 2 + 1), we


have from Poisson’s summation formula with α = 2π that
∞ ∞
" ∞
#
X 1 X X 
−|2πn| −2π n
=π e =π 1+2 e
n=−∞
n2 + 1 n=−∞ n=1
 
2 e−2π 1 + e−2π
=π 1+ −2π
=π .
1−e 1 − e−2π

8. We begin by noting that


    
exp −a(n + c)2 + 2b(n + c) = exp −a (n + c)2 − 2b(n + c)/a
2
h i
2
= e−b /a exp −a (n + c − b/a) .

Therefore,

X   2

X h i
2
exp −a(n + c)2 + 2b(n + c) = e−b /a exp −a (n + c − b/a) .
n=−∞ n=−∞

We now use Poisson’s summation formula, Equation 11.3.51, with f (t) =


2
e−pt , its corresponding Fourier transform
r  
π ω2
F (ω) = exp − ,
p 4p

α = 1, and p = a. We must also use the time shifting theorem, Equation


11.3.6, with τ = b/a − c. All of these substitution leads to the stated result.
Worked Solutions 357

9. Using the fact that F[δ(t − a)] = e−iaω , direct substitution into the sum-
mation formula leads to the result with α = 2π/T .

10. We begin by inventing a periodic function g(x, y) defined by



X ∞
X
g(x, y) = f (x + 2πk1 , y + 2πk2 ).
k1 =−∞ k2 =−∞

Because g(x, y) is a periodic function of 2π in both directions, it can be


represented by the complex double Fourier series:

X ∞
X
g(x, y) = cn1 n2 ein1 x ein2 y
n1 =−∞ n2 =−∞

or

X ∞
X ∞
X ∞
X
g(0, 0) = f (2πk1 , 2πk2 ) = cn1 n2 .
k1 =−∞ k2 =−∞ n1 =−∞ n2 =−∞

Computing cn1 n2 , we find that


Z π Z π
1
cn1 n2 = g(x, y)e−in1 x e−in2 y dx dy
4π 2 −π −π
Z π X ∞ Z π X ∞
1
= f (x + 2k1 π, y + 2k2 π)
4π 2 −π −π
k2 =−∞ k1 =−∞
−in1 x −in2 y
×e e dx dy

X Z π ∞
X Z π
1
= f (x + 2k1 π, y + 2k2 π)
4π 2 −π k =−∞ −π
k2 =−∞ 1

× e−in1 x e−in2 y dx dy
∞Z Z

1
= f (x, y) e−in1 x e−in2 y dx dy
4π 2 −∞ −∞
F (n1 , n2 )
= ,
4π 2
where F (ω1 , ω2 ) is the (double) Fourier transform of f (x, y). Substituting for
cn1 n2 in the equation for g(0, 0), we obtain

X ∞
X ∞
X ∞
X
1
f (2πk1 , 2πk2 ) = F (n1 , n2 )
4π 2 n1 =−∞ n2 =−∞
k1 =−∞ k2 =−∞

or

X ∞
X ∞
X ∞
X  
1 2πn1 2πn2
f (α1 k1 , α2 k2 ) = F , .
α1 α2 n1 =−∞ n2 =−∞
α1 α2
k1 =−∞ k2 =−∞
358 Advanced Engineering Mathematics with MATLAB

Section 11.4

1.   Z Z
0 ∞
iωπ −|ω| i i
F −1 e = ωeω eiωt dω + ωe−ω eiωt dω
2 4 −∞ 4 0
0
ie(1+it)ω
= [(1 + it)ω − 1]
4(1 + it)2 −∞
−(1−it)ω ∞
ie t
+ [−(1 − it)ω − 1] =−
4(1 − it)2 0 (1 + t2 )2

2.
1 2 1 1 1
= − = 1 −
(1 + iω)(1 + 2iω) 1 + 2iω 1 + iω 2 + iω 1 + iω
Taking the inverse term by term,

f (t) = e−t/2 H(t) − e−t H(t).

3.
1 1 1
= +
(1 + iω)(1 − iω) 2(1 + iω) 2(1 − iω)
Taking the inverse term by term,

f (t) = 12 e−t H(t) + 12 et H(−t).

4.
iω 1 1 1 1
= − = −
(1 + iω)(1 + 2iω) 1 + iω 1 + 2iω 1 + iω 2( 12 + iω)
Taking the inverse term by term,

f (t) = e−t H(t) − 12 e−t/2 H(t).

5.
1 1 2 2
= − +
(1 + iω)(1 + 2iω)2 1 + iω 1 + 2iω (1 + 2iω)2
1 1 1
= − 1 + 1
1 + iω 2 + iω 2( 2 + iω)2
Taking the inverse term by term,

f (t) = e−t H(t) − e−t/2 H(t) + 12 te−t/2 H(t).

6. The inversion formula is


Z ∞
1 eiωt
f (t) = dω.
2π −∞ ω 2 + a2
Worked Solutions 359

The poles are located at z = ±ai. For t < 0, we take the pole in the lower
half-plane and
  izt 
1 e (z + ai)eitz eat
f (t) = −2πi Res 2 2
; −ai = −i lim = .
2π z +a z→−ia (z + ai)(z − ai) 2a

The negative sign comes from taking the contour in the negative sense. For
t > 0, we use the pole z = ai and
  izt 
1 e (z − ai)eitz e−at
f (t) = 2πi Res 2 2
; ai = i lim = .
2π z +a z→ia (z + ai)(z − ai) 2a

Therefore, the total answer, using the absolute value sign, is

e−a|t|
f (t) = .
2a

7. The inversion formula is


Z ∞
1 ωeiωt
f (t) = dω.
2π −∞ ω 2 + a2

The poles are located at z = ±ai. For t < 0, we take the pole in the lower
half-plane and
  
1 zeizt
f (t) = −2πi Res ; −ai
2π z 2 + a2
(z + ai)zeitz −ieat
= −i lim = .
z→−ia (z + ai)(z − ai) 2

The negative sign comes from taking the contour in the negative sense. For
t > 0, we use the pole z = ai and
  
1 zeizt (z − ai)zeitz ie−at
f (t) = 2πi Res 2 2
; ai = i lim = .
2π z +a z→ia (z + ai)(z − ai) 2

Therefore, the total answer, using the absolute value sign, is



i 1, t > 0,
f (t) = sgn(t)e−a|t| , where sgn(t) =
2 −1, t < 0.

8. The inversion formula is


Z ∞
1 ωeiωt
f (t) = dω.
2π −∞ (ω 2 + a2 )2
360 Advanced Engineering Mathematics with MATLAB

The poles are located at z = ±ai and are second order. For t < 0, we take
the pole in the lower half-plane and
  
1 zeizt
f (t) = −2πi Res ; −ai
2π (z 2 + a2 )2
 
d (z + ai)2 zeitz
= −i lim
z→−ia dz (z + ai)2 (z − ai)2
 
eitz itzeitz 2zeitz
= −i lim + −
z→−ia (z − ai)2 (z − ai)2 (z − ai)3
 at 
e teat eat iteat
= −i − 2 − + 2 = .
4a 4a 4a 4a
The negative sign comes from taking the contour in the negative sense. For
t > 0, we use the pole z = ai and
    
1 zeizt d (z − ai)2 zeitz
f (t) = 2πi Res ; ai = i lim
2π (z 2 + a2 )2 z→ia dz (z + ai)2 (z − ai)2
 
eitz itzeitz 2zeitz
= i lim + −
z→−ia (z + ai)2 (z + ai)2 (z + ai)3
 −at 
e te−at e−at ite−at
=i − 2 + + 2
= .
4a 4a 4a 4a
Therefore, the total answer, using the absolute value sign, is
it −a|t|
f (t) = e .
4a
9. The inversion formula is
Z ∞
1 ω 2 eiωt
f (t) = dω.
2π −∞ (ω 2 + a2 )2
The poles are located at z = ±ai and are second order. For t < 0, we take
the pole in the lower half-plane and
  
1 z 2 eizt
f (t) = −2πi Res ; −ai
2π (z 2 + a2 )2
 
d (z + ai)2 z 2 eitz
= −i lim
z→−ia dz (z + ai)2 (z − ai)2
 
2zeitz itz 2 eitz 2z 2 eitz
= −i lim + −
z→−ia (z − ai)2 (z − ai)2 (z − ai)3
eat teat eat ateat eat
= + − = + .
2a 4 4a 4a 4a
Worked Solutions 361

The negative sign comes from taking the contour in the negative sense. For
t > 0, we use the pole z = ai and
    
1 z 2 eizt d (z − ai)2 z 2 eitz
f (t) = 2πi Res ; ai = i lim
2π (z 2 + a2 )2 z→ia dz (z + ai)2 (z − ai)2
 
2zeitz itz 2 eitz 2z 2 eitz
= i lim + −
z→ia (z + ai)2 (z + ai)2 (z + ai)3
e−at te−at e−at e−at ate−at
= − − = − .
2a 4 4a 4a 4a
Therefore, the total answer, using the absolute value sign, is
1
f (t) = (1 − a|t|)e−a|t| .
4a

10. The inversion formula is


Z ∞
1 eiωt
f (t) = dω.
2π −∞ ω2− 3iω − 3

The simple poles are located at z = (± 3 + 3i)/2. Because there are no
singularities in the lower half-plane, f (t) = 0 for t < 0. For t > 0,
  
1 eizt √
f (t) = 2πi Res 2 ; ( 3 + 3i)/2
2π z − 3iz − 3
 
eizt √
+ 2πi Res 2 ; (− 3 + 3i)/2
z − 3iz − 3
 √
[z − ( 3 + 3i)/2]eizt
=i lim

z→( 3+3i)/2 z 2 − 3iz − 3
√ 
[z − (− 3 + 3i)/2]eizt
+ lim

z→(− 3+3i)/2 z 2 − 3iz − 3
√ √
ie−3t/2 [cos( 3t/2) + i sin( 3t/2)]
= √
2( 3/2 + 3i/2) − 3i
√ √
ie−3t/2 [cos( 3t/2) − i sin( 3t/2)]
+ √
2(− 3/2 + 3i/2) − 3i
√ !
2 3t
= − √ e−3t/2 sin .
3 2

Therefore, the total answer is


2 √
f (t) = − √ e−3t/2 sin( 3t/2)H(t).
3
362 Advanced Engineering Mathematics with MATLAB

11. The inversion formula is


Z ∞
1 eiωt
f (t) = dω.
2π −∞ (ω − ai)2n+2
The pole is located at z = ai and it is a (2n + 2)th order pole. Because there
are no singularities in the lower half-plane, f (t) = 0 for t < 0. For t > 0,
 
1 eizt
f (t) = 2πi Res ; ai
2π (z − ai)2n+2
  
1 d2n+1 (z − ai)2n+2 eizt
= lim
z→ai (2n + 1)! dz 2n+1 (z − ai)2n+2
1 (−1)n+1 2n+1 −at
= (i)2n+2 t2n+1 e−at = t e .
(2n + 1)! (2n + 1)!
Therefore, the total answer is
(−1)n+1 2n+1 −at
f (t) = t e H(t).
(2n + 1)!
12. The inversion formula is
Z ∞
1 ω 2 eiωt
f (t) = dω.
2π−∞ (ω 2
− 1)2 + 4a2 ω 2

The simple poles are located at z = ± 1 − a2 ± ai. Let us assume that a < 1.
Then
 p 
z 2 eizt 2
Res ; 1 − a + ai
(z 2 − 1)2 + 4a2 z 2
 √ 
(z − 1 − a2 − ai)z 2 eizt
= √lim
z→ 1−a2 +ai (z 2 − 1)2 + 4a2 z 2
zeizt
= √lim
z→ 1−a2 +ai 4(z 2 − 1) + 8a2

it 1−a2 −at
e e p
= √ ( 1 − a2 + ia)
8ia 1 − a 2

and
 p 
z 2 eizt 2
Res ; − 1 − a + ai
(z 2 − 1)2 + 4a2 z 2
 √ 
(z + 1 − a2 − ai)z 2 eizt
= √lim
z→− 1−a2 +ai (z 2 − 1)2 + 4a2 z 2
zeizt
= √lim
z→− 1−a2 +ai 4(z 2 − 1) + 8a2

−it 1−a2 −at
e e p
= √ (− 1 − a2 + ia).
−8ia 1 − a2
Worked Solutions 363

Therefore, for t > 0, the residue theorem gives


p p  p 
e−at
f (t) = √ 1 − a2 cos t 1 − a2 − a sin t 1 − a2
8a 1 − a2
p  p p 
+ ia cos t 1 − a2 + i 1 − a2 sin t 1 − a2
p p  p 
+ 1 − a2 cos t 1 − a2 − a sin t 1 − a2
p  p p 
2 2
− ia cos t 1 − a − i 1 − a sin t 1 − a 2

e−at p  e−at p 
= cos t 1 − a2 − √ sin t 1 − a2 .
4a 4 1 − a2
Similarly, for the lower half-plane,
 p 
z 2 eizt 2
Res ; 1 − a − ai
(z 2 − 1)2 + 4a2 z 2
 √ 
(z − 1 − a2 + ai)z 2 eizt
= √lim
z→ 1−a2 −ai (z 2 − 1)2 + 4a2 z 2
zeizt
= √lim
z→ 1−a2 −ai 4(z 2 − 1) + 8a2

eit 1−a2 at
e p
= √ ( 1 − a2 − ia)
−8ia 1 − a2
and
 p 
z 2 eizt 2
Res ; − 1 − a − ai
(z 2 − 1)2 + 4a2 z 2
 √ 
(z + 1 − a2 + ai)z 2 eizt
= √lim
z→− 1−a2 −ai (z 2 − 1)2 + 4a2 z 2
zeizt
= √lim
z→− 1−a2 −ai 4(z 2 − 1) + 8a2

e −it 1−a2 at
e p
= √ (− 1 − a2 − ia).
8ia 1 − a 2

Therefore, for t < 0, the residue theorem gives


 p p  p 
eat
f (t) = − √ − 1 − a2 cos t 1 − a2 − a sin t 1 − a2
8a 1 − a2
p  p p 
− ia cos t 1 − a2 + i 1 − a2 sin t 1 − a2
p p  p 
− 1 − a2 cos t 1 − a2 − a sin t 1 − a2
p  p p 
+ ia cos t 1 − a2 − i 1 − a2 sin t 1 − a2

eat p  eat p 
= cos t 1 − a2 + √ sin t 1 − a2 .
4a 4 1 − a2
364 Advanced Engineering Mathematics with MATLAB

Now,
√ let us consider
√ a > 1. √
The easiest method is to use the above results
with 1 − a2 = i a2 − 1 or −i a2 − 1. Therefore, the total answer is
 −a|t| √ −a|t|

e cosh( a2 −1|t|) sinh( a2 −1|t|)
4a −e 4

a 2 −1
, a > 1,
f (t) = e−a|t| cos(√1−a2 |t|) e−a|t| sin(√1−a2 |t|)
 − √ , 0 < a < 1.
4a 4 1−a2

13. The inversion formula is


Z ∞
1 3eiωt
f (t) = dω.
2π −∞ (2 − iω)(1 + iω)

The poles are located at z = i and z = −2i. For t > 0,


 
1 3eizt
f (t) = (2πi) Res ;i
2π (2 − iz)(1 + iz)
3eizt
= i lim (z − i) = e−t .
z→i i(2 − iz)(z − i)

For t < 0,
 
1 3eizt
f (t) = (−2πi) Res ; −2i
2π (2 − iz)(1 + iz)
3eizt
= −i lim (z + 2i) = e2t .
z→−2i (−i)(z + 2i)(1 + iz)

Therefore, the total answer is



e2t , t < 0,
f (t) =
e−t , t > 0.

14. From the definition of the Fourier transform,


Z ∞ Z ∞
1 ei(t+1)ω 1 ei(t−1)ω
f (t) = 2 2
dω + dω
4π −∞ ω +a 4π −∞ ω 2 + a2
Z ∞ i(t+1)z Z ∞ i(t−1)z
1 e 1 e
= dz + dz.
4π −∞ z 2 + a2 4π −∞ z 2 + a2

For the first integral, if t > −1, we close the contour with an infinite semi-circle
in the top half-plane and compute the residue of the enclosed singularities.
Thus,
Z ∞ i(t+1)ω  i(t+1)z 
e e π
2 + a2
dω = 2πi Res 2 2
; ai = e−a(t+1) .
−∞ ω z + a a
Worked Solutions 365

If t < −1, we close the contour with an infinite semi-circle in the bottom
half-plane and compute the residue of the enclosed singularities. Thus,
Z ∞  i(t+1)z 
ei(t+1)ω e π
dω = −2πi Res ; −ai = ea(t+1) .
−∞ ω 2 + a2 z 2 + a2 a

For the second integral, if t > 1, we close the contour with an infinite semi-
circle in the top half-plane and compute the residue of the enclosed singular-
ities. Thus,
Z ∞  i(t−1)z 
ei(t−1)ω e π
dω = 2πi Res ; ai = e−a(t−1) .
−∞ ω 2 + a2 z 2 + a2 a

If t < 1, we close the contour with an infinite semi-circle in the bottom half-
plane and compute the residue of the enclosed singularities. Thus,
Z ∞  i(t−1)z 
ei(t−1)ω e π
dω = −2πi Res ; −ai = ea(t−1) .
−∞ ω 2 + a2 z 2 + a2 a

The final answer is


  −a(t−1) 
 e + e−a(t+1) /(4a), t > 1,

f (t) = ea(t−1) + e−a(t+1) /(4a), −1 < t < 1,
  a(t−1) 
e + ea(t+1) /(4a), t < −1.

15. From the definition of the Fourier transform,


Z ∞
1 ei(t−1±1)ω
f± (t) = dω.
2π −∞ (ω − ai)(R2 − e−2ωi )

The singularities consist of simple poles at z = ai and zn = ±nπ + i ln(R),


where n = 0, ±1, ±2, ±3, . . .
For the case of F+ (ω), we have
Z ∞
1 eitω
f+ (t) = dω.
2π −∞ (ω − ai)(R2 − e−2ωi )

For t > 0, we close the contour with an infinite semi-circle in the top half-plane
and compute the residue of the enclosed singularities. Thus,
Z ∞  
eitω eitz
dω = 2πi Res ; ai
−∞ (ω − ai)(R2 − e−2ωi ) (z − ai)(R2 − e−2zi )
X∞  
eitz
+ 2πi Res ; z n .
n=−∞
(z − ai)(R2 − e−2zi )
366 Advanced Engineering Mathematics with MATLAB

Because
 
eitz eitz e−at
Res ; ai = lim =
(z − ai)(R2 − e−2zi ) z→ai R2 − e−2zi R2 − e2a

and
 
eitz eitz z − zn
Res 2 −2zi
; z n = lim lim 2 −2zi
(z − ai)(R − e ) z→z n z − ai z→z n R − e

−t ±inπt
R e
= 2
,
2iR {±nπ + [ln(R) − a] i}

X∞
i e−at 1 einπt
f+ (t) = 2 2a
+ t+2
.
R −e 2R n=−∞
nπ + [ln(R) − a] i

If t < 0, we close the contour with an infinite semi-circle in the bottom half-
plane and compute the residue of the enclosed singularities. Because there
are none, f+ (t) = 0 if t < 0. The final answer is

i e−at H(t) X einπt
f+ (t) = 2 2a
H(t) + t+2
.
R −e 2R n=−∞
nπ + [ln(R) − a] i

Turning to the case of F− (ω), we have


Z ∞
1 ei(t−2)ω
f− (t) = dω.
2π −∞ (ω − ai)(R2 − e−2ωi )

For t > 2, we close the contour with an infinite semi-circle in the top half-plane
and compute the residue of the enclosed singularities. Thus,
Z ∞  
ei(t−2)ω ei(t−2)z
2 −2ωi )
dω = 2πi Res ; ai
−∞ (ω − ai)(R − e (z − ai)(R2 − e−2zi )
X∞  
ei(t−2)z
+ 2πi Res ; z n .
n=−∞
(z − ai)(R2 − e−2zi )

Because
 
ei(t−2)z ei(t−2)z e−at
Res 2 −2zi
; ai = lim 2 −2zi
= 2 −2a
(z − ai)(R − e ) z→ai R − e R e −1

and
 
ei(t−2)z ei(t−2)z z − zn
Res 2 −2zi
; z n = lim lim 2 −2zi
(z − ai)(R − e ) z→z n z − ai z→z n R − e

−t+2 ±inπt
R e
= 2
,
2iR {±nπ + [ln(R) − a] i}
Worked Solutions 367


i e−at 1 X einπt
f− (t) = 2 −2a
+ t
.
R e − 1 2R n=−∞ nπ + [ln(R) − a] i

If t < 2, we close the contour with an infinite semi-circle in the bottom half-
plane and compute the residue of the enclosed singularities. Because there
are none, f− (t) = 0 if t < 2. The final answer is


i e−at H(t − 2) X einπt
f− (t) = 2 −2a
H(t − 2) + t
.
R e −1 2R n=−∞
nπ + [ln(R) − a] i

16. From the definition of the Fourier transform,


Z ∞

1 cosh(y ω 2 + 1 )eiωt
f (t) = √ √ dω
2π −∞ ω 2 + 1 sinh(p ω 2 + 1/2)
I √
1 cosh(y z 2 + 1 )eizt
= √ √ dz,
2π C z 2 + 1 sinh(p z 2 + 1/2)

where we have closed the line integral with an infinite semicircle


√ in the upper
half-plane if t > 0. Simple p poles are located at z = i and p z 2 + 1 = 2nπi,
2 2 2
n = 0, 1, 2, . . ., or zn = i 1 + 4n π /p . Now the residue at z = i is
 √ 
cosh(y z 2 + 1 )eizt
Res √ √ ;i
z 2 + 1 sinh(p z 2 + 1/2)

(z − i) cosh(y z 2 + 1 )eizt e−t
= lim 2 =
z→i (z + 1)p[1 + p2 (z 2 + 1)/24 + · · ·]/2 ip

and  √ 
cosh(y z 2 + 1 )eizt
Res √ √ ; zn
z 2 + 1 sinh(p z 2 + 1/2)

(z − zn ) cosh(y z 2 + 1 )eizt
= lim √ √
z→zn z 2 + 1 sinh(p z 2 + 1/2)

cosh(y z 2 + 1 )eizt
= lim √
z→zn (pz/2) cosh(p z 2 + 1/2)
p
2 cos(2nπy/p) exp(− 1 + 4n2 π 2 /p2 t)
= p .
ip(−1)n 1 + 4n2 π 2 /p2
Therefore, the inverse equals i times the sum of the residues or

∞ p
e−t 2 X (−1)n cos(2nπy/p) exp(− 1 + 4n2 π 2 /p2 t)
f (t) = + p .
p p n=1 1 + 4n2 π 2 /p2
368 Advanced Engineering Mathematics with MATLAB

For t < 0 we close the p


contour in the lower half-plane and evaluate the poles
at z = −i and zn = −i 1 + 4n2 π 2 /p2 . We find that
 √ 
cosh(y z 2 + 1 )eizt
Res √ √ ; −i
z 2 + 1 sinh(p z 2 + 1/2)

(z + i) cosh(y z 2 + 1 )eizt et
= lim = −
z→−i (z 2 + 1)p[1 + p2 (z 2 + 1)/24 + · · ·]/2 ip

and  √ 
cosh(y z 2 + 1 )eizt
Res √ √ ; zn
z 2 + 1 sinh(p z 2 + 1/2)

(z − zn ) cosh(y z 2 + 1 )eizt
= lim √ √
z→zn z 2 + 1 sinh(p z 2 + 1/2)

cosh(y z 2 + 1 )eizt
= lim √
z→zn (pz/2) cosh(p z 2 + 1/2)
p
2 cos(2nπy/p) exp( 1 + 4n2 π 2 /p2 t)
=− p .
ip(−1)n 1 + 4n2 π 2 /p2
Summing the residues and multiplying by −i,
∞ p
et 2 X (−1)n cos(2nπy/p) exp( 1 + 4n2 π 2 /p2 t)
f (t) = + p .
p p n=1 1 + 4n2 π 2 /p2

17. From the definition of the Fourier transform,


Z ∞ I
1 eitω 1 eitz
f (t) = n o dω = n o dz.
2π −∞ cos ωL 2π C cos zL
β[1+iγsgn(ω)] β[1+iγsgn(z)]

The integral has singularities at

(2n − 1)βπ (2n − 1)iβγπ


zn = ± + ,
2L 2L

where n = 1, 2, 3, . . . Because the poles are only in the upper half-plane,


f (t) = 0 for t < 0. For t > 0,
" ∞
!
X eitz
f (t) = i Res n o ; z = zn+
zL
n=1 cos β[1+iγsgn(z)]
!#
eitz
+ Res n o ; z = zn− ,
zL
cos β[1+iγsgn(z)]
Worked Solutions 369

where
 
eitz (z − zn )eitz
Res n o ; z = zn = lim n o
zL z→zn zL
cos β[1+iγsgn(z)] cos β[1+iγsgn(z)]

eitzn
=± L n
β[1+iγsgn(zn )] (−1)
n
(−1) β
=± [1 + iγsgn(zn )]e−(2n−1)βγπt/2L
L
× e±(2n−1)βπit/2L .

Therefore,


iβ X 
f (t) = (−1)n e−(2n−1)βγπt/2L e(2n−1)βπit/2L + iγe±(2n−1)βπit/2L
L n=1

− e−(2n−1)βπit/2L + iγe±(2n−1)βπit/2L

2β X
=− (−1)n e−(2n−1)βγπt/2L
L n=1
× {γ cos[(2n − 1)βπt/2L] + sin[(2n − 1)βπt/2L]} .

18. Z Z 
∞ ∞
sin(x) eix
2
dx = ℑ 2
dx
−∞ x + 4x + 5 −∞ x + 4x + 5
I 
eiz
=ℑ 2
dz ,
C z + 4z + 5

if C is a semicircle of infinite radius in the upper half-plane. Within the


contour there is a simple pole at z = −2 + i. Then,
I  
eiz eiz
dz = 2πi Res ; −2 + i
C z 2 + 4z + 5 z 2 + 4z + 5
(z + 2 − i)eiz π
= 2πi lim = e−2i .
z→−2+i z 2 + 4z + 5 e

Taking the imaginary part gives the desired result.


19.
Z ∞ Z ∞ Z ∞ 
cos(x) 1 cos(x) 1 eix
dx = dx = ℜ dx
0 (x2 + 1)2 2 2
−∞ (x + 1)
2 2 −∞ (x + 1)2
2
I iz

1 e
= ℜ 2 + 1)2
dz ,
2 C (z
370 Advanced Engineering Mathematics with MATLAB

if C is a semicircle of infinite radius in the upper half-plane. Within the


contour there is a second-order pole at z = i. Therefore,
I    
eiz eiz d (z − i)2 eiz
dz = 2πi Res ; i = 2πi lim
C (z 2 + 1)2 (z 2 + 1)2 z→i dz (z − i)2 (z + i)2
 iz iz

ie 2e π
= 2πi lim − =
z→i (z + i)2 (z + i) 3 e

Substituting into the first equation gives the desired result.


20.
Z ∞ Z ∞  I 
x sin(ax) xeaxi zeazi
dx = ℑ dx =ℑ dz ,
−∞ x2 + 4 −∞ x2 + 4 C z2 + 4

if C is a semicircle of infinite radius in the upper half-plane. Within the


contour there is a simple pole at z = 2i. Then,
I  
zeazi zeazi
dz = 2πi Res ; 2i
C z2 + 4 z2 + 4
z(z − 2i)eazi
= 2πi lim = πie−2a .
z→2i (z − 2i)(z + 2i)

Substituting into the first equation gives the desired result.


21.
Z ∞ Z ∞ Z ∞ 
x2 cos(ax) 1 x2 cos(ax) 1 x2 eaxi
dx = dx = ℜ dx .
0 (x2 + b2 )2 2 −∞ (x2 + b2 )2 2 −∞ (x2 + b2 )2

If we now introduce a semicircle of infinite radius in the upper-half of the


complex plane, CR ,
Z ∞ I Z
x2 eaxi z 2 eazi z 2 eazi
dx = dz − dz.
−∞ (x2 + b2 )2 C (z 2 + b2 )2 CR (z 2 + b2 )2

Because of our choice of CR , the second integral on the right side vanishes
and we must only evaluate the closed contour integral. It has a second-order
pole at z = bi. Therefore,
I  2 azi   2 azi 
z 2 eazi z e d z e
dz = 2πi Res ; bi = 2πi lim
C (z 2 + b2 )2 (z 2 + b2 )2 z→2i dz (z + bi)2
 
iaz 2 eazi 2zeazi 2z 2 eazi
= 2πi lim + −
z→2i (z + bi)2 (z + bi)2 (z + bi)3
π 
aπ −ab
= − e .
2b 2
Worked Solutions 371

Substituting this result into the second equation and then substituting the
second equation into the first, gives the desired result.
22.
Z ∞ Z ∞ 
cosh(hx) − 1 cosh(hx) − 1 aix
cos(ax) dx = ℜ e dx
−∞ x sinh(hx) −∞ x sinh(hx)
I 
cosh(hz) − 1 aiz
=ℜ e dz ,
C z sinh(hz)

if a > 0 and C is a semicircle of infinite radius in the upper half-plane.


Within the contour there is a removal singularity at z = 0 and simple poles
at hzn = nπi with n = 1, 2, 3, . . . within the contour. Therefore,
I X∞  
cosh(hz) − 1 aiz cosh(hz) − 1 aiz nπi
e dz = 2πi Res e ;
C z sinh(hz) n=1
z sinh(hz) h

with
   
cosh(hz) − 1 aiz nπi cosh(hz) − 1 aiz
Res e ; = lim e
z sinh(hz) h z→nπi/h z
 
1
× lim
z→nπi/h h cosh(hz)

1 − (−1)n −nπa/h
= e .
nπi
Thus,
Z ∞ X∞
cosh(hx) − 1 exp[−(2m − 1)πa/h]
cos(ax) dx = 4
−∞ x sinh(hx) m=1
2m − 1
= ln[coth(πa/h)].

Because we get the same integral if we replace a by −a, we will get the same
answer except that we must place an absolute value sign around a in the final
answer.

Section 11.5

1. Z ∞ Z ∞
f (t) ∗ g(t) = e−(t−x) H(t − x)e−x dx = e−t H(t − x) dx
0 0

If t < 0, f (t) ∗ g(t) = 0. If t > 0,


Z t
−t
f (t) ∗ g(t) = e dx = te−t .
0
372 Advanced Engineering Mathematics with MATLAB

Therefore, f (t) ∗ g(t) = te−t H(t).

2.
Z ∞ Z ∞
f (t) ∗ g(t) = e(t−x) H(x − t)e−x dx = et e−2x H(x − t) dx
0 0

If t < 0, Z ∞
t
f (t) ∗ g(t) = e e−2x dx = 12 et .
0

If t > 0, Z ∞
t
f (t) ∗ g(t) = e e−2x dx = 12 e−t .
t

Therefore,
f (t) ∗ g(t) = 21 e−|t| .

3.
Z ∞ Z ∞
f (t) ∗ g(t) = e−(t−x) H(t − x)e−2x dx = e−t e−x H(t − x) dx
0 0

If t < 0, f (t) ∗ g(t) = 0. If t > 0,


Z t
f (t) ∗ g(t) = e−t e−x dx = e−t − e−2t .
0

Therefore, f (t) ∗ g(t) = e−t − e −2t
H(t).

4.
Z ∞
t
e H(−t) ∗ [H(t) − H(t − 2)] = et−x H(x − t)[H(x) − H(x − 2)] dx
−∞
Z 2
= et−x H(x − t) dx.
0

If t > 2, the integrand is always zero and the convolution equals zero. If t < 0,
Z 2
et H(−t) ∗ [H(t) − H(t − 2)] = et−x dx = et − et−2 .
0

Finally, if 0 < t < 2,


Z 2
et H(−t) ∗ [H(t) − H(t − 2)] = et−x dx = 1 − et−2 .
t
Worked Solutions 373

5.
Z ∞
[H(t) − H(t − 2)] ∗ [H(t) − H(t − 2)] = [H(t − x) − H(t − x − 2)]
−∞
× [H(x) − H(x − 2)] dx
Z 2
= [H(t − x) − H(t − x − 2)] dx.
0

If t < 0 or t > 4, the integrand is always zero and the convolution equals zero.
For 0 < t < 2, H(t − x − 2) equals zero for 0 < x < 2. Therefore,
Z t
[H(t) − H(t − 2)] ∗ [H(t) − H(t − 2)] = dx = t.
0

For 2 < t < 4, H(t − x) equals one for 0 < x < 2 while H(t − x − 2) equals
one for 0 < x < t − 2. Therefore,
Z 2 Z t−2
[H(t) − H(t − 2)] ∗ [H(t) − H(t − 2)] = dx − dx = 4 − t.
0 0

6. Z ∞
e−|t| ∗ e−|t| = e−|x| e−|t−x| dx
−∞
Z 0 Z ∞
= ex e−|t−x| dx + e−x e−|t−x| dx.
−∞ 0

If t < 0,
Z t Z 0 Z ∞
e−|t| ∗ e−|t| = ex e−(t−x) dx + ex e(t−x) dx + e−x e(t−x) dx
−∞ t 0
t 0 ∞
= 12 e−t e2x + et x − 21 et e−2x = et (1 − t).
−∞ t 0

If t > 0,
Z 0 Z t Z ∞
e−|t| ∗ e−|t| = ex e−(t−x) dx + e−x e−(t−x) dx + e−x e(t−x) dx
−∞ 0 t
0 t ∞
= 21 e−t e2x + e−t x − 21 et e−2x = e−t (1 + t).
−∞ 0 t

7. From Equation 11.1.21,


Z ∞
δ(t − x − a)δ(x − b) dx = δ(t − b − a).
−∞
374 Advanced Engineering Mathematics with MATLAB

Section 11.6

1. Taking the Fourier transform of both sides of the equation, we have that

1 1
(2 + 3iω − ω 2 )Y (ω) = or Y (ω) = .
1 + iω (1 + iω)2 (2 + iω)

Therefore, I
1 eitz
y(t) = − dz,
2π C i(z − i)2 (z − 2i)
where C includes the singularities in the upper half-plane for t > 0 and in-
cludes the singularities in the lower half-plane if t < 0. Because there are no
singularities in the lower half-plane, y(t) = 0 for t < 0. For t > 0,
    
−1 eitz eitz
y(t) = (2πi) Res ; i + Res ; 2i ,
2π i(z − i)2 (z − 2i) i(z − i)2 (z − 2i)

where
   
eitz d 2 eitz
Res ; i = lim (z − i)
i(z − i)2 (z − 2i) z→i dz i(z − i)2 (z − 2i)
 itz

te eitz t − 1 −t
= lim − 2
=− e
z→i (z − 2i) i(z − 2i) i

and
 
eitz eitz e−2t
Res ; 2i = lim (z − 2i) = −
i(z − i)2 (z − 2i) z→2i i(z − i)2 (z − 2i) i

so that
y(t) = (t − 1)e−t + e−2t
for t > 0. Therefore, the particular solution is y(t) = [(t − 1)e−t + e−2t ]H(t).

2. Taking the Fourier transform of both sides of the equation, we have that

1
[(iω)2 + 4iω + 4]Y (ω) =
ω2 + 1
or
1
Y (ω) = .
(ω 2 + 1)(iω + 2)2
Therefore, Z ∞
1 eitω
y(t) = − dω.
2π −∞ (ω 2 + 1)(ω − 2i)2
Worked Solutions 375

For t > 0 we close the line integral with an infinite semicircle in the upper
half-plane. The contribution from the additional arc vanishes by Jordan’s
lemma. The singularities within the closed contour integral
I
1 eitz
y(t) = − dz
2π C (z 2 + 1)(z − 2i)2

occur at z = i and z = 2i. Therefore,


  
1 eitz
y(t) = (2πi) Res − 2 ; i
2π (z + 1)(z − 2i)2
 
eitz
+ Res − 2 ; 2i ,
(z + 1)(z − 2i)2

where
 
eitz eitz e−t
Res − 2 2
; i = − lim (z − i) 2
=
(z + 1)(z − 2i) z→i (z − i)(z + i)(z − 2i) 2i

and
   
eitz d 2 eitz
Res − 2 ; 2i = − lim (z − 2i) 2
(z + 1)(z − 2i)2 z→2i dz (z + 1)(z − 2i)2
 itz

ite 2zeitz
= − lim − 2
z→2i z 2 + 1 (z + 1)2
it 4i
= e−2t + e−2t
3 9

so that
y(t) = 21 e−t − 13 te−2t − 94 e−2t
for t > 0. For t < 0 we close the line integral with an infinite semicircle in the
lower half-plane. The contribution from the arc vanishes by Jordan’s lemma.
Therefore, I
1 eitz
y(t) = − dz.
2π C (z 2 + 1)(z − 2i)2
The only singularity in the lower half-plane is at z = −i. Therefore,
 
1 eitz
y(t) = (−2πi)Res − 2 ; −i ,
2π (z + 1)(z − 2i)2

where
 
eitz eitz et
Res − 2 2
; −i = − lim (z + i) 2
=−
(z + 1)(z − 2i) z→−i (z − i)(z + i)(z − 2i) 18i
376 Advanced Engineering Mathematics with MATLAB

or
et
y(t) =
18
for t < 0. Thus, the particular solution is
 1 −t 1 −2t 4 −2t
e − 3 te − 9e , t > 0,
y(t) = 2 1 t
18 e , t < 0.

3. Taking the Fourier transform of both sides of the equation, we have that

1 1
[(iω)2 − 4iω + 4]Y (ω) = or Y (ω) = .
1 + ωi (1 + ωi)(iω − 2)2

Therefore, for t > 0


Z ∞
1 eitω
y(t) = dω.
2π −∞ (1 + ωi)(iω − 2)2

For t > 0 we close the line integral with an infinite semicircle in the upper
half-plane. The contribution from the additional arc vanishes by Jordan’s
lemma. The singularities within the closed contour integral
I
1 eitz
y(t) = dz
2π C (1 + zi)(iz − 2)2

occur at z = i and z = −2i. Therefore, for t > 0


 
1 eitz
y(t) = (2πi)Res ; i ,
2π (1 + zi)(iz − 2)2

where
 
eitz eitz e−t
Res ; i = lim (z − i) =
(1 + zi)(iz − 2)2 z→i i(z − i)(iz − 2)2 9i

so that y(t) = 91 e−t for t > 0. For t < 0 we close the line integral with
an infinite semicircle in the lower half-plane. The contribution from the arc
vanishes by Jordan’s lemma. Therefore,
I
1 eitz
y(t) = − dz.
2π C (1 + iz)(z + 2i)2

The only singularity in the lower half-plane is at z = −2i. Therefore,


 
1 eitz
y(t) = (−2πi)Res ; −2i ,
2π (1 + zi)(iz − 2)2
Worked Solutions 377

where
   
eitz d 2 eitz
Res ; −2i = − lim (z + 2i)
(1 + zi)(iz − 2)2 z→−2i dz (1 + iz)(z + 2i)2
 itz 
ite ieitz i it
= − lim − 2
= e2t − e2t
z→−2i 1 + iz (1 + iz) 9 3

or y(t) = e2t /9 − te2t /3 for t < 0. Thus, the particular solution is


(
1 −t
9e , t > 0,
y(t) = 1 2t 1 2t
9 e − 3 te , t < 0.

4. Taking the Fourier transform of both sides of the equation, we have that

1
Y (ω) = .
ω 4 − λ4

Therefore, Z ∞
1 eiωx
y(x) = dω.
2π −∞ ω 4 − λ4
For x > 0, the poles iλ and −λ lie in the upper half-plane. Thus,
    izx 
eizx e
y(x) = i Res 4 ; iλ + Res 4 ; −λ ,
z − λ4 z − λ4

where  izx 
e (z − λi)eizx e−λx
Res 4 4
; iλ = lim 4 4
=− 3
z −λ z→iλ z −λ 4λ i
and  
eizx (z + λ)eizx e−iλx
Res 4 ; −λ = lim = − .
z − λ4 z→−λ z 4 − λ4 4λ3
Therefore,
1 
y(x) = − 3
e−λx + ie−iλx .

For x < 0, the poles −iλ and λ lie in the lower half-plane. Thus,
    izx 
eizx e
y(x) = (−i) Res 4 ; −iλ + Res 4 ;λ ,
z − λ4 z − λ4

where  
eizx (z + λi)eizx eλx
Res ; −iλ = lim = 3
z − λ4
4 z→−iλ 4
z −λ 4 4λ i
378 Advanced Engineering Mathematics with MATLAB

and  izx 
e (z − λ)eizx eiλx
Res 4 ; λ = lim = .
z − λ4 z→λ z 4 − λ4 4λ3
Therefore,
1 
y(x) = − 3
eλx + ieiλx .

In general,
1  −λ|x| −iλ|x|

y(x) = − e + ie .
4λ3

Section 11.7

1.  
Z 1
1 1 y 1 −1 x − t
u(x, y) = dt = − tan
π 0 (x − t)2 + y 2 π y 0
    
1 1−x x
= tan−1 + tan−1
π y y

2.
Z ∞ Z
1 y 1 0 y
u(x, y) = 2 + y2
dt − 2 + y2
dt
π 0 (x − t) π −∞ (x − t)
 ∞  0
1 x−t 1 x−t
= − tan−1 + tan−1
π y 0 π y −∞
     
1 1 −1 x 1 −1 x 1 2 x
= + tan + tan − = tan−1
2 π y π y 2 π y

3.  0
Z 0
T0 y T0 x−t
u(x, y) = 2 2
dt = −
π−∞ (x − t) + y π y −∞
      
T0 x π T 0 π x
= − tan−1 + = − tan−1
π y 2 π 2 y

4. Z Z
−1
2T0 y T0 1 y
u(x, y) = 2 2
dt + dt
π −∞ (x − t) + y π −1 (x − t)2 + y 2
  −1  1
2T0 −1 x − t T0 −1 x − t
=− tan − tan
π y −∞ π y −1
Worked Solutions 379
   
2T0 −1 x + 1 T0 −1 x − 1
u(x, y) = − tan + T0 − tan
π y π y
 
T0 x + 1
+ tan−1
π y
    
T0 −1 1 + x −1 1 − x
= π − tan + tan
π y y

5.
Z 1 Z
T0 y T1 − T0 1 yt
u(x, y) = 2 2
dt + 2 2
dt
π −1 (x − t) + y π 0 (x − t) + y
 1
T0 −1 x − t T1 − T0 1
=− tan + y ln[(x − t)2 + y 2 ] 0
π y −1 2π
 1
T1 − T0 −1 x − t
− x tan
π y 0
    
T0 1−x 1+x
u(x, y) = tan−1 + tan−1
π y y
 2 2

T1 − T0 (x − 1) + y
+ y ln
2π x2 + y 2
    
T1 − T0 1−x x
+ x tan−1 + tan−1
π y y

6.
Z Z
T 0 a1 y T 1 a2 y
u(x, y) = dt + dt
π −∞ (x − t)2 + y 2 π a1 (x − t)2 + y 2
Z Z
T 2 a3 y Tn ∞ y
+ dt + · · · + dt
π a2 (x − t)2 + y 2 π an (x − t)2 + y 2
  a1   a2
T0 −1 x − t T1 −1 x − t
=− tan − tan
π y −∞ π y a
  a3  1 ∞
T2 x − t T n x − t
− tan−1 − ··· − tan−1 ,
π y a2 π y an
or   
T0 π a1 − x
u(x, y) = + tan−1
π 2 y
    
T1 a2 − x a1 − x
+ tan−1 − tan−1
π y y
    
T2 a3 − x a2 − x
+ tan−1 − tan−1
π y y
  
Tn π an − x
+ ··· + − tan−1
π 2 y
380 Advanced Engineering Mathematics with MATLAB

Section 11.8

1.
Z b  
1 (ξ − x)2
u(x, t) = √ exp − dξ
4a2 πt −b 4a2 t
(Z   Z x   )
b
1 (ξ − x)2 (ξ − x)2
= √ exp − dξ + exp − dξ
4a2 πt x 4a2 t −b 4a2 t
Z (b−x)/√4a2 t Z 0
1 2 1 2
= √ e−τ dτ + √ √ e−τ dτ
π 0 π (−b−x)/ 4a2 t
Z (b−x)/√4a2 t Z (b+x)/√4a2 t
1 −τ 2 1 2
= √ e dτ + √ e−τ dτ
π 0 π 0
   
1 b−x 1 b+x
= 2 erf √ + 2 erf √ ,
4a2 t 4a2 t

where erf(·) is the error function.

2.
Z ∞   Z 0   
1 −bξ (ξ − x)2 bξ (ξ − x)2
u(x, t) = √ e exp − dξ + e exp − dξ
4a2 πt 0 4a2 t −∞ 4a2 t
Z ∞  
exp(−x2 /4a2 t) ξ2 4a2 bt − 2x
= √ exp − 2 − ξ dξ
4a2 πt 0 4a t 4a2 t
Z ∞   
ξ2 4a2 bt + 2x
+ exp − 2 − ξ dξ
0 4a t 4a2 t
   
2 2 √ x 2 2 √ x
= 21 ea b t−bx erfc ab t − √ + 12 ea b t+bx erfc ab t + √ ,
2a t 2a t

where erfc(·) = 1− erf(·) and we used Formula 3.462.1 from I. S. Gradshteyn


and I. M. Ryrhik’s Table of Integrals, Series and Products.

3. If x < 0,

Z b   Z (b−x)/√4a2 t
T0 (ξ − x)2 T0 2
u(x, t) = √ exp − 2t
dξ = √ √ e−τ dτ
2
4a πt 0 4a π 2
−x/ 4a t
   
b − x −x
= 21 T0 erf √ − 21 T0 erf √
4a2 t 4a2 t
   
1 b−x 1 x
= 2 T0 erf √ + 2 T0 erf √ ,
4a2 t 4a2 t
Worked Solutions 381

where erf(·) is the error function. If x > b,

Z b   Z (x−b)/√4a2 t
T0 (ξ − x)2 T0 2
u(x, t) = √ exp − 2
dξ = − √ √ e−τ dτ
4a2 πt 0 4a t π x/ 4a2 t
   
x x−b
= 21 T0 erf √ − 12 T0 erf √
2
4a t 4a2 t
   
b−x x
= 21 T0 erf √ + 12 T0 erf √ ,
4a2 t 4a2 t

where erf(·) is the error function. If 0 < x < b,


Z x   Z b  
T0 (ξ − x)2 T0 (ξ − x)2
u(x, t) = √ exp − dξ + √ exp − dξ
4a2 πt 0 4a2 t 4a2 πt x 4a2 t

Z 0 Z (b−x)/ 4a2 t
T0 −τ 2 T0 2
=√ √ e dτ + √ e−τ dτ
π −x/ 4a2 t π 0
   
1 −x 1 b−x
= − 2 T0 erf √ + 2 T0 erf √
4a2 t 4a2 t
   
1 b−x 1 x
= 2 T0 erf √ + 2 T0 erf √ ,
4a2 t 4a2 t

where erf(·) is the error function. Thus, in all cases,


   
1 b−x 1 x
u(x, t) = 2 T0 erf √ + 2 T0 erf √ .
4a2 t 4a2 t

4.
Z ∞    
1 (ξ − x)2 1 x2
u(x, t) = √ δ(ξ) exp − dξ = √ exp −
4a2 πt −∞ 4a2 t 2a πt 4a2 t

5. If v(r, t) = ru(r, t), then

∂u 1 ∂v v ∂2u 1 ∂2v 2 ∂v 2v
= − 2, and 2
= − 2 + 3.
∂r r ∂r r ∂r r ∂r2 r ∂r r

Therefore,
∂ 2 u 2 ∂u 1 ∂2v ∂u 1 ∂v
+ = , and =
∂r2 r ∂r r ∂r2 ∂t r ∂t
so that
∂v ∂2v
= a2 2 , 0 ≤ r < ∞, 0 < t,
∂t ∂r
382 Advanced Engineering Mathematics with MATLAB

with v(r, 0) = ru0 (r). From Equation 11.8.14,



Z ∞ 
1 (ξ − r)2
v(r, t) = √ f (ξ) exp − dξ
2a πt −∞ 4a2 t
Z ∞  
1 (r − ρ)2
= √ u0 (ρ) exp − ρ dρ
2a πt 0 4a2 t
Z ∞  
1 (r + ρ)2
− √ u0 (ρ) exp − ρ dρ
2a πt 0 4a2 t
Z ∞     
1 (r − ρ)2 (r + ρ)2
= √ u0 (ρ) exp − − exp − ρ dρ
2a πt 0 4a2 t 4a2 t

because u0 (ρ) = u0 (−ρ). Thus,

Z ( "  2 # "  2 #)

1 r−ρ r+ρ
u(r, t) = √ u0 (ρ) exp − √ − exp − √ ρ dρ.
2ar πt 0 2a t 2a t

For the given u0 (ρ), we have that

Z r0 ( "  2 # "  2 #)
N0 r−ρ r+ρ
u(r, t) = √ exp − √ − exp − √ ρ dρ
2ar πt 0 2a t 2a t
Z r0 ( "  2 # "  2 #)
N0 r−ρ r+ρ
= √ exp − √ + exp − √ dρ
2a πt 0 2a t 2a t
Z r0  "  2 #
N0 r−ρ
− √ (r − ρ) exp − √
2ar πt 0 2a t
"  2 #
r+ρ
+ (r + ρ) exp − √ dρ
2a t

√ √
Z (r0 +r)/ 4a2 t Z (r0 −r)/ 4a2 t
N0 −η 2 N0 2
u(r, t) = √ e dη + √ e−η dη
π 0 π 0
√ Z √ √ Z √
2 2
2aN0 t (r0 −r)/ 4a t −η2 2aN0 t (r0 +r)/ 4a t −η2
+ √ e η dη − √ e η dη
r π r π
 0    0
r0 − r r0 + r
= 12 N0 erf √ + erf √
2a t 2a t
√  "  2 # "  2 #
N0 a t r0 + r r0 − r
+ √ exp − √ − exp − √ ,
r π 2a t 2a t

where erf(·) is the error function.


Worked Solutions 383

Section 12.1

1.
Z ∞
L[cosh(at)] = cosh(at)e−st dt
0
Z ∞ Z ∞
1 −(s−a)t 1
= e dt + e−(s+a)t dt
2 0 2 0
∞ −(s+a)t ∞
 
1 e−(s−a)t 1e 1 1 1
=− − = +
2 s−a 0 2 s+a 0 2 s−a s+a
s
= 2
s − a2

2.
Z
1 ∞
L[cos2 (at)] = [1 + cos(2at)]e−st dt
2 0
 −st ∞   ∞
1 e e−st
= − + −s cos(2at) + 2a sin(2at)
2 s 0 s2 + 4a2 0
 
1 1 s s2 + 2a2
= + 2 2
=
2 s s + 4a s(s2 + 4a2 )

3. Z ∞
2
L[(t + 1) ] = (t + 1)2 e−st dt
0
∞ Z
(t + 1)2 −st 2 ∞
=− e + (t + 1)e−st dt
s 0 s 0
 ∞ Z 
1 2 (t + 1) −st 1 ∞ −st
= + − e + e dt
s s s 0 s 0

1 2 2 1 2 2
= + 2 − 3 e−st = + 2+ 3
s s s 0 s s s

4. Z ∞
−t
L[(t + 1)e ] = (t + 1)e−t e−st dt
0
Z ∞ Z ∞
−(s+1)t
= te dt + e−(s+1)t dt
0 0
∞ ∞
e−(s+1)t e−(s+1)t
= [−(s + 1)t − 1] −
(s + 1)2 0 s+1 0
1 1 s+2
= + =
(s + 1)2 s+1 (s + 1)2
384 Advanced Engineering Mathematics with MATLAB

5. Z 2 2
e−(s−1)t 1 − e−2(s−1)
F (s) = et e−st dt = − =
0 s−1 0 s−1

6.
Z π π
[−s sin(t) − cos(t)] 1 + e−sπ
F (s) = sin(t)e−st dt = e−st =
0 s2 + 1 0 s2 + 1

7.

L[2 sin(t) − cos(2t) + cos(3) − t] = 2L[sin(t)] − L[cos(2t)] + cos(3)L[1] − L[t]


2 s cos(3) 1
= − + − 2
s2 + 1 s2 + 4 s s

8.

L[t − 2 + e−5t − sin(5t) + cos(2)] = L[t] − 2L[1] + L[e−5t ]


− L[sin(5t)] + cos(2)L[1]
1 2 1 5 cos(2)
= 2
− + − 2 +
s s s + 5 s + 25 s

9. From Equation 12.1.5, f (t) = e−3t .

10. Because
1 3! 1 3!
F (s) = 4
× = × 4, f (t) = 16 t3 .
s 3! 6 s

11. Because

3 1 1 3 1
F (s) = × = × 2 , f (t) = 3 sin(3t).
3 s2 + 9 3 s +9

12. Because
2s + 3 s 3
F (s) = =2 2 + ,
s2 + 9 s + 9 s2 + 9
then
f (t) = 2 cos(3t) + sin(3t)
by Equation 12.1.7 and Equation 12.1.9.
Worked Solutions 385

13. Because
       
1 2 1 s
f (t) = 2L−1 − 15 −1
2 L + 2L −1
− 6L −1
,
s2 + 1 s3 s+1 s2 + 4

then
15 2
f (t) = 2 sin(t) − 2 t + 2e−t − 6 cos(2t)
by Equation 12.1.7 and Equation 12.1.9.

14. Because
     
1 −1
15 −1 2 −1 s
f (t) = 3L + 2L +L
s s3 s2 + 1
   
1 1
+ 5L−1 − 6L−1
s2 + 1 s−2

then
15 2
f (t) = 3 + 2 t + cos(t) + 5 sin(t) − 6e2t
by Equation 12.1.3, Equation 12.1.5, Equation 12.1.7, Equation 12.1.9 and
Equation 12.1.10.

15. Because f ′ (t) = a cos(at), f (0) = 0 and L [f ′ (t)] = as/(s2 + a2 ), we have


that
a
sF (s) − f (0) = s 2 − 0 = L[f ′ (t)].
s + a2
This verifies Equation 12.1.20.

16. By definition
Z Z

1 ∞
1 s
L[f (at)] = f (at)e−st dt = f (x)e−(s/a)x dx = F ,
0 a 0 a a

if t = x/a.

17.
F (s) = 12 L{[1 − cos(πt/T )]} = 21 L[1] − 12 L[cos(πt/T )]
1 s 1 sT 2
= − = −
2s 2(s2 + π 2 /T 2 ) 2s 2(s2 T 2 + π 2 )

Section 12.2

1.
f (t) =?H(t − 2)+?H(t − 3)
= [t − 2 − 0]H(t − 2) + [0 − (t − 2)]H(t − 3)
= (t − 2)H(t − 2) − (t − 2)H(t − 3)
386 Advanced Engineering Mathematics with MATLAB

2.

f (t) =?H(t − a)+?H(t − 2a)+?H(t − 3a)


= (1 − 0)H(t − a) + (−1 − 1)H(t − 2a) + [0 − (−1)]H(t − 3a)
= H(t − a) − 2H(t − 2a) + H(t − 3a)

3. y ′′ + 3y ′ + 2y = H(t − 1) 4. y ′′ + 4y = 3H(t − 4)

5. y ′′ + 4y ′ + 4y = tH(t − 2) 6. y ′′ + 3y ′ + 2y = et H(t − 1)

7. y ′′ − 3y ′ + 2y = e−t H(t − 2) 8. y ′′ − 3y ′ + 2y = t2 H(t − 1)

9. y ′′ + y = sin(t)[1 − H(t − π)]


 
10. y ′′ + 3y ′ + 2y = t + ae−(t−a) − t H(t − a)

Section 12.3

1. From the first shifting theorem a = 1 and f (t) = sin(2t). Then F (s) =
2/(s2 + 4). Finally

  2 2
L e−t sin(2t) = 2
= 2 .
(s + 1) + 4 s + 2s + 5

2. From the first shifting theorem a = 2 and f (t) = cos(2t). Then F (s) =
s/(s2 + 4). Finally

  s+2 s+2
L e−2t cos(2t) = = 2 .
(s + 2)2 + 4 s + 4s + 8

3.

f (t) = [(t − 1) + 1]2 H(t − 1) = (t − 1)2 H(t − 1) + 2(t − 1)H(t − 1) + H(t − 1)

By the second shifting theorem,

2 −s 2 1
F (s) = e + 2 e−s + e−s .
s3 s s

4.
f (t) = e6 e2(t−3) H(t − 3).
Worked Solutions 387

By the second shifting theorem,

F (s) = e6 e−3s /(s − 2).

5.
1 3 s′
F (s) = + +
s′2
s′ =s−1 s′2 + 9 s′ =s−1 s′2 + 25 s′ =s−2
1 3 s−2
= 2
+ 2 + 2
(s − 1) s − 2s + 10 s − 4s + 29
6.
4! 3 s′
F (s) = + + ′2
s′5
s′ =s+2 s′2
+ 9 s′ =s−1 s + 16 s′ =s−2
4! 3 s−2
= + 2 +
(s + 2)5 s − 2s + 10 s2 − 4s + 20

7.
2 2 s′
F (s) = + +
s′3
s′ =s+1 s′2 + 4 s′ =s−1 s′2 + 9 s′ =s+3
2 2 s+3
= + 2 +
(s + 1)3 s − 2s + 5 s2 + 6s + 18

8. Because
f (t) = [(t − 1) + 1]2 H(t − 1) + e2 et−2 H(t − 2)
= (t − 1)2 H(t − 1) + 2(t − 1)H(t − 1) + H(t − 1)
+ e2 et−2 H(t − 2),

then
2 −s 2 −s 1 −s e2 −2s
F (s) = e + e + e + e .
s3 s2 s s−1

9. Because
f (t) = {[(t − 1) + 1]2 + 2}H(t − 1) + H(t − 2)
= (t − 1)2 H(t − 1) + 2(t − 1)H(t − 1) + 3H(t − 1) + H(t − 2),

then
2 −s 2 3 1
F (s) = e + 2 e−s + e−s + e−2s .
s3 s s s

10. Because
f (t) = [(t − 1) + 2]2 H(t − 1) + e2 et−2 H(t − 2)
= (t − 1)2 H(t − 1) + 4(t − 1)H(t − 1) + 4H(t − 1) + e2 et−2 H(t − 2),
388 Advanced Engineering Mathematics with MATLAB

then
2 −s 4 4 e2 −2s
F (s) = 3
e + 2 e−s + e−s + e .
s s s s−1

11.
f (t) = sin(t)H(t) + sin(t − π)H(t − π)
By the second shifting theorem,

1 e−sπ
F (s) = + 2 .
s2 +1 s +1

12.
f (t) = t − (t − 2)H(t − 2)
By the second shifting theorem,
 
1 −2s
F (s) = 2 1 − e .
s

13. Let f (t) = e−3t g(t), where g(t) = t sin(2t). Now


 
d 2 4s
G(s) = − = 2 .
ds s2 + 4 (s + 4)2

By the first shifting theorem,

4(s + 3)
F (s) = .
(s2 + 6s + 13)2

14.
1 1
F (s) = 4
= ′4 .
(s + 2) s s′ =s+2

Therefore,
f (t) = 16 t3 e−2t .

15.
s (s + 2) − 2 1 2
F (s) = 4
= 4
= 3

(s + 2) (s + 2) (s + 2) (s + 2)4
Therefore, f (t) = 12 t2 e−2t − 31 t3 e−2t .

16.
s s s+1 1
F (s) = = = −
s2 + 2s + 2 2
(s + 1) + 1 (s + 1) + 1 (s + 1)2 + 1
2
Worked Solutions 389

Therefore,
f (t) = e−t cos(t) − e−t sin(t).

17.
s+3 s+1 2
F (s) = = +
s2 + 2s + 2 (s + 1)2 + 1 (s + 1)2 + 1
Therefore, f (t) = e−t cos(t) + 2e−t sin(t).

18. Because
1 1 s+1
F (s) = 2
− 3
+
(s + 1) (s + 1) (s + 1)2 + 1
1 1 s′
= ′2 − ′3 + ′2 ,
s s′ =s+1 s s′ =s+1 s + 1 s′ =s+1

then
f (t) = te−t − 21 t2 e−t + cos(t)e−t .

19. Because
1 2 s+1 1
F (s) = − + +
s + 2 (s + 2)2 (s + 1)2 + 1 (s + 1)2 + 1
1 2 s′ 1
= ′ − ′2 + ′2 +
s s′ =s+2 s s′ =s+2 s + 1 s′ =s+1 s′2 + 1 s′ =s+1

then f (t) = e−2t − 2te−2t + cos(t)e−t + sin(t)e−t .

20. Because
1 2 s+2 2
F (s) = − + +
(s + 2)2 (s + 2)3 (s + 2)2 + 1 (s + 2)2 + 1
1 2 s′ 2
= ′2 − ′3 + ′2 + ,
s s′ =s+2 s s′ =s+2 s + 1 s′ =s+2 s′2 + 1 s′ =s+2

then
f (t) = te−2t − t2 e−2t + cos(t)e−2t + 2 sin(t)e−2t .

21. By the second shifting theorem, f (t) = et−3 H(t − 3).

22.  
1
L−1 = te−t
(s + 1)2
390 Advanced Engineering Mathematics with MATLAB

by the first shifting theorem. Then, by the second shifting theorem,

f (t) = (t − 2)e−(t−2) H(t − 2).

23.
   
s (s + 1) − 1
L−1 = L −1
s2 + 2s + 2 (s + 1)2 + 1
   
s+1 1
= L−1 − L −1
(s + 1)2 + 1 (s + 1)2 + 1
= e−t [cos(t) − sin(t)]

by the first shifting theorem. Then, by the second shifting theorem,

f (t) = e−(t−1) [cos(t − 1) − sin(t − 1)]H(t − 1).

24.    
−1 1 −1 1
L =L = e−2t sin(t)
s2 + 4s + 5 (s + 2)2 + 1
by the first shifting theorem. Then, by the second shifting theorem,

f (t) = e−2(t−4) sin(t − 4)H(t − 4).

25. Because
   
s 1
L−1 = cos(2t) and L−1 = 16 t3 e2t ,
s2 + 4 (s − 2)4

f (t) = cos[2(t − 1)]H(t − 1) + 61 (t − 3)3 e2(t−3) H(t − 3).

26. Because
   
1 s−1 t2 t3
L−1 = 1
2 sin(2t) and L−1 = − ,
s2 + 4 s4 2 6
 
1 (t − 3)2 (t − 3)3
f (t) = 2 sin[2(t − 1)]H(t − 1) + − H(t − 3).
2 6

27. Because
   
−1 s+1 1 −1 1 t3
L = cos(2t) + 2 sin(2t) and L = ,
s2 + 4 s4 6
Worked Solutions 391

1 (t − 3)3
f (t) = {cos[2(t − 1)] + 2 sin[2(t − 1)]}H(t − 1) + H(t − 3).
6

28. From the definition,


Z 2 Z 2 2
t −st e−(s−1)t
F (s) = te e dt = te−(s−1)t dt = [−(s − 1)t − 1]
1 1 (s − 1)2 1
e−2(s−1) e−(s−1)
= 2
[−2(s − 1) − 1] − [−(s − 1) − 1]
(s − 1) (s − 1)2
e−(s−1) e−(s−1) 2e−2(s−1) e−2(s−1)
= + 2
− − .
s−1 (s − 1) s−1 (s − 1)2

For part (b), f (t) = et g(t), where g(t) = t[H(t − 1) − H(t − 2)]. Next, we note
that

g(t) = (t − 1)H(t − 1) + H(t − 1) − (t − 2)H(t − 2) − 2H(t − 2)

or
e−s e−s e−2s e−2s
+ G(s) =
− − 2
s2 s s2 s
by the second shifting theorem. Finally,

e−(s−1) e−(s−1) e−2(s−1) e−2(s−1)


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

by the first shifting theorem.

29. Following Example 6.1.2, we have that

f (t) = (t − 0)H(t) + (0 − t)H(t − a) = t[1 − H(t − a)].

From the definition of the Laplace transform,


Z a a
e−st 1 e−as ae−as
F (s) = te−st dt = (−st − 1) = − − .
0 s2 0 s2 s2 s

On the other hand, f (t) = t − (t − a)H(t − a) − aH(t − a). Applying the second
shifting theorem term by term,

1 e−as ae−as
F (s) = 2
− 2 − .
s s s

30.
1 1 1 t−2
f (t) = t − tH(t − 2) = t − H(t − 2) − H(t − 2)
2 2 2 2
392 Advanced Engineering Mathematics with MATLAB

From the second shifting theorem,

1 e−2s e−2s
F (s) = 2
− 2
− .
2s 2s s

31.
f (t) = t + (1 − t)H(t − 1) + (0 − 1)H(t − 2)
= t − (t − 1)H(t − 1) − H(t − 2).
From the second shifting theorem,

1 e−s e−2s
F (s) = − − .
s2 s2 s

32.
f (t) = t + (4 − t − t)H(t − 2) + [0 − (4 − t)]H(t − 4)
= t − 2(t − 2)H(t − 2) + (t − 4)H(t − 4)
From the second shifting theorem,

1 2e−2s e−4s
F (s) = − + .
s2 s2 s2

33.

f (t) = (t − 1)H(t − 1) + [1 − (t − 1)]H(t − 2) + (0 − 1)H(t − 3)


= (t − 1)H(t − 1) − (t − 2)H(t − 2) − H(t − 3)

From the second shifting theorem,

e−s e−2s e−3s


F (s) = − − .
s2 s2 s

34.
e−s
s2 Y (s) − sy(0) − y ′ (0) + 3sY (s) − 3y(0) + 2Y (s) =
s
e−s
Y (s) =
s(s + 1)(s + 2)

35.
3e−4s
s2 Y (s) − sy(0) − y ′ (0) + 4Y (s) =
s
s 3e−4s
Y (s) = +
s2 + 4 s(s2 + 4)
Worked Solutions 393

36.

e−2s 2e−2s
s2 Y (s) − sy(0) − y ′ (0) + 4sY (s) − 4y(0) + 4Y (s) = +
s2 s

2 e−2s 2e−2s
Y (s) = + +
(s + 2)2 s2 (s + 2)2 s(s + 2)2

37.
e e−s
s2 Y (s) − sy(0) − y ′ (0) + 3sY (s) − 3y(0) + 2Y (s) =
s−1
e−(s−1)
Y (s) =
(s − 1)(s + 1)(s + 2)

38.
e−2 e−2s
s2 Y (s) − sy(0) − y ′ (0) − 3sY (s) + 3y(0) + 2Y (s) =
s+1
2(s − 3) e−2 e−2s
Y (s) = +
(s − 1)(s − 2) (s + 1)(s − 1)(s − 2)

39.

e−s 2e−s e−s


s2 Y (s) − sy(0) − y ′ (0) − 3sY (s) + 3y(0) + 2Y (s) = 3
+ 2 +
s s s

5 e−s
Y (s) = + 3
(s − 1)(s − 2) s (s − 1)(s − 2)
2e−s e−s
+ 2 +
s (s − 1)(s − 2) s(s − 1)(s − 2)

40.
1 e−sπ
s2 Y (s) − sy(0) − y ′ (0) + Y (s) = + 2
s2 +1 s +1
1 e−sπ
Y (s) = + 2
(s2 + 1) 2 (s + 1)2

41.

1 ae−as e−as ae−as


s2 Y (s) − sy(0) − y ′ (0) + 3sY (s) − 3y(0) + 2Y (s)= + − 2 −
s2 s+1 s s
394 Advanced Engineering Mathematics with MATLAB

1 ae−as
Y (s) = +
s2 (s
+ 2)(s + 1) (s + 1)2 (s + 2)
e−as ae−as
− 2 −
s (s + 1)(s + 2) s(s + 1)(s + 2)

42. f (0) = 0, F (s) = 1/s2 , lims→∞ sF (s) = lims→∞ 1/s = 0 = f (0).

43. f (0) = 1, F (s) = s/(s2 + a2 ), lims→∞ sF (s) = lims→∞ s2 /(s2 + a2 ) = 1 =


f (0).

44. f (0) = 0, F (s) = 1/(s + 1)2 , lims→∞ sF (s) = lims→∞ s/(s + 1)2 = 0 =
f (0).

45. f (0) = 0, F (s) = 3/(s2 − 2s + 10), lims→∞ sF (s) = lims→∞ 3s/(s2 − 2s +


10) = 0 = f (0).

46. No

47. Yes, f (t) = 1, lims→0 sF (s) = 1 = f (∞).

48. Yes, f (t) = e−t , lims→0 sF (s) = 0 = f (∞).

49. No

50. Yes, f (t) = 1 + e−2t − 2e−t , lims→0 sF (s) = 1 = f (∞).

51. No

52. We derive the second equation by setting ξ = ax and c = s/(s+b). Taking


the inverse Laplace of this equation, we find
     Z ax   
−1 1 asx −1 1 −η −1 1 bη
L exp − =L − e L exp dη
s s+b s 0 s+b s+b

Now, setting α = bη, ν = 0, and s′ = s + b and using the first shifting theorem
and the third equation, we obtain the desired result.

Section 12.4

1. 
sin(t), 0 ≤ t ≤ π,
x(t) =
0, t ≥ π.
Therefore, Z π
1 + e−sπ
X(s) = sin(t)e−st dt = .
0 s2 + 1
Worked Solutions 395

Then

X(s) 1 + e−sπ 1  sπ 
F (s) = = = coth .
1 − e−sπ (s2 + 1)(1 − e−sπ ) s2 + 1 2

2. 
sin(t), 0 ≤ t ≤ π,
x(t) =
0, t > π.
Therefore Z π
1 + e−sπ
X(s) = sin(t)e−st dt = .
0 s2 + 1
Then

X(s) 1 + e−sπ 1
F (s) = −2sπ
= 2 −sπ −sπ
= 2 .
1−e (s + 1)(1 − e )(1 + e ) (s + 1)(1 − e−sπ )

3. 
t, 0 ≤ t < a,
x(t) =
0, t > a.
Therefore Z a  
−st 1 −as
X(s) = te dt = 2 1 − (1 + as)e .
0 s
Then
X(s) 1 − (1 + as)e−as
F (s) = = .
1 − e−2as s2 (1 − e−2as )

4. 
 1, 0 < t < a,

0, a < t < 2a,
x(t) =
 −1,
 2a < t < 3a,
0, t > 3a.
Therefore
Z a Z 3a
−st 1 − e−as e−3as − e−2as
X(s) = (1) e dt + (−1) e−st dt = + .
0 2a s s

Then

X(s) (1 − e−as )(1 − e−2as ) 1 − e−as


F (s) = −4as
= −4as
= .
1−e s(1 − e ) s(1 + e−2as )
396 Advanced Engineering Mathematics with MATLAB

Section 12.5

1.
1 A B
F (s) = = + ,
(s + 1)(s + 2) s+2 s+1
where

A = lim (s + 2)F (s) = −1 and B = lim (s + 1)F (s) = 1.


s→−2 s→−1

Therefore,
1 1
F (s) = − or f (t) = e−t − e−2t .
s+1 s+2

2.
A B
F (s) = + ,
s+4 s−2
where
1
A = lim (s + 4)F (s) = 6
s→−4

and
B = lim (s − 2)F (s) = 65 .
s→2

Therefore,  
1 1 5
F (s) = +
6 s+4 s−2
or
f (t) = 16 e−4t + 65 e2t .

3.
A B C
F (s) = + + ,
s+2 s+1 s−3
where

A = lim (s + 2)F (s) = − 56 , B = lims→−1 (s + 1)F (s) = 5


4
s→−2

and
1
C = lim (s − 3)F (s) = − 20 .
s→3

Therefore,
f (t) = 54 e−t − 65 e−2t − 1 3t
20 e .

4.
A B C
F (s) = + + ,
s − 2i s + 2i s + 1
Worked Solutions 397

where
8−i
A = lim (s − 2i)F (s) = 20 ,
s→2i

8+i
B = lim (s + 2i)F (s) = 20
s→−2i

and
C = lim (s + 1)F (s) = − 54 .
s→−1

Therefore,
8−i 2it 8+i −2it
f (t) = 20 e + 20 e − 45 e−t
4 1
= 5 cos(2t) + 10 sin(2t) − 45 e−t .

5.
1 1 1/(2i) 1/(2i)
= = −
s2 + 4s + 5 (s + 2 + i)(s + 2 − i) s+2−i s+2+i
1 3πi/2 1 −3πi/2
2e 2e
= +
s+2−i s+2+i
f (t) = 12 e−2t+ti+3πi/2 + 21 e−2t−ti−3πi/2
 
−2t 3π
=e cos t +
2

6.
1 1
=
s2 + 6s + 13 (s + 3 + 2i)(s + 3 − 2i)
1/(4i) 1/(4i)
= −
s + 3 − 2i s + 3 + 2i
1 3πi/2 1 −3πi/2
e e
= 4 + 4
s + 3 − 2i s + 3 + 2i
f (t) = 14 e−3t+2ti+3πi/2 + 41 e−3t−2ti−3πi/2

= 12 e−3t cos 2t + 3π
2

7.
2s − 5 2s − 5
=
s2 + 16 (s + 4i)(s − 4i)
1 + 5i/8 1 − 5i/8
= +
s − 4i s + 4i
1.1792e0.5586i 1.1792e−0.5586i
= +
s − 4i s + 4i
f (t) = 1.1792e4ti+0.5586i + 1.1792e−4ti−0.5586i
= 2.3584 cos (4t + 0.5586)
398 Advanced Engineering Mathematics with MATLAB

8.
1 1
=
s(s2 + 2s + 2) s(s + 1 + i)(s + 1 − i)
1 −1/4 + i/4 −1/4 − i/4
= + +
2s s+1−i s+1+i
√ 3πi/4 √ −3πi/4
1 2e /4 2e /4
= + +
2s s+1−i s+1+i
√ √
1 2 −t+ti+3πi/4 2 −t−ti−3πi/4
f (t) = + e + e
2 √4 4
 
1 2 −t 3π
= + e cos t +
2 2 4

9.

s+2 s+2 1 −1/4 − i/4 −1/4 + i/4


= = + +
s(s2 + 4) s(s + 2i)(s − 2i) 2s s − 2i s + 2i
√ 5πi/4 √ −5πi/4
1 2e /4 2e /4
= + +
2s s − 2i s + 2i
√ √
1 2 2ti+5πi/4 2 −2ti−5πi/4
f (t) = + e + e
2 √4 4
 
1 2 5π
= + cos 2t +
2 2 4

Section 12.6

1. Z t
1
1∗1= dx = t and L(t) = = L(1)L(1)
0 s2

2. Z t t
sin(ax) sin(at)
1 ∗ cos(at) = cos(ax) dx = =
0 a 0 a
 
sin(at) 1
L = 2 = L(1)L[cos(at)]
a s + a2

3. Z t
t
1 ∗ et = ex dx = ex |0 = et − 1
0
 1 1 1
L et − 1 = − = = L(1)L(et )
s−1 s s(s − 1)
Worked Solutions 399

4. Z t t t
tx2 x3
t∗t= (t − x)x dx = − = 61 t3
0 2 0 3 0

1
L(t3 /6) = 4 = L(t)L(t)
s

5. Z t
t ∗ sin(t) = (t − x) sin(x) dx
0
t t
= − t cos(x)|0 − [sin(x) − x cos(x)]|0 = t − sin(t)
1 1 1
L[t − sin(t)] = − 2 = 2 2 = L(t)L[sin(t)]
s2 s +1 s (s + 1)

6. Z t
t t
t ∗ et = (t − x)ex dx = tex 0
− ex (x − 1) 0
= et − t − 1
0

1 1 1 1
L(t ∗ et ) = − 2− = 2 = L(t)L(et )
s−1 s s s (s − 1)

7. Z t
2
t ∗ sin(at) = (t − x)2 sin(ax) dx
0
Z
1 2 t 2 t
= − (t − x) cos(ax) 0 − (t − x) cos(ax) dx
a a 0
Z t
t2 2 t 2
= − 2 (t − x) sin(ax) 0 − 2 sin(ax) dx
a a a 0
t2 2 t t2 2
= + 3 cos(ax) 0 = − 3 [1 − cos(at)]
a a a a
t2 4 2
= − 3 sin (at/2)
a a
 2   
t 2 2 a
L − 3 [1 − cos(at)] = 3 = L(t2 )L[sin(at)]
a a s s 2 + a2

8. Z t
t ∗ H(t − 1) = (t − x)H(x − 1) dx
0

If 0 < t < 1, t ∗ H(t − 1) = 0 because the integrand is always zero. If t > 1,


Z t   t
x2
t ∗ H(t − 1) = (t − x) dx = tx − = 21 (t − 1)2 .
1 2 1
400 Advanced Engineering Mathematics with MATLAB

Therefore,
t ∗ H(t − 1) = 12 (t − 1)2 H(t − 1).
From the second shifting theorem,

e−s e−s 1
L[t ∗ H(t − 1)] = 3
= × 2 = L[H(t − 1)]L[t]
s s s
and the convolution theorem holds.

9. Let b ≥ a. The case b < a follows by analog. Then


Z t
H(t − b) ∗ H(t − a) = H(t − b − x)H(x − a) dx.
0

Therefore, if t < a, the convolution equals zero. If t > a


Z t Z −b
H(t − b) ∗ H(t − a) = H(t − b − x) dx = − H(η) dη,
a t−b−a

if η = t − b − x. If t < b + a, the convolution equals zero because the Heaviside


always equals zero. On the other hand, if t > b + a,
Z 0
H(t − b) ∗ H(t − a) = − dη = t − a − b
t−b−a

or
H(t − b) ∗ H(t − a) = (t − a − b)H(t − a − b).
Then   
e−as−bs e−as e−bs
L[H(t − b) ∗ H(t − a)] = =
s2 s s

= L[H(t − b)]L[H(t − a)].

10. Z t
t ∗ [H(t) − H(t − 2)] = (t − x)[H(x) − H(x − 2)] dx
0

If 0 < t < 2,
Z t
t ∗ [H(t) − H(t − 2)] = (t − x) dx = t2 /2.
0

If t > 2,
Z 2
t ∗ [H(t) − H(t − 2)] = (t − x) dx = 2t − 2.
0
Worked Solutions 401

Using Heaviside’s step function,

t2 (t − 2)2
t ∗ [H(t) − H(t − 2)] = − H(t − 2).
2 2
From the second shifting theorem,
 
 1 1 1 1 e−2s
L t ∗ [H(t) − H(t − 2)] = 3 − 3 e−2s = 2 −
s s s s s

= L(t)L[H(t) − H(t − 2)].

11. Z Z
t t
f (t) = et ∗ t = et−x x dx = et xe−x dx
0 0
 t
= et e−x (−x − 1) 0 = et − t − 1

12.
Z t Z t Z t
−at −ax −ax
f (t) = t ∗ te = (t − x)xe dx = t xe dx − x2 e−ax dx
0 0 0
t  2 
= 2
1 + e−at + 3 e−at − 1
a a

13.  
ea/s s ea/s 1 ea/s
= = 1+
s−1 s−1 s s−1 s
Because  
ea/s  √ 
L−1 = I0 2 at ,
s
   √ 
ea/s  
L−1 = δ(t) + et ∗ I0 2 at
s−1
Z t Z t
√  √ 
= δ(t − x)I0 2 ax dx + et e−x I0 2 ax dx
0
 √   √  0
= I0 2 at − et e−t I0 2 at + et
Z t
√  √ dx
+ et e−x I1 2 ax (2 a ) √
0 2 x
Z √4at  2
τ √ 2τ dτ /(4a)
= et + et exp − I1 (τ ) a √
0 4a τ /(2 a )

Z 4at  2
τ
= et + et exp − I1 (τ ) dτ,
0 4a
402 Advanced Engineering Mathematics with MATLAB

where τ 2 = 4ax.

14. From Equation 11.1.21 and assuming that a, b > 0,


Z t
δ(t − x − a)δ(x − b) dx = δ(t − b − a).
0

Section 12.7

1.
1 1 1 2
F (s) = + 2F (s) , F (s) = + , f (t) = 1 + 2t
s s+2 s s2

2.
1 1 1 1
F (s) = + F (s) 2 , F (s) = + , f (t) = 1 + 12 t2
s s +1 s s3

3.
1 1 1 1
F (s) = + F (s) , F (s) = + 3, f (t) = t + 21 t2
s2 s+1 s2 s

4.

8 1 8(s + 1)
F (s) = 3
− F (s) , F (s) = , f (t) = 2t2 + 2t − 1 + e−2t
s s+1 s3 (s + 2)

5.
6 1 6 6
F (s) = + F (s) 2 , F (s) = + 6, f (t) = t3 + 1 5
20 t
s4 s +1 s4 s

6.

16 1 16(s2 + 1)
F (s) = 3
− 3F (s) 2 , F (s) = , f (t) = 3 + 2t2 − 3 cos(2t)
s s +1 s3 (s2 + 4)

7.
2 2 2 8
F (s) = 3
− 2F (s) 2 , F (s) = 3
− 5, f (t) = t2 − 13 t4
s s −4 s s

8.
1 s 1 2
F (s) = + 2F (s) 2 , F (s) = + , f (t) = 1 + 2tet
s s +1 s (s − 1)2
Worked Solutions 403

9.
1 s 5 4 2
F (s) = − 2F (s) 2 , F (s) = − −
s−2 s +1 s − 2 s − 1 (s − 1)2

f (t) = 5e2t − 4et − 2tet

10.
2 1 2 2
F (s) = 3
+ F (s) 2 , F (s) = 3
+ 5, f (t) = t2 + 1 4
12 t
s s +1 s s

11.
1 s
F (s) = − 2F (s) 2
s+1 s +1
s2 + 1 1 2 2
F (s) = = − +
(s + 1)3 s + 1 (s + 1)2 (s + 1)3

f (t) = e−t − 2te−t + t2 e−t = (1 − t)2 e−t

12.
6 2
F (s) = + 4F (s) 3
s2 s
1 s+1 3
F (s) = − +
s − 2 (s + 1)2 + 3 (s + 1)2 + 3
√ √ √
f (t) = e2t − e−t cos( 3 t) + 3 e−t sin( 3 t)

13. √ √
a π π
F (s) = 3/2 − √ F (s)
2s s

a π
F (s) = √
2s( π + s1/2 )
ah √ i
f (t) = 1 − eπt erfc( πt)
2

14.
1 s
sF (s) − f (0) = + F (s) 2
s2 s +1
5 4 1
F (s) = 3
+ + 5 or f (t) = 4 + 52 t2 + 1 4
24 t
s s s
404 Advanced Engineering Mathematics with MATLAB

15.
1 s
sF (s) − f (0) = + F (s) 2
s2 +1 s +1
1
F (s) = , f (t) = 12 t2
s3

16. Z t ′ 
√ x (τ )
L(A) = BL( t ) + CL √ dτ
0 t−τ
√ r
A B π π
= 3/2 + C [sX(s)]
s 2s s
or
A B 2A √ Bt
X(s) = √ − and x(t) = t− .
C πs3/2 2Cs2 πC 2C

17. Z 
t
1 x′ (τ )
L[x(t)] + L(t) = √ L √ dτ
c π 0 t−τ
r
1 1 π
X(s) + 2 = √ [sX(s)]
s c π s
or √
c c(c + s )
X(s) = − √ = − .
s2 (c − s ) s2 (c2 − s)
Using partial fractions,
 √  2 
1 s c 1 1
X(s) = − 1+ + − .
c2 c s2 s s − c2

Taking the inverse of X(s),


 r
1 2 c2 t t 1
x(t) = 2 −c t − 1 + e − 2c − √
c π c πt
  √ 
1 1 2
+ √ + cec t erf c t
c πt
( r )
1 2
h  √ i t
= 2 ec t 1 + erf c t − c2 t − 1 − 2c .
c π

18. Taking the Laplace transform of both sides of the equation:



α β π
sF (s) − f (0) = − √ [sF (s) − f (0)] √
s π s
Worked Solutions 405

or √ α
sF (s) + β s F (s) =
s
after substitution of the initial condition. Thus

α α s1/2 − β α αβ
F (s) = 3/2 1/2  = 3/2 = −
s s +β s (s − β 2 ) s (s − β 2 ) s3/2 (s − β 2 )
α α αβ
= 2 − − .
β (s − β 2 ) β 2 s s3/2 (s − β 2 )
Taking the inverse term-by-term,
2 Z
!
α β2 t 2β 3 eβ t t −β 2 x √
f (t) = 2 e − 1 − √ e x dx
β π 0
2 Z
√ !
α β2 t 4eβ t β t −u2 2
= 2 e −1− √ e u du
β π 0
 √
√ 
2 β t 2 Z
α  β2 t 2eβ t −u2 2eβ t β t −u2 
= 2 e − 1 + √ ue − √ e du
β π π 0
0
√ 2 Z
√ !
α β2 t 2β t 2eβ t β t −u2
= 2 e −1+ √ − √ e du .
β π π 0

19. Taking the Laplace transform of both sides of the equation:


 
1 a a
F (s) − √ = 2.
s s s + a2 s
Solving for F (s),
√ √
a s + a2 a(s + a2 ) + a2 s + a2
F (s) = √ =
s [ s + a2 − a] s2
a a3 a2 a4
= + 2 + √ + √ .
s s s s + a2 s 2 s + a2
Taking the inverse term-by-term,

√ √ a2 t 2
f (t) = a + a2 t + 12 a erf( at ) + a3 t erf( at ) + √ e−a t
π
because
 √ 
√ 1 √ t −a2 t
L t erf(a t ) − 2 erf(a t ) + √ e
2a a π
 
d a 1 1
=− √ − √ +
ds s s + a2 2as s + a 2 2a (s + a2 )3/2
a a 1 1
= √ + − √ +
s 2 s + a2 2s(s + a2 )3/2 2as s + a2 2a (s + a2 )3/2
a
= √ .
s 2 s + a2
406 Advanced Engineering Mathematics with MATLAB

20. Because
d
L[(ty ′ )′ ] = sL(ty ′ ) − ty ′ (t)|t=0 = −s [sY (s) − y(0)] = −s[sY ′ (s) + Y ],
ds
and
d
[sY (s) − y(0)] = −sY ′ (s) − Y,
L(ty ′ ) = −s
ds
the Laplace transformed version of the differential equation is

−s2 Y ′ − sY + sY ′ + Y + nY = 0,

or
s(s − 1)Y ′ (s) = (n + 1 − s)Y (s).

Section 12.8

1. The Laplace transform of the ordinary differential equation is

1 1
sY (s) − y(0) − 2Y (s) = − 2.
s s
Substituting the values of the initial conditions and solving for Y (s), we find
that
5 1 1
Y (s) = − + 2.
4(s − 2) 4s 2s
Taking the inverse of Y (s) term-by-term, the final answer is y(t) = 54 e2t − 41 +
1
2 t.

2. The Laplace transform of the ordinary differential equation is

1
s2 Y (s) − sy(0) − y ′ (0) − 4sY (s) + 4y(0) + 3Y (s) = .
s−1

Substituting the values of the initial conditions and solving for Y (s), we find
that
1 1/4 1/4 1/2
Y (s) = = − − .
(s − 1)2 (s − 3) s − 3 s − 1 (s − 1)2
Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = 41 e3t − 14 et − 21 tet .

3. The Laplace transform of the ordinary differential equation is

1
s2 Y (s) − sy(0) − y ′ (0) − 4sY (s) + 4y(0) + 3Y (s) = .
s−2
Worked Solutions 407

Substituting the values of the initial conditions and solving for Y (s), we find
that
1 1 1
Y (s) = = − .
(s − 3)(s − 2) s−3 s−2
Taking the inverse of Y (s) term-by-term, the final answer is y(t) = e3t − e2t .

4. The Laplace transform of the ordinary differential equation is

1
s2 Y (s) − sy(0) − y ′ (0) − 6sY (s) + 6y(0) + 8Y (s) = .
s−1

Substituting the values of the initial conditions and solving for Y (s), we find
that
1 5 1
Y (s) = + + .
3(s − 1) 3(s − 4) s − 2
Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = 31 et + 35 e4t + e2t .

5. The Laplace transform of the ordinary differential equation is

1
s2 Y (s) − sy(0) − y ′ (0) + 4sY (s) − 4y(0) + 3Y (s) = .
s+1

Substituting the values of the initial conditions and solving for Y (s), we find
that
s+5 1
Y (s) = +
(s + 3)(s + 1) (s + 1)2 (s + 3)
3 1 7 1 1
=− + + .
4 s + 3 4 s + 1 2(s + 1)2
Taking the inverse of Y (s) term-by-term, the final answer is y(t) = − 43 e−3t +
7 −t
4e + 21 te−t .

6. The Laplace transform of the ordinary differential equation is

1
s2 Y (s) − sy(0) − y ′ (0) + Y (s) = .
s2
Substituting the values of the initial conditions and solving for Y (s), we find
that
s 1 s 1 1
Y (s) = 2 + 2 2 = 2 + 2− 2 .
s + 1 s (s + 1) s +1 s s +1
Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = cos(t) + t − sin(t).


408 Advanced Engineering Mathematics with MATLAB

7. The Laplace transform of the ordinary differential equation is


1
s2 Y (s) − sy(0) − y ′ (0) + 4sY (s) − 4y(0) + 3Y (s) = .
s−1
Substituting the values of the initial conditions and solving for Y (s), we find
that
2 1
Y (s) = +
(s + 3)(s + 1) (s + 3)(s − 1)(s + 1)
7 1 3 1 1 1
=− + + .
8s+3 4s+1 8s−1
3 −t
Taking the inverse of Y (s) term-by-term, the final answer is y(t) = 4e +
1 t 7 −3t
8e − 8e .

8. The Laplace transform of the ordinary differential equation is

s2 Y (s) − sy(0) − y ′ (0) − 4sY (s) + 4y(0) + 5Y (s) = 0.

Substituting the values of the initial conditions and solving for Y (s), we find
that
2(s − 2)
Y (s) = .
(s − 2)2 + 1
Taking the inverse of Y (s) by the first shifting theorem, the final answer is

y(t) = 2 cos(t)e2t .

9. The Laplace transform of the ordinary differential equation is


e−s e−s
sY (s) − y(0) + Y (s) = 2
+ .
s s
Substituting the value of the initial condition and solving for Y (s), we find
that
e−s
Y (s) = 2 .
s
Taking the inverse of Y (s), the final answer is y(t) = (t − 1)H(t − 1).

10. The Laplace transform of the ordinary differential equation is


e−s
s2 Y (s) − sy(0) − y ′ (0) + 3sY (s) − 3y(0) + 2Y (s) = .
s
Substituting the values of the initial conditions and solving for Y (s), we find
that
1 e−s
Y (s) = +
(s + 2)(s + 1) s(s + 2)(s + 1)
1 1 e−s e−s e−s
= − + + − .
s+1 s+2 2s 2(s + 2) s + 1
Worked Solutions 409

Taking the inverse of Y (s) term-by-term, the final answer is


 
y(t) = e−t − e−2t + 21 + 12 e−2(t−1) − e−(t−1) H(t − 1).

11. The Laplace transform of the ordinary differential equation is

e−s
s2 Y (s) − sy(0) − y ′ (0) − 3sY (s) + 3y(0) + 2Y (s) = .
s
Substituting the values of the initial conditions and solving for Y (s), we find
that
1 e−s
Y (s) = +
(s − 2)(s − 1) s(s − 2)(s − 1)
1 1 e−s e−s e−s
= − + + − .
s−2 s−1 2s 2(s − 2) s − 1
Taking the inverse of Y (s) term-by-term, the final answer is
 
y(t) = e2t − et + 12 + 21 e2(t−1) − et−1 H(t − 1).

12. The Laplace transform of the ordinary differential equation is

s2 Y (s) − sy(0) − y ′ (0) + 4Y (s) = 3e−4s /s.

Substituting the values of the initial conditions and solving for Y (s), we find
that  
s 3 1 s
Y (s) = 2 + − 2 e−4s .
s +4 4 s s +4
Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = cos(2t) + 34 {1 − cos[2(t − 4)]}H(t − 4).

13. The Laplace transform of the ordinary differential equation is

s2 Y (s) − sy(0) − y ′ (0) + 4sY (s) − 4y(0) + 4Y (s) = 4e−2s /s.

Substituting the values of the initial conditions and solving for Y (s), we find
that
4e−2s e−2s e−2s 2e−2s
Y (s) = = − − .
s(s + 2)2 s s + 2 (s + 2)2
Taking the inverse of Y (s) term-by-term, the final answer is
h i
y(t) = 1 − e−2(t−2) − 2(t − 2)e−2(t−2) H(t − 2).
410 Advanced Engineering Mathematics with MATLAB

14. The Laplace transform of the ordinary differential equation is

e−s
s2 Y (s) − sy(0) − y ′ (0) + 3sY (s) − 3y(0) + 2Y (s) = .
s−1
Substituting the values of the initial conditions and solving for Y (s), we find
that
1 e−s
Y (s) = +
(s + 1)(s + 2) (s − 1)(s + 1)(s + 2)
1 1 1 e−s 1 e−s 1 e−s
= − + − + .
s+1 s+2 6s−1 2s+1 3s+2
Taking the inverse of Y (s) term-by-term, the final answer is
 
y(t) = e−t − e−2t + 16 et−1 − 21 e−(t−1) + 13 e−2(t−1) H(t − 1).

15. The Laplace transform of the ordinary differential equation is

e−2s
s2 Y (s) − sy(0) − y ′ (0) − 3sY (s) + 3y(0) + 2Y (s) = .
s+1
Substituting the values of the initial conditions and solving for Y (s), we find
that
e−2s 1 e−2s 1 e−2s 1 e−2s
Y (s) = = − + .
(s − 2)(s − 1)(s + 1) 3s−2 2s−1 6s+1

Taking the inverse of Y (s) term-by-term, the final answer is


 
y(t) = 13 e2(t−2) − 12 et−2 + 61 e−(t−2) H(t − 2).

16. The Laplace transform of the ordinary differential equation is

e−s e−2s
s2 Y (s) − sy(0) − y ′ (0) − 3sY (s) + 3y(0) + 2Y (s) = − .
s s
Substituting the values of the initial conditions and solving for Y (s), we find
that
e−s e−2s
Y (s) = −
s(s − 1)(s − 2) s(s − 1)(s − 2)
e−s e−s e−s e−2s e−2s e−2s
= + − − − + .
2s 2(s − 2) s − 1 2s 2(s − 2) s − 1

Taking the inverse of Y (s) term-by-term, the final answer is


   
y(t) = 12 + 21 e2(t−1) − et−1 H(t − 1) − 12 + 12 e2(t−2) − et−2 H(t − 2).
Worked Solutions 411

17. The Laplace transform of the ordinary differential equation is

1 e−sT
s2 Y (s) − sy(0) − y ′ (0) + Y (s) = − .
s s

Substituting the values of the initial conditions and solving for Y (s), we find
that

1 e−sT 1 s e−sT se−sT


Y (s) = − = − − + .
s(s2 + 1) s(s2 + 1) s s2 + 1 s s2 + 1

Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = 1 − cos(t) − [1 − cos(t − T )] H(t − T ).

18. First we write the forcing function f (t) in terms of Heaviside step func-
tions:
f (t) = sin(t) + sin(t − π)H(t − π).
Then we take the Laplace transform of the ordinary differential equation and
find that
1 + e−sπ
s2 Y (s) − sy(0) − y ′ (0) + Y (s) = 2 .
s +1
Substituting the values of the initial conditions and solving for Y (s), we find
that
1 + e−sπ
Y (s) = 2 .
(s + 1)2
We must now invert the transform F (s) = 1/(s2 +1)2 . However, from Example
6.6.5, we have that
 
−1 1
L = 12 [sin(t) − t cos(t)].
(s2 + 1)2

Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = 21 [sin(t) − t cos(t)] + 12 [sin(t − π) − (t − π) cos(t − π)]H(t − π).

19. First we write the forcing function f (t) in terms of Heaviside step func-
tions:

f (t) = t + [ae−(t−a) − t]H(t − a)


= t + ae−(t−a) H(t − a) − (t − a)H(t − a) − aH(t − a).
412 Advanced Engineering Mathematics with MATLAB

Then we take the Laplace transform of the ordinary differential equation and
find that
1 ae−as e−as ae−as
s2 Y (s)−sy(0)−y ′ (0)+3sY (s)−3y(0)+2Y (s) = 2
+ − 2 − .
s (s + 1) s s
Substituting the values of the initial conditions and solving for Y (s), we find
that
1 ae−as
Y (s) = 2 +
s (s + 2)(s + 1) (s + 1)2 (s + 2)
e−as ae−as
− 2 −
s (s + 2)(s + 1) s(s + 2)(s + 1)
1 1 1 3 1 ae−as
= − − + 2+
s + 1 4 s + 2 4s 2s s+2
−as −as −as
ae ae e 1 e−as
− + 2
− +
s+1 (s + 1) s+1 4s+2
−as −as −as
3e e ae ae−as ae−as
+ − 2
− − + .
4s 2s 2s 2(s + 2) s+1
Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = e−t − 41 e−2t − 43 + 12 t


 
− e−(t−a) − 41 e−2(t−a) − 34 + 21 (t − a) H(t − a)
 
+ a 12 e−2(t−a) + (t − a)e−(t−a) − 12 H(t − a).

20. First we write the forcing function f (t) in terms of Heaviside step func-
tions:
   
t t−a t t−a
f (t) = + 1 − − H(t − a) − 1 − H(t − b)
a b−a a b−a
   
t t−a t−a t−b
= − + H(t − a) + H(t − b).
a a b−a b−a
Then we take the Laplace transform of the ordinary differential equation and
find that
1 e−as e−as e−bs
s2 Y (s) − sy(0) − y ′ (0) + ω 2 Y (s) = 2
− 2
− 2
+ .
as as (b − a)s (b − a)s2
Substituting the values of the initial conditions and solving for Y (s), we find
that
   
1 1 1 1 1 1
Y (s) = − 2 − − 2 e−as
aω 2 s2 s + ω2 aω 2 s2 s + ω2
   
1 1 1 −as 1 1 1
− − 2 e + − 2 e−bs .
(b − a)ω 2 s2 s + ω2 (b − a)ω 2 s2 s + ω2
Worked Solutions 413

Taking the inverse of Y (s) term-by-term, the final answer is


   
1 sin(ωt) 1 sin[ω(t − a)]
y(t) = t − − t − a − H(t − a)
aω 2 ω aω 2 ω
 
1 sin[ω(t − a)]
− t − a − H(t − a)
(b − a)ω 2 ω
 
1 sin[ω(t − b)]
+ t − b − H(t − b).
(b − a)ω 2 ω

21. The Laplace transform of the ordinary differential equation is

s2 Y (s) − sy(0) − y ′ (0) − 2sY (s) + 2y(0) + Y (s) = 3e−2s .

Substituting the values of the initial conditions and solving for Y (s), we find
that
1 3
Y (s) = + e−2s .
(s − 1)2 (s − 1)2
Taking the inverse of Y (s) term-by-term, the final answer is

y(t) = tet + 3(t − 2)et−2 H(t − 2).

22. The Laplace transform of the ordinary differential equation is

s2 Y (s) − sy(0) − y ′ (0) − 5sY (s) + 5y(0) + 4Y (s) = e−s .

Substituting the values of the initial conditions and solving for Y (s), we find
that
1 e−s e−s
Y (s) = e−s = − .
(s − 4)(s − 1) 3(s − 4) 3(s − 1)
Taking the inverse of Y (s) term-by-term, the final answer is

1
 
y(t) = 3 e4(t−1) − et−1 H(t − 1).

23. The Laplace transform of the ordinary differential equation is

s2 Y (s) − sy(0) − y ′ (0) + 5sY (s) − 5y(0) + 6Y (s) = 3e−2s − 4e−5s .

Substituting the values of the initial conditions and solving for Y (s), we find
that
3 −2s 3 −2s 4 −5s 4 −5s
Y (s) = e − e + e − e .
s+2 s+3 s+3 s+2
414 Advanced Engineering Mathematics with MATLAB

Taking the inverse of Y (s) term-by-term, the final answer is


h i h i
y(t) = 3 e−2(t−2) − e−3(t−2) H(t − 2) + 4 e−3(t−5) − e−2(t−5) H(t − 5).

24. The Laplace transform of the ordinary differential equation is

s2 Y (s) − sy(0) − y ′ (0) + ωsY (s) − ωy(0) = Ae−sτ − Be−sτ /s.

Substituting the values of the initial conditions and solving for Y (s), we find
that

Ae−sτ Be−sτ
Y (s) = − 2
s(s + ω) s (s + ω)
   
A e−sτ e−sτ B ωe−sτ e−sτ e−sτ
= − − 2 − +
ω s s+ω ω s2 s2 s+ω

Taking the inverse of Y (s) term-by-term, the final answer is


   
A B A B B
y(t) = − 2 H(t−τ )− + 2 e−ω(t−τ ) H(t−τ )− (t−τ )H(t−τ ).
ω ω ω ω ω

25. The Laplace transform of the ordinary differential equations is

sX(s) − x(0) − 2X(s) + Y (s) = 0

and
sY (s) − y(0) − 3X(s) − 4Y (s) = 0.
Substituting the values of the initial conditions and solving for X(s) and Y (s),
we find that
s−4 s−3 1
X(s) = = −
(s − 3)2 + 2 (s − 3)2 + 2 (s − 3)2 + 2

and
3
Y (s) = .
(s − 3)2 + 2
Taking the inverse of X(s) and Y (s) term-by-term, the final answer is
√ √
x(t) = cos( 2t)e3t − √1
2
sin( 2t)e3t

and √
y(t) = √3 sin( 2t)e3t .
2
Worked Solutions 415

26. The Laplace transform of the ordinary differential equations is

sX(s) − x(0) − 2sY (s) + 2y(0) = 1/s

and
sX(s) − x(0) + Y (s) − X(s) = 0.
Substituting the values of the initial conditions and solving for X(s) and Y (s),
we find that
1 4 2 1
X(s) = 2 = − −
s (2s − 1) 2s − 1 s s2
and
1−s 2 1 1
Y (s) = = − − 2.
s2 (2s
− 1) 2s − 1 s s
Taking the inverse of X(s) and Y (s) term-by-term, the final answer is

x(t) = 2et/2 − 2 − t and y(t) = et/2 − 1 − t.

27. The Laplace transform of the ordinary differential equations is

sX(s) − x(0) + 2X(s) − sY (s) − y(0) = 0

and
sX(s) − x(0) + Y (s) + X(s) = 2/s3 .
Substituting the values of the initial conditions and solving for X(s) and Y (s),
we find that
2 1 1 s+1
X(s) = = 2− +
s2 (s2 + 2s + 2) s s (s + 1)2 + 1

and
2 1 1
Y (s) = 3
− 2+ .
s s (s + 1)2 + 1
Taking the inverse of X(s) and Y (s) term-by-term, the final answer is

x(t) = t − 1 + e−t cos(t), and y(t) = t2 − t + e−t sin(t).

28. The Laplace transform of the ordinary differential equations is

1
sX(s) − x(0) + 3X(s) − Y (s) =
s
and
sX(s) − x(0) + 3X(s) + sY (s) − y(0) = 0.
416 Advanced Engineering Mathematics with MATLAB

Substituting the values of the initial conditions and solving for X(s) and Y (s),
we find that
1 2 1 1 3
X(s) = + − = +
s(s + 3) s + 3 s(s + 1)(s + 3) 2(s + 1) 2(s + 3)

and
1 1 1
Y (s) = − = − .
s(s + 1) s+1 s
Taking the inverse of X(s) and Y (s) term-by-term, the final answer is

x(t) = 21 e−t + 32 e−3t and y(t) = e−t − 1.

29. The Laplace transform of the ordinary differential equations is

F1
(s2 − 1)X(s) − 2(s + 1)Y (s) =
s

and
F2
2(s − 1)X(s) + (s2 − 3)Y (s) = .
s
Solving for X(s) and Y (s),

(s2 − 3)F1 + 2(s + 1)F2


X(s) =
s(s2 − 1)(s2 + 1)

and
(s2 − 1)F2 − 2(s − 1)F1
Y (s) = .
s(s2 − 1)(s2 + 1)
Using partial fraction, we find that

3F1 − 2F2 F1 F2 − F1 /2
X(s) = − +
s 2(s + 1) s−1
(1 + i)F2 /2 − F1 (1 − i)F2 /2 − F1
+ +
s−i s+i

and

F2 − 2F1 F1 F2 + (−1 + i)F1 F2 + (−1 − i)F1


Y (s) = + − − .
s s+1 2(s − i) 2(s + i)

Taking the inverse and using Euler’s identify,

x(t) = 3F1 − 2F2 − F1 cosh(t) + F2 et − 2F1 cos(t) + F2 cos(t) − F2 sin(t)


Worked Solutions 417

and
y(t) = F2 − 2F1 + F1 e−t − F2 cos(t) + F1 cos(t) + F1 sin(t).

30. Taking the Laplace transform, we obtain


d
s2 Y (s) − sy(0) − y ′ (0) − 2 [sY (s) − y(0)] − 8Y (s) = 0,
ds
or
s2 Y (s) − s − 2sY ′ (s) − 2Y (s) − 8Y (s) = 0,
or
 
′ 2 ′ 5 s
2sY (s) + (10 − s )Y (s) = −s, or Y (s) + − Y (s) = − 21 .
s 2
2
The integrating factor here is µ(s) = s5 e−s /4
. Therefore, the differential
equation can be rewritten
d h 5 −s2 /4 i 2
s e Y (s) = − 21 s5 e−s /4 .
ds
Integrating from s to ∞
2  2
s5 e−s /4
Y (s) = A + s4 + 8s2 + 32 e−s /4 ,

or 2
1 8 32 Aes /4
Y (s) = + 3 + 5 + .
s s s s5
In order for Y (s) to exist for all s, A = 0 and Y (s) = 1/s + 8/s3 + 32/s5 .
Inverting Y (s) term by term, we obtain y(t) = 1 + 4t2 + 4t4 /3.

31. Taking the Laplace transform, we obtain


d
s2 Y (s) − sy(0) − y ′ (0) + [sY (s) − y(0)] + 2Y (s) = 0,
ds
or
s2 Y (s) + s + sY ′ (s) + Y (s) + 2Y (s) = 0,
or
 
3
sY ′ (s) + (s2 + 3)Y (s) = −s, or Y ′ (s) + + s Y (s) = −1.
s
2
The integrating factor here is µ(s) = s3 es /2 . Therefore, the differential equa-
tion can be rewritten
d h 3 s2 /2 i 2
s e Y (s) = −s3 es /2 .
ds
418 Advanced Engineering Mathematics with MATLAB

Integrating from 0 to s,
2 2
s 3 es /2
Y (s) = A − 2 + (2 − s2 )es /2
,

or 2
2 1 (A − 2)e−s /2
Y (s) =
3
− + .
s s s3
In order for Y (s) to exist for all s, A = 2 and Y (s) = 2/s3 − 1/s. Inverting
Y (s) term by term, we obtain y(t) = t2 − 1.

32. Taking the Laplace transform, we obtain


d 2  d
− s Y (s) − sy(0) − y ′ (0) −2 [sY (s) − y(0)]− [sY (s) − y(0)]−Y (s) = 0,
ds ds
or

s2 Y ′ (s) + 2sY (s) − y(0) + 2sY (s) − 2y(0) + sY ′ (s) + Y (s) + Y (s) = 0,

or
s(s + 1)Y ′ (s) + 2(2s + 1)Y (s) = 3y(0),
or
s2 (s + 1)2 Y ′ (s) + 2(2s + 1)(s2 + s)Y (s) = 3y(0)(s2 + s).
This last differential equation can be rewritten
d 2 
s (s + 1)2 Y (s) = 3y(0)s(s + 1).
ds
Integrating with respect to s,
 
2 2 1 3 1 2
s (s + 1) Y (s) = A + 3y(0) s + s ,
3 2
or
A y(0) y(0)
Y (s) = + + .
s2 (s + 1)2 s + 1 2(s + 1)2
Using the convolution theorem to invert the first term on the right side and
tables for the others,
 
y(t) = A te−t + 2e−t + t − 2 + 21 y(0) te−t + 2e−t = C1 (t+2)e−t +C2 (t−2)

33. Taking the Laplace transform, we obtain


d 2 
− s Y (s) − sy(0) − y ′ (0) − 2a [sY (s) − y(0)]
ds
d dY
+2b [sY (s) − y(0)] + 2abY (s) − b2 = 0,
ds ds
Worked Solutions 419

or
(s − b)2 Y ′ (s) + 2(1 + a)(s − b)Y (s) = (1 + 2a)y(0),
or
2(1 + a) (1 + 2a)y(0)
Y ′ (s) + Y (s) = .
s−b (s − b)2
This last differential equation can be rewritten

d 
(s − b)2+2a Y (s) = (1 + 2a)y(0)(s − b)2a
ds
after multiplying the previous differential equation with its integrating factor
µ(s) = (s − b)2a+2 . Integrating with respect to s,

(s − b)2+2a Y (s) = A + y(0)(s − b)1+2a ,

or
A y(0)
Y (s) = 2+2a
+ .
(s − b) s−b
Inverting the previous equation,

A 
y(t) = y(0)ebt + t1+2a ebt = C1 + C2 t1+2a ebt .
(2a + 1)!

Section 12.9

1. From Bromwich’s integral,


I
1 (z + 1)etz
f (t) = dz,
2πi C (z + 2)2 (z + 3)

where C is a semicircle of infinite radius with the diameter running along


the imaginary axis and closed in the left half-plane. The singularities are a
second-order pole at z = −2 and a simple pole at z = −3. The corresponding
residues are
   
(z + 1)etz d 2 (z + 1)etz
Res ; −2 = lim (z + 2)
(z + 2)2 (z + 3) z→−2 dz (z + 2)2 (z + 3)
tz
(z + 1)te (z + 1)etz etz
= lim − +
z→−2 z+3 (z + 3)2 z+3
= 2e−2t − te−2t

and
 
(z + 1)etz (z + 1)etz
Res 2
; −3 = lim (z + 3) = −2e−3t .
(z + 2) (z + 3) z→−3 (z + 2)2 (z + 3)
420 Advanced Engineering Mathematics with MATLAB

Therefore,
f (t) = (2 − t)e−2t − 2e−3t .

2. From Bromwich’s integral,


I
1 etz
f (t) = dz,
2πi C z 2 (z+ a)2
where C is a semicircle of infinite radius with the diameter running along
the imaginary axis, and just to the right of it, and closed in the left half-
plane. The singularities are second-order poles at z = 0 and z = −a. The
corresponding residues are
   
etz d 2 etz
Res 2 ; 0 = lim z 2
z (z + a)2 z→0 dz z (z + a)2
tz
te 2etz at − 2
= lim − =
z→0 (z + a)2 (z + a) 3 a3
and    
etz d 2 etz
Res 2 ; −a = lim (z + a) 2
z (z + a)2 z→−a dz z (z + a)2
tz tz
te 2e at + 2 −at
= lim 2
− 3 = e .
z→−a z z a3
Therefore,
at − 2 at + 2 −at
f (t) = + e .
a3 a3

3. From Bromwich’s integral,


I
1 etz
f (t) = dz,
2πi C z(z − 2)3
where C is a semicircle of infinite radius with the diameter running along the
imaginary axis, and just to the right of it, and closed in the left half-plane.
The singularities are a simple pole at z = 0 and a third-order pole at z = 2.
The corresponding residues are
 
etz etz 1
Res ; 0 = lim z =−
z(z − 2)3 z→0 z(z − 2)3 8
and    
etz 1 d2 3 etz
Res ; 2 = lim (z − 2)
z(z − 2)3 z→2 2 dz 2 z(z − 2)3
 2 
1 t tz 2t tz 2 tz
= lim e − 2e + 3e
z→2 2 z z z
 2 
t t 1 2t
= − + e .
4 4 8
Worked Solutions 421

Therefore, the inverse equals the sum of the residues or


 
t2 t 1 1
f (t) = − + e2t − .
4 4 8 8

4. From Bromwich’s integral,


I
1 etz
f (t) = dz,
2πi C z(z + a)2 (z 2 + b2 )

where C is a semicircle of infinite radius with the diameter running along the
imaginary axis, and just to the right of it, and closed in the left half-plane.
The singularities are simple poles at z = 0 and z = ±bi and a second-order
pole at z = −a. The corresponding residues are
 
etz etz 1
Res 2 2 2
; 0 = lim z = 2 2,
z(z + a) (z + b ) z→0 z(z + a)2 (z 2 + b2 ) a b
 
etz etz
Res ; bi = lim (z − bi)
z(z + a)2 (z 2 + b2 ) z→bi z(z + a)2 (z 2 + b2 )
ebti a2 − b2 − 2iab
=− ,
2b2 (a2 + b2 )2
 
etz etz
Res 2 2 2
; −bi = lim (z + bi)
z(z + a) (z + b ) z→−bi z(z + a)2 (z 2 + b2 )
e−bti a2 − b2 + 2iab
=−
2b2 (a2 + b2 )2
and
   
etz d 2 etz
Res ; −a = lim (z + a)
z(z + a)2 (z 2 + b2 ) z→−a dz z(z + a)2 (z 2 + b2 )
 tz

te etz 2etz
= lim − 2 2 +
z→−a z(z 2 + b2 ) z (z + b2 ) (z 2 + b2 )2
at e−at e−at 2 e−at
=− 2 2 − − .
a (a + b2 ) a2 (a2 + b2 ) (a2 + b2 )2

Therefore, the inverse equals the sum of the residues or

1 1 + at 2
f (t) = − 2 2 e−at − 2 e−at
a 2 b2 a (a + b2 ) (a + b2 )2
(a2 − b2 ) 2ab
− 2 2 cos(bt) − 2 2 sin(bt).
b (a + b2 )2 b (a + b2 )2
422 Advanced Engineering Mathematics with MATLAB

5. From Bromwich’s integral,


I
1 e(t−1)z
f (t) = dz,
2πi C z 2 (z + 2)

where C is a semicircle of infinite radius with the diameter running along the
imaginary axis, and just to the right of it, and closed in the left half-plane.
From Jordan’s lemma, this holds only for t > 1. If t < 1, then the contour
is closed in the right half-plane and f (t) = 0. The singularities are a second-
order pole at z = 0 and a simple pole at z = −2. The corresponding residues
are  (t−1)z   
e d e(t−1)z
Res 2 ; 0 = lim z2 2
z (z + 2) z→0 dz z (z + 2)
 
t − 1 (t−1)z 1 (t−1)z
= lim e − e
z→0 z+2 (z + 2)2
t−1 1
= −
2 4
and  
e(t−1)z e(t−1)z 1
Res 2 ; −2 = lim (z + 2) 2 = e−2(t−1) .
z (z + 2) z→−2 z (z + 2) 4
Therefore, the inverse equals the sum of the residues or
 
t − 1 1 1 −2(t−1)
f (t) = − + e H(t − 1).
2 4 4

6. From Bromwich’s integral,


I
1 etz
f (t) = dz,
2πi C z(1 + e−az )

where C is a semicircle of infinite radius with the diameter running along,


and just to the right of, the imaginary axis and closed in the left half-plane.
The singularities are all simple poles and are located at z = 0 and zn =
±(2n − 1)πi/a, where n = 1, 2, 3, . . . The corresponding residues are
 
etz etz 1
Res ; 0 = lim z =
z(1 + e−az ) z→0 z(1 + e−az ) 2

and  
etz etz
Res ; z n = lim (z − z n )
z(1 + e−az ) z→zn z(1 + e−az )
exp[±(2n − 1)πit/a]
=± .
(2n − 1)πi
Worked Solutions 423

Therefore,

1 2 X sin[(2n − 1)πt/a]
f (t) = + .
2 π n=1 (2n − 1)π

7. From Bromwich’s integral,


I
1 etz
f (t) = dz,
2πi C (z + b) cosh(az)

where C is a semicircle of infinite radius with the diameter running along,


and just to the right of, the imaginary axis and closed in the left half-plane.
The singularities are all simple poles and are located at z = −b and zn =
±(2n − 1)πi/(2a), where n = 1, 2, 3, . . . because cosh(az) = cos(iaz) = 0. The
corresponding residues are
 
etz etz e−bt
Res ; −b = lim (z + b) =
(z + b) cosh(az) z→−b (z + b) cosh(az) cosh(ab)

and
 
etz etz
Res ; zn = lim (z − zn )
(z + b) cosh(az) z→zn (z + b) cosh(az)
exp[±(2n − 1)πit/(2a)]
=± .
ai[b ± (2n − 1)πi/(2a)] sin[(2n − 1)π/2]

Summing the residues,

X ∞
e−bt exp[(2n − 1)πit/(2a)]
f (t) = +
cosh(ab) n=1 ai[b + (2n − 1)πi/(2a)](−1)n+1

X exp[−(2n − 1)πit/(2a)]

n=1
ai[b − (2n − 1)πi/(2a)](−1)n+1
X∞
e−bt sin[(2n − 1)πt/(2a)]
= − 8ab (−1)n 2 2
cosh(ab) n=1
4a b + (2n − 1)2 π 2

X (2n − 1)π cos[(2n − 1)πt/(2a)]
+4 (−1)n .
n=1
4a2 b2 + (2n − 1)2 π 2

8. From Bromwich’s integral,


I
1 etz
f (t) = dz,
2πi C z(1 − e−az )
424 Advanced Engineering Mathematics with MATLAB

where C is a semicircle of infinite radius with the diameter running along, and
just to the right of, the imaginary axis and closed in the left half-plane. The
singularities are located at z = 0 and zn = ±2nπi/a, where n = 1, 2, 3, . . ..
Near z = 0,

etz 1 + tz + · · · 1  az 
= = 1 + tz + + · · ·
z(1 − e−az ) az 2 (1 − az/2 + · · ·) az 2 2

so that  
etz t 1
Res ; 0 = + .
z(1 − e−az ) a 2
The remaining residues are
 
etz etz exp(±2nπit/a)
Res ; z n = lim (z − z n ) =± .
z(1 − e−az ) z→zn z(1 − e−az ) 2nπi

Therefore,

t 1 1 X sin(2nπt/a)
f (t) = + + .
a 2 π n=1 n

9. From the definition of the Laplace transform


Z ∞ Z ∞
−zτ
F (z) = f (τ )e dτ ⇒ G(z) = F [ϕ(z)] = f (τ )e−ϕ(z)τ dτ.
0 0

From Bromwich’s integral,


Z c+∞i Z c+∞i
1 1
g(t) = G(z) etz dz = F [ϕ(z)] etz dz.
2πi c−∞i 2πi c−∞i

Substituting for F [ϕ(z)],


Z c+∞i Z ∞ 
1 −ϕ(z)τ
g(t) = f (τ )e dτ etz dz.
2πi c−∞i 0

Reversing the order of integration,


Z ∞  Z c+∞i 
1 −ϕ(z)τ tz
g(t) = f (τ ) e e dz dτ.
0 2πi c−∞i

√ √
Finally, the inverse of exp(−τ z ) is τ exp(−τ 2 /4t)/2 πt3 .
Worked Solutions 425

Section 12.10

1. Taking the Laplace transform of the partial differential equation


d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) − = 0, 0 < x < 1,
dx2
with the boundary conditions U (0, s) = U (1, s) = 0. Substituting the initial
conditions into the first equation, we obtain
d2 U (x, s)
− s2 U (x, s) = −1, 0 < x < 1.
dx2
The general solution is
1
U (x, s) =+ A cosh(sx) + B sinh(sx).
s2
Using the boundary conditions, the transformed solution equals
1 − cosh(sx) [cosh(s) − 1] sinh(sx)
U (x, s) = + .
s2 s2 sinh(s)
The transformed solution has simple poles at zn = ±nπi with n = 1, 2, 3, . . .
and a removable pole at z = 0. From Bromwich’s integral,
I I
1 [1 − cosh(zx)]etz 1 [cosh(z) − 1] sinh(zx)etz
u(x, t) = dz + dz
2πi C z2 2πi C z 2 sinh(z)
I
1 [cosh(z) − 1] sinh(zx)etz
= dz.
2πi C z 2 sinh(z)
Now, the residues equal
 
[cosh(z) − 1] sinh(zx)etz
Res ; zn
z 2 sinh(z)
[cosh(z) − 1] sinh(zx)etz z − zn
= lim lim
z→zn z2 z→zn sinh(z)

[cos(nπ) − 1] sin(nπx) exp(±nπti)


=± .
n2 π 2 i cos(nπ)
Therefore,
X∞
[1 − (−1)n ] sin(nπx) exp(nπti)
u(x, t) =
n=1
n2 π 2 i
[1 − (−1)n ] sin(nπx) exp(−nπti)

n2 π 2 i
X∞ n
[1 − (−1) ] sin(nπx) sin(nπt)
=2
n=1
n2 π 2

4 X sin[(2m − 1)πx] sin[(2m − 1)πt]
= .
π 2 m=1 (2m − 1)2
426 Advanced Engineering Mathematics with MATLAB

2. Taking the Laplace transform of the partial differential equation,

d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) − = 0, 0 < x < 1,
dx2

with the boundary condition U (0, s) = U ′ (1, s) = 0. Substituting the initial


conditions into the first equation, we obtain

d2 U (x, s)
− s2 U (x, s) = −x, 0 < x < 1.
dx2

The general solution is


x
U (x, s) = + A cosh(sx) + B sinh(sx).
s2

Using the boundary condition, the transformed solution equals

xs cosh(s) − sinh(sx)
U (x, s) = .
s3 cosh(s)

The transformed solution has simple poles at zn = ±(2n − 1)πi/2 with n =


1, 2, 3, . . . and a removable pole at z = 0. From Bromwich’s integral,
I
1 [xz cosh(z) − sinh(zx)]etz
u(x, t) = dz.
2πi C z 3 cosh(z)

Now, the residues equal


 
[xz cosh(z) − sinh(zx)]etz
Res ; z n
z 3 cosh(z)
[xz cosh(z) − sinh(zx)]etz z − zn
= lim 3
lim
z→zn z z→zn cosh(z)

8(−1)n+1 sin[(2n − 1)πx/2] exp[±(2n − 1)πti/2]


=± .
(2n − 1)3 π 3 i

Therefore,

X∞  
16(−1)n+1 (2n − 1)πx
u(x, t) = sin
n=1
(2n − 1)3 π 3 2
exp[(2n − 1)πti/2] − exp[−(2n − 1)πti/2]
×
2i
∞    
16 X (−1)n+1 (2n − 1)πx (2n − 1)πt
= 3 sin sin .
π n=1 (2n − 1)3 2 2
Worked Solutions 427

3. Taking the Laplace transform of the partial differential equation,

d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) − = 0, 0 < x < 1,
dx2
with the boundary conditions U (0, s) = U (1, s) = 0. Substituting the initial
conditions into the first equation, we obtain

d2 U (x, s)
− s2 U (x, s) = −s sin(πx) + sin(πx), 0 < x < 1.
dx2
The general solution is
s−1
U (x, s) = A cosh(sx) + B sinh(sx) + sin(πx).
s2 + π 2
Using the boundary conditions, the transformed solution equals
s−1
U (x, s) = sin(πx).
s2+ π2
Inverting by inspection,
1
u(x, t) = sin(πx) cos(πt) − sin(πx) sin(πt).
π

4. Taking the Laplace transform of the partial differential equation,

d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) − c2 = 0, 0 < x < a,
dx2
with the boundary condition U (0, s) = ω/(s2 + ω 2 ), U (a, s) = 0. Substituting
the initial conditions into the first equation, we obtain

d2 U (x, s) s2
− 2 U (x, s) = 0, 0 < x < a.
dx2 c
The general solution is

U (x, s) = A cosh[s(a − x)/c] + B sinh[s(a − x)/c].

Using the boundary condition, the transformed solution equals


ω sinh[s(a − x)/c]
U (x, s) = .
(s2 + ω 2 ) sinh(sa/c)

The transformed solution has simple poles at z = ±ωi and zn = ±nπci/a with
n = 1, 2, 3, . . . and a removable pole at z = 0. From Bromwich’s integral,
I
1 ω sinh[z(a − x)/c]etz
u(x, t) = dz.
2πi C (z 2 + ω 2 ) sinh(za/c)
428 Advanced Engineering Mathematics with MATLAB

Now, the residues equal


 
ω sinh[z(a − x)/c]etz
Res ; ωi
(z 2 + ω 2 ) sinh(za/c)
sinh[z(a − x)/c]etz ω(z − ωi)
= lim lim
z→ωi sinh(za/c) z→ωi z2 + ω2
1 sin[ω(a − x)/c] ωti
= e ,
2i sin(ωa/c)
 
ω sinh[z(a − x)/c]etz
Res ; −ωi
(z 2 + ω 2 ) sinh(za/c)
sinh[z(a − x)/c]etz ω(z + ωi)
= lim lim
z→−ωi sinh(za/c) z→−ωi z 2 + ω 2

1 sin[ω(a − x)/c] −ωti


=− e
2i sin(ωa/c)
and
 
ω sinh[z(a − x)/c]etz
Res ; zn
(z 2 + ω 2 ) sinh(za/c)
ω sinh[z(a − x)/c]etz z − zn
= lim 2 2
lim
z→zn z +ω z→z n sinh(az/c)

ωa2 i sin[nπ(a − x)/a] exp(±nπcti/a)


=± 2 2
a ω − n2 π 2 c2 (a/c) cos(nπ)
   
ωac(−1)n i nπ(a − x) nπcti
=± 2 2 sin exp ± .
a ω − n2 π 2 c2 a a
Therefore, the final answer is
sin[ω(a − x)/c]
u(x, t) = sin(ωt)
sin(ωa/c)
X∞    
2ωac(−1)n nπ(a − x) nπct
+ sin sin .
n=1
n2 π 2 c2 − a2 ω 2 a a
∞  
sin[ω(a − x)/c] 2ωa X sin(nπx/a) nπct
= sin(ωt) − sin .
sin(ωa/c) c n=1 n2 π 2 − a2 ω 2 /c2 a

5. Taking the Laplace transform of the partial differential equation


d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) − c2 =0
dx2
with the boundary conditions

U ′ (0, s) = −F (s) and U ′ (L, s) = 0,


Worked Solutions 429

where F (s) is the Laplace transform of f (t). Substituting the initial conditions
into the first equation, we obtain

d2 U (x, s) s2
− 2 U (x, s) = 0.
dx2 c
The general solution is

U (x, s) = A(s) cosh[s(L − x)/c].

Using the boundary conditions, the transformed solution equals

cF (s) cosh[s(L − x)/c]


U (x, s) = .
s sinh(sL/c)

Replacing sinh and cosh by their definitions and expanding the denominator
as a geometric series,

cF (s) h −sx/c i 
U (x, s) = e + e−s(2L−x)/c 1 + e−2sL/c + e−4sL/c + · · · .
s
Multiplying everything out and inverting term by term, we obtain

X
u(x, t) = c f (t − x/c − 2nL/c)H(t − x/c − 2nL/c)
n=0
X∞
+c f (t + x/c − 2mL/c)H(t + x/c − 2mL/c).
m=1

6. Taking the Laplace transform of the partial differential equation

d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) = c2 − sQ(s) + q(0), a < x < b,
dx2
with the boundary conditions

U (a, s) = 0 and U ′ (b, s) = 0.

Substituting the initial conditions into the first equation, we finally obtain

d2 U (x, s)
c2 − s2 U (x, s) = sQ(s), a < x < b.
dx2
The homogeneous solution to this equation is UH (x, s) = A sin[k(x − a)].
Substituting into the boudary condition, kn = (2n + 1)π/[2(b − a)], where
n = 0, 1, 2, . . ..
430 Advanced Engineering Mathematics with MATLAB

Let us expand the right side using an eigenfunction expansion consisting


of sin[kn (x − a)]. Then

∞  
4sQ(s) X 1 (2n + 1)π(x − a)
sQ(s) = sin .
π n=0
2n + 1 2(b − a)

Assuming that

X  
(2n + 1)π(x − a)
U (x, s) = An sin ,
n=0
2(b − a)

direct substitution yields


 −1
4sc2 Q(s) 2 (2n + 1)2 π 2 c2
An = − s + .
π(2n + 1) 4(b − a)2

Substituting An into the expression for U (x, s) and inverting term-by-term,


the final answer is
∞  
4c2 X 1 (2n + 1)π(x − a)
u(x, t) = − sin
π n=0 2n + 1 2(b − a)
Z t  
(2n + 1)πc(t − τ )
× q(τ ) cos dτ.
0 2(b − a)

7. Taking the Laplace transform of the partial differential equation

d2 U (x, s) e−x
s2 U (x, s) − su(x, 0) − ut (x, 0) − 2
= 2
dx s

with the boundary conditions

1 1
U (0, s) = − and lim |U (x, s)| ∼ xn .
s s+1 x→∞

Substituting the initial conditions into the first equation, we finally obtain

d2 U (x, s) 2 e−x
− s U (x, s) = −x − .
dx2 s2

The general solution is

x e−x
U (x, s) = Ae−sx + + .
s2 s2 (s2 − 1)
Worked Solutions 431

Using the boundary conditions, the transformed solution equals


 
1 1 1 1 x e−x e−x
U (x, s) = − + 2− 2 e−sx + 2
− 2 + 2 .
s s+1 s s −1 s s s −1

Inverting the transformed solution term by term yields

u(x, t) = xt − te−x + sinh(t)e−x


h i
+ 1 − e−(t−x) + t − x − sinh(t − x) H(t − x).

8. Taking the Laplace transform of the partial differential equation

d2 U (x, s) x
s2 U (x, s) − su(x, 0) − ut (x, 0) − 2
=
dx s+1

with the boundary conditions U (0, s) = s/(s2 +1) and limx→∞ |U (x, s)| ∼ xn .
Substituting the initial conditions into the first equation, we finally obtain

d2 U (x, s) x
− s2 U (x, s) = −s − .
dx2 s+1

The general solution is

1 x
U (x, s) = Ae−sx + + .
s s2 (s + 1)

Using the boundary condition, the transformed solution equals


 
s 1 1 x x x
U (x, s) = − e−sx + + − + .
s2 + 1 s s s2 s s+1

Inverting the transformed solution term by term yields

u(x, t) = 1 + xt − x + xe−t + [cos(t − x) − 1]H(t − x).

9. Taking the Laplace transform of the partial differential equation,

d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) − = 0, 0 < x < L,
dx2
with the boundary conditions
g
U (0, s) = 0, s2 U (L, s) − su(L, 0) − ut (L, 0) + ω 2 U ′ (L, s) = ,
s
432 Advanced Engineering Mathematics with MATLAB

where ω 2 = k/m. Substituting the initial conditions into these equations,

d2 U (x, s)
− s2 U (x, s) = 0, 0<x<L
dx2
with
g
U (0, s) = 0, s2 U (L, s) + ω 2 U ′ (L, s) =
.
s
The general solution is U (x, s) = A cosh(sx)+B sinh(sx). Using the boundary
conditions, the transformed solution equals
g sinh(sx)
U (x, s) = .
s2 [s sinh(sL) + ω 2 cosh(sL)]
The transformed solution has simple poles at z = 0 and zn = ±λn i, where
λn = ω 2 cot(λn L) with n = 1, 2, 3, . . . From Bromwich’s integral,
I
1 g sinh(xz) etz
u(x, t) = dz.
2πi C z 2 [z sinh(zL) + ω 2 cosh(zL)]
Now, the residues equal
 
g sinh(xz) etz
Res 2 ; 0
z [z sinh(zL) + ω 2 cosh(zL)]
g etz sinh(xz) gx
= lim 2
lim = 2
z→0 z sinh(zL) + ω cosh(zL) z→0 z ω
and
 
g sinh(xz) etz
Res 2 ; ±λn i
z [z sinh(zL) + ω 2 cosh(zL)]
g sinh(xz) etz z − zn
= lim 2
lim 2
z→zn z z→z n z sinh(zL) + ω cosh(zL)

g sin(λn x) exp(±iλn t)
=− 2
λn [sin(λn L) + λn L cos(λn L) + ω 2 L sin(λn L)]
gω 2 sin(λn x) exp(±iλn t)
=− 2 4 .
λn (ω L + ω 2 + Lλ2n ) sin(λn L)
Therefore, the final answer is

gx 2gω 2 X sin(λn x) cos(λn t)
u(x, t) = − .
ω2 L n=1 λ2n (ω 4 + ω 2 /L + λ2n ) sin(λn L)

10. Taking the Laplace transform of the partial differential equation,


 
2 2 d dU (x, s)
s U (x, s) − su(x, 0) − ut (x, 0) − c x = 0, 0 < x < 1,
dx dx
Worked Solutions 433

with the boundary conditions limx→0 |U (x, s)| < ∞ and U (1, s) = Aω/ (s2 +
ω 2 ). Substituting the initial conditions into these equations,
 
d dU (x, s) s2
x − 2 U (x, s) = 0, 0 < x < 1.
dx dx c

The general solution is


s√ 
U (x, s) = AI0 x .
c
Using the boundary conditions, the transformed solution equals

Aω I0 (2s x/c)
U (x, s) = 2 .
s + ω 2 I0 (2s/c)

The transformed solution has simple poles at z = ±ωi and zn = ±cβn i/2,
where J0 (βn ) = 0, n = 1, 2, 3, ... From Bromwich’s integral,
I √
1 Aω I0 (2z x/c)etz
u(x, t) = dz.
2πi C z 2 + ω 2 I0 (2z/c)

Now, the residues equal


 √  √
Aω I0 (2z x/c)etz Aω(z ∓ ωi)I0 (2z x/c)etz
Res ; ±ωi = lim
(z 2 + ω 2 ) I0 (2z/c) z→±ωi (z 2 + ω 2 ) I0 (2z/c)

AJ0 (2ω x/c)e±iωt

2i J0 (2ω/c)

and
 √ 
Aω I0 (2z x/c)etz
Res ; ±cβn i/2
z2 + ω2 I0 (2z/c)

(z ∓ cβn i/2) AωI0 (2z x/c)etz
= lim lim
z→±cβn i/2 I0 (2z/c) z→±cβn i/2 z2 + ω2

Aωc J0 (βn x ) exp(±iβn ct/2)
=± .
2i (ω 2 − c2 βn2 /4)J1 (βn )

Therefore, the final answer is


√ X∞ √
J0 (2ω x/c) J0 (βn x ) sin(βn ct/2)
u(x, t) = A sin(ωt) + Acω .
J0 (2ω/c) n=1
(ω 2 − c2 βn2 /4)J1 (βn )

11. Taking the Laplace transform of the partial differential equation,

d2 U (x, s)
s2 U (x, s) − su(x, 0) − ut (x, 0) − c2 = 0, 0 < x < ℓ,
dx2
434 Advanced Engineering Mathematics with MATLAB

with the boundary conditions U (0, s) = E/s and U ′ (ℓ, s) = 0. Substituting


the initial conditions into the first equation, we obtain

d2 U (x, s) s2
− 2 U (x, s) = 0, 0 < x < ℓ.
dx2 c

The general solution is

U (x, s) = A cosh[s(ℓ − x)/c] + B sinh[s(ℓ − x)/c].

Using the boundary conditions, the transformed solution equals

E cosh[s(ℓ − x)/c]
U (x, s) = .
s cosh(sℓ/c)

The transformed solution has simple poles at z = 0 and zn = ±(2n−1)cπi/(2ℓ)


with n = 1, 2, 3, . . . From Bromwich’s integral,
I
1 E cosh[z(ℓ − x)/c] etz
u(x, t) = dz.
2πi C z cosh(zℓ/c)

Now, the residues equal


 
E cosh[z(ℓ − x)/c] etz E cosh[z(ℓ − x)/c] etz
Res ; 0 = lim =E
z cosh(zℓ/c) z→0 cosh(zℓ/c)

and
 
E cosh[z(ℓ − x)/c] etz
Res ; zn
z cosh(zℓ/c)
E cosh[z(ℓ − x)/c] etz z − zn
= lim lim
z→zn z z→zn cosh(zℓ/c)

E cos[(2n − 1)π(ℓ − x)/(2ℓ)] exp[±(2n − 1)cπti/(2ℓ)]


=− .
(2n − 1)π sin[(2n − 1)π/2]/2

Therefore, the final answer is


∞  
4E X (−1)n+1 (2n − 1)π(ℓ − x)
u(x, t) = E − cos
π n=1 2n − 1 2ℓ
    
1 (2n − 1)cπti (2n − 1)cπti
× exp + exp −
2 2ℓ 2ℓ
∞    
4E X 1 (2n − 1)πx (2n − 1)cπt
=E− sin cos .
π n=1 2n − 1 2ℓ 2ℓ
Worked Solutions 435

An alternative approach is to replace the hyperbolic functions with their ex-


ponential definitions. Then

E exp[s(ℓ − x)/c] + exp[−s(ℓ − x)/c]


U (x, s) =
s exp(sℓ/c) + exp(−sℓ/c)
E exp(−sx/c) + exp[−s(2ℓ − x)/c]
=
s 1 − exp(−2sℓ/c)
E h −sx/c i
= e − e−s(x+2ℓ)/c + e−s(x+4ℓ)/c − · · ·
s
E h −s(2ℓ−x)/c i
+ e − e−s(4ℓ−x)/c + e−s(6ℓ−x)/c − · · ·
s

after using the summation rule for the geometric series. Taking the inverse
by inspection,

X   X∞  
n x + 2nℓ n [(2n + 2)ℓ − x]
u(x, t) = E (−1) H t − +E (−1) H t − .
n=0
c n=0
c

12. Taking the Laplace transform of the partial differential equation,

d2 U (x, s)
= CR[sU (x, s) − u(x, 0)] + CL[s2 U (x, s) − su(x, 0) − ut (x, 0)].
dx2

Applying the initial conditions,

d2 U (x, s)
− s(CR + CLs)U (x, s) = 0
dx2

with the boundary conditions U (0, s) = 0 and U (ℓ, s) = E/s. Applying the
boundary conditions,
p p
E sinh[x s(CR + CLs) ] E sinh[x s(1/T + s)/c]
U (x, s) = p = p ,
s sinh[ℓ s(CR + CLs) ] s sinh[ℓ s(1/T + s)/c]

where T = L/R and c = 1/ LC. Using Bromwich’s integral,
I p
E sinh[x z(1/T + z)/c]etz
u(x, t) = p dz.
2πi C z sinh[ℓ z(1/T + z)/c]
p
There is a simple poles at z = 0 and the points where sinh[ℓ z(1/T + z)
/c] = 0 or  
p
zn = −1 ± 1 − 4n2 π 2 c2 T 2 /ℓ2 /(2T ).
436 Advanced Engineering Mathematics with MATLAB

Assuming 4π 2 L/R2 Cℓ2 > 1, then all of these latter poles can be written
 p 
zn = −1 ± i n2 δ 2 − 1 /(2T ),

where δ = 2πcT /ℓ. For the pole at z = 0, the residue is


" p # p
sinh[x z(1/T + z)/c]etz sinh[x z(1/T + z)/c]etz x
Res p ; 0 = lim p = .
z sinh[ℓ z(1/T + z)/c] z→0 sinh[ℓ z(1/T + z)/c] ℓ

At z = zn ,
" p #
sinh[x z(1/T + z)/c]etz
Res p ; zn
z sinh[ℓ z(1/T + z)/c]
p
z − zn sinh[x z(1/T + z)/c]etz
= lim p lim
z→zn sinh[ℓ z(1/T + z)/c] z→zn z
2nπic2 sinh(nπxi/ℓ) exp(zn t)
=
ℓ2 cosh(nπi)zn (1/T + 2zn )
√  nπx 
4(−1)n πc2 T 2 i[−1 ∓ i n2 δ 2 − 1 ] √
2 2
=± √ sin e−t/2T ±it n δ −1/2T .
2 2 2
ℓ δ n n δ −1 2 ℓ

Summing the residues and simplifying,

u(x, t) x

2 −t/2T X (−1)n  nπx  sin(t√n2 δ 2 − 1/2T )
= − e sin √
E ℓ π n=1
n ℓ n2 δ 2 − 1
p 
2 2
+ cos t n δ − 1/2T .

13. Taking the Laplace transform of the partial differential equation,

d2 P (x, s)
s2 P (x, s) − sp(x, 0) − pt (x, 0) − c2 = 0, 0 < x < L,
dx2
with the boundary conditions
p0
P (0, s) = , P ′ (L, s) = −ρU (L, s) + ρu(L, 0) = ρu0
s
from the x-momentum equation. Substituting the initial conditions into the
first equation, we obtain

d2 P (x, s) s2 s
− 2 P (x, s) = − 2 p0 , 0 < x < L.
dx2 c c
Worked Solutions 437

The general solution is


p0
P (x, s) = A cosh(sx/c) + B sinh(sx/c) + .
s
Using the boundary conditions, the transformed solution equals

p0 ρu0 c sinh(sx/c)
P (x, s) = + .
s s cosh(sL/c)

From Bromwich’s integral,


I
ρu0 c sinh(zx/c)etz
p(x, t) = p0 + dz.
2πi C z cosh(zL/c)

The inversion integral has simple poles at zn = ±(2n − 1)cπi/(2L) with n =


1, 2, 3, . . . and a removable singularity at z = 0. Now, the residues equal
 
sinh(zx/c)etz sinh(zx/c)etz z − zn
Res ; zn = lim lim
z cosh(zL/c) z→zn z z→zn cosh(zL/c)
   
2(−1)n+1 (2n − 1)πx (2n − 1)cπti
=± sin exp ± .
(2n − 1)πi 2L 2L

Therefore, the final answer is


∞    
4ρu0 c X (−1)n (2n − 1)πx (2n − 1)cπt
p(x, t) = p0 − sin sin .
π n=1 2n − 1 2L 2L

14. Taking the Laplace transform of the partial differential equation,

d2 U (r, s) 2 dU (r, s) 2 s2
+ − U (r, s) − U (r, s) = 0, a < r < ∞,
dr2 r dr r2 c2
with the boundary condition

A A
U (a, s) = − , lim |U (r, s)| < ∞.
s s + c/a r→∞

The general solution to this ordinary differential equation is


   
cosh(sr/c) sinh(sr/c) 1 1
U (r, s) = C1 − 2 2 2 + C2 + e−sr/c .
sr/c s r /c sr/c s2 r2 /c2

Because the solution must be finite as r → ∞, C1 = 0. A simplified version


of this solution is  
1 s
U (r, s) = B + e−sr/c .
r2 cr
438 Advanced Engineering Mathematics with MATLAB

Substituting this into the other boundary condtion,

cA −s(r−a)/c c2 A
U (r, s) = e + e−s(r−a)/c
(s + c/a)2 r s(s + c/a)2 r2
 2   
a a2 c a2 a 1
=A − 2 − − e−s(r−a)/c .
sr2 r (s + c/a) a r2 r (s + c/a)2

Using tables and the second shifting theorem, the answer is


  2   
a2 a cτ a2 a −cτ /a
u(r, t) = A − + − e H(τ ),
r2 r2 a r2 r

where τ = t − (r − a)/c.

15. Taking the Laplace transform of the partial differential equation,

d2 [rU (r, s)]


s2 rU (r, s) − sru(r, 0) − rut (r, 0) = c2
dr2
with the boundary condition
 
d2 U (a, s) 2 dU (a, s) p0
−ρc2 + =
dr2 3a dr s+α

as well as limr→∞ |U (r, s)| < ∞. Substituting the initial conditions into the
differential equation, we obtain

d2 [rU (r, s)] s2


− 2 [rU (r, s)] = 0, a < r < ∞.
dr2 c
The general solution is

A −s(r−a)/c B s(r−a)/c
U (r, s) = e + e .
r r
Because the solution must be finite as r → ∞, B = 0. Using the other
boundary condition, the transformed solution equals

ap0 exp[−s(r − a)/c]


U (r, s) = − .
ρr(s + α)[s2 + 4sc/(3a) + 4c2 /(3a2 )]

We
√ have three simple poles, z = −α and z = −β/ 2 ± βi, where β =
2 2c/(3a). From Bromwich’s integral,
I
ap0 exp[tz − z(r − a)/c]
u(r, t) = − dz.
2πiρr C (z + α)[z 2 + 4zc/(3a) + 4c2 /(3a2 )]
Worked Solutions 439

For t < (r − a)/c we close the Bromwich’s contour in the right half of the
z-plane according to Jordan’s lemma. Because there are no singularities,
u(r, t) = 0 for this case. For t > (r − a)/c, we close the contour in the left
half of the z-plane and compute the values of the residues. They are
 
exp(τ z)
Res ; −α
(z + α)[z 2 + 4zc/(3a) + 4c2 /(3a2 )]
exp(τ z)
= lim 2
z→−α z + 4zc/(3a) + 4c2 /(3a2 )

exp(−ατ ) exp(−ατ )
= 2 = √
α − 4αc/(3a) + 4c2 /(3a2 ) (β/ 2 − α)2 + β 2

and
 
exp(τ z) 2c
Res ; − ± βi
(z + α)[z 2 + 4zc/(3a) + 4c2 /(3a2 )] 3a
eτ z (z + 2c/(3a) ∓ βi)
= lim lim
z→−2c/(3a)±βi z + α z→−2c/(3a)±βi z 2 + 4zc/(3a) + 4c2 /(3a2 )

exp{[−2c/(3a) ± βi]τ }
=± ,
2βi[α − 2c/(3a) ± βi]

where τ = t − (r − a)/c. Applying the residue theorem, the final answer is


 √
  
ap0 −βτ / 2 1 α
u(r, t) = √ e √ − sin(βτ ) + cos(βτ )
ρr[(β/ 2 − α)2 + β 2 ] 2 β

− e−ατ H(τ ).

16. Taking the Laplace transform of the partial differential equation,

L(utt ) = c2 L(uxx ) + gL(1),

or
d2 U g
s2 U (x, s) − su(x, 0) − ut (x, 0) = c2 + .
dx2 s
Because u(x, 0) = −gx2 /2c2 and ut (x, 0) = 0,

d2 U (x, s) s2 sgx2 g
2
− 2 U (x, s) = − 2, U ′ (0, s) = U ′ (L, s) = 0.
dx c 2c4 sc
The solution to this differential equation is
 sx   sx  gx2
U (x, s) = A cosh + B sinh − .
c c 2sc2
440 Advanced Engineering Mathematics with MATLAB

Satisfying the boundary conditions,

gL cosh(sx/c) gx2
U (x, s) = − .
cs2 sinh(sL/c) 2sc2

Therefore, the solution is


 
gx2 −1 gL cosh(sx/c)
u(x, t) = − 2 + L .
2c cs2 sinh(sL/c)

To finish the problem, we must invert the Laplace transform. This is given
by the Bromwich’s integral,
I ∞  
gL cosh(zx/c) etz gL X cosh(zx/c) etz
dz = Res ; z n .
2πic C z 2 sinh(zL/c) c n=0 z 2 sinh(zL/c)

The poles are located at z = 0 and zn = ±nπci/L. To find the residue at


z = 0, we note that

cosh(zx/c) etz (1 + z 2 x2 /2c2 + · · ·)(1 + tz + t2 z 2 /2 + · · ·)


=
z 2 sinh(zL/c) (z 3 L/c)(1 + z 2 L2 /6c2 + · · ·)
c ct x2 ct2 L
= 3
+ 2
+ + − + ···.
Lz Lz 2cLz 2Lz 6cz

Therefore,  
cosh(zx/c) etz x2 ct2 L
Res 2
; 0 = + − .
z sinh(zL/c) 2cL 2L 6c
For zn = ±nπci/L,
 
cosh(zx/c) etz cosh(zx/c) etz z − zn
Res 2
; z n = lim lim
z sinh(zL/c) z→zn z2 z→zn sinh(zL/c)

L cos(nπx/L) exp(±nπcti/L)
=− .
n2 π 2 c cos(nπ)

Summing the residues,


∞  nπx   
gt2 gL2 2gL2 X (−1)n nπct
u(x, t) = − 2 − 2 2 cos cos .
2 6c c π n=1 n2 L L

17. Taking the Laplace transform of the partial differential equation,

L(utt ) − L(uxx ) + L(1) = 0,


Worked Solutions 441

or
d2 U 1
s2 U (x, s) − su(x, 0) − ut (x, 0) = − .
dx2 s
Because u(x, 0) = 0 and ut (x, 0) = 1 − x2 ,

d2 U (x, s) 1 1
− s2 U (x, s) = + x2 − 1, U ′ (0, s) = 0, U ′ (1, s) = .
dx2 s s
The solution to this differential equation is

1 − x2 1 2
U (x, s) = A cosh (sx) + B sinh (sx) + − 3 − 4.
s2 s s
Satisfying the boundary conditions,

1 − x2 1 2 cosh(sx) 2 cosh(sx)
U (x, s) = 2
− 3− 4+ 2 + 3 .
s s s s sinh(s) s sinh(s)

Therefore, the solution is


   
t2 t3
2 −1 cosh(sx) −1 cosh(sx)
u(x, t) = (1 − x )t − − + L + 2L .
2 3 s2 sinh(s) s3 sinh(s)

To finish the problem, we must invert the Laplace transforms. This is given
by the Bromwich’s integral,
I X∞  
1 cosh(zx)etz cosh(zx)etz
dz = Res ; z n
2πi C z 2 sinh(z) n=0
z 2 sinh(z)

and I  
X∞
1 cosh(zx)etz cosh(zx)etz
dz = 2 Res ; z n .
πi C z 3 sinh(z) n=0
z 3 sinh(z)

The poles are located at z = 0 and zn = ±nπi.


To find the residue at z = 0, we note that

cosh(zx)etz (1 + z 2 x2 /2 + · · ·)(1 + tz + t2 z 2 /2 + t3 z 3 /6 + · · ·)
=
z 2 sinh(z) z 3 (1 + z 2 /6 + · · ·)
 2 
1 t t x2 1 1
= 3+ 2+ + − + ···,
z z 2 2 6 z

and
cosh(zx)etz (1 + z 2 x2 /2 + · · ·)(1 + tz + t2 z 2 /2 + t3 z 3 /6 + · · ·)
3
=
z sinh(z) z 4 (1 + z 2 /6 + · · ·)
2  3 
1 t t x2 1 1 t x2 t t 1
= 4+ 3+ + − + + − + ···.
z z 2 2 6 z2 6 2 6 z
442 Advanced Engineering Mathematics with MATLAB

Therefore,  
cosh(zx)etz t2 x2 1
Res ; 0 = + − ,
z 2 sinh(z) 2 2 6
and  
cosh(zx)etz t3 x2 t t
Res 3
; 0 = + − .
z sinh(z) 6 2 6
For zn = nπi,
 
cosh(zx)etz cosh(zx)etz
Res 2 +2 2 ; nπi
z sinh(z) z sinh(z)
 
cosh(zx)etz 2 cosh(zx)etz z − nπi
= lim +
z→nπi z2 z3 sinh(z)
cos(nπx) nπit cos(nπx)
=− 2 2 e −2 3 3 enπit .
n π cos(nπ) n π i cos(nπ)

For zn = −nπi,
 
cosh(zx)etz cosh(zx)etz
Res 2 +2 2 ; −nπi
z sinh(z) z sinh(z)
 
cosh(zx)etz 2 cosh(zx)etz z + nπi
= lim +
z→−nπi z2 z3 sinh(z)
cos(nπx) −nπit cos(nπx)
=− 2 2 e +2 3 3 e−nπit .
n π cos(nπ) n π i cos(nπ)

Summing the residues, the final answer is

X∞  
2t x2 1 cos(nπt) 2 sin(nπt)
u(x, t) = + − −2 (−1)n cos(nπx) + .
3 2 6 n=1
n2 π 2 n3 π 3

18. Taking the Laplace transform of the partial differential equation,

L(utt ) + kL(ut ) = c2 L(uxx ) + αc2 L(ux )

or

d2 U dU
s2 U (x, s) − su(x, 0) − ut (x, 0) + ksU (x, s) − ku(x, 0) = c2 + αc2 .
dx2 dx

Because u(x, 0) = u0 and ut (x, 0) = 0,


   
d2 U (x, s) dU (x, s) s2 + ks s+k
2
+α − U (x, s) = − u0
dx dx c2 c2
Worked Solutions 443

with U ′ (0, s) = −u0 and limx→∞ |U (x, s)| < ∞.


The solution to this differential equation is
 q 
exp x (s + k2 )2 + a2 /c
u0
U (x, s) = + Ae−αx/2 q
s α
+ (s + k2 )2 + a2 /c
2
 q 
k 2 2
exp −x (s + 2 ) + a /c
+ Be−αx/2 q .
α k 2 2 /c
2 + (s + 2 ) + a
Satisfying the boundary conditions,
 q 
exp −x (s + k2 )2 + a2 /c
u0
U (x, s) = + u0 e−αx/2 q .
s α
(s + k2 )2 + a2 /c
2 +

Therefore, the solution is


  q 

 exp −x (s + k 2
) + a 2 /c 

 2 
u(x, t) = u0 + u0 e−αx/2 L−1 q .

 α
+ (s + k 2
) + a 2 /c 

 2 2 
p
Let s′ = p2 + a2 , where p = s + k/2. Then
 ′

−1 exp(−xs /c)
L = ceαc(t−x/c)/2 H(t − x/c).
α/2 + s′ /c
Therefore,
" p #
2 2
−1 exp(−x p + a /c)
L α
p
2 + p2 + a2 /c
 h αc i
= cH(t − x/c) exp − (t − x/c)
2
Z t √  h αc i 
J 1 a t2 − τ 2
−a √ τ exp − (τ − x/c) dτ .
x/c t2 − τ 2 2
Finally, the first shifting theorem yields
 q 
exp[−x (s + k2 )2 + a2 /c]
L−1  q 
α k 2 2
2 + (s + 2 ) + a /c
 h αc i
−kt/2
= ce H(t − x/c) exp − (t − x/c)
2
Z t
√  h i 
J 1 a t2 − τ 2 αc
−a √ τ exp − (τ − x/c) dτ .
x/c t2 − τ 2 2
444 Advanced Engineering Mathematics with MATLAB

Substitution into the u(x, t) equation and simplification leads to the final
answer.

19. Taking the Laplace transform of the partial differential equation,

P
L[utt ] = c2 L[uxx ] + L[δ(t − x/V )]
ρV

or
d2 U P −sx/V
s2 U (x, s) − su(x, 0) − ut (x, 0) = c2 + e .
dx2 ρV
Because u(x, 0) = ut (x, 0) = 0,

d2 U (x, s) P −xs/V
s2 U (x, s) = c2 + e .
dx2 ρV

Next, we find the half-range sine expansion for e−sx/V or


X  nπx 
e−sx/V = An sin , 0 < x < L,
n=1
L

where Z
2 L  nπx 
An = e−sx/V sin dx
L 0 L
L
2 −sx/V s sin(nπx/L)/V − nπ cos(nπx/L)/L
= e
L s2 /V 2 + n2 π 2 /L2 0
2nπV 2 h i
= 2 2 2
1 − (−1)n e−sL/V .
L (s + βn )
Thus, we must solve the ordinary differential equation,

2P X βn h i  nπx 

d2 U s2 n −sL/V
− U = − 1 − (−1) e sin .
dx2 c2 ρLc2 n=1 s2 + βn2 L

Substituting in

X  nπx 
U (x, s) = Bn sin ,
n=1
L

2P βn h i
n −sL/V
Bn = 1 − (−1) e
ρL(s2 + αn2 )(s2 + βn2 )
 h i
2P βn 1 1 n −Ls/V
= − 1 − (−1) e .
ρL(βn2 − αn2 ) s2 + αn2 s2 + βn2
Worked Solutions 445

Therefore,
∞  
2P X βn 1 1
U (x, s) = − 2
ρL n=1 (βn2 − αn2 ) s2 + αn2 s + βn2
h i  nπx 
× 1 − (−1)n e−Ls/V sin .
L
Term-by-term inversion plus the second shifting theorem yields
∞    nπx 
2P X βn sin(αn t) sin(βn t)
u(x, t) = − sin
ρL n=1 αn (βn2 − αn2 ) βn2 − αn2 L
 X ∞  
2P L nπx
− H t− (−1)n sin
ρL V n=1 L
 
βn sin[αn (t − L/V )] sin[βn (t − L/V )]
× −
αn (βn2 − αn2 ) βn2 − αn2
∞    nπx 
2P X sin(βn t) V sin(αn t)
= 2 2
− 2 2
sin
ρL n=1 αn − βn c αn − βn L
 X ∞  nπx 
2P L
− H t− (−1)n sin
ρL V n=1 L
 
sin[βn (t − L/V )] V sin[αn (t − L/V )]
× − .
αn2 − βn2 c αn2 − βn2

20. Taking the Laplace transform of the partial differential equation,


 2   2    u  
1 ∂ u ∂ u 1 ∂u δ(r − α)
L −L − L +L 2 =L ,
c2 ∂t2 ∂r2 r ∂r r α2
or
d2 U (r, s) 1 dU (r, s) U (r, s)
+ −
dr2 r dr r2
2
s s 1 δ(r − α)
− 2 U (r, s) + 2 u(r, 0) + 2 ut (r, 0) = −
c c c sα2
with
dU (a, s) h
lim |U (r, s)| < ∞ and + U (a, s) = 0.
r→0 dr a
Because u(r, 0) = ut (r, 0) = 0,
d2 U (r, s) 1 dU (r, s) U (r, s) s2 δ(r − α)
2
+ − 2
− 2 U (r, s) = − .
dr r dr r c sα2
Next, we find the Fourier-Bessel expansion for δ(r − α),
X∞  
βn r
δ(r − α) = An J1 , 0 < r < a,
n=1
a
446 Advanced Engineering Mathematics with MATLAB

where Z a  
2βn2 /a2 βn r
An = δ(r − α) J 1 r dr
(βn2 + h2 − 1) J12 (βn ) 0 a
2αβ 2 J1 (βn α/a)
= 2 2 n 2
a (βn + h − 1)J12 (βn )
and βn is the nth root of βJ1′ (β) + h J1 (β) = βJ0 (β) + (h − 1)J1 (β) = 0
because β[J0 (β) − J2 (β)] + 2h J1 (β)/a = 0. Thus, we must solve the ordinary
differential equation,
 2 
d2 U (r, s) 1 dU (r, s) s 1
+ − + 2 U (r, s)
dr2 r dr c2 r

2c2 X βn2 J1 (βn α/a)
=− J1 (βn r/a).
sαa n=1 (βn + h2 − 1)J12 (βn )
2 2

Substituting

X  
βn r
U (r, s) = Bn J1
n=1
a

into this ordinary differential equation, we find that

2βn2 c2 αJ1 (βn α/a)


Bn =
+ − 1)s(s2 + c2 βn2 /a2 ) J12 (βn )
a2 (βn2 h2
 
2J1 (βn α/a) 1 s
= − .
α(βn2 + h2 − 1) J12 (βn ) s s2 + c2 βn2 /a2

The final inversion is straightforward.

21. Taking the Laplace transform of the partial differential equation,

d
[sU (x, s) − u(x, 0)] + U (x, s) = 0.
dx
Substituting in the initial condition and simplifying, the differential equation
becomes
dU (x, s)
s + U (x, s) = 0.
dx
Taking the Laplace transform of the bounday conditions gives

1
U (0, s) = , and lim |U (x, s)| < ∞.
s+1 x→∞

Multiplying the differential equation by its integrating factor, ex/s , we have


that
d h x/s i
e U (x, s) = 0.
dx
Worked Solutions 447

Integrating both sides of the equation, U (x, s) = Ae−x/s . The arbitrary


constant is determined by the boundary condition at x = 0. This gives

e−x/s e−x/s e−x/s


U (x, s) = = − .
s+1 s s(s + 1)

Using tables and the convolution theorem, we immediately find that


Z t
√ √
u(x, t) = J0 (2 xt ) − e−t eτ J0 (2 xτ ) dτ.
0

22. Taking the Laplace transform of the partial differential equation,

d dU (x, s)
[sU (x, s) − u(x, 0)] + asU (x, s) − au(x, 0) + b = 0.
dx dx
Substituting in the initial condition and simplifying, the differential equation
becomes
dU (x, s)
(s + b) + asU (x, s) = a.
dx
Taking the Laplace transform of the boundary condition gives

1
U (0, s) = , and lim |U (x, s)| < ∞.
s−c x→∞

To solve the differential equation, we first multiply by the integrating factor


exp[asx/(s + b)] and the differential equation becomes
     
d asx a asx
exp U (x, s) = exp .
dx s+b s+b s+b

Integrating and solving for U (x, s),


 
1 asx
U (x, s) = + C exp − .
s s+b

The value of C is determined by the boundary condition at x = 0. This yields


     
1 1 1 asx 1 c bx
U (x, s) = + − exp − = + e−ax exp .
s s−c s s+b s s(s − c) s+b

Using tables, the first shifting theorem, and the convolution theorem yields
the final solution:
Z t  √ 
ct−ax
u(x, t) = 1 + c e e−(b+c)τ I0 2 bxτ dτ.
0
448 Advanced Engineering Mathematics with MATLAB

Section 12.11

1. Taking the Laplace transform of both sides of the partial differential equa-
tion,

d2 U (x, s)
sU (x, s) − u(x, 0) = − a2 [U (x, s) − T0 /s], 0 < x < 1,
dx2
subject to the boundary conditions U ′ (0, s) = U ′ (1, s) = 0. Substituting in
the initial condition yields the ordinary differential equation

d2 U (x, s) 2 a2 T0
− (s + a )U (x, s) = − .
dx2 s
The general solution is

a2 T0  p   p 
U (x, s) = + A cosh x s + a 2 + B sinh x s + a2 .
s(s + a2 )
Taking the derivative,
p h  p   p i
U ′ (x, s) = s + a2 A sinh x s + a2 + B cosh x s + a2 .

Applying the boundary condition at x = 0, U ′ (0, s) = s + a2 B = 0 or
B = 0. At x = 1,
p p 
U ′ (1, s) = s + a2 A sinh s + a2 = 0,

or A = 0. Therefore, the transformed solution is


   
1 1 2
U (x, s) = T0 − 2
⇒ u(x, t) = T0 1 − e−a t .
s s+a

2. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 U (x, s)
sU (x, s) − u(x, 0) = , 0 < x < 1,
dx2
subject to the boundary conditions U ′ (0, s) = 0 and U (1, s) = 1/s2 . Substi-
tuting in the initial condition yields the ordinary differential equation

d2 U (x, s)
− sU (x, s) = 0.
dx2
√ √
The general solution is U (x, s) = A cosh (x s ) + B sinh (x s ) . Taking the
derivative,
√ √  √ √ 
U ′ (x, s) = A s sinh x s + B s cosh x s .
Worked Solutions 449

Applying the boundary condition
√ at x = 0, U ′ (0, s) = sB = 0 or B = 0. At
x = 1, U (1, s) = A cosh ( s ) = 1/s2 . Therefore, the transformed solution is

cosh (x s )
U (x, s) = 2 √ .
s cosh ( s )

Taking the inverse,


I √
1 cosh (x z ) etz
u(x, t) = √ dz.
2πi C z 2 cosh ( z )

The contour integral has a second-order pole at z = 0 and simple poles at



zn = −(2n − 1)2 π 2 /4 with zn = (2n − 1)πi/2. To compute the residue at
z = 0, we note that

cosh (x z ) etz (1 + zx2 /2 + · · ·)(1 + tz + t2 z 2 /2 + · · ·)
√ =
z 2 cosh ( z ) z 2 (1 + z/2 + z 2 /4! + · · ·)
1 t + (x2 − 1)/2
= 2+ + ···
z z

and the residue equals t + (x2 − 1)/2. The residues for the poles at zn equals
 √ 
cosh (x z ) etz
Res 2 √ ; zn
z cosh ( z )

cosh (x z ) etz z − zn
= lim 2
lim √
z→zn z z→z n cosh ( z)
cosh[(2n − 1)πxi/2] exp[−(2n − 1)2 π 2 t/4]
=
(2n − 1)4 π 4 /16
1
×
sinh[(2n − 1)πi/2]/[(2n − 1)πi]
   
16(−1)n+1 (2n − 1)πx (2n − 1)2 π 2 t
= cos exp − .
(2n − 1)3 π 3 2 4

The final solution is


∞    
1 2 16 X (−1)n (2n − 1)πx (2n − 1)2 π 2 t
u(x, t) = t+ (x −1)− 3 cos exp − .
2 π n=1 (2n − 1)3 2 4

3. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 U (x, s)
sU (x, s) − u(x, 0) = , 0 < x < 1,
dx2
450 Advanced Engineering Mathematics with MATLAB

subject to the boundary conditions U (0, s) = 0 and U (1, s) = 1/s. Substitut-


ing in the initial condition yields the ordinary differential equation

d2 U (x, s)
− sU (x, s) = 0.
dx2
√ √
The general solution is U (x, s) = A cosh (x s ) + B sinh (x s ) . Applying
the boundary condition
√ at x = 0, U (0, s) = A = 0 or A = 0. At x = 1,
U (1, s)√= B sinh ( s√) = 1/s. Therefore, the transformed solution is U (x, s) =
sinh (x s ) /[s sinh ( s )]. Taking the inverse,
I √
1 sinh (x z ) etz
u(x, t) = √ dz.
2πi C z sinh ( z )

The contour integral has simple poles at z = 0 and zn = −n2 π 2 with zn =
nπi. The residue at z = 0 is
 √  √
sinh (x z ) etz sinh(x z )etz
Res √ ; 0 = lim √ = x.
z sinh ( z ) z→0 sinh( z )

The residues for the poles at zn equals


 √  √
sinh (x z ) etz sinh(x z )etz z − zn
Res √ ; zn = lim lim √
z sinh ( z ) z→zn z z→zn sinh ( z )

sinh(nπxi) exp(−n2 π 2 t) 1
=
−n2 π 2 cosh(nπi)/(2nπi)
2(−1)n
= sin(nπx) exp(−n2 π 2 t).

The final solution is



2 X (−1)n 2 2
u(x, t) = x + sin(nπx)e−n π t .
π n=1 n

4. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 U (x, s)
sU (x, s) − u(x, 0) = , − 21 < x < 21 ,
dx2
 
subject to the boundary conditions U ′ − 21 , s = 0 and U ′ 12 , s = 1. Substi-
tuting in the initial condition yields the ordinary differential equation

d2 U (x, s)
− sU (x, s) = 0.
dx2
Worked Solutions 451
√ √
The general solution is U (x, s) = A cosh (x s ) + B sinh (x s ) . Applying the
boundary conditions, the transformed solution is
 √ 
cosh (x + 21 ) s
U (x, s) = √ √ .
s sinh ( s )

There are two way of inverting the transform. First, replacing the hyperbolic
functions by their exponential definition, we have that
 √   √ 
1 exp x + 21 s + exp − x + 12 s
U (x, s) = √ √ √
s s
e −e − s

1   1
√   √ 
= √ exp x − 2 s + exp − x + 23 s
s
 √ √ 
× 1 + e−2 s + e−4 s + · · · .

Taking the inverse term-by-term,



( " 2 # " 2 #)
1 X 2n + 12 − x 2n + 32 + x
u(x, t) = √ exp − + exp − .
π t n=0 4t 4t

On the other hand, we can use Bromwich’s integral and find that
I   √  tz
1 cosh x + 21 z e
u(x, t) = √ √ dz.
2πi C z sinh( z )

The contour integral has simple poles at z = 0 and zn = −n2 π 2 with zn =
nπi. The residue at z = 0 is
   √  tz 
cosh x + 12 z e
Res √ √ ;0
z sinh( z )
h 2 i
1 + x + 21 z/2 + · · · [1 + tz + t2 z 2 /2 + · · ·]
= lim = 1.
z→0 1 + z/6 + · · ·

The residues for the poles at zn equals


   √  tz    √  tz
cosh x + 21 z e cosh x + 12 z e z − zn
Res √ √ ; zn = lim √ lim √
z sinh( z ) z→zn z z→zn sinh ( z )
  2 2
= 2(−1)n cos nπ x + 21 e−n π t .

Summing the residues, yields the final answer of



X   2 2
u(x, t) = 1 + 2 (−1)n cos nπ x + 12 e−n π t .
n=1
452 Advanced Engineering Mathematics with MATLAB

5. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 U (x, s) 1
sU (x, s) − u(x, 0) − = , 0 < x < 1,
dx2 s
subject to the boundary conditions U (0, s) = U (1, s) = 0. Substituting in the
initial condition yields the ordinary differential equation

d2 U (x, s) 1
− sU (x, s) = − .
dx2 s
√ √
The general solution is U (x, s) = 1/s2 + A cosh (x s ) + B sinh (x s ) . Apply-
ing the boundary condition at x =√0, U (0, s) = 1/s2√+ A = 0 or A = −1/s2 .
At x = 1, U (1, s) = 1/s2 − cosh( s )/s2 + B sinh( s ) = 0. Therefore, the
transformed solution is
√ √ √
1 − cosh(x s ) [1 − cosh( s )] sinh(x s )
U (x, s) = − √ .
s2 s2 sinh( s )

Taking the inverse,


I √
1 [1 − cosh(x z )]etz
u(x, t) = dz
2πi C z2
I √ √
1 [1 − cosh( z )] sinh(x z )etz
− √ dz.
2πi C z 2 sinh( z )

The contour integral has a second-order pole at z = 0 and simple poles at



zn = −n2 π 2 with zn = nπi. Because

[1 − cosh(x z )]etz (−x2 z/2 − x4 z 2 /24 − · · ·)(1 + tz + t2 z 2 /2 + · · ·)
=
z2 z2
2
x
= − − ···,
2z
I √
1 [1 − cosh(x z]etz ) x2
2
dz = − .
2πi C z 2
The second integral requires the residues at z = 0 and zn . Because
√ √
[1 − cosh( z )] sinh(x z )etz

z 2 sinh( z )
(−z/2 − z 2 /24 − · · ·)(x + x3 z/3! + · · ·)(1 + tz + t2 z 2 /2 + · · ·)
= .
z 2 (1 + z/6 + z 2 /5! + · · ·)
x
= − − ···,
2z
Worked Solutions 453

The residue equals −x/2. The residues for the poles at zn equals
 √ √ 
[1 − cosh( z )] sinh(x z )etz
Res √ ; z n
z 2 sinh( z )
√ √
[1 − cosh( z )] sinh(x z )etz z − zn
= lim lim √
z→zn z2 z→zn sinh ( z )

[1 − cosh(nπi)] sinh(nπxi) exp(−n2 π 2 t)


=
n4 π 4
1
×
cosh(nπi)/(2nπi)
2[1 − (−1)n ]
= sin(nπx) exp(−n2 π 2 t).
n3 π 3

The final solution is



x(1 − x) 4 X sin[(2m − 1)πx] −(2m−1)2 π2 t
u(x, t) = − 3 e .
2 π m=1 (2m − 1)3

6. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 U (x, s)
sU (x, s) − u(x, 0) = a2 , 0 < x < ∞,
dx2
subject to the boundary conditions U (0, s) = 1/s and limx→∞ |U (x, s)| < ∞.
Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s) s
− 2 U (x, s) = 0.
dx2 a
√ √
The general solution is U (x, s) = Aex s/a +Be−x s/a . Applying the boundary
condition as x → ∞, A√ = 0. Using the boundary condition at x = 0, we
have that U√(x,s) = e−x s/a /s. From an extensive table of inverses, u(x, t) =
erfc x/(2a t ) , where erfc(·) is the complementary error function.

7. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 U (x, s)
sU (x, s) − u(x, 0) = , 0 < x < ∞,
dx2
subject to the boundary conditions U ′ (0, s) = 1/s and limx→∞ |U (x, s)| < ∞.
Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s)
− sU (x, s) = 0.
dx2
454 Advanced Engineering Mathematics with MATLAB
√ √
The general solution is U (x, s) = Aex s + Be−x s . Applying
√ √the boundary
′ −x s
condition
√ as x → ∞, A = 0. Because U (x, s) = − sBe , U ′√(1, s) =
− sB = 1/s. Therefore, the transformed solution is U (x, s) = −e−x s /s3/2 .
From an extensive table of inverses,
  r  2
x t x
u(x, t) = x erfc √ −2 exp − ,
2 t π 4t

where erfc(·) is the complementary error function.

8. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 U (x, s)
sU (x, s) − u(x, 0) = , 0 < x < ∞,
dx2
subject to the boundary conditions U (0, s) = 1/s and limx→∞ |U (x, s)| < ∞.
Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s)
− sU (x, s) = −e−x .
dx2
√ √
The general solution is U (x, s) = e−x /(s−1)+Aex s +Be−x s . Applying the
boundary condition as x → ∞, A = 0. At x = 0, U (0, s) = 1/(s−1)+B = 1/s.
Therefore, the transformed solution is
 
e−x 1 1 √
U (x, s) = + − e−x s
.
s−1 s s−1

From an extensive table of inverses,


      
x x √ x √
u(x, t) = et−x +erfc √ − 21 et e−x erfc √ − t +ex erfc √ + t ,
2 t 2 t 2 t

where erfc(·) is the complementary error function.

9. Taking the Laplace transform of both sides of the partial differential equa-
tion,

d2 U (x, s) dU (x, s)
sU (x, s) − u(x, 0) = a2 2
+ a2 (1 + δ) + a2 δU (x, s),
dx dx

subject to the boundary conditions U (0, s) = u0 /s and limx→∞ |U (x, s)| < ∞.
Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s) dU (x, s)  s
+ (1 + δ) + δ − U (x, s) = 0.
dx2 dx a2
Worked Solutions 455

The general solution is


" r #
(1 + δ)x x a2 (1 − δ)2
U (x, s) = A exp − + +s
2 a 4
" r #
(1 + δ)x x a2 (1 − δ)2
+ B exp − − +s .
2 a 4

Applying the boundary condition as x → ∞, A = 0. Using the boundary


condition at x = 0, we have that
" r #
u0 (1 + δ)x x a2 (1 − δ)2
U (x, s) = exp − − +s .
s 2 a 4

From an extensive table of inverses,


 √ 
u0 −δx x a(1 − δ) t
u(x, t) = e erfc √ +
2 2a t 2
 √ 
u0 −x x a(1 − δ) t
+ e erfc √ − .
2 2a t 2

10. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s)
sU (x, s) − u(x, 0) = a2 , 0 < x < ∞,
dx2
subject to the boundary conditions limx→∞ |U (x, s)| < ∞ and

κd + (s + κd )a2 U ′ (0, s) = sκr U (0, s).

Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s) s
− 2 U (x, s) = 0.
dx2 a
The general solution is
√ √
U (x, s) = Aex s/a
+ Be−x s/a
.

Applying the boundary condition as x → ∞, A = 0. Using the boundary


condition at x = 0, we have that
√  
2κd exp(−x s/a) 1 1
U (x, s) = √ √ − √ ,
a∆ s 2a s + κr − ∆ 2a s + κr + ∆
456 Advanced Engineering Mathematics with MATLAB
p
where ∆ ≡ κ2r − 4a2 κd . Using tables, we find that
κd −x2 /(4a2 t) h x2− 2
i
u(x, t) = e e erfc(x− ) − ex+ erfc(x+ ) ,


where x± = [x + (κr ± ∆)a2 t]/(2a t ) and erfc(·) is the complementary error
function.

11. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s)
sU (x, s) − u(x, 0) = − βU (x, s), 0 < x < ∞,
dx2
subject to the boundary conditions
1
ρU (0, s) − U ′ (0, s) = , lim |U (x, s)| < ∞.
s + β − σ2 x→∞

Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s)
− (s + β)U (x, s) = 0.
dx2
The general solution is
√ √
U (x, s) = Aex s+β
+ Be−x s+β
.

Applying the boundary condition as x → ∞, A = 0. Using the boundary


condition at x = 0, we have that

exp(−x s + β )
U (x, s) = √ .
(s + β − σ 2 )(ρ + s + β )

Using partial fractions,


√ √
′ ′
e−x s e−x s
U (x, s) = √ = √ √ √
(s′ + σ 2 )( s′ + ρ) ( s′ + σ)( s′ − σ)( s′ + ρ)
√ √
′ ′
e−x s e−x s
= √ + √
(ρ2 − σ 2 )( s′ + ρ) 2σ(ρ + σ)( s′ − σ)


e−x s
− √ ,
2σ(ρ − σ)( s′ + σ)

where s′ = s + β. Using the first shifting theorem and the fact that
√ !  2  
−1 e−k s 1 k 2 √ k
L √ = √ exp − − aeak ea t erfc a t + √ ,
a+ s πt 4t 2 t
Worked Solutions 457
    
1 σ 2 t−βte−σx x √ eσx x √
u(x, t) = 2e erfc √ − σ t + erfc √ + σ t
ρ+σ 2 t ρ−σ 2 t
 
ρ 2 x √
− 2 eρx+ρ t−βt erfc √ + ρ t .
ρ − σ2 2 t

12. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s) A −kx
sU (x, s) − u(x, 0) = a2 + e , 0 < x < ∞,
dx2 s
subject to the boundary conditions U ′ (0, s) = 0 and limx→∞ U (x, s) = u0 /s.
Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s) s u0 A
− 2 U (x, s) = − 2 − 2 e−kx .
dx2 a a a s
The general solution is

u0 Ae−kx
U (x, s) = − 2 2 + Be−qx ,
s a s(k − q 2 )

where q = s/a. Applying the boundary conditions, the general solution
becomes
 
u0 A −kx k −qx
U (x, s) = + e − e
s s(s − a2 k 2 ) q
−kx
 
u0 Ae 1 1 Ae−qx Ae−qx
= + 2 2 2 2
− + √ − √ .
s a k s−a k s aks s ak s(s − a2 k 2 )

Taking the inverse and using the convolution theorem,

Ae−kx  2 2 
u(x, t) = u0 + 2 2 ea k t − 1
" ra k
   #
A t x2 x x
+ 2 exp − 2 − erfc √
ak π 4a t a 2a t
2 2 Z  
Aea k t t −a2 k2 τ x2 dτ
− e exp − 2 √ .
ak 0 4a τ πτ

13. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s) P
sU (x, s) − u(x, 0) = a2 − , 0 < x < L,
dx2 s
458 Advanced Engineering Mathematics with MATLAB

subject to the boundary conditions U (0, s) = 1/s2 and U (L, s) = 0. Substi-


tuting in the initial condition yields the ordinary differential equation

d2 U (x, s) s P
− 2 U (x, s) = 2 .
dx2 a sa

The general solution is U (x, s) = A cosh(qx) + B sinh(qx) − P/s2 , where q =



s/a. Applying the boundary conditions, the general solution becomes
 
P sinh(qx) sinh[q(L − x)]
U (x, s) = − 1 + (P + 1) 2 .
s2 sinh(qL) s sinh(qL)

Now
   I tz  
1 sinh(qx) 1 e sinh(qx)
L−1 − 1 = − 1 dz.
s2 sinh(qL) 2πi C z 2 sinh(qL)

Because
 
etz sinh(qx) (1 + tz + t2 z 2 /2 + · · ·)[(x − L) + z(x3 − L3 )/6a2 + · · ·]
− 1 =
z 2 sinh(qL) z 2 L(1 + zL2 /6a2 + · · ·)
x − L t(x − L) x(x2 − L2 )
= + + + ···,
Lz 2 Lz 6a2 Lz
the residue at z = 0 is
 tz   
e sinh(qx) t(x − L) x(x2 − L2 )
Res 2
− 1 ;0 = + .
z sinh(qL) L 6a2 L

For the poles at zn = −n2 π 2 a2 /L2 , we have that


   
etz sinh(qx) sinh(qx) etz z − zn
Res 2
− 1 ; z n = lim 2
lim
z sinh(qL) z→z n z z→z n sinh(qL)

2L2 (−1)n sin(nπx/L) exp(−n2 π 2 a2 t/L2 )


=− .
a2 n3 π 3
On the other hand,
  I tz
−1 sinh[q(L − x)] 1 e sinh[q(L − x)]
L = dz.
s2 sinh(qL) 2πi C z 2 sinh(qL)

Because

etz sinh[q(L − x)] (1 + tz + t2 z 2 /2 + · · ·)[(L − x) + z(L − x)3 /6a2 + · · ·]


=
z2 sinh(qL) z 2 L(1 + zL2 /6a2 + · · ·)
L − x (L − x)3 t(L − x) L(L − x)
= + + − + ···,
z2 6a2 Lz Lz 6a2 z
Worked Solutions 459

the residue at z = 0 is
 tz 
e sinh[q(L − x)] t(L − x) (L − x)3 L(L − x)
Res ; 0 = + − .
z2 sinh(qL) L 6a2 L 6a2

For the poles at zn = −n2 π 2 a2 /L2 , we have that


 tz 
e sinh[q(L − x)] sinh[q(L − x)] etz z − zn
Res ; z n = lim lim
z2 sinh(qL) z→zn z2 z→zn sinh(qL)
2 2 2
t/L2
2L2 (−1)n sin[nπ(L − x)/L]e−n π a
=−
a2 n3 π 3
2L sin(nπx/L) exp(−n2 π 2 a2 t/L2 )
2
= .
a2 n3 π 3
The final solution is

t(L − x) P x(x − L) x(x − L)(x − 2L)


u(x, t) = + −
L 2a2 6a2 L

2 X n    2 2 2 
2P L (−1) nπx a n π t
− 2 3 3
sin exp −
a π n=1 n L L2
∞  nπx   2 2 2 
2(P + 1)L2 X 1 a n π t
+ 2 3 3
sin exp − .
a π n=1
n L L2

14. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s)
sU (x, s) − u(x, 0) = a2 + kU (x, s), 0 < x < L,
dx2

subject to the boundary conditions U (0, s) = U (L, s) = T0 /s. Substituting in


the initial condition yields the ordinary differential equation

d2 U (x, s) s − k T0
− U (x, s) = − 2 .
dx2 a2 a
The general solution is

T0
U (x, s) = + A sinh(qx) + B sinh[q(L − x)],
s−k

where q = s − k/a. Applying the boundary conditions, the particular solu-
tion is
T0 kT0 sinh(qx) + sinh[q(L − x)]
U (x, s) = − .
s − k s(s − k) sinh(qL)
460 Advanced Engineering Mathematics with MATLAB

Now
  I
−1 sinh(qx) + sinh[q(L − x)] 1 sinh(qx) + sinh[q(L − x)] tz
L = e dz.
s (s − k) sinh(qL) 2πi C z (z − k) sinh(qL)
There are simple poles at z = 0, z = k, and zn = k − n2 π 2 a2 /L2 , where
n = 1, 2, 3, . . .. Note here that qn = nπi/L.
The residues at z = 0 and z = k are
 
sinh(qx) + sinh[q(L − x)] tz sinh(qx) + sinh[q(L − x)] tz
Res e ; 0 = lim e
z (z − k) sinh(qL) z→0 (z − k) sinh(qL)
p p
sin(x k/a2 ) + sin[(L − x) k/a2 ]
= p
−k sin(L k/a2 )
p p
2 sin( L2 k/a2 ) cos[( L2 − x) k/a2 ]
= p
−k sin(L k/a2 )
p
cos[(L/2 − x) k/a2 ]
=− p ,
k cos(L k/a2 /2)
and
 
sinh(qx) + sinh[q(L − x)] tz sinh(qx) + sinh[q(L − x)] tz
Res e ; k = lim e
z (z − k) sinh(qL) z→k z sinh(qL)
ekt
= .
k
The residues for z = zn are
 
sinh(qx) + sinh[q(L − x)] tz
Res e ; zn
z (z − k) sinh(qL)
sinh(qx) + sinh[q(L − x)] tz z − zn
= lim e lim
z→zn z(z − k) z→zn sinh(qL)

i sin(nπx/L) + i sin(nπ − nπx/L) kt−n2 π2 a2 t/L2 2na2 πi


= e
(k − n2 π 2 a2 /L2 )(−n2 π 2 a2 /L2 ) L2 cos(nπ)
n n
2(−1) [1 − (−1) ] sin(nπx/L) kt−n2 π2 a2 t/L2
= e .
nπ(k − n2 π 2 a2 /L2 )
Inverting the first term in U (x, s) by inspection and summing the residues,
we obtain the final answer
p
T0 cos[(L/2 − x) k/a2 ]
u(x, t) = p
cos(L k/a2 /2)

4kT0 X sin[(2m − 1)πx/L] 2 2 2 2
+ 2 2 2 2
ekt−(2m−1) π a t/L
π m=1 (2m − 1)[k − (2m − 1) π a /L ]
∞      
4T0 X 1 κm k (2m − 1)πx
= − ekt−κm t sin ,
π m=1 2m − 1 κm − k κm − k L
Worked Solutions 461

where κm = (2m − 1)2 π 2 a2 /L2 .

15. Taking the Laplace transform of both sides of the partial differential
equation,
2
 
2 d U (x, s) 1
sU (x, s) − u(x, 0) = a +q + αU (x, s) , −L < x < L,
dx2 s
subject to the boundary conditions U (−L, s) = U (L, s) = 0. Substituting in
the initial condition yields the ordinary differential equation
d2 U (x, s) αq − s q
2
+ 2
U (x, s) = − 2 .
dx a a s
The general solution is
q √  √ 
U (x, s) = + A cosh x s − αq/a + B sinh x s − αq/a .
s(s − αq)
Applying the boundary conditions, the general solution becomes

q q cosh (x s − αq/a)
sU (x, s) = − √ .
s − αq (s − αq) cosh (L s − αq/a)
The transform sU (x, s) has a removable singularity at s = αq and simple

poles at sn = αq − (2n − 1)2 π 2 a2 /4L2 with sn − αq = (2n − 1)πai/2L.
From Bromwich’s integral,
I  √ 
1 q q cosh (x z − αq/a)
ut (x, t) = − √ etz dz.
2πi C z − αq (z − αq) cosh (L z − αq/a)
Now the residue at zn = αq − (2n − 1)2 π 2 a2 /4L2 is
 √ 
q cosh (x z − αq/a) etz
Res − √ ; zn
(z − αq) cosh (L z − αq/a)

z − zn q cosh (x z − αq/a) etz
= lim √ lim −
z→zn cosh (L z − αq/a) z→zn z − αq
q cos[(2n − 1)πx/2L] exp[αqt − (2n − 1)2 π 2 a2 t/4L2 ]
=
(2n − 1)2 π 2 a2 /4L2
(2n − 1)πai/L
×
sinh[(2n − 1)πi/2](L/a)
4q(−1)n
=− cos[(2n − 1)πx/2L] exp[αqt − (2n − 1)2 π 2 a2 t/4L2 ].
π(2n − 1)
Summing the residues,

4q X (−1)n
ut (x, t) = − cos[(2n − 1)πx/2L]
π n=1 2n − 1
× exp[αqt − (2n − 1)2 π 2 a2 t/4L2 ].
462 Advanced Engineering Mathematics with MATLAB

Finally, we integrate the previous equation with respect to time and obtain

4q X (−1)n cos[(2n − 1)πx/2L]
u(x, t) =
π n=1 (2n − 1)[αq − (2n − 1)2 π 2 a2 /4L2 ]

× 1 − exp[αqt − (2n − 1)2 π 2 a2 t/4L2 ] ,
where the constant of integration ensures that u(x, 0) = 0.

16. We begin by introducing the new variable v(r, t) = r u(r, t) and find that
∂v ∂2v
= 2, 0 ≤ r < 1, t > 0,
∂t ∂r
with the boundary conditions limr→0 v(r, t) → 0 and
∂v(1, t)
− v(1, t) = 1, t>0
∂r
and the initial condition v(r, 0) = 0, 0 ≤ r < 1. Taking the Laplace transform
of both sides of the partial differential equation,
d2 V (r, s)
sV (r, s) − v(r, 0) = , 0 ≤ r < 1,
dr2
subject to the boundary conditions limr→0 V (r, s) → 0 and V ′ (1, s)−V (1, s) =
1/s. Substituting in the initial condition yields the ordinary differential equa-
tion
d2 V (r, s)
− sV (r, s) = 0.
dr2
√ √
The general solution is V (r, s) = A cosh(r s ) + B sinh(r s ). Applying the
boundary √
√ condition as r√ → 0, A = 0. At r = 1, V ′ (1, s) − V (1, s) =
sB cosh( s ) − B sinh( s ) = 1/s. Therefore, the transformed solution is

sinh(r s )
V (r, s) = √ √ √ .
s [ s cosh( s ) − sinh( s )]
Because

sinh(r z )etz
√ √ √
z [ z cosh( z ) − sinh( z )]
(rz 1/2 + r3 z 3/2 /3! + · · ·)(1 + tz + t2 z 2 /2! + · · ·)
= √
z[ z(1 + z/2 + · · ·) − (z 1/2 + z 3/2 /3! + · · ·)]
(r + r3 z/3! + · · ·)(1 + tz + t2 z 2 /2! + · · ·)
=
z(1 + z/2 + z 2 /24 + · · · − 1 − z/6 − z 2 /5! − · · ·)
(r + r3 z/3! + · · ·)(1 + tz + t2 z 2 /2! + · · ·)
=
z(z/3 + z 2 /10 + · · ·)
3
3r r /2 + 3tr − 3r/10
= 2 + + ···,
z z
Worked Solutions 463

we have a second-order pole at z = 0 and the residue equals r3 /2+3tr−3r/10.



We also have poles where zn = iλn , zn = −λ2n and tan(λn ) = λn . Their
residues equal
 √ 
sinh(r z )
Res √ √ √ ; zn
z [ z cosh( z ) − sinh( z )]

sinh(r z )etz z − zn
= lim lim √ √ √
z→zn z z→zn z cosh( z ) − sinh( z )
2 sin(λn r) exp(−λ2n t)
=− .
λ2n sin(λn )

Bring all of these parts together,



r2 3 2 X sin(λn r) −λ2n t
u(r, t) = + 3t − − e ,
2 10 r n=1 λ2n sin(λn )

where tan(λn ) = λn .

17. Taking the Laplace transform of both sides of the partial differential
equation,

a2 d2 [rU (r, s)]


sU (r, s) − u(r, 0) = + Q(s), b < r < ∞,
r dr2
subject to the boundary conditions

u0 + Q(s)
U ′ (b, s) = U (b, s), lim U (r, s) = .
r→∞ s
Substituting in the initial condition yields the ordinary differential equation

d2 [rU (r, s)] s r[Q(s) + u0 ]


2
− 2 rU (r, s) = − .
dr a a2
The general solution is

Q(s) + u0 A e−q(r−b)
U (r, s) = + ,
s r

where q = s/a. Applying the boundary condition at r = b,

[Q(s) + u0 ]b
A=− ,
s(q + 1/β)

where β = b/(1 + b). Therefore, the transformed solution is

u0 + Q(s) b Q(s) e−q(r−b) b u0 e−q(r−b)


U (r, s) = − − .
s s(q + 1/β) r s(q + 1/β) r
464 Advanced Engineering Mathematics with MATLAB

Because
 −√s (r−b)/a 
−1 e
L √
s( s/a + 1/β)
      √ 
r−b r − b a2 t a t r−b
= β erfc √ − exp + 2 erfc + √ ,
2a t β β β 2a t
the final solution is
  Z t 
b−β b−β
u(r, t) = u0 1 − f (r, t) + 1− f (r, t − τ ) q(τ ) dτ,
r 0 r

where
     √ 
r−b r − b a2 t a t r−b
f (r, t) = erfc √ − exp + 2 erfc + √ .
2a t β β β 2a t

18. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s)
sU (x, s) − u(x, 0) − ν = 0, 0 < x < L,
dx2
subject to the boundary conditions U (L, s) = 0 and sU (0, s) − 2µU ′ (0, s)
/m = g/s. Substituting in the initial condition yields the ordinary differential
equation
d2 U (x, s) s
− U (x, s) = 0.
dx2 ν
The general solution that satisfies the boundary condition U (L, s) = 0 is
r 
s
U (x, s) = A sinh (L − x) .
ν

Applying the boundary condition at x = 0,


 r  r  r 
s 2µ s s g
sA sinh L + A cosh L = .
ν m ν ν s

Therefore, the transformed solution is


p
g sinh[(L − x) s/ν ]
U (x, s) = p √ p √ .
s[s sinh(L s/ν ) + 2µ s cosh(L s/ν )/(m ν )]

Taking the inverse,


I p
1 g sinh[(L − x) z/ν ]etz
u(x, t) = p √ p √ dz.
2πi C z[z sinh(L z/ν ) + 2µ z cosh(L z/ν )/(m ν )]
Worked Solutions 465

The contour integral has simple poles at z = 0 and zn = −νλ2n /L2 , where
λn tan(λn ) = 2µL/(mν) ≡ k. The residue at z = 0 is
 p 
g sinh[(L − x) z/ν ]etz
Res p √ p √ ; 0
z[z sinh(L z/ν ) + 2µ z cosh(L z/ν )/(m ν )]
p
g sinh[(L − x) z/ν ]etz
= lim p √ p √
z→0 z sinh(L z/ν ) + 2µ z cosh(L z/ν )/(m ν )

mg(L − x)
= ,

while the residue at zn = −νλ2n /L2 is


 p 
g sinh[(L − x) z/ν ]etz
Res p √ p √ ; zn
z[z sinh(L z/ν ) + 2µ z cosh(L z/ν )/(m ν )]
p
(z − zn )g sinh[(L − x) z/ν ]etz
= lim p √ p √
z→zn z[z sinh(L z/ν ) + 2µ z cosh(L z/ν )/(m ν )]

4gµL3 sin[λn (L − x)/L] exp(−νλ2n t/L2 )


=− .
mν 2 λ2n [λ2n + k(1 + k)] sin(λn )

The final solution is



mg(L − x) 4gµL3 X sin[λn (L − x)/L] exp(−νλ2n t/L2 )
u(x, t) = − .
2µ mν 2 n=1 λ2n [λ2n + k(1 + k)] sin(λn )

19. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s)
sU (x, s) − u(x, 0) − ν = 0, 0 < x < L,
dx2
subject to the boundary conditions U (L, s) = 0 and

ms2 Y (s) − 2µU ′ (0, s) + mω 2 Y (s) = −msA and sY (s) − A = U (0, s).

Substituting in the initial condition yields the ordinary differential equation

d2 U (x, s) s
− U (x, s) = 0.
dx2 ν
The general solution that satisfies the boundary condition U (L, s) = 0 is
r 
s
U (x, s) = B sinh (L − x) .
ν
466 Advanced Engineering Mathematics with MATLAB

Applying the boundary condition at x = 0,


r  r 
s s
ms2 Y (s) + 2µB cosh L + mω 2 Y (s) = msA
ν ν

and  r 
s
sY (s) − A = B sinh L .
ν
Eliminating B between the two equations,
 r  r   r  r 
2 s s 2 s s
ms + 2µs coth L + mω Y (s) = msA + 2µA coth L ,
ν ν ν ν

or  p 
p
ms + 2µ s/ν coth L s/ν
Y (s) = A p  p  .
ms2 + 2µs s/ν coth L s/ν + mω 2

Taking the inverse,


h p  p i
I mz + 2µ z/ν coth L z/ν etz
A
y(t) = p  p  dz.
2πi C mz 2 + 2µz z/ν coth L z/ν + mω 2

The contour integral has simple poles at λn which are the roots of
 p  √
λ2n + 2µλn3/2 coth L λn /ν /(m ν ) + ω 2 = 0.

The residue at z = λn is
h p  p i
 mz + 2µ z/ν coth L z/ν etz 
Res p  p  ; λ n
mz 2 + 2µz z/ν coth L z/ν + mω 2
h p  p i
(z − λn ) mz + 2µ z/ν coth L z/ν etz
= lim p  p 
z→λn
mz 2 + 2µz z/ν coth L z/ν + mω 2
h p  p i
mλn + 2µ λn /ν coth L λn /ν eλn t
=  q   q 
1/2 √ √
2mλn + 3µλn coth L λνn / ν − µLλn csch2 L λνn / ν

4µω 2 λ n eλ n t
= 2µ 2µL 6ω 2 µ
mL λ4n − ( 3 2 2 + ω4
mL )(1 + mν )λn + 2ω λn + mL λn
Worked Solutions 467
 p  √ 3/2
because coth L λn /ν = −m ν(ω 2 + λ2n )/(2µλn ). The final solution is


4µAω 2 X λ n eλ n t
y(t) = 6ω 2 µ
.
mL n=1 λ4n − ( 2µ )(1 + 2µL 3 + 2ω 2 λ2n + + ω4
mL mν )λn mL λn

20. Taking the Laplace transform of both sides of the partial differential
equation,

d2 U (x, s)
sU (x, s) − u(x, 0) − a2 = 0, 0 < x < L,
dx2

subject to the boundary conditions U ′ (0, s) = 0 and a2 U ′ (L, s) + αU (L, s) =


F/s. Substituting in the initial condition yields the ordinary differential equa-
tion
d2 U (x, s) s
− 2 U (x, s) = 0.
dx2 a
The general solution that satisfies the boundary condition U ′ (0, s) = 0 is

U (x, s) = A cosh(qx), q= s/a.

Applying the boundary condition at x = L,

F cosh(qx)
U (x, s) = .
s[a2 q sinh(qL) + α cosh(qL)]

Taking the inverse,


I
F cosh(qx) etz
u(x, t) = dz.
2πi C z[a2 q sinh(qL) + α cosh(qL)]

The contour integral has simple poles at s = 0 and sn = −a2 λ2n /L2 , where λn
is the nth root of λ tan(λ) = αL/a2 , and qn = iλn /L. The residue at z = 0 is
 
cosh(qx) etz cosh(qx) etz 1
Res 2
; 0 = lim 2 = ,
z[a q sinh(qL) + α cosh(qL)] z→0 a q sinh(qL) + α cosh(qL) α

while the residue for z = sn is


 
cosh(qx) etz
Res ; s n
z[a2 q sinh(qL) + α cosh(qL)]
cosh(qx) etz z − sn
= lim lim
z→sn z z→sn a2 q sinh(qL) + α cosh(qL)

2hL cos(λn x/L) exp(−a2 λ2n t/L2 )


=− ,
α (hL + h2 L2 + λ2n ) cos(λn )
468 Advanced Engineering Mathematics with MATLAB

where h = α/a2 . Therefore, summing all of the residues yields


( ∞
)
F X cos(λn x/L) exp(−a2 λ2n t/L2 )
u(x, t) = 1 − 2hL .
α n=1
[hL(1 + hL) + λ2n ) cos(λn )

21. Taking the Laplace transform of both sides of the partial differential
equation,
d2 U (x, s)
sU (x, s) − u(x, 0) = , 0 ≤ x < 1,
dx2
subject to the boundary conditions U (0, s) = 0 and 3a[U ′ (1, s) − U (1, s)]
+sU (1, s) = 1. Substituting in the initial condition yields the ordinary differ-
ential equation
d2 U (x, s)
− sU (x, s) = 0.
dx2
√ √
The general solution is U (x, s) = A cosh(x s ) + B sinh(x s ). Applying the
boundary condition as U (0, s) = 0, A = 0. At x = 1,
 √ √ √  √
3a s cosh( s ) − sinh( s ) + s sinh( s ) B = 1.
Therefore, the transformed solution is

sinh(x s )
U (x, s) = √ √ √ √ .
3a [ s cosh( s ) − sinh( s )] + s sinh( s )
We have simple poles at s = 0 and sn = −λ2n where λn cot(λn ) = (3a+λ2n )/3a.
From Bromwich’s integral,
I √
1 sinh(x z )etz
u(x, t) = √ √ √ √ dz.
2πi C 3a [ z cosh( z ) − sinh( z )] + z sinh( z)
Now
 √ 
sinh(x z )etz
Res √ √ √ √ ;0
3a [ z cosh( z ) − sinh( z )] + z sinh( z )
xz(1 + x2 z/3! + · · ·)(1 + tz + · · ·) x
= lim = ,
z→0 3a(1 + z/2! + · · · − 1 − z/3! − · · ·) + z(1 + z/3! + · · ·) a+1
and
 √ 
sinh(x z )etz
Res √ √ √ √ ; zn
3a [ z cosh( z ) − sinh( z )] + z sinh( z )

(z − zn ) sinh(x z )etz
= lim √ √ √ √
z→zn 3a [ z cosh( z ) − sinh( z )] + z sinh( z )

2 sin(λn x) exp(−λ2n t)
=
3a sin(λn ) + 2 sin(λn ) + λn cos(λn )
2 sin(λn x) exp(−λ2n t)
= .
[3a + 3 + λ2n /(3a)] sin(λn )
Worked Solutions 469

The final answer is


X∞
x sin(λn x) exp(−λ2n t)
u(x, t) = +2 .
a+1 n=1
[3a + 3 + λ2n /(3a)] sin(λn )

22. Taking the Laplace transform of both sides of the partial differential
equation,

dU (x, s) d2 U (x, s)
sU (x, s) − u(x, 0) + V = , 0 < x < 1,
dx dx2
subject to the boundary conditions U (0, s) = 1/s and U ′ (1, s) = 0. Substi-
tuting in the initial condition yields the ordinary differential equation

d2 U (x, s) dU (x, s)
2
−V − sU (x, s) = 0.
dx dx
The general solution is
h p i h p i
U (x, s) = AeV x/2 cosh (1 − x) s + V 2 /4 +BeV x/2 sinh (1 − x) s + V 2 /4 .

Applying the boundary conditions,

µ cosh [µ(1 − x)] + (V /2) sinh [µ(1 − x)]


U (x, s) = eV x/2
s [µ cosh(µ) + (V /2) sinh(µ)]
√ h √ i h √ i
s′ cosh (1 − x) s′ + (V /2) sinh (1 − x) s′
= eV x/2 h√ √  √ i ,
(s′ − V 2 /4) s′ cosh s′ + (V /2) sinh s′
p
where µ = s + V 2 /4 and s′ = s + V 2 /4. We have simple poles at s′ =
V 2 /4 and s′n = −λ2n with λn cot(λn ) = −V /2, where n = 1, 2, 3, . . . From
Bromwich’s integral,

exp V x/2 − V 2 t/4
u(x, t) =
2πi
I √ √ √
{ z cosh [(1 − x) z ] + (V /2) sinh [(1 − x) z ]} etz
× √ √ √ dz.
C (z − V 2 /4) [ z cosh ( z ) + (V /2) sinh ( z )]

Now,
 √ √ √ 
{ z cosh [(1 − x) z ] + (V /2) sinh [(1 − x) z ]} etz V 2
Res √ √ √ ;
(z − V 2 /4) [ z cosh ( z ) + (V /2) sinh ( z )] 4
√ √ √
{ z cosh [(1 − x) z ] + (V /2) sinh [(1 − x) z ]} etz
= lim2 √ √ √
z→V /4 z cosh ( z ) + (V /2) sinh ( z )
2
= eV t/4−V x/2
,
470 Advanced Engineering Mathematics with MATLAB

and
 √ √ √ 
{ z cosh [(1 − x) z ] + (V /2) sinh [(1 − x) z ]} etz 2
Res √ √ √ ; −λ n
(z − V 2 /4) [ z cosh ( z ) + (V /2) sinh ( z )]
√ √ √
{ z cosh [(1 − x) z ] + (V /2) sinh [(1 − x) z ]} etz
= lim 2
z→−λn z − V 2 /4
z + λ2n
× lim 2 √ √ √
z→−λn z cosh ( z ) + (V /2) sinh ( z )
2
2λn {λn cos[λn (1 − x)] + (V /2) sin[λn (1 − x)]}e−λn t
= .
(λ2n + V 2 /4)[cos(λn ) − λn sin(λn ) + (V /2) cos(λn )]

Thus, the final answer is


2
u(x, t) = 1 − 2eV x/2−V t/4
X∞ 2
λn {(V /2) sin[λn (1 − x)] + λn cos[λn (1 − x)]}e−λn t
× .
n=1
(λ2n + V 2 /4)[λn sin(λn ) − (1 + V /2) cos(λn )]

23. Taking the Laplace transform of both sides of the partial differential
equation,
(s + b)U ′ (x, s) + asU (x, s) = 0, 0 < x < ∞,
subject to the boundary conditions limx→0 |U (x, s)| < ∞ and U (0, s) = 1/s.
The solution to this boundary-value problem
 
1 asx
U (x, s) = exp − .
s s+b

Because Z ξ
e−cξ = 1 − c e−cη dη,
0
Z ax  
1 −η bη dη
U (x, s) = − e exp .
s 0 s+b s+b
Inverting the Laplace transform term-by-term and using the first shifting the-
orem, Z ax  p 
u(x, t) = 1 − e−bt e−η I0 2 btη dη.
0

24. Taking the Laplace transform of both sides of the partial differential
equation,  
1 d dU (r, s)
r − sU (r, s) = 1, 0 ≤ r < a,
r dr dr
Worked Solutions 471

subject to the boundary conditions lim √r→0 |U (r, s)|√< ∞ and U (a, s) = 0.
The general solution is U (r, s) = AI0 (r s ) + BK0 (r s ) − 1/s. Applying the
boundary conditions,
√ √
I0 (r s ) − I0 (a s )
U (r, s) = √ .
s I0 (a s )
We have a removable singularity at s = 0 and simple poles at sn = −kn2 /a2 ,
where J0 (kn ) = 0 and n = 1, 2, 3, . . . From Bromwich’s integral,
I √ √
1 I0 (r z ) − I0 (a z ) tz
u(r, t) = √ e dz.
2πi C z I0 (a z )
Now,
 √ √  √ √
I0 (r z ) − I0 (a z ) tz z − zn I0 (r z ) − I0 (a z ) tz
Res √ e ; zn = lim √ lim e
z I0 (a z ) z→zn I0 (a z ) z→zn z
2 J0 (kn r/a) −kn2 t/a2
=− e .
kn J1 (kn )
Thus, the final answer is
X∞
J0 (kn r/a) −kn2 t/a2
u(r, t) = −2 e .
k J (k )
n=1 n 1 n

25. Taking the Laplace transform of both sides of the partial differential
equation,  
1 d dU (r, s) 1
r − sU (r, s) = − , 0 ≤ r < a,
r dr dr s
subject to the boundary conditions lim√ r→0 |U (r, s)| < √∞ and U (a, s) = 0.
The general solution is U (r, s) = AI0 (r s ) + BK0 (r s ) + 1/s2 . Applying
the boundary conditions,
√ √
I0 (a s ) − I0 (r s )
U (r, s) = √ .
s2 I0 (a s)
We have simple poles at s = 0 and sn = −kn2 /a2 where J0 (kn ) = 0 and
n = 1, 2, 3, . . . From Bromwich’s integral,
I √ √
1 I0 (a z ) − I0 (r z ) tz
u(r, t) = √ e dz.
2πi C z 2 I0 (a z)
Now,
 √ √ 
I0 (a z ) − I0 (r z ) tz
Res √ e ; 0
z 2 I0 (a z)
[1 + a2 z/4 + · · · − 1 − r2 z/4 − · · ·][1 + tz + · · ·] a2 − r 2
= lim 2
= ,
z→0 z[1 + a z/4 + · · ·] 4
472 Advanced Engineering Mathematics with MATLAB

and
 √ √  √ √
I0 (a z ) − I0 (r z ) tz z − zn I0 (a z ) − I0 (r z ) tz
Res √ e ; zn = lim √ lim e
z 2 I0 (a z) z→zn I0 (a z) z→zn z2
2a2 J0 (kn r/a) −kn2 t/a2
=− e .
kn3 J1 (kn )
Thus, the final answer is
X∞
a2 − r 2 J0 (kn r/a) −kn2 t/a2
u(r, t) = − 2a2 e .
4 k 3 J (k )
n=1 n 1 n

26. Taking the Laplace transform of both sides of the partial differential
equation,  
1 d dU (r, s)
r − sU (r, s) = −1, 0 ≤ r < a,
r dr dr
subject to the boundary conditions limr→0 |U (r, s)| < √
∞ and U (a, s)√= 1/(s+
1/τ0 ). The general solution is U (r, s) = 1/s + AI0 (r s ) + BK0 (r s ). Ap-
plying the boundary conditions,
  √
1 1 1 I0 (r s )
U (r, s) = + − √ .
s s + 1/τ0 s I0 (a s )
We have simple poles at s = 0, s = −1/τ0 and sn = −kn2 /a2 , where J0 (kn ) = 0
and n = 1, 2, 3, . . . From Bromwich’s integral,
I   √
1 1 1 I0 (r z ) tz
u(r, t) = 1 + − √ e dz.
2πi C z + 1/τ0 z I0 (a z )
Now,
  √  √
1 1 I0 (r z ) tz I0 (r z ) tz
Res − √ e ; 0 = − lim √ e = −1,
z + 1/τ0 z I0 (a z ) z→0 I0 (a z )
  √  √
1 1 I0 (r z ) tz 1 I0 (r z ) tz
Res − √ e ;− = lim √ e
z + 1/τ0 z I0 (a z ) τ0 z→−1/τ0 I0 (a z )
p
J0 (r 1/τ0 ) −t/τ0
= p e ,
J0 (a 1/τ0 )
and
  √ 
1 1 I0 (r z ) tz
Res − √ e ; zn
z + 1/τ0 z I0 (a z)
 
z − zn 1 1 √
= lim √ lim − I0 (r z )etz
z→zn I0 (a z ) z→zn z + 1/τ0 z
 
2kn 1 1 J0 (kn r/a) −kn2 t/a2
= 2 + 2 2 e
a −kn2 /a2 + 1/τ0 kn /a J1 (kn )
2a2 J0 (kn r/a) 2 2
= 2 2
e−kn t/a .
kn (a − kn τ0 )J1 (kn )
Worked Solutions 473

Thus, the final answer is


p ∞
J0 (r 1/τ0 ) −t/τ0 X J0 (kn r/a) 2 2
u(r, t) = p e + 2a2 2 2
e−kn t/a
J0 (a 1/τ0 ) n=1 n
k (a − kn τ0 ) J1 (kn )
X∞
J0 (kn r/a)  2

t/a2
= e−t/τ0 + 2a2 e −kn
− e −t/τ0
.
k (a2 − kn2 τ0 ) J1 (kn )
n=1 n

27. Taking the Laplace transform of both sides of the partial differential
equation,  
1 d dU (r, s) s
r − 2 U (r, s) = 0, 0 ≤ r < b,
r dr dr a
2
subject to the boundary conditions limr→0 √ |U (r, s)| < ∞√and U (b, s) = k/s .
The general solution is U (r, s) = AI0 (r s/a) + BK0 (r s/a). Applying the
boundary conditions, √
k I0 (r s/a)
U (r, s) = 2 √ .
s I0 (b s/a)

We have second-order pole at z = 0 and simple poles at iκn = zn /a or
2 2
zn = −a κn , where J0 (κn b) = 0 and n = 1, 2, 3, . . . From Bromwich’s integral,
I √
k I0 (r z/a)etz
u(r, t) = √ dz.
2πi C z 2 I0 (b z/a)

Now,
 √   
I0 (r z/a)etz d (1 + r2 z/4a2 + · · ·)(1 + tz + · · ·)
Res 2 √ ; 0 = lim
z I0 (b z/a) z→0 dz 1 + b2 z/4a2 + · · ·
b2 − r 2
=t− ,
4a2
and
 √  √
I0 (r z/a)etz z − zn I0 (r z/a)etz
Res √ ; z n = lim √ lim
z 2 I0 (b z/a) z→zn I0 (b z/a) z→zn z2
√ √
2a zn I0 (r zn /a)etzn
= ′ √
bI0 (b z/a) zn2
2 2 2 2
2iI0 (irκn )e−a κn t 2J0 (κn r)e−a κn t
= = .
a2 bκ3n I0′ (ibκn ) a2 bκ3n J1 (κn b)

Thus, the final answer is


" ∞
#
b2 − r 2 2 X J0 (κn r)
u(r, t) = k t − + 2 .
4a2 a b n=1 κ3n J1 (κn b)
474 Advanced Engineering Mathematics with MATLAB

28. Introducing the variable change,

∂u 1 ∂v ∂u 1 ∂v v ∂2u 1 ∂2v 2 ∂v 2v
= , = − 2, 2
= 2
− 2 + 3.
∂t r ∂t ∂r r ∂r r ∂r r ∂r r ∂r r

Substituting these equations into the original differential equation and bound-
ary conditions yields the desired result.
Taking the Laplace transform of the partial differential equation in Step
1 gives
d2 V (r, s) s A
− 2 V (r, s) = − 3 , α < r < β,
dr2 a sr
along with
V (α, s)
V ′ (α, s) + = V (β, s) = 0.
α
To find the particular solution, we use the variation of parameters:

Vp (r, s) = u1 (r, s) cosh(qr) + u2 (r, s) sinh(qr).

Then,
W1 W2
u′1 (r, s) = and u′2 (r, s) = ,
W W
where
cosh(qr) sinh(qr)
W = = q,
q sinh(qr) q cosh(qr)

0 sinh(qr) A
W1 = = 3 sinh(qr),
−A/sr3 q cosh(qr) sr
and
cosh(qr) 0 A
W2 = = − 3 cosh(qr).
q sinh(qr) −A/sr3 sr
Thus,
Z r Z r
A sinh(qτ ) A cosh(qτ )
u1 (r, s) = dτ, and u2 (r, s) = − dτ.
sq β τ3 sq β τ3

Therefore, the general solution is

V (r, s) = c1 cosh(qr) + c2 sinh(qr)


Z r Z r
A sinh(qτ ) A cosh(qτ )
+ cosh(qr) 3
dτ − sinh(qr) dτ
sq β τ sq β τ3
Z
A r sinh[q(r − τ )]
= C sinh[q(r − β)] − dτ.
sq β τ3
Worked Solutions 475

This solution satisfies the condition that V (β, s) = 0. Because

Z β
A cosh[q(α − τ )]
V ′ (α, s) = Cq cosh[q(β − α)] + dτ,
s α τ3

and
Z β
A sinh[q(α − τ )]
V (α, s) = C sinh[q(α − β)] + dτ,
sq α τ3

we have from the boundary condition V ′ (α, s) + V (α, s)/α = 0 that

Z β
A sinh[q(α − τ )]
[qα cosh(qℓ ) + sinh(qℓ )]C = dτ
sq α τ3
Z β
αA cosh[q(α − τ )]
− dτ.
s α τ3

Thus,

sinh[q(r − β)]
V (r, s) =
αq cosh(qℓ ) + sinh(qℓ )
" Z #
A β αq cosh[q(α − τ )] − sinh[q(α − τ )]
× − dτ
sq α τ3
Z
A β sinh[q(τ − r)]
− dτ
sq r τ3
 Z ℓ
A sinh[q(β − r)] αq cosh(qη) + sinh(qη)
= dη
sq αq cosh(qℓ ) + sinh(qℓ ) 0 (α + η)3
Z β−r 
sinh(qη)
− dη ,
0 (r + η)3

where η = τ − α in the first integral and η = τ − r in the second. Finally we


divide V (r, s) by r to find U (r, s).
There are simple poles at s = 0 and sn = −a2 γn2 where γn is the nth root
of αγn cos(γn ℓ ) + sin(γn ℓ ) = 0. If we denote

 Z ℓ
etz sinh[q(β − r)] αq cosh(qη) + sinh(qη)
F (z) = dη
rzq αq cosh(qℓ ) + sinh(qℓ ) 0 (α + η)3
Z β−r 
sinh(qη)
− dη ,
0 (r + η)3
476 Advanced Engineering Mathematics with MATLAB

the residue for z = 0 is


 Z ℓ
A sinh[q(β − r)] αq cosh(qη) + sinh(qη)
Res[F (z); 0] = lim dη
z→0 qr αq cosh(qℓ ) + sinh(qℓ ) 0 (α + η)3
Z β−r 
sinh(qη)
− dη
0 (r + η)3
" Z Z β−r Z β−r #
A β−r ℓ dη dη dη
= − +r
r α + ℓ 0 (α + η)2 0 (r + η)2 0 (r + η)3
"  ℓ #
β−r β−r
A r−β 1 1 r 1
= + −
r α+ℓ α+η 0 r+η 0 2 (r + η)2 0
     
A r 1 1 1 r 1 1 1 1
= 1− − − + − +
r β α β r 2 r β r β
   
1 1 1 1 1 1
=A − − + .
r β α 2 r β
For the simple poles at zn = −a2 γn2 , we have that
Z
sinh[q(β − r)]etz ℓ αq cosh(qη) + sinh(qη)
Res[F (z); zn ] = lim dη
z→zn zqr 0 (α + η)3
z − zn
× lim
z→zn αq cosh(qℓ ) + sinh(qℓ )

2a2 γn sin[γn (β − r)] exp(−a2 γn2 t)


Res[F (z); zn ] = −
ra2 γn3 [α cos(γn l) − αℓγn sin(γn ℓ) + ℓ cos(γn ℓ)]
Z ℓ
αγn cos(γn η) + sin(γn η)
× dη
0 (α + η)3
2 sin[γn (β − r)] exp(−a2 γn2 t)
= 2
rγn [α cos(γn l) − αℓγn sin(γn ℓ) + ℓ cos(γn ℓ)]
Z ℓ
cos(γn ℓ) sin(γn η) − sin(γn ℓ) cos(γn η)
× dη
0 cos(γn ℓ)(α + η)3
Z
2 sin[γn (β − r)] exp(−a2 γn2 t) ℓ sin[γn (ℓ − η)]
= dη
rγn2 cos2 (γn ℓ)(β + α2 ℓγn2 ) 0 (α + η)3
Z
2α2 sin[γn (β − r)] exp(−a2 γn2 t) 1 sin(γn ℓτ )
=− dτ,
rℓ2 sin2 (γn ℓ)(β + α2 ℓγn2 ) 0 (δ − τ )3
where η = ℓ − ℓτ and we have used αγn + tan(γn ℓ) = 0 many times. The final
answer results from the sum of the residues.

Section 12.12

1. Let A(x, t) = w(x) + v(x, t), where w(x) is the steady-state solution and
v(x, t) is the transient part. We find the steady-state solution by solving
Worked Solutions 477

w′′ = 0 with w(0) = w(L) = 1. The steady-state solution is w(x) = 1. To find


the transient solution, we solve

∂v ∂2v
= a2 2 , 0 < x < L, t > 0,
∂t ∂x

with the boundary conditions v(0, t) = v(L, t) = 0, t > 0 and the initial
condition v(x, 0) = −1 for 0 < x < L. We can now use separation of variables
and find that
X∞  nπx  2 2 2 2
v(x, t) = Bn sin e−a n π t/L .
n=1
L

Using the initial condition,



X  nπx 
v(x, 0) = Bn sin = −1.
n=1
L

This is a half-range Fourier sine expansion and


Z L  nπx   nπx  L
2 2 2[1 − (−1)n ]
Bn = − sin dx = cos =− .
L 0 L nπ L 0 nπ

Thus, the final solution is



4 X sin[(2m − 1)πx/L] −a2 (2m−1)2 π2 t/L2
A(x, t) = 1 − e .
π m=1 2m − 1

From Duhamel’s theorem,


Z t
u(x, t) = f (t)A(x, 0) + f (τ )At (x, t − τ ) dτ.
0

Now
∞  
4a2 π X (2m − 1)πx −a2 (2m−1)2 π2 t/L2
At (x, t) = (2m − 1) sin e .
L2 m=1 L

Therefore the final answer is


∞  
4a2 π X (2m − 1)πx −a2 (2m−1)2 π2 t/L2
u(x, t) = (2m − 1) sin e
L2 m=1 L
Z t
2 2 2 2
× f (τ )ea (2m−1) π τ /L dτ.
0
478 Advanced Engineering Mathematics with MATLAB

2. Let A(r, t) = w(r) + v(r, t) where w(r) is the steady-state solution and
v(r, t) is the transient part. We find the steady-state solution by solving
 
d dw
r = 0, lim |w(r)| < ∞, w(b) = 1.
dr dr r→0

The steady-state solution is w(r) = 1. To find the transient solution, we solve


 
∂v a2 ∂ ∂v
= r , 0 ≤ r < b, t > 0,
∂t r ∂r ∂r

with the boundary conditions limr→0 |v(r, t)| < ∞, v(b, t) = 0, t > 0 and the
initial condition v(r, 0) = −1 for 0 ≤ r < b. We can now use separation of
variables and find that

X    
kn r a2 kn2
v(r, t) = An J0 exp − 2 t ,
n=1
b b

where J0 (kn ) = 0. Using the initial condition,



X  
kn r
v(r, 0) = An J0 = −1,
n=1
b

where Z  
b
2 kn r 2
An = − 2 rJ0 dr = − .
J1 (kn )b2 0 b kn J1 (kn )
The final solution is

X∞  2 2 
J0 (kn r/b) a k
A(r, t) = 1 − 2 exp − 2 n t .
k J
n=1 n 1 n
(k ) b

From Duhamel’s theorem,


Z t
u(r, t) = f (t)A(r, 0) + f (τ )At (r, t − τ ) dτ.
0

Now  2 2 

2a2 X kn J0 (kn r/b) a k
At (r, t) = 2 exp − 2 n t .
b n=1 J1 (kn ) b

Therefore the final answer is


∞ Z  2 2 
2a2 X kn J0 (kn r/b) t a kn (t − τ )
u(r, t) = ϕ(τ ) exp − dτ.
b2 n=1 J1 (kn ) 0 b2
Worked Solutions 479

For ϕ(τ ) = Gτ ,
∞ Z
2a2 X kn J0 (kn r/b) −a2 kn2 t/b2 t 2 2 2
u(r, t) = 2 e Gτ ea kn τ /b dτ
b n=1 J1 (kn ) 0

X J0 (kn r/b)    t
−a2 kn
2
t/b2 a2 k n
2
τ /b2 b2
= 2G e e τ− 2 2
k J (k )
n=1 n 1 n
a kn 0

X J0 (kn r/b)  
b2 b2 2 2 2
= 2G t − 2 2 + 2 2 e−a kn t/b .
k J (k )
n=1 n 1 n
a kn a kn

3. Taking the Laplace transform of both sides of the partial differential equa-
tion,
d2 A(x, s)
sA(x, s) − A(x, 0) = ν , 0<x<∞
dx2
subject to the boundary conditions A(0, s) = 1/s and limx→∞ A(x, s) < ∞.
Substituting in the initial condition yields the ordinary differential equation

d2 A(x, s) s
− A(x, s) = 0.
dx2 ν
The general solution is
√ √
A(x, s) = Cex s/ν
+ De−x s/ν
.

Applying the boundary condition as x → ∞, C √= 0. Using the boundary


condition at x = 0, we have that A(x, s) = e−x s/ν /s. From an extensive
table of inverses,
  Z ∞
x 2 −η 2
A(x, t) = erfc √ =√ √ e dη.
2 νt π x/2 νt

From Equation 12.12.13 and A(x, 0) = 0,


Z t
2 x
u(x, t) = V (ξ)e−x /[4ν(t−ξ)]
p dξ
0 2 πν(t − ξ)3
Z t
x exp[−x2 /(4ντ )]
= √
V (t − τ ) dτ
0 2 πντ 3
Z x/√4νt  
2 x2 2
= −√ V t− 2
e−η dη
π ∞ 4νη
Z ∞  
2 x2 2
=√ √ V t − 2
e−η dη,
π x/ 4νt 4νη
480 Advanced Engineering Mathematics with MATLAB

where η = x/ 4ντ and τ = t − ξ.

4. Step 1 follows just like Problem 3 with ν = a2 . From Equation 12.12.13


and A(x, 0) = 0,
Z t   2 2 x
u(x, t) = u0 − 32 f (ξ) e−x /[4a (t−ξ)] p dξ
0 2a π(t − ξ)3
Z t 2 2 Z t
x e−x /[4a (t−ξ)] 2 x exp[−x2 /(4a2 τ )]
= u0 p dξ − f (t − τ ) √ dτ
0 2a π(t − ξ)3 3 0 2a πτ 3
  Z ∞  
x 4 x2 2
= u0 erfc √ − √ √ f t − 2 2
e−η dη,
2a t 3 π x/ 4a2 t 4a η

where η = x/ 4a2 τ and τ = t − ξ.

5. Let A(x, t) = 1 − hx/(1 + h) + ϕ(x, t), where the term 1 − hx/(1 + h) was
introduced so that we have a homogeneous boundary condition at x = 0. To
find ϕ, we solve

∂ϕ ∂2ϕ
= , 0 < x < 1, 0 < t,
∂t ∂x2
with the boundary conditions ϕ(0, t) = 0, ϕx (1, t) = −hϕ(1, t), 0 < t, and
the initial condition ϕ(x, 0) = hx/(1 + h) − 1. We can now use separation of
variables and find that

X 2
ϕ(x, t) = Cn sin(kn x)e−kn t ,
n=1

where kn is the nth root of k cot(k) = −h. Using the initial condition,

X hx
ϕ(x, 0) = Cn sin(kn x) = − 1,
n=1
1+h

where
R1
0
[hx/(1 + h) − 1] sin(kn x) dx 2 kn2 + h2
Cn = R1 2 =− .
sin (kn x) dx kn kn2 + h2 + h
0

In simplifying Cn , I used kn cos(kn ) = −h sin(kn ), and sin2 (kn ) = kn2 /(kn2 +


h2 ). Therefore, the final answer in Step 1 is

X∞
hx kn2 + h2 2
A(x, t) = 1 − −2 2 2
sin(kn x)e−kn t .
1+h k (k + h + h)
m=1 n n
Worked Solutions 481

From Duhamel’s theorem,


Z t
u(x, t) = f (t)A(x, 0) + f (τ )At (x, t − τ ) dτ.
0

Now A(x, 0) = 0 and

X∞
kn (kn2 + h2 ) 2
At (x, t) = 2 2 2
sin(kn x)e−kn t .
k +h +h
m=1 n

The final answer is


X∞ Z t
kn (kn2 + h2 ) 2
−kn t 2
u(x, t) = 2 2 2
sin(k n x)e f (τ )ekn τ dτ.
k +h +h
m=1 n 0

Section 12.13

1. Taking the Laplace transform with respect to x,

d2 U
+ s2 U − su(0, y) − ux (0, y) = 0,
dy 2
or
d2 U
+ s2 U = s + f (s, y).
dy 2
Because

2 X [1 − (−1)n ]  nπy 
1= sin
π n=1 n a

and expanding f (s, y) in a half-range sine expansion:



X  nπy  Z a  nπy 
2
f (s, y) = An sin , where An = f (s, y) sin dy,
n=1
a a 0 a

∞   
d2 U 2
X 2s[1 − (−1)n ] nπy 
+ s U = + An sin ,
dy 2 n=1
nπ a
and
X∞
2s[1 − (−1)n ] + nπAn  nπy 
U (s, y) = sin .
n=1
nπ(s2 − n2 π 2 /a2 ) a

For the solution to remain finite as x → ∞, s = nπ/a cannot be a pole of the


transform U (s, y). Therefore, An = −2[1 − (−1)n ]/a and

X∞
2[1 − (−1)n ]  nπy 
U (s, y) = sin .
n=1
nπ(s + nπ/a) a
482 Advanced Engineering Mathematics with MATLAB

Taking the inverse term by term,


∞    
4 X 1 (2m − 1)πx (2m − 1)πy
u(x, y) = exp − sin .
π m=1 2m − 1 a a

2. Taking the Laplace transform of the partial differential equation, we have


that  
1 d dU (r, s)
r + s2 U (r, s) − su(r, 0) − uz (r, 0) = 0.
r dr dr
Substituting u(r, 0) = 1 and uz (r, 0) = f (r), we find that
 
1 d dU (r, s)
r + s2 U (r, s) = s + f (r), 0 ≤ r < a,
r dr dr

with |U (0, s)| < ∞ and U (a, s) = 0. Let us rewrite f (r) as the Fourier-Bessel
series:

X
f (r) = An J0 (kn r/a),
n=1

where kn is the nth root of the J0 (k) = 0 and


Z a
2
An = 2 2 f (r) J0 (kn r/a) r dr.
a J1 (kn ) 0

Because
X∞
J0 (kn r/a)
1=2 , 0 ≤ r < a,
k J (k )
n=1 n 1 n
  ∞  
1 d dU (r, s) 2 X sa2 J1 (kn ) − kn ak kn r
r + s2 U (r, s) = 2 J 0 ,
r dr dr a n=1 kn J12 (kn ) a
Ra
where ak = 0 f (r)J0 (kn r/a) r dr. Therefore,

2 X sa2 J1 (kn ) − kn ak
U (r, s) = J0 (kn r/a), 0 ≤ r < a.
a2 n=1 (s2 − kn2 /a2 )kn J12 (kn )

Because s = kn /a cannot be a pole of U (r, s), ak = aJ1 (kn ) and



X J0 (kn r/a)
U (r, s) = 2 , 0 ≤ r < a.
k (s + kn /a)J1 (kn )
n=1 n

The inverse of U (r, s) then follows directly from simple inversion and equals

X∞
J0 (kn r/a) −kn z/a
u(r, z) = 2 e .
k J (k )
n=1 n 1 n
Worked Solutions 483

Section 13.1

1.
∞  n
X X∞  n
1 1 1 2z
F (z) = z −n = = −1
=
n=0
2 n=0
2z 1 − (2z) 2z − 1

if |z| > 1/2.

2.

X ∞  iθ n
X e 1 z
F (z) = einθ z −n = = =
n=0 n=0
z 1 − (eθi /z) z − eθi

if |z| > 1.

3.
5  n
X 1 1 − (1/z)6 z6 − 1
F (z) = = = 6
n=0
z 1 − (1/z) z − z5

if |z| > 0.

4.

X10  n X∞  n  11 X∞  m
1 1 1 − (1/2z)11 1 1
F (z) = + = +
n=0
2z n=11
4z 1 − (1/2z) 4z m=0
4z
1 − (1/2z)11 1 1 (2z)11 − 1 1
= + 11
= +
1 − (1/2z) (4z) 1 − (1/4z) (2z)11 − (2z)10 (4z)11 − (4z)10

if |z| > 4.

5.

1 a 2 X  a m
∞ ∞
1 X n −n a2 1 a2 + a − z
F (z) = − + a z =− + 2 = 2 − =
z n=2 z z m=0 z z − az z z(z − a)

if |z| > a.

Section 13.2

1. We have that fn = gn e−anT , where gn = nT . Now Z(nT ) = zT /(z − 1)2 .


Therefore, from Equation 13.2.2, we have that F (z) = zT eaT /(zeaT − 1)2 .

2. Because Z(an ) = z/(z − a),


 
z d z z
F (z) = − =
a dz z−a (z − a)2
484 Advanced Engineering Mathematics with MATLAB

by Equation 13.2.25.

3. Here we have that fn = ngn , where gn = nan−1 . From problem 2, G(z) =


z/(z − a)2 . From F (z) = −zG′ (z) = z(z + a)/(z − a)3 .

4. We first write
1
  
F (z) = 2 Z an ein + Z an e−in .
 
Because Z an ein = z/(z − aei ) and Z an e−in = z/(z − ae−i ),
 
1 z z
F (z) = +
2 z − aei z − ae−i
 
1 z z
= +
2 z − a cos(1) − ia sin(1) z − a cos(1) + ia sin(1)
1 z[z − a cos(1)]
= .
2 z − 2az cos(1) + a2
2

5.
z − cos(1)
F (z) = z −2 Z[cos(n)] =
z[z 2 − 2z cos(1) + 1]

6.
 3z z
F (z) = Z(3) + Z e−2nT = +
z − 1 z − e−2T

7. Because

sin(nω0 T + θ) = sin(nω0 T ) cos(θ) + cos(nω0 T ) sin(θ),

then
F (z) = cos(θ)Z[sin(nω0 T )] + sin(θ)Z[cos(nω0 T )]
z sin(θ)[z − cos(ω0 T )] + z cos(θ) sin(ω0 T )
=
z 2 − 2z cos(ω0 T ) + 1
z[z sin(θ) + sin(ω0 T − θ)]
=
z 2 − 2z cos(ω0 T ) + 1

8.
X(z)
F (z) = ,
1 − z −4
where
1 2 1
X(z) = 0 + + 2 + 3.
z z z
Worked Solutions 485

Therefore,
z 3 + 2z 2 + z z(z + 1)
F (z) = = .
z4 − 1 (z − 1)(z 2 + 1)

9.
X(z) 1
F (z) = , where X(z) = 1 − .
1 − z −2 z
Therefore,
z(z − 1) z
F (z) = = .
z2 − 1 z+1

10.    
d d z z
Z(n) = −z Z(1) = −z =
dz dz z − 1 (z − 1)2
   
2 d d z z(z + 1)
Z(n ) = −z Z(n) = −z =
dz dz (z − 1)2 (z − 1)3

11. From the definition


n
X
wn = f n ∗ g n = 1 = n + 1.
k=0

Therefore, W (z) = z 2 /(z −1)2 = F (z)G(z), because F (z) = G(z) = z/(z −1).

12. From the definition


n
X
wn = f n ∗ g n = k = 12 n(n + 1).
k=0

Therefore,
z2
W (z) = = F (z)G(z)
(z − 1)3
because F (z) = z/(z − 1) and G(z) = z/(z − 1)2 .

13. From the definition


n
X n
1 1 X n! (1 + x)n 2n
wn = fn ∗ g n = = = = .
k!(n − k)! n! k!(n − k)! n! x=1 n!
k=0 k=0

Therefore, W (z) = e2/z = F (z)G(z), because F (z) = G(z) = e1/z .


486 Advanced Engineering Mathematics with MATLAB

14.

X ∞
X  a n ∞
X
Z[an fn ] = an fn z −n = fn = fn ζ −n = F (ζ) = F (z/a),
n=0 n=0
z n=0

where ζ = z/a.

Section 13.3

1.
0.007143 + 0.08503z −1 + 0.1626z −2 + 0.2328z −3 + ···
2
2
12.6z −24z+11.4 0.09z + 0.9000z + 0.0900
0.09z 2 − 0.1714z + 0.0814
1.0714z + 0.0086
1.0714z − 2.0407 + 0.9693z −1
2.0493 − 0.9693z −1
2.0493 − 3.9024z −1 + · · ·
2.9331z −1 + · · ·

2.
0.5z −3 + z −4 + z −5 + 0.5z −6 + 0z −7 + 0z −8 + ···

2z 4 −2z 3 +2z−2 z +1
z −1 + 0z −1 + z −2 − z −3
2 + 0z −1 − z −2 + z −3
2 − 2z −1 + 0z −2 + 2z −3 − 2z −4
2z −1 − z −2 − z −3 + 2z −4 + · · ·
2z −1 − 2z −2 + 0z −3 + 2z −4 − · · ·
z −2 − z −3 + 0z −4 + · · ·
z −2 − z −3 + 0z −4 + · · ·
+ ···

3.
0.09836 + 0.3345z −1 + 0.6099z −2 + 0.7935z −3 + ···
2
15.25z −36.75z+30.75 1.5z 2
+ 1.5000z
1.5z 2 − 3.6147z + 3.0246
5.1147z − 3.0246
5.1147z − 12.3260 + 10.3136z −1
9.3014 − 10.3136z −1
9.3014 − 22.4138z −1 + ···
12.1002z −1 + ···
Worked Solutions 487

4.
0.3158z −1 + 0.8643z −2 + 1.1521z −3 + 1.1620z −4 + ···

19z 3 −33z 2 +21z−7 6z 2 + 6.0000z


6z 2 − 10.4214z + 6.6318 − 2.2106z −1
16.4214z − 6.6318 + 2.2106z −1
16.4214z − 28.5219 + 18.1503z −1 − · · ·
21.8901 − 15.9397z −1 + · · ·
21.8901 − 38.0193z −1 + · · ·
22.0796z −1 + · · ·

5.
F (z) z+1 A B C
= = + + ,
z (z − 1)(z − 1/2)2 z − 1 z − 1/2 (z − 1/2)2
where
 
F (z) d F (z)
A = lim (z − 1) = 8, B = lim (z − 1/2)2 = −8
z→1 z z→1/2 dz z

and
F (z)
C = lim (z − 1/2)2 = −3.
z→1/2 z
Therefore,
8z 8z 3z
F (z) = − −
z − 1 z − 1/2 (z − 1/2)2
or  
1 n 1 n
fn = 8 − 8 2 − 6n 2 .

6.
F (z) 1 − e−aT A B
= = + ,
z (z − 1)(z − e−aT ) z − 1 z − e−aT
where
F (z)
A = lim (z − 1) =1
z→1 z
and
F (z)
B= lim (z − e−aT ) = −1.
z→e−aT z
Therefore,
z z
F (z) = −
z − 1 z − e−aT
or
fn = 1 − e−anT .
488 Advanced Engineering Mathematics with MATLAB

7.
F (z) z A B
= = + ,
z (z − 1)(z − α) z−1 z−α
where
F (z) 1
A = lim (z − 1) =
z→1 z 1−α
and
F (z) α
B = lim (z − α) =− .
z→α z 1−α
Therefore,

1 z α z 1 − αn+1
F (z) = − or fn = .
1−αz−1 1−αz−α 1−α

8.
F (z) 2z − a − b A B
= = + ,
z (z − a)(z − b) z−a z−b
where
F (z)
A = lim (z − a) =1
z→a z
and
F (z)
B = lim (z − b) = 1.
z→b z
Therefore,
z z
F (z) = +
z−a z−b
or
f n = a n + bn .

9.
z+1 z z
F (z) = z −10 = z −10 + z −11
z − 1/2 z − 1/2 z − 1/2
or  
1 n−10 1 n−11
fn = 2 Hn−10 + 2 Hn−11
from Equation 11.2.10.

10.
I  
1 z+3 n 1 d2 n+1 n
fn = z dz = z + 3z
2πi C (z − 1/2)3 2 dz 2 z=1/2
h   i 
n−1 n−2 1 n
= 12 n(n + 1) 12 + 3n(n − 1) 21 = n(7n − 5) 2 .
Worked Solutions 489

11.
I
1 zn
fn = dz
2πi (z + 1)2 (z − 1/2)
C   
zn zn 1
= Res ; −1 + Res ; ,
(z + 1)2 (z − 1/2) (z + 1)2 (z − 1/2) 2

where
   
zn d zn
Res ; −1 = lim
(z + 1)2 (z − 1/2) z→−1 dz z − 1/2
 n−1

nz zn
= lim −
z→−1 z − 1/2 (z − 1/2)2
6n − 4
= (−1)n
9
and    n
zn 1 zn 4 1
Res ; = lim = .
(z + 1)2 (z − 1/2) 2 z→1/2 (z + 1)2 9 2
Therefore,  n
6n − 4 4 1
fn = (−1)n + .
9 9 2

12. I
1 zn
fn = 2 2
dz
2πi
C (z + 1) (z − 1)
   
zn zn
= Res ; −1 + Res ; 1 ,
(z + 1)2 (z − 1)2 (z + 1)2 (z − 1)2
where
   
zn d 2 zn
Res ; 1 = lim (z − 1)
(z + 1)2 (z − 1)2 z→1 dz (z − 1)2 (z + 1)2
 
nz n−1 2z n n−1
= lim − =
z→1 (z + 1)2 (z + 1)3 4

and
   
zn d 2 zn
Res ; −1 = lim (z + 1)
(z + 1)2 (z − 1)2 z→−1 dz (z − 1)2 (z + 1)2
 n−1

nz 2z n 1−n
= lim 2
− 3
= (−1)n .
z→−1 (z − 1) (z − 1) 4

Therefore,
n−1
fn = [1 − (−1)n ].
4
490 Advanced Engineering Mathematics with MATLAB

13. I h i
1
fn = ea/z z n−1 dz = Res ea/z z n−1 ; 0
2πi C

Because
a a2
ea/z z n−1 = z n−1 + z n−2 + z n−3 + · · · ,
1! 2!
h i
Res ea/z z n−1 ; 0 = an /n!.

Therefore, fn = an /(n!).

Section 13.4

1. Taking the z-transform of the difference equation, we obtain

z(z + 1)
Z(yn+1 ) − Z(yn ) = Z(n2 ) or zY (z) − zy0 − Y (z) =
(z − 1)3
or
z z(z + 1)
Y (z) = + .
z − 1 (z − 1)4
Taking the inverse,  
−1 z(z + 1)
yn = 1 + Z .
(z − 1)4
From the inversion integral,
  I  
−1 z(z + 1) 1 z+1 n 1 d3 n+1 n
Z = z dz = lim z +z
(z − 1)4 2πi C (z − 1)4 z→1 3! dz 3

= 61 n(n − 1)(2n − 1).

Therefore, the final answer is yn = 1 + 61 n(n − 1)(2n − 1).

2. Taking the z-transform of the difference equation, we obtain

Z(yn+2 ) − 2Z(yn+1 ) + Z(yn ) = 0

or
z 2 Y (z) − z 2 y0 − zy1 − 2zY (z) + 2zy0 + Y (z) = 0
or
z
Y (z) = .
z−1
Taking the inverse, yn = 1.

3. Taking the z-transform of the difference equation, we obtain

Z(yn+2 ) − 2Z(yn+1 ) + Z(yn ) = Z(1)


Worked Solutions 491

or
z z
z 2 Y (z) − z 2 y0 − zy1 − 2zY (z) + 2zy0 + Y (z) = or Y (z) = .
z−1 (z − 1)3

From the inversion integral,


I
1 zn
yn = dz = 12 n(n − 1).
2πi C (z − 1)3

4. Taking the z-transform of the difference equation, we obtain

Z(yn+1 ) + 3Z(yn ) = Z(n)

or
z
zY (z) − zy0 + 3Y (z) =
(z − 1)2
or
z
Y (z) = .
(z − 1)2 (z + 3)
From the inversion integral,
I
1 zn
yn = dz
2πi C (z − 1)2 (z + 3)
   
zn zn
= Res ; 1 + Res ; −3 ,
(z − 1)2 (z + 3) (z − 1)2 (z + 3)

where    n 
zn d z n 1
Res ; 1 = lim = −
(z − 1)2 (z + 3) z→1 dz z+3 4 16
and  
zn zn (−3)n
Res ; −3 = lim = .
(z − 1)2 (z + 3) z→−3 (z − 1)2 16
Therefore,
n (−3)n − 1
yn = + .
4 16

5. Taking the z-transform of the difference equation, we obtain


z
Z(yn+1 ) − 5Z(yn ) = Z[cos(nπ)] or zY (z) − zy0 − 5Y (z) =
z+1
or  
z 1 z z
Y (z) = = − .
(z − 5)(z + 1) 6 z−5 z+1
1
Therefore, yn = 6 [5n − (−1)n ] .
492 Advanced Engineering Mathematics with MATLAB

6. Taking the z-transform of the difference equation, we obtain

Z(yn+2 ) − 4Z(yn ) = Z(1)

or
z
z 2 Y (z) − z 2 y0 − zy1 − 4Y (z) =
z−1
or
z
(z 2 − 4)Y (z) = z 2 + .
z−1
Using partial fractions,

3 z 7 z 1 z
Y (z) = + − .
4 z − 2 12 z + 2 3 z − 1

Inverting term-by-term, the final answer is yn = 43 2n + 7


12 (−2)
n
− 13 .

7. Taking the z-transform of the difference equation, we obtain


  
1 n
Z(yn+2 ) − 41 Z(yn ) = Z 2

or
z
z 2 Y (z) − z 2 y0 − zy1 − 41 Y (z) =
z − 1/2
or I
1 zn
yn = dz.
2πi C (z − 1/2)2 (z + 1/2)
Computing the residues,
   
zn 1 d zn
Res ; = lim
(z − 1/2)2 (z + 1/2) 2 z→1/2 dz z + 1/2
 
nz n−1 zn
= lim −
z→1/2 z + 1/2 (z + 1/2)2

1 n
= (2n − 1) 2

and
   n
zn 1 zn 1
Res ; − = lim = − .
(z − 1/2)2 (z + 1/2) 2 z→−1/2 (z − 1/2)2 2

1 n
n
Therefore, yn = (2n − 1) 2 + − 21 .

8. Taking the z-transform of the difference equation, we obtain

Z(yn+2 ) − 5Z(yn+1 ) + 6Z(yn ) = 0


Worked Solutions 493

or
z 2 Y (z) − z 2 y0 − zy1 − 5zY (z) + 5zy0 + 6Y (z) = 0
or
2z z
Y (z) = −
z−2 z−3
by partial fractions. Inverting term-by-term, yn = 2n+1 − 3n .

9. Taking the z-transform of the difference equation, we obtain

Z(yn+2 ) − 3Z(yn+1 ) + 2Z(yn ) = Z(1)

or
z
z 2 Y (z) − z 2 y0 − zy1 − 3[zY (z) − zy0 ] + 2Y (z) =
z−1
or
z
Y (z) = .
(z − 1)2 (z − 2)
From the inversion integral,
I
1 zn
yn = dz
2πi C (z − 1)2 (z − 2)
   
zn zn
= Res ; 1 + Res ;2 ,
(z − 1)2 (z − 2) (z − 1)2 (z − 2)

where    n 
zn d z
Res ; 1 = lim = −n − 1
(z − 1)2 (z − 2) z→1 dz z−2
and  
zn zn
Res 2
; 2 = lim = 2n .
(z − 1) (z − 2) z→2 (z − 1)2

Therefore, yn = 2n − n − 1.

10. Taking the z-transform of the difference equation, we obtain

Z(yn+2 ) − 2Z(yn+1 ) + Z(yn ) = 2Z(1)

or
2z
z 2 Y (z) − z 2 y0 − zy1 − 2[zY (z) − zy0 ] + Y (z) =
z−1
or
2z 2
Y (z) = .
(z − 1)3
From the inversion integral,
I  
1 2z n+1 2z n+1
yn = dz = Res ; 1 ,
2πi C (z − 1)3 (z − 1)3
494 Advanced Engineering Mathematics with MATLAB

where
   
2z n+1 1 d2 3 2z
n+1
Res ; 1 = lim (z − 1) = n(n + 1).
(z − 1)3 2 z→1 dz 2 (z − 1)3

Therefore, yn = n(n + 1).

11. Taking the z-transform of the difference equation, we obtain

zX(z) − x0 z = 3X(z) − 4Y (z), zY (z) − y0 z = 2X(z) − 3Y (z)

or
(z − 3)X(z) + 4Y (z) = 3z, −2X(z) + (z + 3)Y (z) = 2z.
Solving for X(z) and Y (z),

z(3z + 1) 2z z 2z 2 z z
X(z) = = + and Y (z) = = + .
z2 − 1 z−1 z+1 z2 − 1 z−1 z+1

Taking the inverse term-by-term, xn = 2 + (−1)n and yn = 1 + (−1)n .

12. Taking the z-transform of the difference equation, we obtain

zX(z) − x0 z = 2X(z) − 10Y (z)

zY (z) − y0 z = −X(z) − Y (z)


or
(z − 2)X(z) + 10Y (z) = 3z
X(z) + (z + 1)Y (z) = −2z.
Solving for X(z) and Y (z),

z(3z + 23) 5z 2z
X(z) = = −
(z − 4)(z + 3) z−4 z+3

and
z(1 − 2z) z z
Y (z) = =− − .
(z − 4)(z + 3) z−4 z+3
Taking the inverse term-by-term, xn = 5 4n − 2(−3)n and yn = −4n − (−3)n .

13. Taking the z-transform of the difference equation, we obtain

zX(z) − x0 z = X(z) − 2Y (z), zY (z) − y0 z = −6Y (z)

or
(z − 1)X(z) + 2Y (z) = −z, (z + 6)Y (z) = −7z.
Worked Solutions 495

Solving for X(z) and Y (z),

z(z − 8) z 2z 7z
X(z) = − = − and Y (z) = − .
(z − 1)(z + 6) z−1 z+6 z+6

Taking the inverse term-by-term, xn = 1 − 2(−6)n and yn = −7(−6)n .

14. Taking the z-transform of the difference equation, we obtain

zX(z) − x0 z = 4X(z) − 5Y (z)

zY (z) − y0 z = X(z) − 2Y (z)


or
(z − 4)X(z) + 5Y (z) = 6z
−X(z) + (z + 2)Y (z) = 2z.
Solving for X(z) and Y (z),

6z 2 + 2z 5z z
X(z) = = +
(z − 3)(z + 1) z−3 z+1

and
2z(z − 1) z z
Y (z) = = + .
(z − 3)(z + 1) z−3 z+1
Taking the inverse term-by-term, xn = 5 3n + (−1)n and yn = 3n + (−1)n .

Section 13.5

1. Taking the z-transform, Y (z) = z −1 Y (z) + X(z). Therefore,

Y (z) z
G(z) = =
X(z) z−1

and the system is marginally stable.

2. Taking the z-transform,

Y (z) = 2z −1 Y (z) − z −2 Y (z) + X(z).

Therefore,
Y (z) z2
G(z) = =
X(z) (z − 1)2
and the system is marginally stable.
496 Advanced Engineering Mathematics with MATLAB

3. Taking the z-transform, Y (z) = 3z −1 Y (z) + X(z). Therefore,

Y (z) z
G(z) = =
X(z) z−3

and the system is unstable.

4. Taking the z-transform,

Y (z) = 14 z −2 Y (z) + X(z).

Therefore,
Y (z) z2
G(z) = = 2 1
X(z) z − 4

and the system is stable.

Section 14.1

1.
Z ∞
dτ R t−ǫ
H(A) = A = −A lim ln |t − τ ||t+ǫ − A lim ln |t − τ ||−R
−∞ t−τ R→∞
ǫ→0
R→∞
ǫ→0

t−R
= −A lim ln =0
R→∞ t+R

2. From the definition,


Z ∞
1 cos(ωτ )
H [cos(ωt)] = dτ.
π −∞ t−τ

If x = t − τ , then
Z Z
1 ∞ cos[ω(t − x)] sin(ωt) ∞ sin(ωx)
H [cos(ωt)] = − dτ = dx
π −∞ x π −∞ x
= sin(ωt) sgn(ω).

3. From the definition,


Z ∞
1 δ(τ ) 1
H [δ(t)] = dτ = ,
π −∞ t−τ πt

from the sifting property of the delta function, Equation 11.1.21.


Worked Solutions 497

4. From the definition,


Z ∞
1 1
x
b(t) = PV dτ.
π −∞ (t − τ )(τ 2 + 1)

Because of the singularity on the real axis at τ = t, we treat this integral in


the sense of Cauchy principal value.
We convert this integral into a closed contour integration by introducing
a semicircle CR of infinite radius in the upper half plane. This yields a closed
contour C which consists of the real line plus this semicircle. Therefore,
Z ∞ I
1 1
PV dτ = P V dz
−∞ (t − τ )(τ 2 + 1) C (t − z)(z 2 + 1)
Z
1
− dz.
CR (t − z)(z 2 + 1)

The second integral on the right side vanishes by Equation 10.9.7.


The evaluation of the closed integral follows from an application of residue
theorem. We have that
 
1 z−t 1
Res ; t = lim =− 2 ,
(t − z)(z 2 + 1) z→t (t − z)(z 2 + 1) t +1

and  
1 z−i 1
Res 2
; i = lim 2
= .
(t − z)(z + 1) z→i (t − z)(z + 1) 2i(t − i)
Therefore,
Z ∞
1 πi π (t + i)
PV dτ = − 2 + 2 .
−∞ (t − τ )(τ 2 + 1) t +1 t +1

The final result is  


1 t
H 2 = 2 .
t +1 t +1

5.
Z ∞
sin[2πω(t − τ )]
y(t) = x(τ ) dτ
−∞ π(t − τ )
Z
1 ∞ sin(2πωt) cos(2πωτ ) − cos(2πωt) sin(2πωτ )
= x(τ ) dτ
π −∞ t−τ
Z Z
sin(2πωt) ∞ cos(2πωτ ) cos(2πωt) ∞ sin(2πωτ )
= x(τ ) dτ − x(τ ) dτ
π −∞ t − τ π −∞ t−τ
= sin(2πωt)H [x(t) cos(2πωt)] − cos(2πωt)H [x(τ ) sin(2πωτ )]
498 Advanced Engineering Mathematics with MATLAB

6. Because X(ω) = πe−|ω| ,


Z ∞ ∞
sin(tω) + t cos(tω) t
x
b(t) = e−ω sin(tω) dω = − e−ω = .
0 1 + t2 0 t2 +1

7. Because X(ω) = 2 sin(ωa)/ω,


Z ∞
2 sin(aω) sin(tω) 1 t+a
x
b(t) = dω = ln
π 0 ω π t−a

from Gradshteyn, I. S., and I. M. Ryzhik, 1965: Tables of Integrals, Series


and Products, Academic Press, New York, Formula 3.741.1.

8.
1 1
H[f (t) ∗ g(t)] = ∗ [f (t) ∗ g(t)] = [f (t) ∗ g(t)] ∗
πt   πt 
1 1
= ∗ f (t) ∗ g(t) = f (t) ∗ g(t) ∗
πt πt
= fb(t) ∗ g(t) = f (t) ∗ gb(t).

Section 14.2
√ 
b(t) = t(1 + t2 )/
1. Since x 2 (1 + t4 ) ,
Z ∞ Z ∞
t(1 + t2 )
x(t)b
x(t) dt = √ dt = 0,
−∞ −∞ 2 (1 + t4 )2

because the integrand is an odd function.


 
b(t) = e−1 − cos(t) /(t2 + 1),
2. Since x
Z ∞ Z ∞
[e−1 − cos(t)] sin(t)
x(t)b
x(t) dt = dt = 0,
−∞ −∞ (1 + t2 )2

because the integrand is an odd function.

3. Since x
b(t) = ln |t/(t − a)|,
Z ∞ Z
1 a
x(t)b
x(t) dt = [ln(t) − ln(a − t)] dt
−∞ π 0
1 a a
= { [t ln(t) − t]|0 [(a − t) ln(a − t) + t]|0 } = 0.
π
Worked Solutions 499

4. With u(t) = H(t) − H(t − a) and v(t) = sin(t),


Z a
a
w(t) = u(t) ∗ v(t) = sin(t − x) dx = cos(t − x)|0 = cos(t − a) − cos(t),
0

so that w(t)
b = sin(t − a) − sin(t).
Because vb(t) = − cos(t),
Z a
a
u(t) ∗ vb(t) = − cos(t − x) dx = sin(t − x)|0 = sin(t − a) − sin(t) = w(t)
b
0

and we verify that the convolution theorem w(t)


b = u(t) ∗ vb(t) holds true for
Hilbert transforms in this particular case.

5. With u(t) = sin(t) and v(t) = 1/(1 + t2 ),


Z ∞
sin(t − x)
w(t) = u(t) ∗ v(t) = 2
dx
−∞ 1 + x
Z ∞ Z ∞
sin(t) cos(x) cos(t) sin(x)
= 2
dx − dx = πe−1 sin(t)
−∞ 1 + x −∞ 1 + x2

b = −πe−1 cos(t).
so that w(t)
Because vb(t) = t/(1 + t2 ),
Z ∞
x
u(t) ∗ vb(t) = sin(t − x) dx
−∞ 1 + x2
Z ∞ Z ∞
sin(t)x cos(x) cos(t)x sin(x)
= dx − dx
−∞ 1 + x2 −∞ 1 + x2
Z ∞
x sin(x)
= − cos(t) 2
dx = −πe−1 cos(t) = w(t)
b
−∞ 1 + x

and we verify that the convolution theorem w(t)


b = u(t) ∗ vb(t) holds true for
Hilbert transforms in this particular case.

6. If f (t) = Jn (bt), then


 
2(−1)m |ω|
F (ω) = √ Tn H(b − |ω|),
b2 − ω 2 b

while g(t) = sin(at) has the Fourier transform


1
G(ω) = [δ(ω − a) − δ(ω + a)] .
2i
Because 0 < b < a, F (ω) and G(ω) fulfill condition (1) of the product theorem.
Since gb(t) = − cos(at),

H[f (t)g(t)] = H[sin(at)Jn (bt)] = f (t)b


g (t) = − cos(at)Jn (bt).
500 Advanced Engineering Mathematics with MATLAB

7. If f (t) = Ci(a|t|), then



0, 0 < |ω| < a,
F (ω) = 0 < a,
−π/|ω|, a < |ω| < ∞,

while g(t) = sin(bt) has the Fourier transform


1
G(ω) = [δ(ω − b) − δ(ω + b)] .
2i
Because 0 < b < a, F (ω) and G(ω) fullfill condition (1) of the product theo-
rem. Since gb(t) = − cos(at),

H[f (t)g(t)] = H[sin(bt)Ci(a|t|)] = f (t)b


g (t) = − sgn(t) sin(bt)Si(a|t|).

8. From the definition,


Z Z Z
1 ∞ τ x(τ ) t ∞ x(τ ) 1 ∞
H [tx(t)] = dτ = dτ − x(τ ) dτ
π −∞ t − τ π −∞ t − τ π −∞
Z
1 ∞
= tb
x(t) − x(τ ) dτ.
π −∞

Section 14.3

1. From Table 6.1.1, we have that x


b(t) = sin(ωt) so that z(t) = cos(ωt) +
i sin(ωt) = eiωt .

2. Because z(t) = |z(t)|eiϕ(t) = |z(t)| cos[ϕ(t)] + i|z(t)| sin[ϕ(t)], x(t) =


|z(t)| cos[ϕ(t)] and x
b(t) = |z(t)| sin[ϕ(t)]. If we square x(t) and x b(t) and
add the results together, we get z 2 (t) = x2 (t) + x
b2 (t). On the other hand,
if we divide xb(t) by x(t) and take the inverse of the tangent, we obtain the
second desired result.

3. From the definition of z(t), z(t) = |z(t)|eiϕ(t) = |z(t)|eiω0 t eiϕ (t) = r(t)eiω0 t ,

if r(t) = |z(t)|eiϕ (t) .

Section 14.4

1. Because x(t) = xe (t) + xo (t), x(−t) = xe (−t) + xo (−t) = 0 for a causal


function. Then xe (t) = xo (t) and xe (−t) = −xo (−t). Therefore, xe (t) =
sgn(t)xo (t) and xo (t) = sgn(t)xe (t).

2. For this case, x(t) = xe (t) − sgn(t)xe (t), we have that

X(ω) = Xe (ω) − F [sgn(t)xe (t)]


Z
i ∞ Xe (τ ) be (ω),
= Xe (ω) + dτ = Xe (ω) + iX
π −∞ ω − τ
Worked Solutions 501

where Z ∞
be (ω) = 1
X
Xe (τ )
dτ.
π −∞ ω−τ
t
If x(t) = e H(−t),
1 1 + ωi
X(ω) = = 2 .
1 − ωi ω +1
From this, we find that

1 t
x(t) = and x
b(t) = .
t2 + 1 t2 + 1

Checking the tables, we find this is true, verifying this version of Kramers-
Kronig relationship.

3. From the definition of the Fourier transform,


Z ∞ Z ∞
G(ω) = te−t e−iωt dt = te−(1+iω)t dt
0 0

e−(1+iω)t 1 (1 − iω)2
= [−1 − (1 + iω)t] = = .
(1 + iω)2 0 (1 + iω)2 (ω 2 + 1)2

Therefore,
1 − t2 2t
x(t) = and x
b(t) = .
(1 + t2 )2 (1 + t2 )2

4. From the definition of the Fourier transform,


Z ∞ Z ∞
G(ω) = cos(at)e−t e−iωt dt = cos(at)e−(1+iω)t dt
0 0

e−(1+iω)t
= [−(1 + iω) cos(at) + a sin(at)]
(1 + iω)2 + a2 0
1 + a2 + ω 2 + i(a2 ω − ω 3 − ω)
= .
(1 + a2 − ω 2 )2 + 4ω 2

Therefore,

1 + a 2 + t2 1 − a 2 + t2
x(t) = and x
b(t) = t .
(1 + a2 − t2 )2 + 4t2 (1 + a2 − t2 )2 + 4t2

5. To verify the Kramers-Kronig relationship, we must show that


Z
ω 1 ∞ dτ
= .
ω2 + 1 π −∞ (τ 2 + 1)(ω − τ )
502 Advanced Engineering Mathematics with MATLAB

To evaluate the integral, we find the Cauchy principal value of the integral
via the residue theorem:
Z  
1 ∞ dτ 1
= i Res ; ω
π −∞ (τ 2 + 1)(ω − τ ) (z 2 + 1)(ω − z)
 
1
+ 2i Res ; i
(z 2 + 1)(ω − z)
i 1 ω
=− 2 + = 2 .
ω +1 ω−i ω +1

Because the value of the integral and left side of the first line are the same,
we have verified the Kramers-Kronig relationship.

Section 15.2

1. To find the Green’s function, we must solve

g ′ + kg = δ(t − τ ), g(0|τ ) = 0.

Taking the Laplace transform and introducing the initial condition,

sG(s|τ ) + kG(s|τ ) = e−sτ .

The transfer function is 1/(s + k). Then the impulse response is e−kt .
Taking the inverse Laplace transform, the Green’s function is

g(t|τ ) = e−k(t−τ ) H(t − τ ).

The step response is given by a′ + ka = H(t) and A(s) = 1/[s(s + k)].
Taking the inverse, a(t) = 1 − e−kt /k.

2. To find the Green’s function, we must solve

g ′′ − 2g ′ − 3g = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) − 2sG(s|τ ) − 3G(s|τ ) = e−sτ ,

or
(s − 3)(s + 1)G(s|τ ) = e−sτ .
The transfer function is 1/(s2 − 2s − 3) and the impulse response is

1 3t 
g(t|0) = e − e−t .
4
Worked Solutions 503

Solving for G(s|τ ),

e−sτ 1 e−sτ 1 e−sτ


G(s|τ ) = = − .
(s − 3)(s + 1) 4s−3 4s+1

Taking the inverse Laplace transform, the Green’s function is

g(t|τ ) = 14 e3(t−τ ) H(t − τ ) − 41 e−(t−τ ) H(t − τ ).

The step response is given by a′′ − 2a′ − 3a = H(t) and A(s) = 1/[s(s −
1 3t
3)(s + 1)]. Taking the inverse, a(t) = 12 e + 41 e−t − 13 .

3. To find the Green’s function, we must solve

g ′′ + 4g ′ + 3g = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) + 4sG(s|τ ) + 3G(s|τ ) = e−sτ ,

or
(s + 3)(s + 1)G(s|τ ) = e−sτ .
The transfer function is 1/(s2 + 4s + 3) and the impulse response is

1 −t 
g(t|0) = e − e−3t .
2
Solving for G(s|τ ),

e−sτ 1 e−sτ 1 e−sτ


G(s|τ ) = = − .
(s + 3)(s + 1) 2s+1 2s+3

Taking the inverse Laplace transform, the Green’s function is

g(t|τ ) = 12 e−(t−τ ) H(t − τ ) − 21 e−3(t−τ ) H(t − τ ).

The step response is given by a′′ + 4a′ + 3a = H(t) and A(s) = 1/[s(s +
3)(s + 1)]. Taking the inverse, a(t) = 61 e−3t − 21 e−t + 13 .

4. To find the Green’s function, we must solve

g ′′ − 2g ′ + 5g = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) − 2sG(s|τ ) + 5G(s|τ ) = e−sτ ,


504 Advanced Engineering Mathematics with MATLAB

or
[(s − 1)2 + 4]G(s|τ ) = e−sτ .
The transfer function is 1/[(s−1)2 +4] and the impulse response is 21 et sin(2t).
Solving for G(s|τ ),

e−sτ
G(s|τ ) = .
(s − 1)2 + 4

Using the first and second shifting theorems, the Green’s function is

g(t|τ ) = 21 et−τ sin[2(t − τ )]H(t − τ ).

The step response is given by a′′ − 2a′ + 5a = H(t) and A(s) = 1/{s[(s −
1) + 4]}. Taking the inverse, a(t) = 51 − 15 et cos(2t) + 10
2 1 t
e sin(2t).

5. To find the Green’s function, we must solve

g ′′ − 3g ′ + 2g = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) − 3sG(s|τ ) + 2G(s|τ ) = e−sτ ,

or
(s − 2)(s − 1)G(s|τ ) = e−sτ .
The transfer function is 1/[(s − 2)(s − 1)] and the impulse response is g(t) =
e2t − et .
Solving for G(s|τ ),

e−sτ e−sτ e−sτ


G(s|τ ) = = − .
(s − 2)(s − 1) s−2 s−1

Inverting G(s|τ ) term by term, the Green’s function is

g(t|τ ) = e2(t−τ ) H(t − τ ) − et−τ H(t − τ ).

The step response is given by a′′ − 3a′ + 2a = H(t) and A(s) = 1/[s(s −
2)(s − 1)]. Taking the inverse, a(t) = 21 + 21 e2t − et .

6. To find the Green’s function, we must solve

g ′′ + 4g ′ + 4g = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) + 4sG(s|τ ) + 4G(s|τ ) = e−sτ ,


Worked Solutions 505

or
(s + 2)2 G(s|τ ) = e−sτ .
The transfer function is 1/(s + 2)2 and the impulse response is te−2t .
Solving for G(s|τ ), the Green’s function is

e−sτ
G(s|τ ) = .
(s + 2)2

Using the first and second shifting theorems, the Green’s function is

g(t|τ ) = (t − τ )e−2(t−τ ) H(t − τ ).

The step response is given by a′′ +4a′ +4a = H(t) and A(s) = 1/[s(s+2)2 ].
Taking the inverse, a(t) = 41 − 14 e−2t − 21 te−2t .

7. To find the Green’s function, we must solve

g ′′ − 9g = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) − 9G(s|τ ) = e−sτ ,

or
(s − 3)(s + 3)G(s|τ ) = e−sτ .
The transfer function is 1/(s2 − 9) and the impulse response is

g(t|0) = e3t − e−3t /6.

Solving for G(s|τ ),

e−sτ 1 e−sτ 1 e−sτ


G(s|τ ) = = − .
(s − 3)(s + 3) 6s−3 6s+3

Inverting G(s|τ ) term by term, the Green’s function is

g(t|τ ) = 16 e3(t−τ ) H(t − τ ) − 61 e−3(t−τ ) H(t − τ ).

The step response is given by a′′ −9a = H(t)


 and A(s) = 1/[s(s−3)(s+3)].
1
Taking the inverse, a(t) = 18 e3t + e−3t − 2

8. To find the Green’s function, we must solve

g ′′ + g = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.


506 Advanced Engineering Mathematics with MATLAB

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) + G(s|τ ) = e−sτ ,

or
(s2 + 1)G(s|τ ) = e−sτ .
The transfer function is 1/(s2 + 1) and the impulse response is g(t) = sin(t).
Solving for G(s|τ ),
e−sτ
G(s|τ ) = 2 .
s +1
Inverting G(s|τ ) term by term, the Green’s function is

g(t|τ ) = sin(t − τ )H(t − τ ).

The step response is given by a′′ + a = H(t) and A(s) = 1/[s(s2 + 1)].
Taking the inverse, a(t) = 1 − cos(t).

9. To find the Green’s function, we must solve

g ′′ − g ′ = δ(t − τ ), g(0|τ ) = g ′ (0|τ ) = 0.

Taking the Laplace transform and introducing the initial conditions,

s2 G(s|τ ) − sG(s|τ ) = e−sτ ,

or
s(s − 1)G(s|τ ) = e−sτ .
The transfer function is 1/[s(s − 1)] and the impulse response is g(t) = et − 1.
Solving for G(s|τ ),

e−sτ e−sτ e−sτ


G(s|τ ) = = − .
s(s − 1) s−1 s

Inverting G(s|τ ) term by term, the Green’s function is

g(t|τ ) = et−τ H(t − τ ) − H(t − τ ).

The step response is given by a′′ + a′ = H(t) and A(s) = 1/[s2 (s − 1)].
Taking the inverse, a(t) = et − t − 1

10. Solving the differential equation g ′′ = 0, we have



Ax + B, x < ξ,
g(x|ξ) =
Cx + D, x > ξ.
Worked Solutions 507

From the boundary condition g(0|ξ) − αg ′ (0|ξ) = B − αA = 0, or B = αA.


From g(L|ξ) = CL + D, or D = −LC. Because the Green’s function must be
continuous at x = ξ, g(ξ − |ξ) = g(ξ + |ξ), or Aξ + B = Cξ + D. Integrating
x=ξ +
the differential equation from x = ξ − to x = ξ + , g ′ (x|ξ)|x=ξ− = −1, or
C − A = −1. Solving for A, B, C and D, we find that

L−ξ α(L − ξ) ξ+α L(ξ + α)


A= , B= , C=− , D= .
L+α L+α L+α L+α
Therefore, 
1 (L − ξ)(x + α), x < ξ,
g(x|ξ) =
L+α (L − x)(ξ + α), x > ξ,
or more conveniently,

(L − x> )(x< + α)
g(x|ξ) = .
L+α
To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,
r(x) = 1, and λ = 0. Let λn = kn2 . The solution to the Sturm-Liouville
problem is
ϕn (x) = An sin[kn (L − x)].
This solution satisfies the boundary condition ϕn (L) = 0. From the boundary
condition ϕn (0) − αϕ′n (0) = 0,

ϕn (0) − αϕ′n (0) = An sin(kn L) + αkn An cos(kn L) = 0,

or
tan(kn L) = −αkn .
To find the value of An so that ϕn (x) is orthonormal,
Z L
A2n sin2 [kn (L − x)] dx = 1,
0
Z L
1 2
2 An {1 − cos[2kn (L − x)]} dx = 1,
0
( )
L
1 2 1
2 An L+
2kn
sin[2kn (L − x)] = 1,
0

and  
1 2 sin(kn L) cos(kn L)
2 An L−
kn
= 1.

If we use tan(kn L) = −αkn to eliminate sin(kn L), we find that

[L + α cos2 (kn L)]A2n = 2.


508 Advanced Engineering Mathematics with MATLAB

Therefore, substituting these eigenfunctions into Equation 15.2.123,

X∞
sin[kn (L − ξ)] sin[kn (L − x)]
g(x|ξ) = 2 ,
n=1
[L + α cos2 (kn L)]kn2

or
X∞
(1 + α2 kn2 )sin[kn (L − ξ)] sin[kn (L − x)]
g(x|ξ) = 2 ,
n=1
[α + L(1 + α2 kn2 )]kn2

because [1 − cos2 (kn L)]2 = α2 kn2 cos2 (kn L) or (1 + α2 kn2 ) cos2 (kn L) = 1 from
the dispersion relationship.

11. Solving the differential equation g ′′ = 0, we have



Ax + B, x < ξ,
g(x|ξ) =
Cx + D, x > ξ.

From the boundary condition g(0|ξ) − g ′ (0|ξ) = B − A = 0, or B = A. From


g(L|ξ) − g ′ (L|ξ) = CL + D − C = 0, or D = C − LC. Because the Green’s
function must be continuous at x = ξ, g(ξ − |ξ) = g(ξ + |ξ), or Aξ +B = Cξ +D.
x=ξ +
Integrating the differential equation from x = ξ − to x = ξ + , g ′ (x|ξ)|x=ξ− =
−1, or C − A = −1. Solving for A, B, C and D, we find that

L−ξ−1 ξ+1 (ξ + 1)(L − 1)


A=B= , C=− , D= .
L L L
Therefore, 
1 (L − ξ − 1)(x + 1), x < ξ,
g(x|ξ) =
L (1 + ξ)(L − 1 − x), x > ξ,
or more conveniently,

(1 + x< )(L − 1 − x> )


g(x|ξ) = .
L

To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,


r(x) = 1, and λ = 0. Let λn = kn2 . The solution to the Sturm-Liouville
problem is ϕn (x) = An cos(kn x) + Bn sin(kn x). From the boundary condition
ϕn (0) − ϕ′n (0) = 0,

ϕn (0) − ϕ′n (0) = An − kn Bn = 0,

or An = kn Bn . From the boundary condition ϕn (L) − ϕ′n (L) = 0,

ϕn (L) − ϕ′n (L) = An cos(kn L) + Bn sin(kn L) + kn An sin(kn L)


− kn Bn cos(kn L) = 0,
Worked Solutions 509

or
[cos(kn L) + kn sin(kn L)]An + [sin(kn L) − kn cos(kn L)]Bn = 0.
Eliminating Bn from these equation, we see that

(1 + kn2 ) sin(kn L) = 0,

or
k02 = −1, kn L = nπ, n = 1, 2, 3, . . . .
The eigenfunctions are as follows:

λ0 = −1; ϕ0 (x) = A0 ex ,

and

λn = n2 π 2 /L2 ; ϕn (x) = An [sin(nπx/L) + nπ cos(nπx/L)/L] .

To find the value of An so that ϕn (x) is orthonormal,


Z L 
A20 e2x dx = 21 A20 e2L − 1 = 1,
0

and Z L h nπ  nπx 
 nπx i2
A2n sin cos + dx = 1,
0 L L L
Z L  nπx  2nπ  nπx   nπx 
A2n sin2 + sin cos
0 L L L L
n2 π 2  nπx 
+ cos2 dx = 1,
L2 L
and  
L n2 π 2
A2n + = 1.
2 2L
Therefore, substituting these eigenfunctions into Equation 15.2.123,

2ex+ξ 2L3 X ϕn (ξ)ϕn (x)
g(x|ξ) = − + ,
e2L − 1 π 2 n=1 n2 (n2 π 2 + L2 )

where ϕn (x) = sin(nπx/L) + nπ cos(nπx/L)/L.

12. Solving the differential equation g ′′ = 0, we have



Ax + B, x < ξ,
g(x|ξ) =
Cx + D, x > ξ.
510 Advanced Engineering Mathematics with MATLAB

From the boundary condition g(0|ξ) − g ′ (0|ξ) = B − A = 0, or B = A.


From g(L|ξ) + g ′ (L|ξ) = CL + D + C = 0, or D = −C − LC. Because
the Green’s function must be continuous at x = ξ, g(ξ − |ξ) = g(ξ + |ξ), or
Aξ + B = Cξ + D. Integrating the differential equation from x = ξ − to
x=ξ +
x = ξ + , g ′ (x|ξ)|x=ξ− = −1, or C − A = −1. Solving for A, B, C and D, we
find that
L+1−ξ ξ+1 (ξ + 1)(L + 1)
A=B= , C=− , D= .
L+2 L+2 L+2
Therefore,

1 (L + 1 − ξ)(x + 1), x < ξ,
g(x|ξ) =
L+2 (ξ + 1)(L + 1 − x), x > ξ,

or more conveniently,

(x< + 1)(L + 1 − x> )


g(x|ξ) = .
L+2
To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,
r(x) = 1, and λ = 0. Let λn = kn2 . The solution to the Sturm-Liouville
problem is ϕn (x) = An cos(kn x) + Bn sin(kn x). From the boundary condition
ϕn (0) − ϕ′n (0) = 0,

ϕn (0) − ϕ′n (0) = An − kn Bn = 0,

or An = kn Bn . From the boundary condition ϕn (L) + ϕ′n (L) = 0,

ϕn (L) + ϕ′n (L) = An cos(kn L) + Bn sin(kn L) − kn An sin(kn L)


+ kn Bn cos(kn L) = 0,
or
[cos(kn L) − kn sin(kn L)] An + [sin(kn L) + kn cos(kn L)] Bn = 0.
Eliminating An from these equations, we see that

2kn
= tan(kn L), n = 1, 2, 3, . . . .
kn2 − 1

The eigenfunctions are

ϕn (x) = Bn [sin(kn x) + kn cos(kn x)] .

To find the value of Bn so that ϕn (x) is orthonormal,


Z L  
Bn2 sin2 (kn x) + 2kn sin(kn x) cos(kn x) + cos2 (kn x) dx = 1,
0
Worked Solutions 511
Z L Z L
1 2
2 Bn [1 − cos(2kn x)] dx + kn Bn2 sin(2kn x) dx
0 0
Z L
+ 21 kn2 Bn2 [1 + cos(2kn x)] dx = 1,
0
1 2
2 Bn [L − sin(2kn L)/(2kn )] + 12 Bn2 [1 − cos(2kn L)]
+ 21 kn2 Bn2 [L + sin(2kn L)/(2kn )] = 1,
or
 
1 2 sin(kn ) cos(kn ) 2 2 kn2 sin(kn L) cos(kn L)
2 Bn L−
kn
+ 2 sin (kn L) + kn L +
kn
= 1.

Using (kn2 − 1) sin(kn L) = 2kn cos(kn L),


 
kn2 − 1 2 4kn2 sin2 (kn L) kn2 (kn2 − 1)
1 2
2 Bn L− sin (k n L) + + k 2
n L + sin2 (kn L)
2kn2 2kn2 2kn2
= 1.

Now, because (kn2 − 1) sin(kn L) = 2kn cos(kn L), we can square this equation
and use cos2 (kn L) = 1 − sin2 (kn L) to obtain (1 + kn2 ) sin2 (kn L) = 4kn2 . Elim-
inating sin2 (kn L) from the previous displayed equation, we obtain the simple
result that
Bn2 (2 + L + kn2 L) = 2.
Therefore, substituting these eigenfunctions into Equation 15.2.123,

X ϕ(ξ)ϕ(x)
g(x|ξ) = 2 ,
n=1
(2 + L + kn2 L)kn2

where ϕn (x) = sin(kn x) + kn cos(kn x).

13. Solving the differential equation g ′′ − k 2 g = 0, we have



A sinh(kx), x < ξ,
g(x|ξ) =
B sinh[k(L − x)], x > ξ.

These solutions satisfy the boundary conditions: g(0|ξ) = g(L|ξ) = 0. Be-


cause the Green’s function must be continuous at x = ξ, g(ξ − |ξ) = g(ξ + |ξ),
or A sinh(kξ) = B sinh[k(L − ξ)]. Integrating the differential equation from
x=ξ +
x = ξ − to x = ξ + , g ′ (x|ξ)|x=ξ− = −1, or −kB cosh[k(L − ξ)] − kA cosh[k(L −
ξ)] = −1. Therefore,

sinh[k(L − ξ)] sinh(kξ)


A= , and B= .
k sinh(kL) k sinh(kL)
512 Advanced Engineering Mathematics with MATLAB

Therefore,
sinh[k(L − ξ)] sinh(kx)
g(x|ξ) =
k sinh(kL)
if x < ξ, and
sinh(kξ) sinh[k(L − x)]
g(x|ξ) =
k sinh(kL)
if x > ξ. More conveniently,

sinh(kx< ) sinh[k(L − x> )]


g(x|ξ) = .
k sinh(kL)

To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,


r(x) = 1, and λ = −k 2 . Let λn = kn2 . The eigenfunction solution to the
Sturm-Liouville problem is ϕn (x) = An sin(nπx/L) because it satisfies the
boundary conditions ϕn (0) = ϕn (L) = 0.
To find the value of An so that ϕn (x) is orthonormal,
Z L  nπx  LA2n
A2n sin2 dx = = 1.
0 L 2
p
Therefore, An = 2/L. Therefore, substituting this orthonormal eigenfunc-
tions into Equation 15.2.123,

X∞
sin(nπξ/L) sin(nπx/L)
g(x|ξ) = 2L .
n=1
n2 π 2 + k 2 L2

14. Solving the differential equation g ′′ − k 2 g = 0, we have



A cosh(kx), x < ξ,
g(x|ξ) =
B cosh[k(x − L)], x > ξ.

These solutions satisfy the boundary conditions: g ′ (0|ξ) = g ′ (L|ξ) = 0. Be-


cause the Green’s function must be continuous at x = ξ, g(ξ − |ξ) = g(ξ + |ξ),
or A cosh(kξ) = B cosh[k(ξ − L)]. Integrating the differential equation from
x=ξ +
x = ξ − to x = ξ + , g ′ (x|ξ)|x=ξ− = −1, or kB sinh[k(ξ − L)] − kA sin(kξ) = −1.
Therefore,
cosh[k(ξ − L)] cosh(kξ)
A= , and B = .
k sinh(kL) k sinh(kL)
Therefore,
cosh[k(L − ξ)] cosh(kx)
g(x|ξ) =
k sinh(kL)
Worked Solutions 513

if x < ξ, and
cosh(kξ) cosh[k(L − x)]
g(x|ξ) =
k sinh(kL)
if x > ξ. More conveniently,

cosh(kx< ) cosh[k(L − x> )]


g(x|ξ) = .
k sinh(kL)

To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,


r(x) = 1, and λ = −k 2 . Let λn = kn2 . The eigenfunction solution to the
Sturm-Liouville problem is ϕ0 (x) = A0 and ϕn (x) = An cos(nπx/L) because
it satisfies the boundary conditions ϕ′n (0) = ϕ′n (L) = 0.
To find the value of An so that ϕn (x) is orthonormal,
Z L
A20 dx = LA20 = 1,
0

and Z L  nπx  LA2n


A2n cos2 dx = = 1.
0 L 2
Therefore, substituting this orthonormal eigenfunctions into Equation 15.2.
123,
X∞
1 cos(nπξ/L) cos(nπx/L)
g(x|ξ) = 2 + 2L .
k L n=1
n2 π 2 + k 2 L2

15. Solving the differential equation g ′′ − k 2 g = 0, we have



A sinh(kx), x < ξ,
g(x|ξ) =
B{sinh[k(x − L)] − k cosh[k(x − L)]}, x > ξ.

These solutions satisfy the boundary conditions: g(0|ξ) = g(L|ξ) + g ′ (L|ξ) =


0. Because the Green’s function must be continuous at x = ξ, g(ξ − |ξ) =
g(ξ + |ξ), or A sinh(kξ) = B{sinh[k(ξ − L)] − k cosh[k(ξ − L)]}. Integrating
x=ξ +
the differential equation from x = ξ − to x = ξ + , g ′ (x|ξ)|x=ξ− = −1, or
kB{cosh[k(ξ − L)] − k sinh[k(ξ − L)]} − kA cosh(kξ) = −1. Therefore,

k cosh[k(ξ − L)] − sinh[k(ξ − L)] sinh(kξ)


A= 2
, and B = − .
k sinh(kL) + k cosh(kL) k sinh(kL) + k 2 cosh(kL)

Therefore,

sinh(kx){k cosh[k(ξ − L)] − sinh[k(ξ − L)]}


g(x|ξ) =
k sinh(kL) + k 2 cosh(kL)
514 Advanced Engineering Mathematics with MATLAB

if x < ξ, and
sinh(kξ){k cosh[k(x − L)] − sinh[k(x − L)]}
g(x|ξ) =
k sinh(kL) + k 2 cosh(kL)
if x > ξ. More conveniently,
sinh(kx< ){k cosh[k(x> − L)] − sinh[k(x> − L)]}
g(x|ξ) = .
k sinh(kL) + k 2 cosh(kL)

To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,


r(x) = 1, and λ = −k 2 . Let λn = kn2 . The eigenfunction solution to the
Sturm-Liouville problem is ϕn (x) = An sin(kn x) because it satisfies ϕn (0) = 0.
To satisfy the boundary condition ϕn (L) + ϕ′n (L) = 0, tan(kn L) = −kn .
To find the value of An so that ϕn (x) is orthonormal,
Z L Z L
2 2 1 2
An sin (kn x) dx = 2 An [1 − cos(2kn x)] dx = 1,
0 0

or  
1 2 sin(2kn L)  
2 An L− = 21 A2n L + cos2 (kn L) = 1.
2kn
Now, (1 + kn2 ) cos2 (kn L) = 1 since tan2 (kn L) = kn2 and eliminating sin2 (kn L)
from this equation. Therefore, substituting this orthonormal eigenfunctions
into Equation 15.2.123,
X∞
(1 + kn2 ) sin(kn ξ) sin(kn x)
g(x|ξ) = 2 .
n=1
[1 + (1 + kn2 )L](kn2 + k 2 )

16. Solving the differential equation g ′′ − k 2 g = 0, we have



A sinh(kx), x < ξ,
g(x|ξ) =
B{sinh[k(x − L)] + k cosh[k(x − L)]}, x > ξ.

These solutions satisfy the boundary conditions: g(0|ξ) = g(L|ξ) − g ′ (L|ξ) =


0. Because the Green’s function must be continuous at x = ξ, g(ξ − |ξ) =
g(ξ + |ξ), or A sinh(kξ) = B{sinh[k(ξ − L)] + k cosh[k(ξ − L)]}. Integrating
x=ξ +
the differential equation from x = ξ − to x = ξ + , g ′ (x|ξ)|x=ξ− = −1, or
kB{cosh[k(ξ − L)] + k sinh[k(ξ − L)]} − kA cosh(kξ) = −1. Therefore,

sinh[k(ξ − L)] + k cosh[k(ξ − L)] sinh(kξ)


A= 2
and B = 2 .
k cosh(kL) − k sinh(kL) k cosh(kL) − k sinh(kL)
Therefore,
sinh(kx){k cosh[k(ξ − L)] + sinh[k(ξ − L)]}
g(x|ξ) =
k 2 cosh(kL) − k sinh(kL)
Worked Solutions 515

if x < ξ, and

sinh(kξ){k cosh[k(x − L)] + sinh[k(x − L)]}


g(x|ξ) =
k 2 cosh(kL) − k sinh(kL)

if x > ξ. More conveniently,

sinh(kx< ){k cosh[k(x> − L)] + sinh[k(x> − L)]}


g(x|ξ) = .
k 2 cosh(kL) − k sinh(kL)

To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,


r(x) = 1, and λ = −k 2 . Let λn = kn2 . The eigenfunction solution to the
Sturm-Liouville problem is ϕn (x) = An sin(kn x) because it satisfies ϕn (0) = 0.
To satisfy the boundary condition ϕn (L) − ϕ′n (L) = 0, tan(kn L) = kn .
To find the value of An so that ϕn (x) is orthonormal,
Z L Z L
A2n sin2 (kn x) dx = 21 A2n [1 − cos(2kn x)] dx = 1,
0 0

or  
1 2 sin(2kn L)  
2 An L− = 21 A2n L − cos2 (kn L) = 1.
2kn
Now, (1 + kn2 ) cos2 (kn L) = 1 since tan2 (kn L) = kn2 and eliminating sin2 (kn L)
from this equation. Therefore, substituting this orthonormal eigenfunctions
into Equation 15.2.123,

X∞
(1 + kn2 ) sin(kn ξ) sin(kn x)
g(x|ξ) = 2 .
n=1
[(1 + kn2 )L − 1](kn2 + k 2 )

17. Solving the differential equation g ′′ − k 2 g = 0, we have



A[a sinh(kx) − k cosh(kx)], x < ξ,
g(x|ξ) =
B cosh[k(L − x)], x > ξ.

These solutions satisfy the boundary conditions: ag(0|ξ) + g ′ (0|ξ) = g ′ (L|ξ) =


0. Because the Green’s function must be continuous at x = ξ, g(ξ − |ξ) =
g(ξ + |ξ), or aA sinh(kξ) − kA cosh(kξ) = B cosh[k(L − ξ)]}. Integrating the
x=ξ +
differential equation from x = ξ − to x = ξ + , g ′ (x|ξ)|x=ξ− = −1, or

−kB sinh[k(L − ξ)] − kA[a cosh(kξ) − k sinh(kξ)] = −1.

Therefore,

cosh[k(L − ξ)] a sinh(kξ) − k cosh(kξ)


A= , and B = .
k[a cosh(kL) − k sinh(kL)] k[a cosh(kL) − k sinh(kL)]
516 Advanced Engineering Mathematics with MATLAB

Therefore,

[a sinh(kx) − k cosh(kx)] cosh[k(L − ξ)]


g(x|ξ) =
k[a cosh(kL) − k sinh(kL)]

if x < ξ, and

[a sinh(kξ) − k cosh(kξ)] cosh[k(L − x)]


g(x|ξ) =
k[a cosh(kL) − k sinh(kL)]

if x > ξ. More conveniently,

[a sinh(kx< ) − k cosh(kx< )] cosh[k(L − x> )]


g(x|ξ) = .
k[a cosh(kL) − k sinh(kL)]

To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,


r(x) = 1, and λ = −k 2 . Let λn = kn2 . The eigenfunction solution to
the Sturm-Liouville problem is ϕn (x) = An cos[kn (x − L)] because it sat-
isfies ϕ′n (L) = 0. To satisfy the boundary condition aϕn (0) + ϕ′n (0) = 0,
kn tan(kn L) = −a, where n = 1, 2, 3, . . ..
To find the value of An so that ϕn (x) is orthonormal,
Z L Z L
A2n cos2 [kn (x − L)] dx = 21 A2n {1 + cos[2kn (x − L)]} dx = 1,
0 0

or  
sin(2kn L) 1 2 
1 2
2 An L+ = A aL − sin2 (kn L) = 1.
2kn 2a n
Now, (a2 + kn2 ) sin2 (kn L) = a2 since kn2 sin2 (kn L) = a2 cos2 (kn L) and elimi-
nating cos2 (kn L) from this equation. Therefore, substituting this orthonormal
eigenfunctions into Equation 15.2.123,

X∞
(a2 + kn2 ) cos[kn (ξ − L)] cos[kn (x − L)]
g(x|ξ) = 2 .
n=1
[(a2 + kn2 )L − a](kn2 + k 2 )

18. Solving the differential equation g ′′ − k 2 g = 0, we have



A[sinh(kx) − k cosh(kx)], x < ξ,
g(x|ξ) =
B{sinh[k(L − x)] − k cosh[k(L − x)]} x > ξ.

These solutions satisfy the boundary conditions: g(0|ξ) + g ′ (0|ξ) = g(L|ξ) −


g ′ (L|ξ) = 0. Because the Green’s function must be continuous at x =
ξ, g(ξ − |ξ) = g(ξ + |ξ), or A[sinh(kξ) − k cosh(kξ)] = B{sinh[k(L − ξ)] −
Worked Solutions 517

k cosh[k(L−ξ)]}. Integrating the differential equation from x = ξ − to x = ξ + ,


x=ξ +
g ′ (x|ξ)|x=ξ− = −1, or

kB{− cosh[k(L − ξ)] + k sinh[k(L − ξ)]} − kA[cosh(kξ) − k sinh(kξ)] = −1.

Therefore,
sinh[k(L − ξ)] − k cosh[k(L − ξ)]
A= ,
k[(k 2 + 1) sinh(kL) − 2k cosh(kL)]
and
sinh(kL) − k cosh(kL)
B= .
k[(k 2 + 1) sinh(kL) − 2k cosh(kL)]
Therefore,

[sinh(kx) − k cosh(kx)]{sinh[k(L − ξ)] − k cosh[k(L − ξ)]}


g(x|ξ) =
k[(k 2 + 1) sinh(kL) − 2k cosh(kL)]

if x < ξ, and

[sinh(kξ) − k cosh(kξ)]{sinh[k(L − x)] − k cosh[k(L − x)]}


g(x|ξ) =
k[(k 2 + 1) sinh(kL) − 2k cosh(kL)]

if x > ξ. More conveniently,

[sinh(kx< ) − k cosh(kx< )]{sinh[k(L − x> )] − k cosh[k(L − x> )]}


g(x|ξ) = .
k[(k 2 + 1) sinh(kL) − 2k cosh(kL)]

To find the eigenfunction expansion, we note that p(x) = 1, q(x) = 0,


r(x) = 1, and λ = −k 2 . Let λn = kn2 . The eigenfunction solution to the
Sturm-Liouville problem is ϕn (x) = An [sin(kn x) − kn cos(kn x)] because it
satisfies ϕn (0) + ϕ′n (0) = 0. To satisfy the boundary condition ϕn (L) −
ϕ′n (L) = 0, tan(kn L) = 2kn /(1 − kn2 ), where n = 1, 2, 3, . . ..
To find the value of An so that ϕn (x) is orthonormal,
Z L  
A2n sin2 (kn x) − 2kn sin(kn x) cos(kn x) + kn2 cos2 (kn x) dx = 1,
0

Z L
L
1 2
2 An [1 − cos(2kn x)] dx − A2n sin2 (kn x) 0
0
Z L
+ 12 kn2 A2n [1 + cos(2kn x)] dx = 1,
0
   
sin(2kn L) sin(2kn L)
A2n L − − 2A2n sin2 (kn L) + kn2 A2n L + = 2,
2kn 2kn
518 Advanced Engineering Mathematics with MATLAB

sin(kn L) cos(kn L)
A2n L(1 + kn2 )−2 sin2 (kn L) −
kn

+ kn sin(kn L) cos(kn L) = 2.

Now, 4kn2 cos2 (kn L) = (1−kn2 )2 sin2 (kn L) or 4kn2 = (1+kn2 )2 sin2 (kn L). Then,
A2n [(1+kn2 )L−2] = 2. Therefore, substituting this orthonormal eigenfunctions
into Equation 15.2.123,

X ϕn (ξ)ϕn (x)
g(x|ξ) = 2 ,
n=1
[(1 + kn2 )L − 2](kn2 + k 2 )

where ϕn (x) = sin(kn x) − kn cos(kn x).

Section 15.4

1. Let ξ = xt. Then,

∂g(x, t|0, 0) x
= J0′ (ξ) √ H(x)H(t) + J0 (ξ)H(x)δ(t),
∂t 2 t

and
∂ 2 g(x, t|0, 0) 1
= 41 J0′′ (ξ)H(x)H(t) + J0′ (ξ) √ H(x)H(t)
∂x∂t 4 xt
√ √
′ x ′ t
+ J0 (ξ) √ δ(x)H(t) + J0 (ξ) √ H(x)δ(t)
2 t 2 x
+ J0 (ξ)δ(x)δ(t).
Now, √
x
J0 (ξ)δ(x)δ(t) = δ(x)δ(t), J0′ (ξ) √ δ(x)H(t) = 0,
2 t
and √
t
J0′ (ξ) √ H(x)δ(t) = 0.
2 x
Therefore,

∂ 2 g(x, t|0, 0) 1
+ 4 g(x, t|0, 0)
∂x∂t
= 41 [J”0 (ξ) + J0′ (ξ)/ξ + J0 (ξ)] H(x)H(t) + δ(x)δ(t)
= δ(x)δ(t),

because the quantity in the square brackets equals zero since it satisfies Equa-
tion 6.5.1.
Worked Solutions 519

2. With c = 1, the orthonormal eigenfunctions that satisfy the boundary


conditions ϕn (0) = ϕ′ (L) = 0 are
r  
2 (2n − 1)πx
ϕn (x) = sin
L 2L
with kn = (2n−1)π/(2L). Therefore, direct substitution into Equation 15.3.21
yields
X∞    
4 1 (2n − 1)πξ (2n − 1)πx
g(x, t|ξ, τ ) = H(t − τ ) sin sin
π n=1
2n − 1 2L 2L
 
(2n − 1)π(t − τ )
× sin .
2L

3. With c = 1, the orthonormal eigenfunctions that satisfy the boundary


conditions ϕ′n (0) = ϕ′ (L) = 0 are
r
1
ϕ0 (x) = with k0 = 0,
L
and r  
2 (2n − 1)πx
ϕn (x) = cos
L 2L
with kn = nπ/L. Therefore, direct substitution into Equation 15.3.21 yields
X∞    nπx 
t−τ 2 1 nπξ
g(x, t|ξ, τ ) = H(t − τ ) + H(t − τ ) cos cos
L π n=1
n L L
 
nπ(t − τ )
× sin .
L

4. With c = 1, Equation 15.4.9 becomes


Z t
u(x, t) = [g(x, t|L, τ )uξ (L, τ ) − u(L, τ )gξ (x, t|L, τ )] dτ
0
Z t
− [g(x, t|0, τ )uξ (0, τ ) − u(0, τ )gξ (x, t|0, τ )] dτ
0
Z L
− [u(ξ, 0)gτ (x, t|ξ, 0) − g(x, t|ξ, 0)uξ (ξ, 0)] dξ,
0

since there is no source term. The Green’s function is given by Equation


15.3.27. Next, we note that g(x, t|L, τ ) = g(x, t|0, τ ) = 0 and u(0, τ ) =
u(L, τ ) = 0, as well as uτ (ξ, 0) = 0. Consequently, we have
Z L
u(x, t) = − u(ξ, 0)gτ (x, t|ξ, 0) dξ.
0
520 Advanced Engineering Mathematics with MATLAB

If we now substitute for g(x, t|ξ, τ ) and reverse the order of integration and
summation,
Z L
u(ξ, 0)gτ (x, t|ξ, 0) dξ
0
 Z L    
2 X  nπx 

nπt πξ nπξ
=− sin cos cos sin dξ
L n=1 L L 0 L L
∞    
8 X m 2mπx 2mπt
=− sin cos .
L m=1 4m2 − 1 L L

Thus, the solution equals


∞    
8 X m 2mπx 2mπt
u(x, t) = sin cos .
L m=1 4m2 − 1 L L

5. With c = 1, Equation 15.4.9 becomes


Z t
u(x, t) = [g(x, t|L, τ )uξ (L, τ ) − u(L, τ )gξ (x, t|L, τ )] dτ
0
Z t
− [g(x, t|0, τ )uξ (0, τ ) − u(0, τ )gξ (x, t|0, τ )] dτ
0
Z L
− [u(ξ, 0)gτ (x, t|ξ, 0) − g(x, t|ξ, 0)uξ (ξ, 0)] dξ,
0

since there is no source term. The Green’s function is given by Equation


15.3.27. Next, we note that g(x, t|L, τ ) = g(x, t|0, τ ) = 0 and u(L, τ ) = 0.
Consequently, we have
Z t Z L
u(x, t) = u(0, τ )gξ (x, t|0, τ ) dτ − u(ξ, 0)gτ (x, t|ξ, 0) dξ
0 0
Z L
+ uτ (ξ, 0)g(x, t|ξ, 0) dξ.
0

If we now substitute for g(x, t|ξ, τ ) and reverse the order of integration and
summation,
Z t
u(0, τ )gξ (x, t|0, τ ) dτ
0
∞  nπx  Z t  
2 X nπ(t − τ )
= (−1)n sin e−τ sin dτ
L n=1 L 0 L
Worked Solutions 521
Z
2 X  nπx  −t t s  nπs 

= sin e e sin ds
L n=1 L 0 L

X  nπx 
=2 sin
n=1
L
     
nπ −t nπt L nπt
× e − cos + sin ,
L2 + n2 π 2 L L2 + n2 π 2 L

Z L
u(ξ, 0)gτ (x, t|ξ, 0) dξ
0
 Z L    
2 X  nπx 

nπt πξ nπξ
=− sin cos sin sin dξ
L n=1 L L 0 L L
 πx   
πt
= −2 sin cos ,
L L

and

Z L
uτ (ξ, 0)g(x, t|ξ, 0) dξ
0
2X1
∞  nπx   nπt  Z L 
nπξ

= sin sin 1 sin dξ
π n=1 n L L 0 L

2L X 1  nπx   nπt  
nπξ
L
=− 2 sin sin cos
π n=1 n2 L L L 0
X∞    
4L 1 (2m − 1)πx (2m − 1)πt
= 2 sin sin .
π m=1 (2m − 1)2 L L

Thus, the solution equals


X  nπx 
u(x, t) = 2 sin
n=1
L
     
nπ −t nπt L nπt
× e − cos + sin
L2 + n2 π 2 L L2 + n2 π 2 L
 πx   
πt
+ 2 sin cos
L L
X∞    
4L 1 (2m − 1)πx (2m − 1)πt
+ 2 sin sin .
π m=1 (2m − 1)2 L L
522 Advanced Engineering Mathematics with MATLAB

6. With c = 1, Equation 15.4.9 becomes


Z t
u(x, t) = [g(x, t|L, τ )uξ (L, τ ) − u(L, τ )gξ (x, t|L, τ )] dτ
0
Z t
− [g(x, t|0, τ )uξ (0, τ ) − u(0, τ )gξ (x, t|0, τ )] dτ
0
Z L
− [u(ξ, 0)gτ (x, t|ξ, 0) − g(x, t|ξ, 0)uξ (ξ, 0)] dξ,
0

since there is no source term. The Green’s function is given by Problem 2 in


the section. Next, we note that g(x, t|0, τ ) = gξ (x, t|L, τ ) = 0 and u(0, τ ) = 0.
Consequently, we have
Z t Z L
u(x, t) = uξ (L, τ )g(x, t|L, τ ) dτ − u(ξ, 0)gτ (x, t|ξ, 0) dξ
0 0
Z L
+ uτ (ξ, 0)g(x, t|ξ, 0) dξ.
0

If we now substitute for g(x, t|ξ, τ ) and reverse the order of integration and
summation,
Z t
uξ (L, τ )g(x, t|L, τ ) dτ
0
∞  Z t  
4 X (−1)n+1 (2n − 1)πx (2n − 1)π(t − τ )
= sin sin dτ
π n=1 2n − 1 2L 0 2L
∞     τ =t
8L X (−1)n+1 (2n − 1)πx (2n − 1)π(t − τ )
= 2 sin cos
π n=1 (2n − 1)2 2L 2L τ =0
∞     
8L X (−1)n+1 (2n − 1)πx (2n − 1)πt
=− 2 2
sin 1 − cos ,
π n=1 (2n − 1) 2L 2L

Z L
u(ξ, 0)gτ (x, t|ξ, 0) dξ
0
∞    Z L  
2 X (2n − 1)πx (2n − 1)πt (2n − 1)πξ
=− sin cos ξ sin dξ
L n=1 2L 2L 0 2L
∞    
8L X (−1)n+1 (2n − 1)πx (2n − 1)πt
=− 2 sin cos ,
π n=1 (2n − 1)2 2L 2L

and
Z L
uτ (ξ, 0)g(x, t|ξ, 0) dξ
0
Worked Solutions 523

∞    Z L  
4X 1 (2n − 1)πx (2n − 1)πt (2n − 1)πξ
= sin sin 1 sin dξ
π n=1 2n = 1 2L 2L 0 2L
∞      L
8L X 1 (2n − 1)πx (2n − 1)πt (2n − 1)πξ
=− 2 sin sin cos
π n=1 (2n − 1)2 2L 2L 2L 0
∞    
8L X 1 (2n − 1)πx (2n − 1)πt
= 2 2
sin sin .
π n=1 (2n − 1) 2L 2L

Thus, the solution equals


∞    
8L X (−1)n+1 (2n − 1)πx (2n − 1)πt
u(x, t) = − 2 sin 1 − cos
π n=1 (2n − 1)2 2L 2L
∞    
8L X (−1)n+1 (2n − 1)πx (2n − 1)πt
+ 2 sin cos
π n=1 (2n − 1)2 2L 2L
∞    
8L X 1 (2n − 1)πx (2n − 1)πt
− 2 sin sin .
π n=1 (2n − 1)2 2L 2L

7. With c = 1, Equation 15.4.9 becomes


Z t
u(x, t) = [g(x, t|L, τ )uξ (L, τ ) − u(L, τ )gξ (x, t|L, τ )] dτ
0
Z t
− [g(x, t|0, τ )uξ (0, τ ) − u(0, τ )gξ (x, t|0, τ )] dτ
0
Z L
− [u(ξ, 0)gτ (x, t|ξ, 0) − g(x, t|ξ, 0)uξ (ξ, 0)] dξ,
0

since there is no source term. The Green’s function is given by Problem


3 in the section. Next, we note that gξ (x, t|0, τ ) = gξ (x, t|L, τ ) = 0 and
uξ (L, τ ) = uτ (ξ, 0) = 0. Consequently, we have
Z t Z L
u(x, t) = − uξ (0, τ )g(x, t|0, τ ) dτ − u(ξ, 0)gτ (x, t|ξ, 0) dξ.
0 0

If we now substitute for g(x, t|ξ, τ ) and reverse the order of integration and
summation,
Z t Z
1 t
uξ (0, τ )g(x, t|0, τ ) dτ = (t − τ ) dτ
0 L 0
2X1
∞  nπx  Z t  nπ(t − τ ) 
+ cos sin dτ
π n=1 n L 0 L
t2

2L X 1  nπx   
nπt

= + 2 cos 1 − cos ,
2L π n=1 n2 L L
524 Advanced Engineering Mathematics with MATLAB

and
Z L Z
1 L
u(ξ, 0)gτ (x, t|ξ, 0) dξ = − 1 dξ
0 L 0
∞  nπx   Z L  
2 X nπt nπξ
− cos cos cos dξ
L n=1 L L 0 L
= −1.

Thus, the solution equals

t2

2L X 1  nπx   
nπt

u(x, t) = 1 − − 2 cos 1 − cos .
2L π n=1 n2 L L

Section 15.5

1. Let us define
Z ∞
1
G(x, s|ξ, τ ) = G(k, s|ξ, τ )eikx dk,
2π −∞

where Z ∞
G(k, s|ξ, τ ) = G(x, s|ξ, τ )e−ikx dx.
−∞

Because Z ∞
d2 G −ikx
e dx = −k 2 G(k, s|ξ, τ ),
−∞ dx2
and Z ∞
dG −ikx
e dx = ikG(k, s|ξ, τ ),
−∞ dx
the Fourier transform of the differential equation in Step 1 is

[bk 2 + ikv − a + s]G(k, s|ξ, τ ) = e−ikξ−sτ ,

e−ikξ−sτ
G(k, s|ξ, τ ) = .
bk 2 + ikv + s − a
Taking the inverse Fourier transform,
Z ∞
e−sτ eik(x−ξ)
G(x, s|ξ, τ ) = dk.
2π −∞ s − a + bk 2 + ikv
Worked Solutions 525

Finally, taking the inverse Laplace transform,


Z ∞
H(t − τ ) 2
g(x, t|ξ, τ ) = e(a−bk −ikv)(t−τ ) ik(x−ξ)
e dk
2π −∞
Z ∞
ea(t−τ ) 2
= H(t − τ ) e−(bk +ikv)(t−τ )+ik(x−ξ) dk
2π 0
Z ∞ 
2
+ e−(bk −ikv)(t−τ )−ik(x−ξ) dk
0
Z ∞
ea(t−τ ) 2
= H(t − τ ) e−bk (t−τ )
cos{k[x − ξ − v(t − τ )]} dk,
π 0

where we broke the integral from (−∞, ∞) into two integrals from (−∞, 0)
and (0, ∞). In the integral from (−∞, 0) we substitute k with −k and change
the limits. This gives the second integral in the second line.

2. Because there is no soureces, Equation 15.5.6 simplies to


Z t
u(x, t) = [g(x, t|∞, τ )uξ (∞, τ ) − u(∞, τ )gξ (x, t|∞, τ )] dτ
0
Z t
− [g(x, t| − ∞, τ )uξ (−∞, τ ) − u(−∞, τ )gξ (x, t|∞, τ )] dτ
0
Z ∞
+ u(ξ, 0)g(x, t|ξ, 0) dξ.
0

Equation 15.5.15 gives the Green’s function. Because g(−∞, t|ξ, τ ), gx (−∞, t
|ξ, τ ), g(∞, t|ξ, τ ), and gx (∞, t|ξ, τ ) tend to zero, the first two integrals van-
ishes. Therefore, the third integral gives u(x, t) and
Z ∞  2   
1 x + ξ2 xξ
u(x, t) = √ f (ξ) exp − sinh dξ.
πa2 t 0 4a2 t 2a2 t

3. Because
r  
2 (2n − 1)πx (2n − 1)π
ϕn (x) = sin and kn = ,
L 2L 2L

Equation 15.5.30 with a = 1 gives


∞    
2 X (2n − 1)πξ (2n − 1)πx
g(x, t|ξ, τ ) = sin sin
L n=1 2L 2L
 
(2n − 1)2 π 2 (t − τ )
× exp − H(t − τ ).
4L2
526 Advanced Engineering Mathematics with MATLAB
p
4. Because ϕ0 (x) = 1/L with k0 = 0 and
r  nπx 
2 nπ
ϕn (x) = cos with kn = ,
L L L
Equation 15.5.30 with a = 1 gives
H(t − τ )
g(x, t|ξ, τ ) =
L
∞    nπx   2 2 
2 X nπξ n π (t − τ )
+ cos cos exp − H(t − τ ).
L n=1 L L L2

5. Because there is no soureces, Equation 15.5.6 simplies to


Z t
u(x, t) = [g(x, t|L, τ )uξ (L, τ ) − u(L, τ )gξ (x, t|L, τ )] dτ
0
Z t
− [g(x, t|0, τ )uξ (0, τ ) − u(0, τ )gξ (x, t|0, τ )] dτ
0
Z L
+ u(ξ, 0)g(x, t|ξ, 0) dξ.
0

Now, g(x, t|L, τ ) = g(x, t|0, τ ) = 0 as well as u(L, τ ) = 0. Therefore, we only


have to evaluate
Z t
u(0, τ )gξ (x, t|0, τ ) dτ
0
∞  nπx   2 2 
2 X nπ n π t
= sin exp − 2
L n=1 L L L
Z t  2 2 
n π τ
× exp − τ dτ
0 L2
X∞
n  nπx    2 2 
n π t
−t
= 2π 2 π 2 − L2
sin e − exp − 2 ,
n=1
n L L

and
Z L
u(ξ, 0)g(x, t|ξ, 0) dξ
0
 2 2 Z L  
2 X  nπx 

n π t nπξ
= sin exp − 2 sin dξ
L n=1 L L 0 L
∞  nπx   2 2 
2 X 1 − (−1)n n π t
= sin exp − 2
π n=1 n L L
∞    
4 X 1 (2m − 1)πx (2m − 1)2 π 2 t
= sin exp − .
π m=1 2m − 1 L L2
Worked Solutions 527

Substituting these results into the first equation,


X∞
n  nπx    2 2 
n π t
−t
u(x, t) = 2π 2 π 2 − L2
sin e − exp − 2
n=1
n L L
∞    
4 X 1 (2m − 1)πx (2m − 1)2 π 2 t
+ sin exp − .
π m=1 2m − 1 L L2

6. Because there is no soureces, Equation 15.5.6 simplies to


Z t
u(x, t) = [g(x, t|L, τ )uξ (L, τ ) − u(L, τ )gξ (x, t|L, τ )] dτ
0
Z t
− [g(x, t|0, τ )uξ (0, τ ) − u(0, τ )gξ (x, t|0, τ )] dτ
0
Z L
+ u(ξ, 0)g(x, t|ξ, 0) dξ.
0

Now, g(x, t|0, τ ) = gξ (x, t|L, τ ) = 0 as well as uξ (L, τ ) = 0. Therefore, we


only have to evaluate
Z t
u(0, τ )gξ (x, t|0, τ ) dτ
0
∞    
π X (2n − 1)πx (2n − 1)2 π 2 t
= 2 (2n − 1) sin exp −
L n=1 2L 4L2
Z t  
(2n − 1)2 π 2 τ
× sin(τ ) exp dτ
0 4L2
X∞  
2n − 1 (2n − 1)πx
= 16πL2 sin
n=1
(2n − 1)4 π 4 + 16L4 2L
 2 2
 
(2n − 1) π (2n − 1)2 π 2 t
× sin(t) − cos(t) − exp − ,
4L2 4L2
and
Z L
u(ξ, 0)g(x, t|ξ, 0) dξ
0
∞    Z L  
2 X (2n − 1)πx (2n − 1)2 π 2 t (2n − 1)πξ
= sin exp − sin dξ
L n=1 2L 4L2 0 2L
∞    
2 X 2L (2n − 1)πx (2n − 1)2 π 2 t
= sin exp −
L n=1 (2n − 1)π 2L 4L2
∞    
4X 1 (2n − 1)πx (2n − 1)2 π 2 t
= sin exp − .
π n=1 2n − 1 2L 4L2
528 Advanced Engineering Mathematics with MATLAB

Substituting these results into the first equation,



X  
2n − 1
2 (2n − 1)πx
u(x, t) = 16πL sin
n=1
(2n − 1)4 π 4 + 16L4 2L
 2 2
 
(2n − 1) π (2n − 1)2 π 2 t
× sin(t) − cos(t) − exp −
4L2 4L2
∞    
4X 1 (2n − 1)πx (2n − 1)2 π 2 t
+ sin exp − .
π n=1 2n − 1 2L 4L2

7. Because there is no soureces, Equation 15.5.6 simplies to


Z t
u(x, t) = [g(x, t|L, τ )uξ (L, τ ) − u(L, τ )gξ (x, t|L, τ )] dτ
0
Z t
− [g(x, t|0, τ )uξ (0, τ ) − u(0, τ )gξ (x, t|0, τ )] dτ
0
Z L
+ u(ξ, 0)g(x, t|ξ, 0) dξ.
0

Now, gξ (x, t|0, τ ) = gξ (x, t|L, τ ) = 0 as well as uξ (L, τ ) = 0. Therefore, we


only have to evaluate
Z t
uξ (0, τ )g(x, t|0, τ ) dτ
0
Z ∞  nπx   2 2 Z t  2 2 
1 2 X
t
n π t n π τ
= dτ +
cos exp − 2 exp dτ
0L L n=1
L L 0 L2
t

2L X 1  nπx    2 2 
n π t
= + 2 cos 1 − exp − 2 ,
L π n=1 n2 L L

and
Z L
u(ξ, 0)g(x, t|ξ, 0) dξ
0
Z ∞  nπx   2 2 Z L  
L
dξ 2 X n π t nπξ
= + cos exp − 2 cos dξ
0 L L n=1 L L 0 L
= 1.

Substituting these results into the first equation,

t

2L X 1  nπx    2 2 
n π t
u(x, t) = 1 − − 2 2
cos 1 − exp − 2 .
L π n=1 n L L
Worked Solutions 529

8. Taking the Laplace transform of the partial differential equation, we find


that
d2 G
−a2 2 + a2 k 2 G + sG = δ(x − ξ)e−sτ ,
dx
with the boundary conditions G(0, s|ξ, τ ) = G′ (L, s|ξ, τ ) = 0. Assuming that
G(x, s|ξ, τ ) and the delta function can be written as a generalized Fourier
series that satisfies the boundary conditions ϕn (0) = ϕ′n (L) = 0, namely

X  
(2n − 1)πx
G(x, s|ξ, τ ) = Gn sin ,
n=1
2L

and    

2 X (2n − 1)πξ (2n − 1)πx
δ(x − ξ) = sin sin ,
L n=1 2L 2L

we find
   
(2n − 1)2 π 2 a2 2 2 2 (2n − 1)πξ
+ a k + s Gn = sin .
4L2 L 2L

Therefore,
2 sin[(2n − 1)πξ/(2L)]
Gn = e−sτ ,
L s + a k 2 + (2n − 1)2 π 2 a2 /(4L2 )
2

and

2 X e−sτ
G(x, s|ξ, τ ) =
L n=1 s + a2 k 2 + (2n − 1)2 π 2 a2 /(4L2 )
   
(2n − 1)πξ (2n − 1)πx
× sin sin .
2L 2L

Taking the inverse of G(x, s|ξ, τ ), the final answer is

X∞    
2 −a2 k2 (t−τ ) (2n − 1)πξ (2n − 1)πx
g(x, t|ξ, τ ) = e H(t − τ ) sin sin
L n=1
2L 2L
 2 2 2

(2n − 1) π a (t − τ )
× exp − .
4L2

Section 15.6

1. Because we have
  
nπx 

2X nπξ
δ(x − ξ) = sin sin ,
a n=1 a a
530 Advanced Engineering Mathematics with MATLAB

we write  

X nπξ  nπx 
g(x, y|ξ, η) = Gn (y|η) sin sin .
n=1
a a

This solution satisfies the boundary conditions at x = 0 and x = a. Substi-


tuting these equations into the partial differential equation and equating the
various harmonics, we obtain the ordinary differential equation

d2 Gn n2 π 2 2
2
− 2 Gn = − δ(y − η)
dy a a

with the boundary conditions

lim |Gn (y|η)| < ∞.


|y|→∞

Solving this differential equation following Example 13.2.8,

1  nπ 
Gn (y|η) = exp − |y − η| .
nπ a
Therefore, the final answer is

1X1
∞  nπ   nπξ   nπx 
g(x, y|ξ, η) = exp − |y − η| sin sin .
π n=1 n a a a

2. Because we have
∞    
2X (2n − 1)πξ (2n − 1)πx
δ(x − ξ) = cos cos ,
a n=1 2a 2a

we write

X    
(2n − 1)πξ (2n − 1)πx
g(x, y|ξ, η) = Gn (y|η) cos cos .
n=1
2a 2a

This solution satisfies the boundary conditions at x = 0 and x = a. Substi-


tuting these equations into the partial differential equation and equating the
various harmonics, we obtain the ordinary differential equation

d2 Gn (2n − 1)2 π 2 2
2
− Gn = − δ(y − η)
dy 4a2 a

with the boundary conditions

lim |Gn (y|η)| < ∞.


|y|→∞
Worked Solutions 531

Solving this differential equation following Example 13.2.8,


 
2 (2n − 1)π
Gn (y|η) = exp − |y − η| .
(2n − 1)π 2a

Therefore, the final answer is


∞  
2X 1 (2n − 1)π
g(x, y|ξ, η) = exp − |y − η|
π n=1 2n − 1 2a
   
(2n − 1)πξ (2n − 1)πx
× cos cos .
2a 2a

3. Because we have

2 X  nπη   nπy 

δ(y − η) = sin sin ,
b n=1 b b

we write

X  nπη   nπy 
g(x, y|ξ, η) = Gn (x|ξ) sin sin .
n=1
b b

This solution satisfies the boundary conditions at y = 0 and y = b. Substi-


tuting these equations into the partial differential equation and equating the
various harmonics, we obtain the ordinary differential equation

d2 Gn n2 π 2 2
− Gn = − δ(x − ξ)
dx2 b2 b

with the boundary conditions

Gn (0|ξ) = 0 and G′n (a|ξ) + βGn (a|ξ) = 0.

Solving this differential equation following Example 13.2.8,

Gn (x|ξ) = A sinh(nπx/b), 0 < x < ξ,

and     
nπ(a − x) nπ nπ(a − x)
Gn (x|ξ) = B β sinh + cosh .
b b b
The condition that the Green’s function must be continuous yields
    
nπ(a − ξ) nπ nπ(a − ξ)
A sinh(nπξ/b) = B β sinh + cosh .
b b b
532 Advanced Engineering Mathematics with MATLAB

On the other hand, integrating the ordinary differential equation from x = ξ −


to x = ξ + gives the second condition, or

−νB {β cosh[ν(a − ξ)] + ν sinh[ν(a − ξ)]} − Aν cosh(νξ) = −1,

where ν = nπ/b. Solving for A and B,

β sinh[ν(a − ξ)] + ν cosh[ν(a − ξ)]


A= ,
νβ sinh(νa) + ν 2 cosh(νa)
and
sinh(νξ)
B= .
νβ sinh(νa) + ν 2 cosh(νa)
Therefore, we can write the Green’s function with the single expression

X sinh(νx< ) {ν cosh [ν(a − x> )] + β sinh [ν(a − x> )]}
g(x, y|ξ, η) =
n=1
ν 2 cosh(νa) + βν sinh(νa)
 nπη   nπy 
× sin sin ,
b b
where ν = nπ/b, x> = max(x, ξ), and x< = min(x, ξ).

4. From the form of the delta function, we have that



X
g(r, θ|ρ, θ′ ) = g0 (r|ρ) + gn (r|ρ) cos[n(θ − θ′ )].
n=1

Turning to the g0 (r|ρ) term first, it is given by


 
d dg0 δ(r − ρ)
r =− .
dr dr 2π
The solution to this ordinary differential equation that satisfies the boundary
conditions g0 (a|ρ) = g0 (b|ρ) = 0 is

g0 (r|ρ) = A ln(r/a), a < r < ρ,

and
g0 (r|ρ) = B ln(b/r), ρ < r < b.
From the continuity requirement on the Green’s function,

A ln(ρ/a) = B ln(b/ρ).

Integrating the ordinary differential equation from r = ρ− to r = ρ+ , the


second condition is
ρ+
dg0 1
r =− ,
dr ρ− 2π
Worked Solutions 533

or
1
B+A= .

Solving for A and B, we find that

ln(b/ρ)
ln(b/a)A = ,

and
ln(ρ/a)
ln(b/a)B = .

Therefore, the g0 (r|ρ) can be written

ln(r< /a) ln(b/r> )


g0 (r|ρ) = ,
2π ln(b/a)

where r> = max(r, ρ) and r< = min(r, ρ).


Similarly, the differential equation for gn (r|ρ) is
 
1 d dgn n2 δ(r − ρ)
r − 2 gn = − .
r dr dr r πr

The solution to this ordinary differential equation that satisfies the boundary
conditions gn (a|ρ) = gn (b|ρ) = 0 is
 n 
r an
gn (r|ρ) = A n − n , a < r < ρ,
a r

and  
rn bn
gn (r|ρ) = B − . ρ < r < b.
bn rn
From the continuity requirement on the Green’s function,
 n   n 
ρ an ρ bn
A n − n =B n − n .
a ρ b ρ

Integrating the ordinary differential equation from r = ρ− to r = ρ+ , the


second condition is
ρ+
dgn 1
r =− ,
dr ρ− π
or    n 
ρn bn ρ an 1
B n + n −A n + n =− .
b ρ a ρ nπ
Solving for A and B,
   
bn an 1 ρn bn
2A − = − − ,
an bn nπ bn ρn
534 Advanced Engineering Mathematics with MATLAB

and    
bn an 1 ρn an
2B − = − − .
an bn nπ an ρn
Therefore,  
1 1/ρn − ρn /b2n rn − a2n /rn
gn (r|ρ) =
2nπ 1 − (a/b)2n
for a < r < ρ, and
 
1 1/rn − rn /b2n ρn − a2n /ρn
gn (r|ρ) =
2nπ 1 − (a/b)2n
for ρ < r < b. Therefore, the final solution is
ln(r< /a) ln(b/r> )
g(r, θ|ρ, θ′ ) =
2π ln(b/a)

1 X cos[n(θ − θ′ )] n
 
+ r< − a2n /r<
n n
1/r> n
− r> /b2n .
2π n=1
n [1 − (a/b)2n ]

5. From the form of the delta function, we have that


X∞    
nπθ′ nπθ
g(r, θ|ρ, θ′ ) = gn (r|ρ) sin sin .
n=1
β β

Substituting into the partial differential equation and equating harmonics,


 
1 d dgn n2 π 2 2
r − 2 2 gn = − δ(r − ρ).
r dr dr β r βr
The solution to this ordinary differential equation that satisfies the boundary
conditions

lim |gn (r|ρ)| < ∞ and lim |gn (r|ρ)| < ∞,


r→0 r→∞

is  nπ/β
r
gn (r|ρ) = A , 0 < r < ρ,
ρ
and  ρ nπ/β
gn (r|ρ) = B , ρ < r < ∞.
r
From the continuity requirement on the Green’s function, A = B. Integrating
the ordinary differential equation from r = ρ− to r = ρ+ , the second condition
is
ρ+
dgn 2
r =− ,
dr ρ− β
Worked Solutions 535

or
2
nπB + nπA = .
β
Solving for A and B,
1
A=B= .

Therefore,
 nπ/β
1 r
gn (r|ρ) = , 0 < r < ρ,
nπ ρ
and
1  ρ nπ/β
gn (r|ρ) = , ρ < r < ∞.
nπ r
Therefore, the final solution is
∞    
′ 1 X 1 nπ/β −nπ/β nπθ′ nπθ
g(r, θ|ρ, θ ) = r r> sin sin .
π n=1 n < β β

6. From the form of the delta function, we have that



X    
nπθ′ nπθ
g(r, θ|ρ, θ′ ) = gn (r|ρ) sin sin .
n=1
β β

Substituting into the partial differential equation and equating harmonics,


 
1 d dgn n2 π 2 2
r − 2 2 gn = − δ(r − ρ).
r dr dr β r βr

The solution to this ordinary differential equation that satisfies the boundary
conditions
lim |gn (r|ρ)| < ∞ and gn (a|ρ) = 0,
r→0

is  r nπ/β
gn (r|ρ) = A , 0 < r < ρ,
a
and   
r nπ/β  a nπ/β
gn (r|ρ) = B − , ρ < r ≤ a.
a r
From the continuity requirement on the Green’s function,
"  nπ/β #
 ρ nπ/β  ρ nπ/β a
A =B − .
a a ρ
536 Advanced Engineering Mathematics with MATLAB

Integrating the ordinary differential equation from r = ρ− to r = ρ+ , the


second condition is
ρ+
dgn 2
r =− ,
dr ρ− β
or "  nπ/β #
 ρ nπ/β a  ρ nπ/β
nπB + − nπA = −2.
a ρ a
Solving for A and B,
"  nπ/β #
1  ρ nπ/β a
A=− − ,
nπ a ρ

and
1  ρ nπ/β
B=− .
nπ a
Therefore, Therefore, the final solution is
"  #
1 X 1  r< nπ/β  r nπ/β
∞ nπ/β
′ a >
g(r, θ|ρ, θ ) = −
π n=1 n a r> a
   
nπθ′ nπθ
× sin sin .
β β

7. Because   
nπz 

2 X nπζ
δ(z − ζ) = sin sin ,
L n=1 L L
then  

X nπζ  nπz 
g(r, z|ρ, ζ) = gn (r|ρ) sin sin .
n=1
L L
Substituting into the partial differential equation and equating harmonics,

d2 g n 1 dgn n2 π 2 δ(r − ρ)
+ − gn = − .
dr2 r dr L2 πLr
Now    

δ(r − ρ) 1 X 1 km ρ km r
= J 0 J 0 ,
2πr πa2 m=1 J12 (km ) a a

where km in the mth root of J0 (k) = 0. Therefore, we can write g(r|ρ) as the
eigenfunction expansion

X    
km ρ km r
g(r|ρ) = Anm J0 J0 .
m=1
a a
Worked Solutions 537

Substituting this solution into the differential equation and equating harmon-
ics,
 2 
km n2 π 2 2
+ = ,
a2 L2 πa2 LJ12 (km )
or
2
Anm = .
πa2 LJ12 (km )(km
2 /a2 + n2 π 2 /L2 )
Therefore, the final answer is

∞ ∞
2 XX J0 (km ρ/a)J0 (km r/a)
g(r, z|ρ, ζ) =
πa2 L n=1 m=1 πa2 LJ12 (km )(km
2 /a2 + n2 π 2 /L2 )
  
nπζ nπz 
× sin sin .
L L

8. Because  
2X

nπξ  nπx 
δ(x − ξ) = αn cos cos
a n=0 a a

and
2 X
∞  mπη   mπy 
δ(y − η) = αm cos cos ,
b m=0 b b
1
where α0 = 2 and αn = 1 for n > 0, then

∞ X
X ∞    nπx   mπη   mπy 
nπξ
g(x, y|ξ, η) = Gnm cos cos cos cos .
n=0 m=0
a a b b

Substituting g(x, y|ξ, η) into the partial differential equation and equating
harmonics,
 
2 n2 π 2 m2 π 2 4
k0 − 2 − 2
Gnm = − αn αm ,
a b ab
or
4 αn αm
Gnm = .
ab n2 π 2 /a2 + m2 π 2 /b2 − k02
Therefore, the final solution is

∞ ∞  
4 XX αn αm nπξ
g(x, y|ξ, η) = Gnm 2 2 2 cos
ab n=0 m=0 n π /a + m2 π 2 /b2 − k02 a
 nπx   mπη   mπy 
× cos cos cos .
a b b
538 Advanced Engineering Mathematics with MATLAB

9. From the definition of Fourier sine transform given in the textbook, we


have that Z ∞ 2
∂ g
sin(kx) dx = −k 2 G(k, y|ξ, η),
0 ∂x2
Z ∞ 2
∂ g d2 G(k, y|ξ, η)
2
sin(kx) dx = ,
0 ∂y dy 2
and Z ∞
δ(x − ξ)δ(y − η) sin(kx) dx = sin(kξ)δ(y − η).
0
Therefore, the partial differential equation and boundary conditions becomes
d2 G
− k 2 G = − sin(kξ)δ(y − η),
dy 2
and
G(k, 0|ξ, η) = 0, and lim |G(k, y|ξ, η)| < ∞.
y→∞

Next, we must solve the ordinary differential equation. First, we find the
particular solution. For y > η and y < η, Gp (k, y|ξ, η) = Ae−k|y−η| . This
solution is continuous at y = η. Integrating the ordinary differential equation
from y = η − to y = η + , we find that
η+
dGp
= − sin(kξ).
dy η−

Substituting Gp into this equation, we find that


sin(kξ) −k|y−η|
Gp (k, y|ξ, η) = e .
2k
The homogeneous solution is GH (k, y|ξ, η) = Be−k(y+η) . Therefore, the gen-
eral solution is
sin(kξ) −k|y−η|
G(k, y|ξ, η) = e + Be−k(y+η) .
2k
The constant B must be chosen so that G(k, 0|ξ, η) = 0. This yields
sin(kξ) h −k|y−η| i
G(k, y|ξ, η) = e − e−k(y+η) .
2k
Taking the inverse of the Fourier sine transform and the integral tables,
Z
1 ∞ h −k|y−η| i dk
g(x, y|ξ, η) = e − e−k(y+η) sin(kξ) sin(kx)
π 0 k
 2 2

1 (x + ξ) + (y − η)
= ln
4π (x − ξ)2 + (y − η)2
 
1 (x + ξ)2 + (y + η)2
− ln
4π (x − ξ)2 + (y + η)2
 
1 [(x − ξ)2 + (y − η)2 ][(x + ξ)2 + (y + η)2 ]
=− ln .
4π [(x − ξ)2 + (y + η)2 ][(x + ξ)2 + (y − η)2 ]
Worked Solutions 539

10. From the definition of Fourier transform given in the textbook, we have
that Z ∞ 2
∂ g −ikx
2
e dx = −k 2 G(k, y|ξ, η),
−∞ ∂x
Z ∞ 2
∂ g −ikx d2 G(k, y|ξ, η)
2
e dx = ,
−∞ ∂y dy 2
and Z ∞
δ(x − ξ)δ(y − η)e−ikx dx = e−ikx δ(y − η).
−∞

Therefore, the partial differential equation and boundary conditions becomes

d2 G 
2
− k 2 + 1 G = −e−ikx δ(y − η).
dy

Let Z ∞
1
G(k, y|ξ, η) = G(k, ℓ|ξ, η)eiℓy dℓ,
2π −∞

where Z ∞
G(k, ℓ|ξ, η) = G(k, y|ξ, η)e−iℓy dy.
−∞

Then, the Fourier transform of the ordinary differential equation is



ℓ2 + k 2 + 1 G(k, ℓ|ξ, η) = e−ikx−iℓy .

Taking the inverse Fourier transforms in both k and ℓ,


Z ∞ Z ∞
1 eik(x−ξ) eiℓ(y−η)
g(x, y|ξ, η) = dℓ dk
4π 2 −∞ −∞ ℓ2 + k 2 + 1
Z ∞ Z 2π irκ cos(θ−ϕ)
1 e
= dθ κ dκ
4π 2 0 0 κ2 + 1
Z 2π−ϕ∞ Z 
1 irκ cos(ψ) κ
= e dψ 2 dκ
4π 2 0 −ϕ κ +1
"
Z ∞ Z 2π−ϕ−π/2 #
1 κ
= e−irκ sin(θ) dθ 2 dκ
4π 2 0 −ϕ−π/2 κ +1
Z ∞
1 J0 (κr) K0 (r)
= κ dκ = ,
2π 0 κ2 + 1 2π

where we have used the results from Gradshteyn, I. S., and I. M. Ryzhik,
1965: Table of Integrals, Series, and Products. Academic Press, Section 6.532,
Formula 4.
540 Advanced Engineering Mathematics with MATLAB

11. If g(x, y|ξ, η) = ex/2 ϕ(x, y|ξ, η), then

gx (x, y|ξ, η) = 12 ex/2 ϕ(x, y|ξ, η) + ex/2 ϕx (x, y|ξ, η),

gxx (x, y|ξ, η) = 41 ex/2 ϕ(x, y|ξ, η) + ex/2 ϕx (x, y|ξ, η) + ex/2 ϕxx (x, y|ξ, η),

and
gyy (x, y|ξ, η) = ex/2 ϕyy (x, y|ξ, η).

The partial differential equation becomes

ϕxx + ϕyy − 14 ϕ = −e−x/2 δ(x − ξ)δ(y − η).

To solve the partial differential equation, we follow very closely the pre-
vious problem. We take the Fourier transform in both the x and y directions.
When we take the inverses in the k and ℓ dimensions, this yields
Z ∞ Z ∞
e−ξ/2 eik(x−ξ) eiℓ(y−η)
ϕ(x, y|ξ, η) = dℓ dk
4π 2 −∞ −∞ ℓ2 + k 2 + 14
K0 (r/2)
= e−ξ/2 .

We obtain the second line by again transforming the first line so that we can
do the double integral exactly. The final answer follows from back substitution
and is
K0 (r/2)
g(x, y|ξ, η) = e(x−ξ)/2 .

Section 16.2

1.(a)
S = {HH, HT, T H, T T }

(b)
S = {ab, ac, ba, bc, ca, cb}

(c)
S = {aa, ab, ac, ba, bb, bc, ca, cb, cc}

(d)
S = {bbb, bbg, bgb, bgg, ggb, ggg, gbb, gbg}

(e)
S = {bbb, bbg, bgb, bgg, ggb, ggg, gbb, gbg}
Worked Solutions 541

2. The possible configurations is given by the matrix


1, 1 1, 2 1, 3 1, 4 1, 5 1, 6
2, 1 2, 2 2, 3 2, 4 2, 5 2, 6
3, 1 3, 2 3, 3 3, 4 3, 5 3, 6
4, 1 4, 2 4, 3 4, 4 4, 5 4, 6
5, 1 5, 2 5, 3 5, 4 5, 5 5, 6
6, 1 6, 2 6, 3 6, 4 6, 5 6, 6
Therefore, there are 36 possible configurations. Of those 36 configurations,
six throws have a sum of seven: (6, 1), (5, 2), (4, 3), (5, 2) and (6, 1). Thus,
the probability of throwing a seven using two dice is 6/36 or 1/6.

3. This is an example of two events that are mutually exclusive. The chance
that any one side with the number of dots varying from 1 to 6 is 1/6. There-
fore, the probability of obtaining a one or two is the sum of the probabilities
for the appearance of a one or two, 1/3.

4. (a)
 2  4
6! 1 1 15
P (X = 2) = = = 0.2344
4!2! 2 2 16
(b)
 3  3
6! 1 1 20
P (X = 3) = = = 0.3125
3!3! 2 2 64

5. The sample space is the elements rr, rb, rg, bb, br, bg, gg, gr and gb,
where r, g and b denote a red, green, and blue ball, respectively. Therefore,
X = 0, 1, 2, denote the choice of no, one, and two green balls, respectively.
Of the 9 members of the sample space, three of the members contains one
green ball. Assuming that all of the members are equally likely to be chosen,
P (X = 1) = 1/3.

6. After the first selection, P (r) = 50/80 and P (b) = 30/80. After the
second selection, P (rr) = (50/80)(49/79) and P (bb) = (30/80)(29/79). After
the third selection, P (rrr) = (50/80)(49/79)(48/78) = 0.2386 and P (bbb) =
(30/80)(29/79)(28/78) = 0.0494.

7. This is similar to the previous problem. Here P (jack) = 4/52 and P (ten) =
4/52. Therefore, the answer is
P (jack ∪ ten) = P (jack) + P (ten) = 2/13.

8. The number of possible combinations is 4! = 24. Of these 24 combina-


tions there are 4 possible ways that there are boys at the end: b1, g1, g2, b2;
b1, g2, g1, b2; b2, g1, g2, b1 and b2, g2, g1, b1. Therefore, the probability is
4 1
P (A) = = .
24 6
542 Advanced Engineering Mathematics with MATLAB

9. The sample space consists of all three digit numbers chosen from 10 different
and nonrepeating digits. Therefore, n(S) equals 10!/(3!7!) = 720. If order
matters, then there will be a single winner and the probability of winning is
1/720. On the other hand, if order does not matter, then there are 3! = 6
possible winners. The probability therefore rises to 6/720 = 1/120.

10. The area of the sample space is 4. If A denotes the event that the point
falls inside the circle, its area is π. Therefore,

Area covered by set A π


P (A) = = .
Area covered by set S 4

11. Let A denote the event that Ed plays football and B denotes the event
that he wrestles. We know that P (A) = 0.2 and P (A ∩ B) = 0.1. Therefore,
P (B|A) = P (A ∩ B)/P (A) = 0.5.

12.
P (A2 ) = P (A2 |A1 )P (A1 ) + P (A2 |Ac1 )P (Ac1 )
     
3 4 4 48 4
= + =
51 51 51 51 52

13.
     
4 1 6 1 1
P (red) = P (red|H)P (H) + P (red|T )P (T ) = + = .
10 2 10 2 2

14. (a)
P (C) = 1 − P (E) = 0.8, P (D|E) = 1 − P (L|E) = 0.2,
P (L|C) = 1 − P (D|C) = 0.3

(b)

P (D) = P (E)P (D|E) + P (C)P (D|C) = (0.2)(0.2) + (0.8)(0.3) = 0.28

(c)
P (E|L)P (L) = P (L|E)P (E), P (L) = 1 − P (D).
P (E|L) = (0.8)(0.2)/(0.72) = 0.16/0.72 = 0.2083

15. Let A denote the event that the first selected point is greater than 1/4
while B denotes the event that the second selected point is less than 3/4.
Because P (A) = 3/4 and P (B) = 3/4, P (A ∩ B) = P (A)P (B) = 9/16.
Worked Solutions 543

16. Here we have p = 0.01 and n = 3. Then

3!
P3 (3) = (0.01)3 = 1 × 10−6 ,
3!0!
3!
P3 (2) = (0.99)(0.01)2 = 2.97 × 10−4 ,
2!1!
3!
P3 (1) = (0.99)2 (0.01) = 2.94 × 10−2 ,
1!2!
and
3!
P3 (0) = (0.99)3 = 0.9703.
0!3!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code For Experimenting
% with Intrinsic Function rand
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; N = 100; tests = 100;

for j = 1:tests
X1 = rand(1,N); icount = 0;
for i = 1:N
if (X1(i) <= 0.333333333) icount = icount + 1; end
end
num1(j) = j;
prob1(j) = icount / N;
end

N = 1000;
for j = 1:tests
X2 = rand(1,N); icount = 0;
for i = 1:N
if (X2(i) <= 0.333333333) icount = icount + 1; end
end
num2(j) = j;
prob2(j) = icount / N;
end

N = 10000;
for j = 1:tests
X3 = rand(1,N); icount = 0;
for i = 1:N
544 Advanced Engineering Mathematics with MATLAB

if (X3(i) <= 0.333333333) icount = icount + 1; end


end
num3(j) = j;
prob3(j) = icount / N;
end

plot(num1,prob1,’k’,num2,prob2,’b’,...
num3,prob3,’r’,’LineWidth’,1.5)
xlabel(’experiment number’,’FontSize’,20);
ylabel(’probability’,’FontSize’,20);
legend(’n = 100’,’n = 1000’,’n = 10000’)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code For Experimenting
% with Intrinsic Function randper
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; N = 30; icount = 0; classes = 20000;

% repeating the experiment "classes’’ times, see how many


% classes have students with identical birthdays

for iclass = 1:classes

% create the birthday within each class

for n = 1:N
perm = randperm(365); birthday(n) = perm(1);
end

% see if any of the birthdays are repeated.


If so, increase the counter ...
b = unique(birthday);
if (length(b) < N) icount = icount + 1; end
end

% compute the probability


probability = icount / classes

% now compute the exact probability


ratio = 1;
for n = 1:N-1
Worked Solutions 545

ratio = ratio * (365-n) / 365;


end

exact probability = 1 - ratio

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 16.3
P
1. Because xk pX [xk ] = 1, we have

X 1
X
pX [xk ] = pX [xk ] = (1 − p) + p = 1.
xk k=0

Therefore, the Bernoulli distribution is a proper probability mass function.


Now from Equation 16.3.12 we have that
X
FX (x) = pX [xk ].
x≤xk

Here we have only x0 = 0 and x1 = 1. Therefore, if x < 0, there are no terms


in the summation and FX (x) = 0. For 0 ≤ x < 1, there is a single term and
FX (x) = pX [x0 ] = 1 − p. Finally, for x ≥ 1, FX (x) = pX [x0 ] + p1 [x1 ] = 1.
Therefore, in summary,
( 0, x < 0,
FX (x) = 1 − p, 0 ≤ x < 1,
1, 1 ≤ x.

2. The chance of success during any one experiment is p = 0.1 while the
chance of failure q = 1 − p = 0.9. Because we have a Bernoulli distribution,
p[xi ] = 0.1 · 0.9i−1 , where i = 1, 2, 3, . . ..

3. If X = n denotes the random variable for successfully finding the nth


programmer who knows the programming language, then the probability mass
functions is
pX [xn ] = 0.5(0.95)n−1 .
Now, if N is the number of programmers that the company needs to interview,

P (X ≤ N ) = 1 − P (X > N ) = 0.75.

Therefore,

X
P (X > N ) = (0.5)(0.95)n−1 = 0.25,
n=N +1
546 Advanced Engineering Mathematics with MATLAB

or
(0.95)N = 0.25.

Solving this equation, we find that N = 27.

Section 16.4

1. The definition of cumulative distribution function is


Z x
FX (x) = pX (t) dt.
−∞

If x ≤ 0, FX (x) = 0 because the integrand is zero. For x > 0,


Z x
x
FX (x) = λe−λt dt = −e−λt 0
= 1 − e−λx .
0

In summary, 
0, x ≤ 0,
FX (x) =
1 − e−λx , 0 < x.

R∞
2. Because −∞
pX (x) dx = 1, then

Z 2 2
kx2
k x dx = = 2k = 1.
0 2 0

Therefore, k = 21 .
For x < 0, FX (x) = 0. For 0 < x < 2,
Z x
1 x2
FX (x) = 2 x dx = .
0 4

For x > 2,
Z 2
1
FX (x) = 2 x dx = 1.
0

In summary,
( 0, x ≤ 0,
FX (x) = x2 /4, 0 ≤ x < 2,
1, 2 ≤ x.
Finally,

1
P (1 < X ≤ 2) = FX (2) − FX (1) = 1 − 4 = 34 .
Worked Solutions 547
R∞
3. Because −∞
pX (x) dx = 1, then
Z ∞ Z 0 Z 1
pX (x) dx = k (1 + x) dx + k (1 − x) dx = 1
−∞ −1 0
  0   1
x2 x2
=k x+ +k x− =1
2 −1 2 0
= k = 1.

For x < −1, Z x


FX (x) = 0 dξ = 0.
−∞

For −1 < x < 0,


Z x x
ξ
FX (x) = (1 + ξ) dξ = ξ + = (x + 1)2 /2.
−1 2 −1

For 0 < x < 1,


Z 0 Z x
FX (x) = (1 + ξ) dξ + (1 − ξ) dξ
−1 0
0 x
ξ ξ
= ξ+ +ξ− = (1 + 2x − x2 )/2.
2 −1 2 0

For 1 < x, Z Z
0 1
FX (x) = (1 + ξ) dξ + (1 − ξ) dξ
−1 0
0 1
ξ ξ
= ξ+ +ξ− = 1.
2 −1 2 0

In summary,

 0, x < −1,

(1 + x)2 /2, −1 ≤ x < 0,
FX (x) = 2
 1 − (x − 1) /2,
 0 ≤ x < 1,
1, 1 ≤ x.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Central Limit Theorem
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; M = 100; delta S = 0.01; NUM = 10000000;


548 Advanced Engineering Mathematics with MATLAB

for num = 1:NUM


X = rand(M,1);
S(num) = sum(X) / M;
end

bincenters = [0.35:delta S:0.65]; bins = length(bincenters);


[n,S out] = hist(S,bincenters); n = n / (delta S*NUM)
bar h = bar(S out,n); bar child = get(bar h,’Children’);
set (bar child,’CData’,n);
xlabel(’S’); ylabel(’probability density’);
colormap(’Autumn’);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 16.5

1. Because px [0] = px [1] = 21 ,

E(X) = 12 (1 + 0) = 12 ,

and  
1 1 2 1 1 2
Var(X) = 2 0− 2 + 2 1− 2 = 14 .

2. First, we find the mean:



X p 1
E(X) = kpq k−1 = = ,
(1 − q)2 p
k=1

where q = 1 − p. Because E(X 2 ) = E[X(X − 1)] + E(X), and


X ∞
X
E[X(X − 1)] = k(k − 1)p(1 − p)k−1 = k(k − 1)pq k−2
k=1 k=2
2pq 2(1 − p)
= = ,
(1 − q)3 p2

then
2(1 − p) 1 2−p
E(X 2 ) = E[X(X − 1)] + E(X) = + = .
p2 p p2
Finally,
2 2−p 1 1−p
σX = Var(X) = E(X 2 ) − µ2X = 2
− 2 = .
p p p2
Worked Solutions 549

3. To find k, we have that


Z 2   2
x3 4k
k x(2 − x) dx = k x2 − = = 1.
0 3 0 3

Therefore, k = 3/4.
To find the mean,
Z 2   2
3 2 3 2x3 x4
E(X) = x (2 − x) dx = − = 1.
4 0 4 3 4 0

To find the variance, we first find


Z 2   2
3 2 3 3 x4 x5 6
E(X ) = x (2 − x) dx = − = .
4 0 4 2 5 0 5

Therefore,
6 1
Var(X) = E(X 2 ) − [E(X)]2 = −1= .
5 5

4.
Z 2  ν
1 √ 2a 
φ(ω) = 2 (a2 − x2 )ν− 2 cos(ωx) dx = π Γ ν+ 1
2 Jν (aω),
0 ω

where we have used Formula 3.771.8 from Gradshteyn, I. S., and I. M. Ryzhik,
1965: Table of Integrals, Series and Products. Academic Press, 1086 pp.

5. From Equation 16.5.18,


n  
X n  
X
n k n−k ikω n k n
φX (ω) = p q e = peiω q n−k = peiω + q .
k k
k=0 k=0

Now,
n−1
φ′X (ω) = nipeiω peiω + q
and
2 n−2 n−1
φ′′X (ω) = n(n − 1) ipeiω peiω + q + ni2 peiω peiω + q .

Therefore, φ′X (0) = inp and µX = np. Furthermore, φ′′X (0) = −n(n−1)p2 −np
and E(X 2 ) = (np)2 + npq. Therefore, Var(X) = npq.

6. From Equation 16.5.18,


∞ ∞ k
X k X λeiω
−λ λ ωi
= e−λ(1−e ) .
ωi
ikω −λ
φX (ω) = e e = e = e−λ eλe
k! k!
k=0 k=0
550 Advanced Engineering Mathematics with MATLAB

Now,
ωi
φ′X (ω) = iλeωi e−λ(1−e ) ,
and ωi ωi
φ′′X (ω) = −λ2 e2ωi e−λ(1−e ) − λeωi e−λ(1−e ) .
Therefore, φ′X (0) = λi and µX = λ. Furthermore, φ′′X (0) = −λ2 − λ and
E(X 2 ) = λ2 + λ. Therefore, Var(X) = λ.

7. From Equation 16.5.18,



X ∞
X k p
φX (ω) = pq k eikω = p qeωi = .
1 − qeωi
k=0 k=0

Now,
ipqeωi
φ′X (ω) = 2,
(1 − qeωi )
and
2pq 2 eωi pqeωi
φ′′X (ω) = − 3 − 2.
(1 − qeωi ) (1 − qeωi )
Therefore, φ′X (0) = iq/p and µX = q/p. Furthermore, φ′′X (0) = −2q 2 /p2 −q/p
and E(X 2 ) = 2q 2 /p2 + q/p. Therefore, Var(X) = q/p2 .

8. From Equation 16.5.19,


Z b
eiωx eiωb − eiωa iω ω2 2
φX (ω) = dx = = 1 + (b + a) − (a + ab + b2 ) + · · · .
a b−a iω(b − a) 2 6

Now,
i ω
φ′X (ω) = (b + a) − (a2 + ab + b2 ) + · · · ,
2 3
and
1
φ′′X (ω) = − (a2 + ab + b2 ) + · · · .
3
Therefore, φX (0) = i(a + b)/2 and µX = (a + b)/2. Furthermore, φ′′X (0) =

−(a2 + ab + b2 )/3, and E(X 2 ) = (a2 + ab + b2 )/3. Therefore, Var(X) =


(b − a)2 /12.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% MATLAB Code for the Monte Carlo Integration


and Importance Sampling

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Worked Solutions 551

clear; answer = pi/4; IEXP = 2000; M = 10;


x = rand(M,IEXP); f = sqrt(1-x.*x);

for iter = 1:IEXP


integral(iter) = 0;
for m = 1:M
integral(iter) = integral(iter) + f(m,iter);
end
integral(iter) = integral(iter) / M - answer;
end

% find the integral using Monte Carlo simulation

[n 1,xout 1] = hist(integral,20); width = xout 1(2) - xout 1(1)


n 1 = n 1 / (IEXP*width);

clear f x;

M = 50; x = rand(M,IEXP); f = sqrt(1-x.*x);

for iter = 1:IEXP


integral(iter) = 0;
for m = 1:M
integral(iter) = integral(iter) + f(m,iter);
end
integral(iter) = integral(iter) / M - answer;
end

[n 2,xout 2] = hist(integral,20); width = xout 2(2) - xout 2(1)


n 2 = n 2 / (IEXP*width);

clear f x; M = 100; x = rand(M,IEXP); f = sqrt(1-x.*x);

for iter = 1:IEXP


integral(iter) = 0;
for m = 1:M
integral(iter) = integral(iter) + f(m,iter);
end
integral(iter) = integral(iter) / M - answer;
end

[n 3,xout 3] = hist(integral,20); width = xout 3(2) - xout 3(1)


n 3 = n 3 / (IEXP*width);
clear f int x; M = 500; x = rand(M,IEXP); f = sqrt(1-x.*x);
552 Advanced Engineering Mathematics with MATLAB

for iter = 1:IEXP


integral(iter) = 0;
for m = 1:M
integral(iter) = integral(iter) + f(m,iter);
end
integral(iter) = integral(iter) / M - answer;
end

[n 4,xout 4] = hist(integral,20); width = xout 4(2) - xout 4(1)


n 4 = n 4 / (IEXP*width);

% plot the results

subplot(2,2,1); xlim([-0.2 0.2]); ylim([0 0.2]);


bar h = bar(xout 1,n 1); bar child = get(bar h,’Children’);
set(bar child,’CData’,n 1); title(’M = 10’,’FontSize’,20)
colormap(autumn); hold on
ylabel(’probability density’,’FontSize’,20)

subplot(2,2,2)
bar h = bar(xout 2,n 2); bar child = get(bar h,’Children’);
set(bar child,’CData’,n 2); title(’M = 50’,’FontSize’,20)
colormap(autumn); hold on

subplot(2,2,3)
bar h = bar(xout 3,n 3); bar child = get(bar h,’Children’);
set(bar child,’CData’,n 3); title(’M = 100’,’FontSize’,20)
colormap(autumn): hold on
xlabel(’approximate - exact value of the integral’,
’FontSize’,20)
ylabel(’probability density’,’FontSize’,20)

subplot(2,2,4)
bar h = bar(xout 4,n 4); bar child = get(bar h,’Children’);
set(bar child,’CData’,n 4); title(’M = 500’,’FontSize’,20)
colormap(autumn); hold on
xlabel(’approximate - exact value of the integral’,...
’FontSize’,20)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 16.6

1. We have a binomial random variable with


   k  4−k
4 1 1
pX [xk ] = .
k 2 2
Worked Solutions 553

Therefore,
(a)
   0  4
4 1 1 1
pX [0] = = ,
0 2 2 16
(b)
   1  3
4 1 1 1
pX [1] = = ,
1 2 2 4
(c)
15
pX [1] + pX [2] + pX [3] + pX [4] = 1 − pX [0] = ,
16
and
(d)
   4  0
4 1 1 1
pX [4] = = .
4 2 2 16

2. This is an example of a binomial distribution where the random variable X


denotes success if the digit equals 1 and failure if the digit equals 0. Because
there is equal probability of obtaining a zero or one, p = 0.5. Thus,
   3  3
6 1 1 6! 20
P (X = 3) = pX [3] = = (0.5)6 = = 0.3125.
3 2 2 3!3! 64

The easiest way of computing P (X ≥ 3) is

P (X ≥ 3) = 1 − P (X ≤ 2).

Now
2    k  6−k
X  
6 1 1 1 6! 6! 6!
P (X ≤ 2) = = + +
k 2 2 26 0!6! 1!5! 2!4!
k=0
1 22
= (1 + 6 + 15) = = 0.34375.
64 64
Therefore,
P (X ≥ 3) = 1 − 0.34375 = 0.65625.

3. We have an experiment with 2n trials and n successes. Therefore,


 
2n 1 1 · 2 · 3 · 4 · 5 · · · 2n
pX [xn ] = =
n 22n (1 · 2 · 3 · · · n)(1 · 2 · 3 · · · n)22n
(1 · 3 · 5 · · · 2n − 1)(2 · 4 · 6 · · · 2n)
=
(2 · 4 · 6 · · · 2n)(2 · 4 · 6 · · · 2n)
1 · 3 · 5 · · · 2n − 1
=
2 · 4 · 6 · · · 2n
554 Advanced Engineering Mathematics with MATLAB

4. The probability is given by

(λt)k −λt
P (k) = e ,
k!
with
3 times
λ= = 1 time/hr.
3 hr
The probability of no calls is

30 −3
P (0) = e = 0.0498.
0!
The probability that you will receive 6 or more calls is

X 3k
P (k ≥ 6) = e−3 = 0.0839.
k!
k=6

The probability that you will not receive more than two calls is
2
X 3k
P (k ≤ 2) = pX [0] + pX [1] + pX [2 = e−3 = 0.4232.
k!
k=0

5. Let the discrete random variable X denote the number of defective DVDs.
A package has defective DVDs if X > 0. Therefore, the probability that a
package contains a defective DVD,
10!
P (X > 0) = 1 − P (X = 0) = 1 − (0.999)10 (0.001)0 = 0.01,
0!10!
and
P (X > 1) = 1 − P (X = 0) − P (X = 1)
10! 10!
=1− (0.999)10 (0.001)0 − (0.999)9 (0.001)1 = 9 × 10−5 .
0!10! 1!9!

6. Let X denote the discrete random variable that equals the number of
students who show up. Then the probability of overbooking the class is
22! 22!
P (X = 21) + P (X = 22) = (0.95)21 (0.05)1 + (0.95)22 (0.05)0
21!1! 22!0!
= 0.6992.

7. Z 150 150
100 100 1
P (T < 150) = =− =
100 t2 t 100 3
Worked Solutions 555

Therefore,
   3  2
5 1 2
P (X) = = 0.1646
3 3 3

Section 16.7

1.    
7 8 5
xi yj 5 − x i − yj
pXY [xi , yj ] =   ,
20
5
where xi = 0, 1, 2, 3, 4, 5, yj = 0, 1, 2, 3, 4, 5 and 0 ≤ xi + yj ≤ 5.

2. In the first toss, pX [xi ] = 1/6 for i = 1, 2, 3, 4, 5, 6 and pY [yj ] = 1/6 for
j = 1, 2, 3, 4, 5, 6 on the second toss. Then by the convolution theorem,
6
X
pZ [zk ] = pX [xi ]pY [zk − xi ],
i=1

where k = 2, 3, . . . , 12. Preforming the calculation, we find that pZ [2] = 1/36,


pZ [3] = 2/36, pZ [4] = 3/36, pZ [5] = 4/36, pZ [6] = 5/36, pZ [7] = 6/36,
pZ [8] = 5/36, pZ [9] = 4/36, pZ [10] = 3/36, pZ [11] = 2/36, pZ [12] = 1/36.

3.

Cov(aX + b, cY + d) = E[acXY + adX + bcY + bd]


− [aE(X) + b][cE(Y ) + d]
= acE(XY ) + adE(X)X + bcE(Y ) + bd
− acE(X)E(Y ) − adE(X) − bcE(Y ) − bd
= acE(XY ) − acE(X)E(Y ) == ac Cov(X, Y ).

Convolution Project

From Equation 16.7.36, we have that


Z ∞ Z 1
pZ (z) = pX (z − y)pY (y) dy = [H(z − y) − H(z − y − 1)] dy.
−∞ 0

If z < 0 or z > 2, then the integrand is always zero. If 0 < z < 1, the second
term in the square brackets always equals zero and
Z z
pZ (z) = dy = z.
0
556 Advanced Engineering Mathematics with MATLAB

If 1 < z < 2, the first Heaviside is always on and


Z 1 Z z−1
pZ (z) = dy − dy = 2 − z.
0 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code For Convolution Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; N = 10000; delta bin = 0.1;


X = rand(1,N); Y = rand(1,N); Z = X + Y;

bincenters = 0:delta bin:2; xaxis = [0:0.1:2]’;


axis([-1 3 0 1]); [n,xout] = hist(Z,bincenters)
n = n / (delta bin*N);
bar h = bar(xout,n); bar child = get(bar h,’Children’);
set(bar child,’CData’,n); colormap(autumn)
xlabel(’\it z’,’fontsize’,25)
ylabel(’Estimated \it p Z(z)’,’fontsize’,25)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 17.0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Gambler’s Ruin Problem
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear
icount = 0; t = [0:1:100000]; tosses = length(t); b = [10];
levels = length(b); iruns = 5000; y = zeros(1,tosses+1);

% create 3 realizations of this game


for irun = 1:3

% compute the flip of the coin


uniform = rand(1,tosses); x = round(uniform); z = -1 + 2*x;
% find net winnings after each flip
if (irun == 1) y1 = cumsum(z); end
if (irun == 2) y2 = cumsum(z); end
Worked Solutions 557

if (irun == 3) y3 = cumsum(z); end


end

% plot these 3 realizations

subplot(2,1,1); hold on
plot(t,y1,’k-’); plot(t,y2,’b-’); plot(t,y3,’r-’);
axis([0 1000 -50 50])
xlabel(’number of tosses’,’FontSize’,20)
ylabel(’gain/loss (in dimes)’,’FontSize’,20)

temp = zeros(1,iruns);

% compute the probability density function

for irun = 1:iruns

% compute the result of coin flipping

uniform = rand(1,tosses); x = round(uniform); z = -1 + 2*x;

% find the winning (or losses) at the end of each flip

y = cumsum(z);

% find all of times at which your winnings exceed a given level

b 1 = find(y >= b(1));

% save the time at which you would win all of the money

if (length(b 1) > 0)
icount = icount+1; temp(icount) = t(b 1(1));
end

end

icount
mean(temp)

% create the probability density function and plot it

d edge = 50; edges = [0:d edge:1000];


subplot(2,1,2); hold on
nn = histc(temp,edges); nn = nn / (iruns*d edge);
558 Advanced Engineering Mathematics with MATLAB

M = length(nn)-1;
for n = 1:M
mm(n) = nn(n);
edge(n) = (edges(n+1)+edges(n))/2;
end
bar h = bar(edge,mm); bar child = get(bar h,’Children’);
set(bar child,’CData’,mm); axis([0 1000 0 0.005])
colormap(Autumn)
xlabel(’N’,’fontsize’,20)
ylabel(’Estimated PDF’,’fontsize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 17.1

1. Because this probability density function is for a Gaussian distribution, we


2
see from inspection that µX = 0 and σX = 1. Therefore,

µX (t) = E[X(t)] = µX cos(ωt) = 0.

Similarly,
2 2
σX (t) = Var[X(t)] = σX cos(ωt) = cos(ωt).

2. From the definition of expectation,


Z π π
1 A
E(Xt ) = A cos(ωt + θ) dθ = sin(ωt + θ) = 0.
−π 2π 2π −π

For the autocorrelation


CX (t1 , t2 ) = E[A cos(ωt1 + Θ)A cos(ωt2 + Θ)]
Z π
2 1
=A cos(ωt1 + θ) cos(ωt2 + θ) dθ
−π 2π
Z
A2 π
= [cos(ωt1 + +ωt2 + 2θ) + cos(ωt1 − ωt2 )] dθ
4π −π
A2
= cos(ωt1 − ωt2 ).
2

3. For t1 = t2 ,

RX (t1 , t2 ) = E[X 2 (t1 )] = 12 · p + 02 · (1 − p) = p.

On the other hand, for t1 6= t2 ,

RX (t1 , t2 ) = E[X(t1 )]E[X(t2 )] = p2 .


Worked Solutions 559

For t1 = t2 ,

CX (t1 , t2 ) = RX (t1 , t2 ) − µ2X (t) = p − p2 = p(1 − p).

On the other hand, for t1 6= t2 ,

CX (t1 , t2 ) = RX (t1 , t2 ) − µ2X (t) = p2 − p2 = 0.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Autocorrelation Project
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear
deltat = 0.01; t = [0:deltat:12]; N = length(t)

for m = 1:500

%%%%%%%%%%%%%%%% create telegraph signal %%%%%%%%%%%%%%%%%%%%

random = rand(1,1);

if (random >= 0.5)


sgn = 1; telegraph(1,m) = sgn;
else
sgn = -1; telegraph(1,m) = sgn;
end

N switch = 10000; % Number of switches in realization


lambda = 1; % Switching rate (switches per second)
S = rand(1,N switch); % Uniform random variable
T = - log(S)/lambda; % Transform to an exponential
% random variable
V = cumsum(T); % Switching times

icount = 1;

for k = 2:N
if ( t(k) >= V(icount) )
sgn = - sgn; icount = icount+1;
end
telegraph(k,m) = sgn;
end
560 Advanced Engineering Mathematics with MATLAB

%%%%%%%%%%%%%%%% create another telegraph signal %%%%%%%%%%%%%

t s = 2; istart = t s/deltat + 1;
tau = [0:deltat:0.75]; length(tau)

for i = 1:length(tau)

R X(i) = 0;

for m = 1:500
R X(i) = R X(i) + telegraph(istart,m)*telegraph(istart+i-1,m);
end

R X(i) = R X(i) / 500;


exact(i) = exp(-2*lambda*tau(i));

end

subplot(1,2,1)
plot(tau,R X,’LineWidth’,2)
hold on
plot(tau,exact,’--k’,’LineWidth’,2)
hold on
xlabel(’\tau’,’FontSize’,25)
ylabel(’\it R X’,’FontSize’,25)

clear R X
for i = 1:length(tau)

R X(i) = 0; istop = length(t) - i;

for m = 1:istop
R X(i) = R X(i) + telegraph(m,200)*telegraph(m+i-1,200);
end

R X(i) = R X(i) / istop;


exact(i) = exp(-2*lambda*tau(i));

end

subplot(1,2,2)
plot(tau,R X,’LineWidth’,2)
hold on
plot(tau,exact,’--k’,’LineWidth’,2)
Worked Solutions 561

xlabel(’\tau’,’FontSize’,25)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 17.2

1.
Z ∞ Z ∞
SX (ω) = RX (τ )e−iωτ dτ = RX (τ ) [cos(ωτ ) − sin(ωτ )] dτ
−∞ −∞
Z ∞ Z ∞
= RX (τ ) cos(ωτ ) dτ = 2 RX (τ ) cos(ωτ ) dτ.
−∞ 0

Section 17.3

1. From Equation 17.3.14, we have a = 1/4 and b = 1/2 and

a 1 b 1 1 3
= , , 1−a−b= , a+b= .
a+b 3 a+b4 4 4

Therefore, from Equation 17.3.15,


 
2/3 + (1/3)(1/4)n 1/3 − (1/3)(1/4)n
Pn = .
2/3 − (2/3)(1/4)n 1/3 + (2/3)(1/4)n

Consequently, taking the limit as n → ∞,


 
∞ 2/3 1/3
P = .
2/3 1/3

2. The transition matrix is


 
1 0
P = ,
α 1−α

Because a = 0 and b = α,
 
(n) 1 0
P = ,
1 − (1 − α)n (1 − α)n

Taking the limit of n → ∞,


 
1 0
P (∞) = ,
1 0
562 Advanced Engineering Mathematics with MATLAB

The expected time in each stage at n training sessions,


(n)
µ00 = n,
(n)
µ10 = n − (1 − α) [1 − (1 − α)n ] /α,
(n)
µ01 = 0,
(n)
µ11 = (1 − α) [1 − (1 − α)n ] /α.

Section 17.4

1. Multiplying Equation (1) by z n and summing from n = 0 to N − 1, we


obtain
N
X XN N
X −1
dpn
zn = −(ρ + ν)et/α nz n pn + ρet/α (n + 1)z n pn+1 ,
n=0
dt n=0 n=0

after including Equation (2). Because


N
∂φ X n dpn
= z ,
∂t n=0
dt

N
∂φ X n
z = nz pn (t),
∂z n=0

and
N
X −1
∂φ
= (n + 1)z n pn+1 (t),
∂z n=0

we substitute these results into the first equation. This gives the partial
differential equation.
From the partial differential equation, we obtain

dt dz
= .
e−t/α ρ − (ρ + ν)z

Integrating this equation, we obtain

ln[ρ − (ρ + ν)z]
ξ(z, t) = αet/α − .
ρ+ν

There, the general solution is φ(z, t) = Φ[ξ(z, t)]. Turning to initial condition,
 
ln[ρ − (ρ + ν)z]
φ(z, 0) = Φ α − = zN .
ρ+ν
Worked Solutions 563

Setting
ln[ρ − (ρ + ν)z]
y =α− ,
ρ+ν
we find that
ρ exp[(ρ + ν)(α − y)]
z= − .
ρ+ν ρ+ν
Therefore,
 N
ρ exp[(ρ + ν)(α − y)]
Φ(y) = − .
ρ+ν ρ+ν
The final solution follows by substituting ξ(z, t) for y.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Stochastic Chemical Reaction
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

(a) Japanese code

clear; deltat = 0.00001;


const1 = 10; const2 = 0.01; const3 = 10;
konst1 = const1*deltat; konst2 = const2*deltat;
konst3 = const3*deltat;
% initial x and y
clear x y p guess
% introduce the value from the uniformly distributed
p guess = rand(1,3000001); t = zeros(1,301);
x = zeros(1,3000001); X = zeros(1,301);
y = zeros(1,3000001); Y = zeros(1,301);

% initialize the dependent variables


icount = 1; t(1) = 0; x(1) = 1000; y(1) = 1000;
X(1) = 1000; Y(1) = 1000;

% compute a sample function

for n = 1:3000000

p1 = konst1*x(n); p2 = konst2*x(n)*y(n) + p1;


p3 = konst3*y(n) + p2;

if (p guess(n) <= p2)

if (p guess(n) <= p1)


564 Advanced Engineering Mathematics with MATLAB

x(n+1) = x(n)+1; y(n+1) = y(n);


else
x(n+1) = x(n)-1; y(n+1) = y(n)+1;
end

else
x(n+1) = x(n);
if (p guess(n) <= p3)
y(n+1) = y(n)-1;
else
y(n+1) = y(n);
end

end

if (mod(n,10000) == 0)
icount = icount+1;
t(icount) = n*deltat; X(icount) = X(icount) + x(n+1);
Y(icount) = Y(icount) + y(n+1);
end % end of sampling of the x and y values
end % end of i loop
subplot(2,1,1); hold on; plot(t,X,’-k’)
xlabel(’\it time’,’FontSize’,25)
ylabel(’\it number of x molecules’,’FontSize’,25)
axis([0 30 0 3000])

subplot(2,1,2); hold on; plot(t,Y,’-k’)


xlabel(’\it time’,’FontSize’,25)
ylabel(’\it number of y molecules’,’FontSize’,25)
axis([0 30 0 3000])

(b) Gisslipie code

clear
const1 = 10; const2 = 0.01; const3 = 10; N = 1000000;
% initial x and y
icount = 1; t(1) = 0; x(1) = 1000; y(1) = 1000;
x np1 = x(1); y np1 = y(1); time = 0;
% introduce the value from the uniformly distributed
r1 = rand(1,N); r2 = rand(1,N); r3 = log(1./r1);
% compute a sample function
format long g

for n = 1:N
Worked Solutions 565

x n = x np1; y n = y np1;

a(1) = const1*x n; a(2) = const2*x n*y n;


a(3) = const3*y n; a0 = sum(a);

tau = r3(n)/a0; check = a0*r2(n); time = time + tau;

if ( check <= a(1)+a(2) )


if (check <= a(1))
x np1 = x n+1; y np1 = y n;
else
x np1 = x n-1; y np1 = y n+1;
end
else
x np1 = x n; y np1 = y n-1;
end

if (mod(n,1000) == 0)
icount = icount + 1;
t(icount) = time; x(icount) = x np1; y(icount) = y np1;
end
end % end of i loop

subplot(2,1,1); hold on; plot(t,x,’-k’)


xlabel(’\it time’,’FontSize’,25)
ylabel(’\it number of x molecules’,’FontSize’,25)
axis([0 30 0 3000])

subplot(2,1,2); hold on; plot(t,y,’-k’);


xlabel(’\it time’,’FontSize’,25)
ylabel(’\it number of y molecules’,’FontSize’,25)
axis([0 30 0 3000])

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 17.5

1. We begin by multiplying Equation 17.5.18 by z n and then summing from


n = 0 to n = ∞. We find that
X∞ ∞
X X∞
dpn n
z = −λ pn (t)z n − λ pn−1 (t)z n .
n=0
dt n=0 n=0

Now, because
X∞
∂F dpn n
= z ,
∂t n=0
dt
566 Advanced Engineering Mathematics with MATLAB

and

X ∞
X ∞
X
zF = pn (t)z n+1 = pk−1 (t)z k = pn−1 (t)z n ,
n=0 k=1 n=0

since p−1 (t) = 0, the first equation becomes the partial differential equation

∂F
= λ(z − 1)F, F (z, 0) = 1.
∂t

The general solution to this differential equation is F (z, t) = C(z)eλ(z−1)t .


From the initial condition, C(z) = 1. Therefore,
 
−λt λzt −λt λzt λ2 z 2 t2
F (z, t) = e e =e 1+ + + ··· .
1! 2!

Consequently,
(λt)n
pn (t) = e−λt .
n!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Output from a Filter
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear

deltat = 0.05; const 1 = 0.5*deltat; t = [0:deltat:2000];


N = length(t); x 0 = 0; y(1) = x 0;

%%%%%%%%%%%%%%% create telegraph signal %%%%%%%%%%%%%%%

random = rand(1,1);
if (random >= 0.5)
sgn = 1;
forcing(1) = sgn;
else
sgn = -1;
forcing(1) = sgn;
end

N switch = 10000; % Number of switches in realization


lambda = 1.9; % Switching rate (switches per second)
S = rand(1,N switch); % Uniform random variable
% Transform to an exponential random variable
Worked Solutions 567

T = - log(S)/lambda;
V = cumsum(T); % Switching times
icount = 1;

for k = 2:N
if ( t(k) >= V(icount) )
random = rand(1,1);
if (random >= 0.5)
sgn = 1;
else
sgn = -1;
end;
icount = icount+1;
end
forcing(k) = sgn;
end

%%%%%%%%%%%% find solution to differential equation %%%%%%%%%$

for n = 2:N

clear vector

vector = exp(t(1:n-1)-t(n)) .* forcing(1:n-1) ...


+ exp(t(2: n )-t(n)) .* forcing(2: n );
y(n) = const 1*sum(vector);

end

clear forcing t vector

d edge = 0.1; edges = [-1.15:d edge:1.15]


[n,xout] = hist(y,edges); n = n / (d edge*N);
bar h = bar(edges,n); bar child = get(bar h,’Children’);
set(bar child,’CData’,n); colormap(autumn)
xlabel(’\it y’,’fontsize’,25)
ylabel(’\it P(y)’,’fontsize’,25)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 18.0

1. At any point away from tn , N (t + dt) = N (t) and dN (t) = 0. At t = tm ,


N (t + dt) = N (t) + 1 and dN (t) = 1.
568 Advanced Engineering Mathematics with MATLAB

2.

dX(t) = X(t + dt) − X(t) = (−1)N (t+1) − (−1)N (t)


h i
= (−1)N (t)+dN (t) − (−1)N (t) = (−1)N (t) (−1)dN (t) − 1 .

Because dN (t) is either zero or one for all t, (−1)dN (t) − 1 = 0 or −2, respec-
tively. Therefore,
dX(t) == −2X(t) dN (t).

3.

d[c X(t)] = c X(t + dt) − c X(t) = c [X(t + dt) − X(t)] = c dX(t).

d[X(t) ± Y (t)] = [X(t + dt) ± Y (t + dt)] − [X(t) ± Y (t)]


= [X(t + dt) − X(t)] ± [Y (t + dt)] − Y (t)]
= dX(t) ± dY (t).
d[X(t)Y (t)] = X(t + dt)Y (t + dt) − X(t) ∗ Y (t)
= [X(t + dt) − X(t)][Y (t + dt) − Y (t)] + X(t)[Y (t + dt) − Y (t)]
+ [X(t + dt) − X(t)] ∗ Y (t)
= X(t) dY (t) + Y (t) dX(t) + dX(t) dY (t)

Section 18.1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code Used in Low-Pass Filter With Random Input
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear deltat = 0.01; const 1 = 0.5*deltat;


t = [0:deltat:4]; N = length(t); x 0 = 1; iruns = 20000;

eexp neg = exp(-t); eexp pos = const 1*exp(t);

for irun = 1:iruns

y(1) = x 0;
forcing = randn(1,N);
vector = eexp pos(1:N-1).*forcing(1:N-1)
+ eexp pos(2:N).*forcing(2:N);
integral = cumsum(vector);
Worked Solutions 569

y(2:N) = x 0 * eexp neg(2:N) + eexp neg(2:N) .* integral(1:N-1);


forcing save(1:N,irun) = forcing; y save(1:N,irun) = y;

end % end of the irun do loop

for n = 1:N

for m = 1:iruns
temp1(m) = forcing save(n,m); temp2(m) = y save(n,m);
end

% compute the mean and variance of the filter

mean forcing(n) = mean(temp1); mean response(n) = mean(temp2);


var forcing(n) = var(temp1); var response(n) = var(temp2);
end

% compute the exact mean and variance


for n = 1:21

t1(n) = 0.2*(n-1);

exact mean(n) = x 0*exp(-t1(n));


exact var(n) = 1 - exp(-2*t1(n));
exact var(n) = const 1*exact var(n);

end

% plot results

subplot(2,2,1); plot(t,mean forcing,’k-’)


ylabel(’mean of forcing’,’FontSize’,20)

subplot(2,2,2); hold on
plot(t,mean response,’k-’); plot(t1,exact mean,’r+’)
ylabel(’mean of response’,’FontSize’,20)

subplot(2,2,3); plot(t,var forcing,’k-’)


xlabel(’t’,’FontSize’,20)
ylabel(’variance of forcing’,’FontSize’,20)

subplot(2,2,4); hold on
plot(t,var response,’k-’); plot(t1,exact var,’r+’)
xlabel(’t’,’FontSize’,20)
570 Advanced Engineering Mathematics with MATLAB

ylabel(’variance of response’,’FontSize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

MATLAB Code Used First-Passage Problem


with Random Vibrations

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% initialize constants used in the computations


clear; deltat = 0.05; const 1 = 0.5*deltat;
t = [0:deltat:10000]; N = length(t)
xi = 0.05; radical = sqrt(1-xi*xi); const 2 = xi/radical;
b = [0.4:0.4:1.6]; levels = length(b); x 0 = 0; xp 0 = 0;
icount 1 = 0; icount 2 = 0; icount 3 = 0; icount 4 = 0;
iruns = 50000;

% using the trapazoidal rule, numerically


% integrate Equation 17.3.28
% do this for ‘‘iruns’’ realization

eexp neg = exp(-xi*t); eexp pos = exp( xi*t);


ccos = cos(radical*t); ssin = sin(radical*t);
cos neg = eexp neg .* ccos / radical;
sin neg = eexp neg .* ssin / radical;
cos pos = const 1 * eexp pos .* ccos;
sin pos = const 1 * eexp pos .* ssin;

for irun = 1:iruns

y(1) = x 0; forcing = randn(1,N);


vector1 = cos pos(1:N-1) .* forcing(1:N-1) ...
+ cos pos(2: N ) .* forcing(2: N );
vector2 = sin pos(1:N-1) .* forcing(1:N-1) ...
+ sin pos(2: N ) .* forcing(2: N );

integral1 = cumsum(vector1); integral2 = cumsum(vector2);

y(2:N) = x 0 .* (cos neg(2:N) + const 2.*sin neg(2:N)) ...


+ xp 0 .* sin neg(2:N) / radical ...
+ sin neg(2:N) .* integral1(1:N-1) ...
- cos neg(2:N) .* integral2(1:N-1);

b 1 = find(y >= b(1)); b 2 = find(y >= b(2));


b 3 = find(y >= b(3)); b 4 = find(y >= b(4));
Worked Solutions 571

if (length(b 1) > 0)
icount 1 = icount 1+1; temp1(icount 1) = t(b 1(1)); end
if (length(b 2) > 0)
icount 2 = icount 2+1; temp2(icount 2) = t(b 2(1)); end
if (length(b 3) > 0)
icount 3 = icount 3+1; temp3(icount 3) = t(b 3(1)); end
if (length(b 4) > 0)
icount 4 = icount 4+1; temp4(icount 4) = t(b 4(1)); end

end % end of the irun do loop

clear ccos cos neg cos pos eexp neg eexp pos ssin sin neg sin pos
clear forcing integral1 integral2 vector1 vector2 y

length(temp1); length(temp2); length(temp3); length(temp4);


mean(temp1); mean(temp2); mean(temp3); mean(temp4);

% plot your probability density distributions

d edge = 2.5; edges = [0:d edge:50];


subplot(2,2,1); hold on
nn = histc(temp1,edges); nn = nn / (iruns*d edge);
M = length(nn)-1;
for n = 1:M
mm(n) = nn(n); edge(n) = (edges(n+1)+edges(n))/2;
end
bar h = bar(edge,mm); bar child = get(bar h,’Children’);
set(bar child,’CData’,mm); axis([0 50 0 0.08]);
colormap(Autumn)
title([’\it b = ’,num2str(b(1))],’FontSize’,20)
ylabel(’Estimated PDF’,’fontsize’,20)

clear edges; d edge = 10; edges = [0:d edge:200];


subplot(2,2,2); hold on
nn = histc(temp2,edges); nn = nn / (iruns*d edge);
M = length(nn)-1;
for n = 1:M
mm(n) = nn(n); edge(n) = (edges(n+1)+edges(n))/2;
end
bar h = bar(edge,mm); bar child = get(bar h,’Children’);
set(bar child,’CData’,mm); axis([0 200 0 0.015]);
colormap(Autumn)
title([’\it b = ’,num2str(b(2))],’FontSize’,20)
ylabel(’Estimated PDF’,’fontsize’,20)
572 Advanced Engineering Mathematics with MATLAB

clear edges; d edge = 50; edges = [0:d edge:1000];


subplot(2,2,3); hold on
nn = histc(temp3,edges); nn = nn / (iruns*d edge);
M = length(nn)-1;
for n = 1:M
mm(n) = nn(n); edge(n) = (edges(n+1)+edges(n))/2;
end
bar h = bar(edge,mm); bar child = get(bar h,’Children’);
set(bar child,’CData’,mm); axis([0 1000 0 0.003]);
colormap(Autumn)
title([’\it b = ’,num2str(b(3))],’FontSize’,20)
xlabel(’\it\omega 0T’,’fontsize’,20)
ylabel(’Estimated PDF’,’fontsize’,20)

clear edges d edge = 100; edges = [0:d edge:2000];


subplot(2,2,4); hold on
nn = histc(temp4,edges); nn = nn / (iruns*d edge);
M = length(nn)-1;
for n = 1:M
mm(n) = nn(n); edge(n) = (edges(n+1)+edges(n))/2;
end
bar h = bar(edge,mm); bar child = get(bar h,’Children’);
set(bar child,’CData’,mm); axis([0 2000 0 0.0002])
colormap(Autumn)
title([’\it b = ’,num2str(b(4))],’FontSize’,20)
xlabel(’\it\omega 0T’,’fontsize’,20)
ylabel(’Estimated PDF’,’fontsize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

MATLAB Code For the Wave Equation


with Random Vibrations

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; deltat = 0.01; tau = [0:deltat:10];


iruns = 10000; omega = 2; dt = 0.1; dx = 0.1;
ccos = 0.5*cos(omega*tau)*deltat; ccos(1) = 0.5*ccos(1);

for TT = 1:50

clear tau

t = TT*dt; tau = [0:deltat:t]; M = length(tau);


Worked Solutions 573

% create arrays for plotting

for XX = 1:121
x = -6 + dx*(XX-1);
t array(1:M) = t; t plot(XX,TT) = t;
x array(1:M) = x; x plot(XX,TT) = x;

for irun = 1:iruns

X = randn(1,M);
arg = t array - tau - abs(X - x array);
u(irun) = 0;

% are there any nonzero values for the integrand?


b = find(arg >= 0);

% use the trapezoidal rule to compute the solution

if (length(b) > 0)

cosine(1:M) = ccos(1:M);
N = max(b); dummy = cosine(b); u(irun) = sum(dummy);

% if the integrand at the right endpoint is nonzero,


% modify so that it is half of an interior point
if (N == M) u(irun) = u(irun) - 0.5*cosine(M); end

end % end of if test to make sure there are points to integrate

end % end of the irun do loop

% compute the mean of the ensembles at grid point (x,t)

average(XX,TT) = mean(u);

% compute the variance of the ensembles at grid point (x,t)

variance(XX,TT) = var(u);

end % end of distance loop


end % end of time loop

% plot solution
574 Advanced Engineering Mathematics with MATLAB

subplot(1,2,1); hold on
surf(x plot,t plot,average); axis([-6 6 0 5 -0.2 0.2]);
colormap(autumn)
xlabel(’\it x’,’Fontsize’,25); ylabel(’\it t’,’Fontsize’,25)
zlabel(’\it mean’,’Fontsize’,25)

subplot(1,2,2); hold on
surf(x plot,t plot,variance); axis([-6 6 0 5 0 0.001]);
colormap(autumn)
xlabel(’\it x’,’Fontsize’,25); ylabel(’\it t’,’Fontsize’,25)
zlabel(’\it variance’,’Fontsize’,25)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 18.2

1. " #
X∞
(−1)n−1 a2n−1 2n−1
E{sin[aB(t)]} = E B (t)
n=1
(2n − 1)!
X∞
(−1)n−1 a2n−1  2n−1 
= E B (t) = 0
n=1
(2n − 1)!

2.
" ∞
# ∞
X (−1)n a2n 2n X (−1)n a2n  2n 
E{cos[aB(t)]} = E B (t) = E B (t)
n=0
(2n)! n=0
(2n)!
X∞
(−1)n 2 n
= (a t)
n=0
2n n!

3. " #
X∞ X∞
an n an
E{exp[aB(t)]} = E B (t) = E[B n (t)]
n=0
n! n=0
n!
X∞  2 n  2 
1 a t a t
= = exp
n=0
n! 2 2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code Used In the Probabilistic Solution Method
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Worked Solutions 575

clear

iruns = 3200; isteps = 2000; N = 20;

V = zeros(N,N);
V (1:N, N ) = [0:1/(N-1):1];
V1(1:N,1:N) = V(1:N,1:N); V2(1:N,1:N) = V(1:N,1:N);
V3(1:N,1:N) = V(1:N,1:N); V4(1:N,1:N) = V(1:N,1:N);
for j = 1:N
for i = 1:N
XX(i,j) = (i-1)/(N-1);
YY(i,j) = (j-1)/(N-1);
end; end

for j = 2:N-1
for i = 2:N-1

for irun = 1:iruns

iflag = 0; index = i; jflag = 0; jndex = j;

random = rand(1,isteps); % introduce an uniform distribution

iwalk(1) = i; jwalk(1) = j;
for istep = 2:isteps

if ( (iflag == 0) & (jflag == 0) )

iflag = 0; index = i; jflag = 0; jndex = j;

% for each time step, get the value from an uniform distribution
random = rand(1,isteps);

iwalk(1) = i; jwalk(1) = j;
for istep = 2:isteps

if ( (iflag == 0) & (jflag == 0) )

if ( random(istep) <= 0.5 ) % if east-west step, do this

if ( random(istep) <= 0.25 )


index = index + 1; iwalk(istep) = index; jwalk(istep) = jndex;
else
index = index - 1; iwalk(istep) = index; jwalk(istep) = jndex;
576 Advanced Engineering Mathematics with MATLAB

end

if (index == 1) iflag = 1; end % have reached west boundary


if (index == N) iflag = 1; end % have reached east boundary

else % else do north-south step

if ( random(istep) <= 0.75 )


jndex = jndex + 1; iwalk(istep) = index; jwalk(istep) = jndex;
else
jndex = jndex - 1; iwalk(istep) = index; jwalk(istep) = jndex;
end

if (jndex == 1) jflag = 1; end % have reached south boundary


if (jndex == N) jflag = 1; end % have reached north boundary

end % end of separation of east-west vs. north-south steps

end % stop random walk at boundary

end % end of the random walk

V boundary(irun) = V(index,jndex);

end % end of the realizations

temp = cumsum(V boundary);

V1(i,j) = temp( 50) / 50;


V2(i,j) = temp( 200) / 200;
V3(i,j) = temp( 800) / 800;
V4(i,j) = temp(3200) / 3200;

clear iwalk jwalk random

end; end % end of finding the potential

% plot solution

subplot(2,2,1)
hold on
surf(XX,YY,V1); axis([0 1 0 1 0 1]);
colormap(Spring)
xlabel(’\it x’,’Fontsize’,25); ylabel(’\it y’,’Fontsize’,25)
zlabel(’\it u(x,y)’,’Fontsize’,25)
Worked Solutions 577

title(’ 50 realizations ’,’FontSize’,25)

subplot(2,2,2)
hold on
surf(XX,YY,V2); axis([0 1 0 1 0 1]);
colormap(Spring)
xlabel(’\it x’,’Fontsize’,25); ylabel(’\it y’,’Fontsize’,25)
zlabel(’\it u(x,y)’,’Fontsize’,25)
title(’ 200 realizations ’,’FontSize’,25)

subplot(2,2,3)
hold on
surf(XX,YY,V3); axis([0 1 0 1 0 1]);
colormap(Spring)
xlabel(’\it x’,’Fontsize’,25); ylabel(’\it y’,’Fontsize’,25)
zlabel(’\it u(x,y)’,’Fontsize’,25)
title(’ 800 realizations ’,’FontSize’,25)

subplot(2,2,4)
hold on
surf(XX,YY,V4); axis([0 1 0 1 0 1]);
colormap(Spring)
xlabel(’\it x’,’Fontsize’,25); ylabel(’\it y’,’Fontsize’,25)
zlabel(’\it u(x,y)’,’Fontsize’,25)
title(’ 3200 realizations ’,’FontSize’,25)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 18.3

1. Z b
2
E(X) = 0, Var(X) = E(X ) = t2 dt = (b3 − a3 )/3
a

2.
E(X) = 0
Z b Z b
Var(X) = E(X 2 ) = E{|tB(t)|2 } dt = t2 E{|B(t)|2 } dt
a a
Z b
= t3 dt = (b4 − a4 )/4
a

3.
Z b Z b
2 2
E(X) = 0, Var(X) = E(X ) = E{|B(t)| } dt = t dt = (b2 − a2 )/2
a a
578 Advanced Engineering Mathematics with MATLAB

4.
E(X) = 0
Z b n√ o Z b
2 2
Var(X) = E(X ) = E t exp[B(t)] dt = t E{exp[2B(t)]} dt
a a
Z b  
= te2t dt = 1
2 be2b − ae2a − 1
4 e2b − e2a
a

5. Because E(X) = 0,
Z b n o
2
Var(X) = E(X 2 ) = E |f (t){sin[B(t)] + cos[B(t)]}| dt
a
Z b
= E[f 2 (t)]E({sin[B(t)] + cos[B(t)]}2 ) dt
a
Z b Z b
2
= f (t)E({1 + sin[2B(t)]}) dt = f 2 (t) dt,
a a

since E{sin[2B(t)]} = 0.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Testing Equation 18.3.5
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear N = 1000000; M = 10; T = 1;


% t is the column vector [0 1/N 2/N ... 1]
t = (0:1:N)’/N; t = t*T;

for i = 1:N
t1(i) = t(i); t2(i) = t(i+1);
end

for j = 1:M % test Equation 18.3.5 M times

% create the Brownian motion


W = [0; cumsum(randn(N,1))]/sqrt(N); W = W*sqrt(T);

for i = 1:N
product(i) = W(i)*(W(i+1) - W(i));
end

LHS = sum(product); RHS = 0.5*(W(N+1)*W(N+1) - t(N+1));


Worked Solutions 579

[j LHS RHS] % print out the results for the jth test

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for the Numerical Check
% of Equations 18.3.19 and 18.3.24
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear N = 1000; M = 1000000; T = 1;


% t is the column vector [0 1/N 2/N ... 1]
t = (0:1:N)’/N; t = t*T:

for i = 1:N
t1(i) = t(i); t2(i) = t(i+1);
end

for j = 1:M % for M realizations

% created the Brownian motion


W = [0; cumsum(randn(N,1))]/sqrt(N); W = W*sqrt(T);

for i = 1:N
func = sqrt(t1(i))*sin(W(i));
product(i) = func*(W(i+1) - W(i));
end

S(j) = sum(product);

end

mean(S) % compute the mean of the integration


var(S) % compute the variance of the integration

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Section 18.4

2. Because
ft = −x, fx = x2 − t, and fxx = 2x,
df = −B(t) dt + [B 2 (t) − t] dB(t) + B(t) dt = [B 2 (t) − t] dB(t).
580 Advanced Engineering Mathematics with MATLAB

Integrating both side from 0 to t yields the result.

10. Because
   
λ3 λ2 t 2 λ2 t
ft = ∓ exp ±λx − , fx = λ exp ±λx − ,
2 2 2
 
3 λ2 t
fxx = ±λ exp ±λx − ,
2
we get
    Z t  
λ2 t 2 λ2 η
±λ exp ±λB(t) − −1 = λ exp ±λB(η) − dB(η).
2 0 2

Simplifying this equation yields the final result.

11. Because
 2   
λ2 λ t λ2 t
ft = exp sin(λx), fx = −λ exp cos(λx),
2 2 2
 
2 λ2 t
fxx = −λ exp sin(λx),
2
we get the desired result by direct substitution.

12. Because
 2   
λ2 λ t λ2 t
ft = − exp cos(λx), fx = λ exp sin(λx),
2 2 2
 
λ2 t
fxx = λ2 exp cos(λx),
2
we get the desired result by direct substitution.

13. Because
   2  2
x2 x2 x x x
ft = − 12 t−3/2 exp − 5/2 exp , fx = 3/2 exp ,
2t 2t 2t t 2t
 2  2
−3/2 x x2 x
fxx =t exp + 5/2 exp ,
2t 2t 2t
we get the desired result by direct substitution.

16.
d [tG(t)] = eB(t) dt, t G(t) dt + t dG(t) = eB(t) dt
Worked Solutions 581
h i
t dG(t) = eB(t) − G(t) dt

Section 18.5

1. h i
dX(t) = d et/2 B(t)

Integrating both sides,

X(t) = et/2 B(t) + X(0).

2.  
dX(t) = e2t d[B 2 (t)] + d(e2t )B 2 (t) = d e2t B 2 (t)
Integrating both sides,
X(t) = e2t B 2 (t) + X0 .

3.
dX(t) = d[B 2 (t)] + d[tB(t)]
Integrating both sides,

X(t) = B 2 (t) + tB(t) + X0 .

4.
dX(t) = d(t3 ) + d[tB(t)]
Integrating both sides,

X(t) = t3 + tB(t) + X0 .

5.

dX(t) = td[B 2 (t)] + B 2 (t) dt − t dt = d[tB 2 (t)] − 21 d(t2 ) = d[tB 2 (t) − 12 t2 ]

Integrating both sides,

X(t) = tB 2 (t) − t2 /2 + X0 .

6.
e−2t dX(t) − 2e−2t X(t) dt = e−2t dt + dB(t)
 
d e−2t X(t) = e−2t dt + dB(t)
582 Advanced Engineering Mathematics with MATLAB

e−2t X(t) − X(0) = − 12 e−2t − 1 + B(t)

X(t) = X(0)e2t + 21 e2t − 1 + e2t B(t)

7. Multiplying the stochastic differential equation by exp[t/(RC)], we have

Q t/(RC) V (t) t/(RC) α(t) t/(RC)


et/(RC) dQ + e dt = e dt + e dB(t).
RC R R
Running the product rule backwards,
h i V (t) α(t) t/(RC)
d et/(RC) Q(t) = et/(RC) dt + e dB(t).
R R
Integrating from 0 to t, we obtain
Z t Z t
1 1
et/(RC) Q(t) − Q(0) = eη/(RC) V (η) dη + eη/(RC) α(η) dη.
R 0 R 0

2
8. Multiplying the stochastic differential equation by e−t , we find
2 2 2 2
e−t dX = 2te−t X(t) dt + e−t −t
dt + e−t dB.

Running the product rule backwards, we have


h 2 i 2 2
d e−t X(t) = e−t −t dt + e−t dB.

Integrating both sides of the equation from 0 to t,


Z t Z t
−t2 −η 2 −η 2
e X(t) − X(0) = e dη + e−η dB(η).
0 0

Consequently the final answer is


Z t Z t
t2 t2 −η 2 −η t2 2
X(t) = e X(0) + e e dη + e e−η dB(η).
0 0

9.
e−4t dX(t) − 4e−4t X(t) dt = −e−4t dt + 2e−4t dB(t)
 
d e−4t X(t) = −e−4t dt + 2e−4t dB(t)
Z t

e−4t X(t) − X(0) = 41 e−4t − 1 + 2 e−4η dB(η)
0
Worked Solutions 583
Z t

X(t) = X(0)e4t + 1
4 1 − e−4t + 2 e4(t−η) dB(η)
0

10.
et dX(t) + et X(t) dt = 2et dt + B(t) dB(t)
 
d et X(t) = 2et dt + 21 d[B 2 (t) − t]

et X(t) − X0 = 2(et − 1) + 12 [B 2 (t) − t]

X(t) = X0 e−t + 2(1 − e−t ) + 12 e−t [B 2 (t) − t]

11.
e−t dX(t) − e−t X(t) dt = e−t dt + B(t) dB(t)
 
d e−t X(t) = e−t dt + B(t) dB(t)

e−t X(t) − X0 = (1 − et ) + 12 [B 2 (t) − t]

X(t) = X0 et + et − 1 + 12 et [B 2 (t) − t]

12.
e−t/2 dX(t) − 12 e−t/2 X(t) dt = e−t/2 dt + et/2 cos[B(t)] dB(t)
h i
d e−t/2 X(t) = e−t/2 dt + et/2 cos[B(t)] dB(t)
 
e−t/2 X(t) − X0 = 2 1 − e−t/2 + et/2 sin[B(t)]
 
X(t) = X0 et/2 + 2 et/2 − 1 + et sin[B(t)]

13.
e−t/2 dX(t) − 21 e−t/2 X(t) dt = te−t/2 dt + et/2 sin[B(t)] dB(t)
h i
d e−t/2 X(t) = te−t/2 dt + et/2 sin[B(t)] dB(t)

e−t/2 X(t) − X0 = −2te−t/2 − 4e−t/2 + 4 + 1 − et/2 cos[B(t)]

X(t) = et/2 X0 − 2t − 4 + 5et/2 − et cos[B(t)]

16.
Z t Z t   3 Z t 
1 2 t
X(t) = X0 exp 2η dη + η dB(η) = X0 exp + η dB(η)
0 0 6 0
584 Advanced Engineering Mathematics with MATLAB

17.
Z t Z t 
 
X(t) = X0 exp cos(η) − 1
sin2 (η) dη +
sin(η) dB(η)
2
0 0
 Z t 
= X0 exp 18 sin(2t) + sin(t) − 41 t + sin(η) dB(η)
0

18.
Z t Z tp 
1
X(t) = X0 exp 2 ln(η + 1) dη + ln(η + 1) dB(η)
0 0
 Z tp 
1 1 1
= X0 exp 2 t ln(t + 1) + 2 ln(t + 1) − 2t + ln(η + 1) dB(η)
0

19. Z Z 
t   t
1 2
X(t) = X0 exp ln(η + 1) − 2η dη + η dB(η)
0 0
 Z t 
1 3
= X0 exp (t + 1) ln(t + 1) − t − 6t + η dB(η)
0

20. Using Itô lemma,

dΦ(t) = d[X 1−n (t)] = (1 − n)X −n (t) dX(t) − 21 n(1 − n)X −n−1 (t)[dX(t)]2 .

Substituting for dX(t) and neglecting terms containing (dt)2 and dt dB(t), we
have that

dΦ(t) = (1 − n)X −n (t) {[aX n (t) + bX(t)] dt + cX(t) dB(t)}


− 21 n(1 − n)c2 X −n−1 (t)[dB(t)]2
 
= (1 − n) b − 12 n(1 − n)c2 dt + (1 − n)a dt.

21. Using Itô lemma,

dΦ(t) = d{exp[−cX(t)]} = −ce−cX(t) dX(t) + 12 c2 e−cX(t) [dX(t)]2 .

Substituting for dX(t) and neglecting terms containing (dt)2 and dt dB(t), we
have that
nh i o
dΦ(t) = −ce−cX(t) aecX(t) + b dt + σ dB(t) + 12 c2 σ 2 e−cX(t) [dB(t)]2
= −ac dt − bcΦ(t) dt − σcΦ(t) dB(t) + 21 σ 2 c2 dt
= −(bc − σ 2 c2 /2)Φ(t) dt − σcΦ(t) dB(t) − ac dt.
Worked Solutions 585

Now,
 Z t Z t 
Y (t) = exp −bc dη − bc dB(η) = exp[−bct − bcB(t)] ,
0 0

and  Z t 
Φ(t) = e−ǫ(t) Φ(0) − ac eǫ(η) dη ,
0

where ǫ(t) = bct+bcB(t). Upon substituting Φ(0) = e−cX0 and Φ(t) = e−cX(t)
into this equation and taking the log of both sides, we obtain the final result.

22. Using Itô lemma,


 
−1 1 2X(t)
dΦ(t) = d{tan [X(t)]} = 2 dX(t) + 1
2 − 2 [dX(t)]2 .
X (t) + 1 [X (t) + 1]2

Substituting for dX(t) and neglecting terms containing (dt)2 and dt dB(t), we
have that
1  
dΦ(t) = [1 + X(t)][1 + X 2 (t)] dt + [1 + X 2 (t)] dB(t)
X 2 (t) + 1
 
2X(t)
+ 21 − 2 [1 + X 2 (t)]2 dt
[X (t) + 1]2
= dt + dB(t).

Simplely integrating this last equation yields

Φ(t) − Φ(0) = t + B(t).

Upon substituting Φ(0) = tan−1 (X0 ) and Φ(t) = tan−1 (t) into this equation
and solving for X(t), we obtain the final result.

Section 18.6

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Noisy RL Circuit
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; clf
t student = 2.228 % t for 95% and 10 degrees of freedom
alpha over L = 1; beta over L = 0; T = 4; % maximum time
h = 0.02; % time step
t = [0:h:T]; % create time
586 Advanced Engineering Mathematics with MATLAB

t exact = [0:5*h:T];
N = length(t); N exact = length(t exact);
M = 11; % number of realizations
hold on

% compute the deterministic solution


for i = 1:N exact
exact(i) = 1 - exp(-t exact(i));
end

for j = 1:M % for each realization, .....

I(1:N) = zeros(N,1);

for i=1:N-1 % take N steps


Delta W 1 = randn*sqrt(h); % ∆Wn
Delta W 2 = randn*sqrt(h); % ∆Wn
I(i+1) = I(i) + (1 - I(i))*h - alpha over L*I(i)*Delta W 1 ...
+ beta over L*Delta W 2;
end;

% plot the results


plot(t,I)

% save the results from the j realization


I save(1:N,j) = I(1:N);
end % end the creation of a realization

%% compute the average value


for i = 1:N
average(i) = 0;
for j = 1:M
average(i) = average(i) + I save(i,j);
end
average(i) = average(i) / M;
sd(i) = 0;
for j = 1:M
sd(i) = sd(i) + (I save(i,j)-average(i)) ...
*(I save(i,j)-average(i));
end
sd(i) = t student*sqrt(sd(i)/M);
upper(i) = average(i) + sd(i);
lower(i) = average(i) - sd(i);
end
Worked Solutions 587

% plot the mean, confidence intervals

plot(t,average,’k’,’LineWidth’,2)
plot(t exact,exact,’b+’,’LineWidth’,3)
plot(t,upper,’k--’,’LineWidth’,2)
plot(t,lower,’k--’,’LineWidth’,2)
xlabel(’Rt/L’,’FontSize’,20); ylabel(’I(t)’,’FontSize’,20)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Nonlinear Oscillator
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear clf
a = 0.8; tau = 100; m = 1.2; T = 1000; % maximum time
h = 0.1; % time step
t = [0:h:T]; N = length(t); % time array
M = 10000; % number of realizations
hold on
x0(1:N) = zeros(N,1); y0(1:N) = zeros(N,1); y0(1) = 1;

for i=1:N-1 % take N steps


x0(i+1) = x0(i) - x0(i)*(x0(i)*x0(i)-a*a)*h - y0(i)*h;
y0(i+1) = y0(i) + (x0(i)-m*y0(i))*h/tau;
end;
sigma = 0.01;
for j = 1:M % for M realizations
x(1:N) = zeros(N,1); y(1:N) = zeros(N,1); y(1) = 1;
for i=1:N-1 % take N steps
Delta W 1 = randn*sqrt(h); % ∆W1
Delta W 2 = randn*sqrt(h); % ∆W2
x(i+1) = x(i) - x(i)*(x(i)*x(i)-a*a)*h ...
- y(i)*h + sigma*Delta W 1;
y(i+1) = y(i) + (x(i)-m*y(i))*h/tau + sigma*Delta W 2;
end;

for i=1:N
x save(j,i) = x(i);
end

end

Mean1 = mean(x save);


588 Advanced Engineering Mathematics with MATLAB

sigma = 0.1;
for j = 1:M % for M realizations

x(1:N) = zeros(N,1); y(1:N) = zeros(N,1); y(1) = 1;

for i=1:N-1 % take N steps


Delta W 1 = randn*sqrt(h); % ∆W1
Delta W 2 = randn*sqrt(h); % ∆W2
x(i+1) = x(i) - x(i)*(x(i)*x(i)-a*a)*h - y(i)*h ...
+ sigma*Delta W 1;
y(i+1) = y(i) + (x(i)-m*y(i))*h/tau + sigma*Delta W 2;
end;

for i=1:N
x save(j,i) = x(i);
end

end

Mean2 = mean(x save);

% move results into arrays time, data1, data2


% and data3 for plotting
istep = 1;
for i=1:N
if (mod(i-1,100) == 0)
time(istep) = t(i); data1(istep) = x0(i);
data2(istep) = Mean1(i); data3(istep) = Mean2(i);
istep = istep+1;
end; end

plot(time,data1,’-kx’,time,data2,’-bo’,
time,data3,’-r+’,’LineWidth’,2)
xlabel(’time’,’FontSize’,20); ylabel(’E[x(t)]’,’FontSize’,20);
legend(’\sigma = 0’,’\sigma = 0.01’,’\sigma = 0.1’)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Stochastic Damped Harmonic Oscillator
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear, clf
alpha = 0.1; gamma = 0.25; k = 1; T = 30; % maximum time t
h = 0.1; % time step
Worked Solutions 589

t = [0:h:T]; N = length(t); % time array


M = 5000; % number of realizations
hold on

x(1:N) = zeros(N,1); u(1:N) = zeros(N,1);


y(1:N) = zeros(N,1); v(1:N) = zeros(N,1);
z(1:N) = zeros(N,1); w(1:N) = zeros(N,1);

for j = 1:M
x(1) = 1; u(1) = 0; y(1) = 1; v(1) = 0; z(1) = 1; w(1) = 0;

% Heun method

for i = 1:N-1 % take N steps


% compute the first estimate
xi = randn*sqrt(h); x star = x(i) + u(i)*h;
u star = u(i) - k*k*h*x(i) - gamma*h*u(i) - alpha*x(i)*xi;

% compute the correction step

x(i+1) = x(i) + 0.5*h*(u star + u(i));


u(i+1) = u(i) - 0.5*k*k*h*(x star + x(i)) ...
- 0.5*gamma*h*(u star + u(i)) - alpha*x(i)*xi;
end

% leapfrog method

for i = 1:N-1 % take N steps

% compute the first estimate

y star = y(i) + 0.5*h*v(i);


v star = v(i) - 0.5*k*k*h*y(i) - 0.5*h*gamma*v(i);

% compute the correction step

temp = -k*k*y star - gamma*v star;


y(i+1) = y star + 0.5*h*(v(i)+h*temp);
v(i+1) = v(i) - k*k*h*y star - h*gamma*v star;

xi = randn;
y(i+1) = y(i+1) - alpha*y(i)*sqrt(h)*xi
+ 0.5*gamma*alpha*y(i)*sqrt(h*h*h)*xi;
v(i+1) = v(i+1) - alpha*y(i)*sqrt(h*h*h)*xi/sqrt(3);
590 Advanced Engineering Mathematics with MATLAB

end

% Euler method

for i= 1:N-1 % take N steps


xi = randn*sqrt(h);
z(i+1) = z(i) + h*w(i);
w(i+1) = w(i) - k*k*h*z(i) - gamma*h*w(i) - alpha*z(i)*xi;
end

% load data in (realization times time) arrays


for i = 1:N
x heun(j,i) = x(i);
x leapfrog(j,i) = y(i);
x euler(j,i) = z(i);
end;

end

% compute the mean values


Mean1 = mean(x euler);
Mean2 = mean(x heun);
Mean3 = mean(x leapfrog);

icount = 0;

for i = 1:N
if (mod(i-1,4) == 0)
icount = icount + 1;
time(icount) = t(i); xxx(icount) = Mean1(i);
yyy(icount) = Mean2(i); zzz(icount) = Mean3(i);
end; end

plot(time,xxx,’-kx’,time,yyy,’-bo’,time,zzz,’-r+’,’LineWidth’,2)
xlabel(’time’,’FontSize’,20); ylabel(’E[x(t)]’,’FontSize’,20);
legend({’Euler method’,’Heun method’,’leapfrog method’},...
’FontSize’,10)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for First Passage Time
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Seesselberg, M., and F. Petruccione, 1993: An improved


Worked Solutions 591

% algorithm for the estimation of the mean first passage


% time of ordinary stochastic differential equations.
% Computer Phys. Communications, 74, 247--255.
clear, clf

T = 10; % maximum time to go to


M = 60000; % number of realizations
X0 = -1; % initial condition

for itest = 1:20

sqrt h = 0.01 * itest; xxx(itest) = sqrt h; h = sqrt h*sqrt h;


t = [0:h:T]; N = length(t)
x(1:N) = zeros(N,1); m = 0;
y(1:N) = zeros(N,1); mm = 0;

for j = 1:M % take M realizations

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Euler method

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

x(1) = X0;

for k = 1:N-1 % take N steps

Delta W = randn*sqrt(h); % ∆Wn


aaa = x(k) - x(k)*x(k)*x(k);
bbb = 4 / (1+x(k)*x(k));
x(k+1) = x(k) + aaa*h + bbb*Delta W;

if (x(k+1) >= 0)
m = m+1; tau(m) = h*(k+1); break
end

end; end

% find the mean time

if (m > 0) yyy(itest) = mean(tau); end

for j = 1:M % take M realizations


592 Advanced Engineering Mathematics with MATLAB

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Milstein method
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

y(1) = X0;

for k = 1:N-1 % take N steps

Delta W = randn*sqrt(h); % ∆Wn


aaa = y(k) - y(k)*y(k)*y(k);
denom = 1 + y(k)*y(k);
bbb = 4 / denom;
bbb prime = - 8*y(k) / (denom*denom);
correction = 0.5*bbb*bbb prime*(Delta W*Delta W-h);
y(k+1) = y(k) + aaa*h + bbb*Delta W + correction;

if (y(k+1) >= 0)
mm = mm+1; ttau(mm) = h*(k+1); break
end

end; end

% find the mean time

if (mm > 0) zzz(itest) = mean(ttau); end

clear t tau ttau x y

end

[temp1,ErrorEst] = polyfit(xxx,yyy,1)

y fit = polyval(temp1,xxx,ErrorEst)

[temp2,ErrorEst] = polyfit(xxx,zzz,1)

z fit = polyval(temp2,xxx,ErrorEst)

plot(xxx,y fit,’-k’,xxx,z fit,’--k’,xxx,yyy,’+’,xxx,zzz,’o’,...


’LineWidth’,2,’MarkerSize’,10)
xlabel(’h^{1/2}’,’FontSize’,20);
ylabel(’mean time’,’FontSize’,20);
Worked Solutions 593

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MATLAB Code for Business Bankruptcy
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear, clf

mu = 1.001;
T = 3; % maximum time to go to
h = 0.005;
temp1 = mu*h;
t = [0:h:T];
N = length(t);
M = 1000000; % number of realizations
D = 100;
X0 = 500;

x(1:N) = zeros(N,1);

for type = 1:3

if (type == 1) sigma = 1.5; end


if (type == 2) sigma = 2.0; end
if (type == 3) sigma = 2.5; end
temp3 = sqrt(h)*sigma; temp4 = sigma*sigma*h;

for i = 1:41

interest(i) = 0.25*(i-1); m = 0;
iD = interest(i)*D/100; temp2 = iD*h;

for j = 1:M % take M realizations


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Milstein method
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

x(1) = X0; % introduce initial condition

for k = 1:N-1 % take N steps


Delta W = temp3*randn; % ∆Wn
temp5 = 1 + temp1 + Delta W + 0.5*(Delta W*Delta W-temp4);
x(k+1) = temp5*x(k) - temp2;
594 Advanced Engineering Mathematics with MATLAB

if (x(k+1) <= 0) m = m+1; break; end


end;
end

end

% compute the probability of bankruptcy

if (type == 1) probability1(i) = m / M; end


if (type == 2) probability2(i) = m / M; end
if (type == 3) probability3(i) = m / M; end

end; end

plot(interest,probability1,’-kx’,interest,probability2,’-bo’,...
interest,probability3,’-r+’,’LineWidth’,2)
xlabel(’interest (%/yr)’,’FontSize’,20);
ylabel(’probability of bankruptcy’,’FontSize’,20);
legend({′ \sigma = 1.5’,’\sigma = 2.0’,’\sigma = 2.5’},
’FontSize’,15)

You might also like