Download as pdf or txt
Download as pdf or txt
You are on page 1of 77

Lectures of

Mr.Munther 2015
ENVIRONMENTAL ENGINEERING DEPARTMENT
Engineering Analysis Differential Equation 1

A differential equation is an equation involving an unknown function and its derivatives. A


differential equation is an ordinary differential equation (ODE) if the unknown function
depends on only one independent variable. If the unknown function depends on two or more
independent variables, the differential equation is a partial differential equation (PDE).
Example: The following are differential equations involving the unknown function y.
dy
 9x  4
dx
2
d 2y  dy 
e y
 2   1
 dx 
2
dx
7 2
d 3y  dy  3  dy 
4 3  sin x    y    5x
dx  dx   dx 

2 y 2 y
 4 0
t 2 x 2

Expression Used to represent


dy
y' First derivative
dx
d 2y
y'' Second derivative
dx 2
d 3y
y''' Third derivative
dx 3
d 4y
y(4) Forth derivative
dx 4
d ny
y(n) nth derivative
dx n
m
 dy 
(y')m   (First derivative)m
 dx 
9
(5) 9  d 5y 
(y )  5 (Fifth derivative)9
 dx 
m
(n) m d ny 
(y )  n  (nth derivative)m
 dx 
d5 Fifth derivative
5 
(y9)(5) y 9
dx (function)m
dn nth derivative
(ym)(n)
dx n
y m  (function)m

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 2

Standard form fora First-order differential equation in the unknown function y(x) is:
y '  f x , y 

First Order Differential Equation Types:


1. Separable Equations
2. Homogeneous Equations
3. Exact Equations
4. Linear Equations
5. Bernoulli Equations

2.1- Separable Differential Equations

Procedure to solve a Separable First Order Differential Equation

1- Write the equation in the form :

2- Integrate A(x) with respect to x and B(y) with respect to y to obtain an


equation that relates y and x .

Example 1 : Solve differential equations

(b)  y ln y  dx  1  x 2  dy  0 y  0   e
1 x
(a) dx  2 dy  0
y y
(c) e x 2 y dy  e y 2x dx  0 (d) H.W. x  2 y  3 dx  1  x 2  dy  0

1 x
Solution : (a) dx  2 dy  0
y y
1 x 1 x 1 y
dx  2 dy  0  dx  2 dy  dx  2 dy
y y y y x y
1 1
dx  dy  0
x y

 
1 1
dx  dy  C  ln x  ln y  C
x y
y  C 1x  Ans.

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 3

Solution : (b)  y ln y  dx  1  x 2  dy  0 y  0   e
 y ln y  dx  1  x 2  dy 0
1
  1  x 2  dy
1
 y ln y  dx  dx  dy
1  x   y ln y 
2

1 1
dx  dy  0
1  x   y ln y 
2

 
1 1
dx  dy  C  tan 1  x   ln  ln y   C
1  x 2   y ln y 
y  0  e  tan 1  0   ln  ln e   C
0  ln 1  C  C 0
tan 1  x   ln  ln y   0
 tan 1 x 
y  ee  Ans.

Solution : (c) e x 2 y dy  e y 2x dx  0


e x  2 y dy  e y  2 x dx  0
dy e y  2 x

dx e x  2 y
dy dy
 e  y  2 x   x  2 y    e  y  2 y   x  2 x 
dx dx
dy
 e  y 3 x e y  dy  e 3x dx
dx
e 3x dx  e y dy  0

 e 3 x

dx  e y dy  C
3 x
e
e y C
3
 e 3x 
y  ln C    Ans.
 3 

H.W 1 : Solve differential equations


dy e 2x  y
 (b) 1   y   ky k is constant 
2
(a)
dx e x  y
dy 1 x 2
(c) x 2 y  1  x  csc y (d) xe y dy  dx  0
dx y

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 4

2.2- Homogenous Differential Equations

Certain first order differential equations are not of the ‘variable-separable’ type, but can
be made separable by changing the variable.
An equation of the form
dy
N x , y   M x , y 
dx

Where N and M are functions of both x and y of the same degree throughout, is said to
be Homogeneous in y and x.

Homogenous First Order Differential Equation

A first order differential equation is Homogenous if it can be put in the form:

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 5

Procedure to solve a Homogenous First Order Differential Equation

1. Rewrite into the form

2. Make the substitution .

3. Rewrite into the form .

4. Solve

5. Rewrite the solution into the form of x and y ( ).

Note:
If the form of a Homogenous (F-ODE) is , the steps are:

1. Rewrite into the form

2. Make the substitution .

3. Rewrite into the form .

4. Solve

5. Rewrite the solution into the form of x and y ( ).

Example 2 : Solve differential equations


dx dy dy dx
(a)  2 (b)  2
xy x  y 2 xy x  y 2
 y   y    y 
(c)  x sin    y cos    dx   x cos    dy  0 , y  2   
 x   x    x 
 xy 
(d)  xe  y  dx  xdy  0
 
y 1  ln  y   ln  x  
(e) H.W. y   , y 1  1
x  ln  y   ln  x  

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 6

dx dy
Solution : (a)  2
xy x  y 2
dx dy
 2
xy x  y 2
x 2  y 2 dy dy x 2 y 2
   
xy dx dx xy xy
dy x y
 
dx y x
y 1
Let v   F v    v
x v

   
dx dv dx dv
 C   C
x v  F v  x 1 
v   v 
v 
2
y 
 
 
v2
ln x     C
dx x
 vdv  C  ln x  C 
x 2 2
y   x 2 ln x  C 1 C 1  2C   Ans.

dy dx
Solution : (b)  2
xy x  y 2
dy dx
 2
xy x  y 2
x 2  y 2 dx dx x 2 y 2
   
xy dy dy xy xy
dx x y
 
dy y x
y 1
Let u  F u    u
x u

   
dy du dy du
 C   C
y u  F u  y 1 
u   u 
u 
2
x 
y 
 
u2
ln y     C
dy
 udu  C  ln y  C 
y 2 2
2
x 
2 ln y     2C  Ans.
y 

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 7

 y   y    y 
Solution : (c)  x sin    y cos    dx   x cos    dy  0 , y  2   
 x   x    x 
 y   y    y 
 x sin  x  y cos  x    x cos  x  
      dx      dy  0  x cos  y 
 
 x cos  y  x cos  y    x cos  y   x 
       
 x  x    x 
 y  y  dy y y 
 tan  x   x  dx  dy  0  dx  x  tan  x 
     
y
Let v   F v   v  tan v 
x

   
dx dv dx dv
 C   C
x v  F v  x v  v  tan v  

 
x 
ln x  ln  sin v    C
dx
 cot v  dv  C   y  x sin 1  
x C 
2
y  2      2 sin 1    C 2
C 
x 
y  x sin 1    Ans.
2

 y 
Solution : (d)  xe x  y  dx  xdy  0
 
y y
 y
 dy xe  y x
dy xe y x
dy y
y
 xe  y  dx  xdy  0       e 
x x

  dx x dx x x dx x
y
Let v   F v   e v  v
x

   
dx dv dx dv
 C   C
x v  F v  x v  e v  v 

 x  e
y
dx 
 v
dv  C  ln  x   e v
C  ln  x   e x
C

y   x ln C  ln  x    Ans.

H.W 2 : Solve differential equations

dy x 2  y 2 x dy
(a)  (b) x y  x2y2
dx y dx
dy e y  e x
(c)  x 2  y 2  dy  y 2dx  0 (d)  1
dx e y  e x

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 8

2.3- Exact Differential Equations

A first order differential equation is Exact if it can be put in the form:


M  x , y dx  N  x , y dy  0  4
or
f f
x
dx  dy  0
y
 5
f f
M  , N 
x y
And having the property that

M  N
y x

Procedure to solve a Exact Differential Equation

1. Rewrite the equation in the form :

2. Integrate with respect to x, writing the constant of integration


as

3. Differentiate with respect to y, and set result equal to find

4. Integrate to find and substituted in Eq.(6), then writing the


solution of exact equation as

General Solution

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 9

Example 3 : Solve differential equations

 y  x 
(a)  e x  ln  y    dx    ln  x   sin  y   dy  0
 x  y 
 

(b) x  1  y 2 dx   y   

xy
 dy  0
1  y 2 

 y x 
Solution : (a)  e x  ln  y    dx    ln  x   sin  y   dy  0
 x  y 
y x
M  e x  ln  y   & N   ln  x   sin  y 
x y
M 1 1 N 1 1
  &    exact 
y y x x y x


 x y 
f x , y    e  ln  y    dx  k  y 
 x 
y constant

f  x , y   e x  x ln  y   y ln  x   k  y 
f x x
N    ln  x   sin  y    ln  x   k   y   k   y   sin  y 
y y y
 k  y    cos  y 
 e x  x ln  y   y ln  x   cos  y   C  Ans.

 

Solution : (b) x  1  y 2 dx   y 



xy
1 y 2
 dy  0


xy
M  x  1 y 2 & N y 
1 y 2
M y N y
 &   Exact 
y 1 y 2 x 1 y 2

R
 M dx 
  
x  1  y 2 dx 
x2
2
 x 1 y 2
y cons tan t y cons tan t

R xy

y 1 y 2

 R    
  
 y  xy xy y2
K  N   dy      dy  y dy 
 y   1  y 2  1  y 2 
 2
x cons tan t x cons tan t  x cons tan t

x2 y2
R  K C   x 1 y 2  C  Ans.
2 2

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 11

H.W 3 : Solve differential equation


x 
(a) e x  ln  y   dx    1 dy  0 , y  ln  2    1
y 
 y2 
(b)   2 y  dx   2 y tan 1  x   2x  sinh  y   dy  0
 1  x 2

 

(c) x  1  y 2 dx   y   

xy
 dy  0
1  y 2 

(d)  sin  x   tan 1 

 y 

  dx  y  ln
 x 
 x2y2 dy  0
2.3.1 Integration factor
 M N 
It can be shown that every nonexact    differential equation, can be made exact
 y x 
by multiplying both sides by a suitable integrating factor I  x , y  .

I  x , y  M  x , y dx  I  x , y  N x , y dy  0

Condition Integrating factor


1  M N 
Case [1] If   g x  I x , y   e 
g  x dx

N  y x 

1  M N 
Case [2] If   h y  I x , y   e 
 h  y dy

M  y x 

I x , y  
1
Case [3] If M  y f  xy  and N  x g  xy 
xM  yN

Example 4 : Solve differential equations


(a) ydx  xdy  0 (b)  x  3y  dx  xdy  0 (c) 2xy 2dx  3x 2 ydy  0

Solution : (a) ydx  xdy  0


M y & N  x
M N
1 &  1  nonexact 
y x
1  M N 
1   1   
1 2
    g x  
N  y x  x x
2
I e e
g  x dx  dx 1
x

x2

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 11

1
Integtation factor I 
x2
 y   1
 IM  dx   IN  dy 0   2  dx     dy  0
x   x
  IM  1   IN  1
&  2  exact 
y x2 x x

 
 y  y
R IM dx   2  dx  
x  x
y cons tan t y cons tan t

R 1

y x
 R   1   1 
K 

x cons tan t
 IN 
 y
 dy 
 x cons tan t
          dy 
  x   x   
x cons tan t
 0 dy  C 1

y y
R  K C    C1  C   C 2  Ans.
x x

Solution : (b)  x  3y  dx  xdy  0


M  x  3y & N x
M N
3 & 1  nonexact 
y x
Integtation factor I  x 2
 IM  dx   IN  dy 0  x 3
 3x 2 y  dx  x 3dy  0
  IM    IN   3x 2
 3x 2 &  exact 
y x

f x , y  

y constant
x 3
 3x 2 y  dx  k  y 

x4
f x , y    x 3y  k  y 
4
f
IN   x 3  x 3  k  y   k  y   0
y
 k  y   C1
x4
  x 3y  C1  C
4
4
x
 x 3y  C 2  Ans.
4

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 12

Solution : (c) 2xy 2dx  3x 2 ydy  0


2xy 2dx  3x 2 ydy  0
M  2xy 2 & N  3x 2 y
M N
 4xy &  6xy  nonexact 
y x
1  M N  2
I e
1 g  x dx 1
    2  4xy  6xy    g x  
N  y x  3x y 3x 2
x3
1  M N  1
I e 
1  h  y dy
2 
    4xy  6xy    h y  y
M  y x  2xy y
1 1
M  y f  xy  and N  x g  xy  I   2 2
xM  yN x y
Integtation factor I  y
 IM  dx   IN  dy 0  2xy 3dx  3x 2 y 2dy  0
  IM    IN   6xy 2
 6xy 2 &  exact 
y x

R

y cons tan t
IM dx 

y cons tan t
 2xy  dx  x
3 2
y3

R
 3x 2 y 2
y

 3x y   3x y dy  


 R 
K 

x cons tan t
 IN 
 y
 dy 
 x cons tan t
2 2 2 2

x cons tan t
 0 dy  C1

R  K C  x y  C1  C  x y  C 2
2 3 2 3
 Ans.

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 13

2.4- Linear First-Order Differential Equations

A differential equation that can be written in the form:


dy
 P x  y Q x  7
dx
Where P  x  and Q  x  are functions of x, is called a linear first order equation

Note: We can be written a linear first order equation in the form:


dx
 P  y  x Q  y 
dy

Procedure to solve a Linear First-Order Differential Equation

1. Rewrite the equation in standard form :

2. Find

3. Find

Example 5 : Solve differential equations


dy dy
(a) cosh  x   sinh  x  y  e  x (b) 1  x   2 y  x , y  0  1
dx dx
dy
Solution : (a) cosh  x   sinh  x  y  e  x
dx
dy
cosh  x   sinh  x  y  e  x
dx
 cosh  x   dy  sinh  x    e x 
     y     cosh  x 
 cosh  x   dx  cosh  x    cosh  x  
dy
 tanh  x  y  e  x sech  x 
dx
P  x   tanh  x  & Q  x   e  x sech  x 

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 14

 x   e  e
P  x  dx tanh  x  dx
e 
ln cosh  x  
 cosh  x 

   x Q  x dx
1
y x  
 x 

cosh  x  
1
y x   cosh  x  e sech  x  dx x

  e  C    e  e  x  C 
1 1 1
y x   e dx  x x

cosh  x  cosh  x  x
e 
x

 
 2 
C 1e  2
x
y x    Ans.
e 2x  1

dy
Solution : (b) 1  x   2 y  x , y  0  1
dx
dy
1  x   2y  x
dx
dy 2 x
 y 
dx 1  x 1 x
2 x
P x   & Q x  
1 x 1 x
2
 x   e   e  1 x  e 2 ln 1 x   1  x 
P  x  dx dx 2

    x  x dx
1  x  1 1
y x   1  x   dx  x 1  x  dx 
2 2

1  x   1 x  1  x  1  x 
2 2 2

x2 x3  0 2 03 
   C    C
y x    2 3 
 1 
2 3
 C 0
1  x  1  0 
2 2

2
 x  1 x 
y x         Ans.
 1 x   2 3 

H.W 5: Solve differential equations


sin  x 
(b) e 2 y dx  2  xe 2 y  y  dy  0
dy
(a) x  3y 
dx x2
(c) 1  y 2  dx  1  2xy  dy  0
dy
(d)  x  1  4  x  1 y  x  1
3 2

dx
d 2 y dy dy
(e) x 2
 x2 (f) x  2 y  1  x 2 , y 1  1
dx dx dx

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 15

2.5- Bernoulli Equations

A Bernoulli differential equation has the form:


y'  P  x  y  Q  x  y n 8
Where n is a real number. The substitution
z  y 1n

y '  P x  y  Q x  y n
y'
 P  x  n 1  Q  x 
1
n
y y
1 dz y' y' 1 dz
Let z   1  n  n  
y n 1
dx y y n
1  n  dx
 P x  z  Q x 
1 dz
1  n  dx
 1  n  P  x  z  1  n Q  x 
dz
dx

Procedure to solve a Bernoulli Differential Equation

1. Rewrite the equation in standard form :

2. Find

3. Find

Then

Mr.Munther 2015
Engineering Analysis First Order Differential Equations 16

Example 6 : Solve differential equations


dy 1 cos x dy
(a)  y  3 y4 (b) H.W. 2 y  3  y 4e 3x
dx x x dx
dy 1 cos x
Solution : (a)  y  3 y4
dx x x
dy 1 cos x
 y  3 y4
dx x x
y'  1  1 cos x
   3   3
 x y
4
y x
1
n 4 Let z  3
y
 P*  x  z  Q *  x 
dz
dx
dz  1  cos x  dz  3   3cos x 
 1  4     z  1  4    3    z   
 x  x  dx  x   x 
3
dx

P*  x  
3
x
Q* x  
3cos x
x3
 3

 x   e  P  x dx
*
  dx
e x   x 3
1
z x     x Q *  x dx
 x  
1 3  3cos x  1
z x   3 x  3  dx  3  3 sin x  C 
x  x  x
1 1
  3 sin x  C 
y 3
x3
x3
 3 sin x  C  Ans.
y3

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 17

Many physical laws and relations can be expressed mathematically in the form of
differential equations. If we want to solve an engineering problem, we first have to formulate
the problem as a mathematical expression in terms of variables, functions, and equations.
Such an expression is known as a mathematical model of the given problem. Such a model is
called a differential equation.

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 18

3.1- Outflow Problems

Discharge is the volume of a fluid passed per unit time. If water (or other liquid) drains
from a tank, we expect that the flow will be greatest at first (when the water depth is greatest)
and will gradually decrease as the water level decreases. But we need a more precise
mathematical description of how the flow decreases in order to answer the kinds of questions
that engineers ask: How long does it take for a tank to drain completely?

V
Q  A
t
Q  Q in  Qout
Qout   r 2 2 gy  Gravity Flow  Torricelli Law
dA  y  * dy
 Q in  Qout
dt
dA  y   A  y    R 22
dy
R2  Q in   r 2 2 gy
dt
2
dy Q r 
 in2    2g y
dt  R R 
dy
2
 dt
Q in  r 

 R 2  R 
2g y

Case [1] Q in  0
Case [2] Q in  Constant

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 19

Example 7: The 1.5-m-diameter tank is initially filled with water. There is a 2-cm-diameter hole in
the bottom. If the water level is 5 m and the hole is suddenly opened. Estimate the water
level at time 10 min and, when will the tank be empty?

Q  Q in  Qout
Q in  0
Qout   r 2 2 gy  Gravity Flow 
dA  y  * dy
 Q in  Qout
dt
dA  y   A  y    R 2
dy
R2   r 2 2 gy
dt
dy r 
    2g y
dt R 
 R   2  dy
2
dy
 dt       dt
  
2
r  r g  2 y
  2g y
R 
R   2 
2

    y  t C
r   g
B .C at t  0 y  H
R   2 
2

C       H
  
r g 
2
 r   g 
2

y   H     t 
  R  2
   
 R   2H 
2

t      when y  0
r   g 
2
  0.02 / 2   9.81 
2

y   5  
   10  60    4 m
  1.5 / 2   2  
 1.5 / 2   2 *5 
2

t       5670sec  1hr 35min


 0.02 / 2   9.81 

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 21

H.W1: The cylindrical tank (1m) diameter is initially filled with water and inside flow is (5 L/sec).
There is a (2cm) diameter hole in the bottom. If the water level is (2m) and the hole is
suddenly opened. Estimate the water level at time (15 min) and, when will the tank be
empty?
H.W2: The frustum tank with (1m) top diameter and (0.25m) bottom diameter, the tank is initially
filled with water. There is a (1.5cm) diameter hole in the bottom. If the water level is
(2.5m) and the hole is suddenly opened. Estimate the water level at time (25 min) and,
when will the tank be empty?
H.W3: The conical tank (1.5m) top diameter is initially filled with water and inside flow is (2 L/sec).
There is a (1cm) diameter hole in the bottom. If the water level is (1.8m) and the hole is
suddenly opened. Estimate the water level at time (30 min) and, when will the tank be
empty?

3.2- Mixing problems

Consider a tank which initially holds (Vo unit of volume) of brine that contains (Co unit of
weight) of salt. Another brine solution, containing (Cin unit of weight) of salt per unit of volume,
is poured into the tank at the rate of (Qin unit of discharge) while, at the same time, the well-
stirred solution leaves the tank at the rate of (Qout unit of discharge) (Fig.). The problem is to
find the amount of salt in the tank at any time t. Let (W) denote the amount of salt in the tank
at any time t. The time rate of change of W, dWIdt, equals the rate at which salt enters the
tank minus the rate at which salt leaves the tank. Salt enters the tank at the rate of (CinQin unit
of weight per unit of time). To determine the rate at which salt leaves the tank, we first
calculate the volume of brine in the tank at any time t, which is the initial volume Vo plus the
volume of brine added Qint minus the volume of brine removed Qout t.
Thus, the volume of brine at any time is
V o  Qin  Qout  t .

The concentration of salt in the tank at any time is W / V o  Qin  Qout  t  , from which it
follows that salt leaves the tank at the rate of
 Qout 
W out    W t 
V o  Q in  Qout  t 

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 21

 volume unit  V
Q  Discharge  
 time unit  t
V  Volume volume unit   Q  t
t  Time time unit 
 weight unit  W
C  Concentration  
 volume unit  V
W Weight weight unit   C V

V t  V o V in V out
V in  Q int
V out  Qout t
W t 
C t  
V t 
W t 
C 
V o  Q in  Qout  t
C out  C
W t  W o W in W out W o  C inQ in  C outQout  t
dW
 C inQ in  C outQout
dt
dW  Qout 
 C inQ in    W t 
dt V o  Q in  Q out  t 
dW  Qout 
  W  C inQ in
dt V o  Q in  Q out  t 

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 22

Example 8: A tank initially holds (400 L) of a brine solution containing (10 kg) of salt. At t = 0, fresh
water is poured into the tank at the rate of (20 L/min), while the well-stirred mixture
leaves the tank at the same rate. Find the amount of salt in the tank at any time t.

Solution

dW  Qout 
 W  C inQ in
dt V o  Q in  Qout  t 
dW  20 
 W   0  20 
dt  400   20  20  t 
dW  1 
  W  0
dt  20 
dW 1 1 1
W
  dt
20  W
dw    dt
20
t
ln W    c
20
B .C at t 0 W  10
0
ln 10   c c  ln 10
20
t t W t
ln W    ln 10 ln W  ln 10   ln 
20 20 10 20
t

W  10e 20

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 23

Example 9: A tank contains 20 kg of salt dissolved in 5000 L of water. Brine that contains 0.03 kg
of salt per liter of water enters the tank at a rate of 25 L/min. The solution is kept
thoroughly mixed and drains from the tank at the same rate. How much salt remains in
the tank after half an hour?

Solution

dW  Qout 
 W  C inQ in
dt V o  Q in  Qout  t 
dW  25 
 W   0.03 25
dt  5000   25  25 t 
dW  1  dW W dW
 W  0.75  0.75  200  150 W
dt  200  dt 200 dt
dW 1
200  dt 200  dw   dt
150 W 150 W
200ln 150 W  t  c
t
ln 150 W  c1 
200
B .C at t 0 W  20
0
ln 150  20  c1  c1  ln 130
200
t t 150 W t
ln 150 W  ln 130  ln 150 W  ln 130   ln 
200 200 130 200
t

W  150  130e 200

30

W t 30 min
 150  130e 200
 38.1 kg

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 24

Example 10: A tank initially holds (250 L) of a brine solution containing (5 kg) of salt. At (t = 0)
fresh water is poured into the tank at the rate of (15 L/min), while the well-stirred mixture
leaves the tank at the same rate. Find:
(a) The amount of salt in the tank at any time t and
(b) The time at which the mixture in the tank contains (1 kg) of salt.
(c) The amount of salt in the tank after 20 minutes.
Solution (a)

dW  Qout 
 W  C inQ in
dt V o  Q in  Qout  t 
dW  15 
 W   0 15
dt  250  15  15 t 
dW
 0.06W  0
dt
dW 1
W
 0.06dt W dw   0.06 dt

ln W  0.06t  c
B .C at t 0 W  10
ln 5  0.06  0   c c  ln 5
W
ln W  0.06t  ln 10 ln W  ln 5  0.06t ln  0.06t
10
W  5e 0.06t
Solution (b)
1  5e 0.06t
1 1
t  ln  27 min
0.06 5
Solution (c)
W  5e 0.06t  5e 0.06(20)  1.5 kg

Mr.Munther 2015
Engineering Analysis Application of First Order Differential Equation 25

H.W1: A 150-L tank initially contains (30 L) of fresh water. At (t = 0), a brine solution containing
(0.5 kg) of salt per liter is poured into the tank at the rate of (10 L/min), while the well-
stirred mixture leaves the tank at the rate of (4 L/min). Find:
(a) The amount of time required for overflow to occur and
(b) The amount of salt in the tank at the moment of overflow.

H.W2: A tank contains (400 L) of brine made by dissolving (20 kg) of salt in water. Salt water
containing (0.75 kg) of salt per liter runs in at the rate of (2 L/min) and the well-stirred
mixture runs out at the same rate of (5 L/min). Find the amount of salt in the tank after
15 minutes.

H.W3: A tank contains (100 gal) of brine made by dissolving (80 Ib) of salt in water. Pure water runs
into the tank at the rate of (4 gal/min), and the well-stirred mixture runs out at the same
rate. Find:
(a) The amount of salt in the tank at any time t.
(b) The time required for half the salt to leave the tank.

Mr.Munther 2015
Engineering Analysis Second Order Linear Homogeneous Equations 26

The linear equation


d 2y
dx 2
 2a
dy
dx
 by  0   D 2  2a D  b  y  0

is called second order linear homogenous equation


D is called a linear differential operator
The equation
r 2  2a r  b  0
is the characteristic equation of the equation
d 2y dy
2
 2a  by  0
dx dx

d 2y dy
Solution of 2
 2a  by  0
dx dx
Roots of r 2  2a r  b  0 Solution
r1 , r2 real and unequal y  C 1 e r1 x  C 2 e r2 x
r1 , r2 real and equal y  C 1 x  C 2  e r2 x
r1 , r2 complex conjugate ,    i y  e  x C1 cos  x  C 2 sin  x 

Example 11 : Solve differential equation


(a) y   2 y   0 (b) y   4 y   4 y  0 (c) y   2 y   4 y  0

Solution : (a) y   2 y   0

y   2 y   0
 D  2D  y  0
2

 r  2r   0
2

r  r  2  0
 r1  0 & r2  2  r1 & r2 real and unequal 
y  C 1 e 0 x  C 2 e 2 x  y  C 1  C 2 e 2 x  Ans.

Solution : (b) y   4 y   4 y  0

y   4 y   4 y  0
 D  4D  4  y  0
2

 r  4r  4   0
2

 r  2 0
2

 r1  r2  2  r1 & r2 real and equal 


y  C 1 x C2  e r x 
2
y  C1  C 2 e 2x  Ans.

Mr.Munther 2015
Engineering Analysis Second Order Linear Homogeneous Equations 27

Solution : (c) y   2 y   4 y  0

y   2 y   4 y  0
 D  2D  4  y  0
2

 r  2r  4   0
2

  2    2   4  1 4
2

r
2 1
 r1  1  3 i  r1 & r2 complex conjugate 
 1 ,   3
y  e  x C 1 cos  x  C 2 sin  x   
y  e x C 1 cos 3 x  C 2 sin 3 x   Ans.

H.W 5 : Solve differential equation


(a) y   9 y  0 y  ln 2   1 , y   ln 2   3
(b) 4 y   12 y   9 y  0 y  0  0 , y   0  1
(c) y   6 y   10 y  0 y  0  7 , y   0  1

Mr.Munther 2015
Engineering Analysis Second Order Linear Nonhomogeneous Equations 28

If F  x   0 , the linear equation

d 2y dy
2
 2a  by  F  x 
dx dx
is called second order linear nonhomogeneous equation
The general solution of the nonhomogeneous equation is
y  yh  yp
Where
y h = homogeneous solution
y p = particular solution

5.1- Method of Variation of Parameters

Steps of solution second order linear nonhomogeneous equation by variation of


parameters method:

Procedure to use a Method of Variation of Parameters

1. Find

2. Calculate

3. Find and

4. Write the particular solution as

5. Write the general solution as

1. Mr.Munther 2015
Engineering Analysis Second Order Linear Nonhomogeneous Equations 29

Example 1 : Solve differential equation


(a) y   y  e x (b) y   y   e x cos x (c) y   y  sec x tan x

Solution : (a) y   y  e x

y   y  e x
First , find y h
D 2
 1 y  0
r2 1  0  r1  1 & r2  1
y  C1 e x  C 2 e  x
 u1  e x , u2  e  x , F x   ex
 u1  e x , u2   e  x
u1 u2 ex ex
D  D   e x e  x  e x e  x  1  1  2
u1 u2 e x
e x

u2 F  x  e  x e x 1 x
v 1   v 1    v1   C1
D 2 2 2

u1 F  x  ex ex 1 1
v 2   v 2    e 2x  v 2  C2  e 2x
D 2 2 4
y  v 1 u1  v 2 u2
x   1  x  1
y    C1  e x  C 2  e 2 x e where C3  C1  
 2   4   4
1
y  xe x  C3e x  C 2e  x  Ans.
2

Solution : (b) y   y   e x cos x

y   y   e x cos x
First , find y h
D 2
Dy  0
r2  r  0  r  r  1  0  r1  0 & r2  1
y  C1  C 2 e x
 u1  1 , u2  e x , F  x   e x cos x
 u1  0 , u2  e x
u u 1 ex
D 1 2  D e x  0  D  ex
u1 u2 0 e x

u2 F  x   e x  e x cos x 1
v 1   v 1    e x cos x  v 1  C1  e x cos x  sin x 
D ex 2
u F x  1  e x cos x
v 2  1  
v2   cos x  v 2  C 2  sin x
D ex
Mr.Munther 2015
Engineering Analysis Second Order Linear Nonhomogeneous Equations 31

 1 
y   C1  e x cos x  sin x    1  C2  sin x   e x
 2 
1
y  C1  C2 e x  e x cos x  sin x   Ans.
2

Solution : (c) y   y  sec x tan x

y   y  sec x tan x
First , find y h
y   y  0
D 2
 1 y  0
r2 1  0  r  i   0,   0 
y  C1 cos x  C 2 sin x
 u1  cos x , u2  sin x , F  x   sec x tan x
 u1   sin x , u2  cos x
u1 u2 cos x sin x
D  D  cos2 x    sin2 x   D 1
u1 u2  sin x cos x
u2 F  x   sin x  sec x tan x
v 1   v 1    tan2 x  v 1  x  tan x  C1
D 1
u F x  cos x  sec x tan x
v 2  1  v 2   tan x  v 2  ln sec x  C 2
D 1
y   x  tan x  C1   cos x   ln sec x  C 2   sin x C3  C 2  1
y  x cos x  sin x ln sec x  C1 cos x  C 3 sin x  Ans.

H.W 6 : Solve differential equation


(a) y   y  csc x
(b) y   y  cot x
(c) y   y   e x  e  x
(d) y   4 y   5 y  e x  4
(e) y   y  sec 2 x

Mr.Munther 2015
Engineering Analysis Second Order Linear Nonhomogeneous Equations 31

5.2- Method of Undetermined Coefficients

Procedure to use a Method of Undetermined Coefficients

2. Find

3. Find

4. Write the general solution as

F x  Condition yp
e kx k  r1 and k  r2 Ae kx
k  r1 or k  r2 Axe kx
k  r1 and k  r2 Ax 2e kx
sin kx ,cos kx k  r1 and k  r2 B cos kx  C sin kx
k  r1 and k  r2 Bx cos kx  Cx sin kx
ax 2  bx  c 0  r1 and 0  r2 Dx 2  Ex  F
0  r1 or 0  r2 Dx 3  Ex 2  Fx
0  r1 and 0  r2 Dx 4  Ex 3  Fx 2

Example 7 : Solve differential equation


(a) y   y  e x  x 2 (b) y   y   6 y  e  x  7 cos x

Solution : (a) y   y  e x  x 2

y   y  e x  x 2
First , find y h
y   y  0
D 2
 1 y  0
r2  1  0  r1  1 & r2  1
x
y  C1 e  C 2 e
x

Second , find y p
F  x 1  e x , k  1  r1    y p 1  A xe x
F  x 2  x 2 , r1 & r2  0    y p 2  Bx 2  Cx  D

Mr.Munther 2015
Engineering Analysis Second Order Linear Nonhomogeneous Equations 32

y p   y p 1   y p 2
y p  A xe x  Bx 2  Cx  D
y p  A  xe x  e x   2 Bx  C
y p  A  xe x  2e x   2 B  A xe x  2A e x  2 B
y p  y p  e x  x 2
 A xe x
 2A e x  2 B    A xe x  Bx 2  Cx  D   e x  x 2
2A e x  Bx 2  Cx  2 B  D  e x  x 2
1
 2A e x  e x  A
2
  Bx  x
2 2
 B  1
  Cx  0x  C 0
 2B  D  0  D  2 B  2
1 x
 yp  xe  x 2  2
2
1
 y  yh  y p  y  C1 e x  C 2 e  x  xe x  x 2  2  Ans.
2

Solution : (b) y   y   6 y  e  x  7 cos x

y   y   6 y  e  x  7 cos x
First , find y h
D 2
 D  6 y  0
r2  r  6  0   r  3 r  2   0  r1  3 & r2  2
y  C1 e 3x  C 2 e 2 x
Second , find y p
F  x 1  e  x , k  1  r1 & r2  k     y p 1  A e  x
F  x 2  cos x , k 1  r1 & r2  k     y p 2  B cos x  C sin x
y p   y p 1   y p 2  y p  A e  x  B cos x  C sin x
y p   A e  x  B sin x  C cos x
y p  A e  x  B cos x  C sin x
y p  y p  6 y p  e  x  7 cos x
A e x
 B cos x  C sin x     A e  x  B sin x  C cos x   6  A e  x  B cos x  C sin x   e  x  7cos x
1  1  6 A e  x    B  C  6B  cos x   C  B  6C  sin x  e  x  7 cos x

Mr.Munther 2015
Engineering Analysis Second Order Linear Nonhomogeneous Equations 33

1
  4A e  x  e  x  A 
4
   7 B  C  cos x  7 cos x  7B  C  7 ..... 1
  B  7C  sin x  0 sin x  B  7C  0 .....  2 
49 7
 B , C 
50 50
1 49 7
 y p   e  x  cos x  sin x
4 50 50
1 49 7
 y  yh  y p  y C1 e 3x  C 2 e 2 x  e  x  cos x  sin x  Ans.
4 50 50

Mr.Munther 2015
Engineering Analysis Second Order Linear Nonhomogeneous Equations 34

Differential Equation yp
c
y   2a y   b y  c
b
c
y   2a y   c x
2a

c bd  2ac
y   2a y   b y  cx  d x
b b2
c 2 2ad  c
y   2a y   cx  d x  x
4a 4a 2
c 3 d 2
y   cx  d x  x
6 2

c
y   2a y   b y  ce k x ek x
k  2ak  b
2

c
y   2a y   b y  ce k x k  r1 or r2 x ek x
2a  2k
c 2 kx
y   2a y   b y  ce k x k  r1  r2 x e
2

  
b  k 2  cos k x   2ak  sin k x 
c
y   2a y   b y  c cos k x k  r1  r2  2 
 b  k    2ak  
2 2

c
y   2a y   b y  c cos k x k  r1  r2  2 sin k x
2k
c
y   k 2 y  c cos k x x sin k x
2k

  
 2ak  cos k x  b  k 2  sin k x 
c
y   2a y   b y  c sin k x k  r1  r2  2 
 b  k    2ak  
2 2

c
y   2a y   b y  c sin k x k  r1  r2 cos k x
2k 2
c
y   k 2 y  c sin k x  x cos k x
2k

c 2 bd  4ac 8a2c  2abd  b 2e  2bc


y   2a y   b y  cx 2  dx  e x  x 
b b2 b3
c 3 ad  c 2 2a2e  ad  c
y   2a y   cx 2  dx  e x  x  x
6a 4a2 4a3
c 4 d 3 e 2
y   cx 2  dx  e x  x  x
12 6 2

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 35

The form of a linear nth-order homogeneous differential equation:


d ny d n 1 y d n 2 y dy
an  x  n
 an 1  x  n 1
 an 2  x  n 2
 ..........  a1  x   ao  x  y  0
dx dx dx dx

The form of a linear nth-order nonhomogeneous differential equation:


d ny d n 1 y d n 2 y dy
an  x  n
 an 1  x  n 1
 an 2  x  n 2
 ..........  a1  x   ao  x  y  f  x 
dx dx dx dx

If the functions ai  x  , i = 0, 1, 2, . . ., n are constants, the equation is said to have constant


coefficients.

6.1- Homogeneous Higher Order Constant Coefficient Equations

The form of a linear nth-order homogeneous differential equation:


d ny d n 1 y d n 2 y dy
an n
 an 1 n 1
 an 2 n 2
 ..........  a1  ao y  0
dx dx dx dx

The solution of the homogeneous equation is


y h  y 1  y 2  y 3  .....  y n

Type of Roots Roots of r Solution


Real r  r1 y 1  C 1 e r1 x
r  r2 y 2  C 2 e r2 x
r  r3 y 3  C 3 e r3 x

r  rk y k  C k e rk x
Real and equal r  r1  r2  r3 ....  rk y 1  C1 e r x
y 2  C 2 xe r x
y 3  C 3 x 2e r x

y k  C k x k 1e r x
Complex r1  1  1 i y 1  y 2  e 1 x C 1 cos 1x  C 2 sin 1x 
conjugate r2   2   2 i
y 3  y 4  e 2 x C 3 cos  2 x  C 4 sin  2 x 
r3   3   3 i
y 5  y 6  e 3 x C 5 cos  3x  C 6 sin  3x 

rk   k   k i
y 2 k 1  y 2 k  e k x C 2 k 1 cos  k x  C 2 k sin  k x 

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 36

Complex r  r1  r2  r3 ...  rk     i y 1  y 2  e  x C 1 cos  x  C 2 sin  x 


conjugate and
equal y 3  y 4  xe  x C 3 cos  x  C 4 sin  x 
y 5  y 6  x 2e  x C 5 cos  x  C 6 sin  x 

y 2 k 1  y 2 k  x k 1 e  x C 2 k 1 cos  x  C 2 k sin  x 

Example 8 : Solve differential equation


(a) y '''  2 y ''  5y '  6y  0
(b) y '''  2 y ''  4 y '  0
(c) y 4  2 y ''  y  0
(d) 6 y 4  7 y '''  13y ''  4 y'  4 y  0
(e) y 5  5y 4  2 y '''  10 y ''  y '  5y  0
(f) 2 y 5  7 y 4  12 y '''  8y ''  0

Solution : (a) y '''  2 y ''  5y '  6y  0

y '''  2 y ''  5 y '  6 y  0 D 3 y  2 D 2 y  5Dy  6 y  0 D 3


 2 D 2  5D  6  y  0
r 3  2r 2  5r  6  0
a  1 Synthetic Division
b  1,  2 ,  3,  6
1 1 2 5 6
b
 1,  2 ,  3,  6  1 1 6
a
Try  1 1 1 6 0
1  2 1  5 1  6  0
3 2
O.K
 r  1  r 2  r  6   0  r  1 r  3 r  2   0
r1  1 y 1  C1 e x
r2  3 y 2  C 2 e 3x
r3  2 y 3  C 3 e 2 x
 y  C 1 e x  C 2 e 3x  C 3 e 2 x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 37

Solution : (b) y '''  2 y ''  4 y '  0

Solution : (c) y    2 y ''  y  0


4

Solution : (d) 6 y    7 y '''  13y ''  4 y'  4 y  0


4

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 38

Solution : (e) y    5y    2 y '''  10 y ''  y '  5y  0


5 4

Solution : (f) 2 y    7 y    12 y '''  8y ''  0


5 4

H.W 7 : Solve differential equation


(a) y '''  4 y ''  4 y '  0
(b) y 4  y ''  2 y  0
(c) y 6  12 y 4  48y  64 y  0
(d) y '''  3y ''  3 y'  y  0
(e) y '''  4 y ''  7 y '  10y  0
(f) y 6  y 5  3y 4  5y 3  2 y 2  0
(g) y 6  y 5  3y 4  5y 3  2 y 2  0
Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 39

6.2- Nonhomogeneous Higher Order Constant Coefficient Equations

The form of a linear nth-order Nonhomogeneous differential equation:


d ny d n 1 y d n 2 y dy
an n
 an 1 n 1
 an 2 n 2
 ..........  a1  ao y  f  x 
dx dx dx dx

The solution of the Nonhomogeneous equation is


y  yh  yp

6.2.1 Undetermined Coefficients Method


F x  Condition yp
k A
xm r 0 r are all roots A0  A1x  A2x 2  .....  Am 1x m 1  Am x m
r 0 r is one root repet s  ones  x s  A0  A1x  A2 x 2  .....  Am 1x m 1  Am x m 
x me kx k r r are all roots A 0  A1x  A2x 2  .....  Am x m e kx
k r r is one root e rx  x s  A0  A1x  A2x 2  .....  Am x m e kx
x m sin kx k   of all roots  A  A x  A x  .....  A x cos kx
0 1 2
2
m
m

  B  B x  B x  .....  B x  sin kx
x m cos kx 2 m
0 1 2 m

k  cos  x , sin  x  x  A  A x  A x  .....  A x cos kx


s
0 1 2
2
m
m

 x  B  B x  B x  .....  B x  sin kx
s
0 1 2
2
m
m

e px sin kx p  & k    &  of all roots e px  A0 cos kx  B0 sin kx 


e px cos kx
p  & k    &  of one roots x se px  A0 cos kx  B0 sin kx 
e x
cos  x ,e  x sin  x 
e px x m sin kx p  & k    &  of all roots e px  A0  A1x  A2 x 2  .....  Am x m cos kx
e px  B0  B1x  B2 x 2  .....  Bm x m  sin kx
e px x m cos kx

p  & k    &  of one roots x se px  A0  A1x  A2 x 2  .....  Am x m cos kx


e x
cos  x ,e  x sin  x 
 x se px  B0  B1x  B2x 2  .....  Bm x m  sin kx

Example 9 : Solve differential equation


(a) y ''' 5y '' 6 y '  x 2  sinx
(b) y ''' y ''  e x cos x
(c) y 4  y ''  4x  2xe  x
(d) y ''' 3y '' 3y ' y  x  4e x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 41

Solution : (a) y ''' 5y '' 6 y '  x 2  sinx

Solution : (b) y ''' y ''  e x cos x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 41

Solution : (c) y    y ''  4x  2xe  x


4

Solution : (d) y ''' 3y '' 3y ' y  x  4e x

H.W 8 : Solve differential equation


(a) y ''' y '' 2 y  3  2cos x (b) y ''' y '' y ' y  2  e  x
(c) y 4  y '''  1  x 2e  x (d) y ''' 6 y ''  3  cos x
(e) y ''' 2 y '' 4 y ' 8y  6xe 2 x (f) y ''' y '' 4 y ' 4 y  5  e x  e 2 x
(g) y 4  2 y '' y   x  1
2

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 42

6.2.2 Variation of Parameters Method


y h  c1 y 1  c 2 y 2  c 3 y 3  c 4 y 4  .....  c n y n

y p  u1 y 1  u 2 y 2  u 3 y 3  u 4 y 4  .....  u n y n

y1 y2 y3 y4 yn
y 1' y 2' y 3' y 4' y n'
y 1'' y 2'' y 3'' y 4'' y n ''
W  y 1''' y 2''' y 3''' y 4''' y n '''

y 1
n 2 
y 2
n 2 
y 3
n 2 
y 4
n 2 
y n
n 2 

y 1 n 1 y 2  n 1 y 3 n 1 y 4  n 1 y n  n 1

0 y2 y3 y4 yn
y2 y3 y4 yn
0 y 2' y 3' y 4' y n'
y 2' y 3' y 4' y n'
0 y 2'' y 3'' y 4'' y n ''
y 2'' y 3'' y 4'' y n ''
  1 f x 
n 1
W1  0 y 2''' y 3''' y 4''' y n '''
y 2''' y 3''' y 4''' y n '''

y 1 n 2  y 2  n 2  y 3 n  2  y 4  n 2  y n  n 2 
y 2  n 2 y 3 n 1 y 4  n 1 y n  n 1
f x  y2  n 1
y3  n 1
y4  n 1
yn  n 1

y1 0 y3 y4 yn
y1 y3 y4 yn
y 1' 0 y 3' y 4' y n'
y 1' y 3' y 4' y n'
y 1'' 0 y 3'' y 4'' y n ''
y 1'' y 3'' y 4'' y n ''
  1 f x 
n 2
W 2  y 1''' 0 y 3''' y 4''' y n '''
y 1''' y 3''' y 4''' y n '''

y 1
n 2 
y 3
n 2 
y 4
n 2 
y n
n 2 
0
y 1
n 2 
y 3
n 2 
y 4
n 2 
y n
n 2 

y1  n 1
f x  y3  n 1
y4  n 1
yn  n 1

y1 y2 y3 0 yn
y1 y2 y3 yn
y 1' y 2' y 3' 0 y n'
y 1' y 2' y 3' y n'
y 1'' y 2'' y 3'' 0 y n ''
y 1'' y 2'' y 3'' y n ''
  1 f x 
n i
W i  y 1''' y 2''' y 3''' 0 y n '''
y 1''' y 2''' y 3''' y n '''

y 1
n 2 
y 2
n 2 
y 3
n 2 
y n
n 2 
0
y 1
n 2
y 2
n 2 
y 3
n 2 
y n
n 2 

y1  n 1
y2  n 1
y3  n 1
f x  yn  n 1

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 43

   
W1 W2 Wi Wn
u1  dx , u 2  dx .... ui  dx .... un  dx
W W W W

 y p  u1 y 1  u 2 y 2  u 3 y 3  u 4 y 4  .....  u n y n 

 y  y h  y p 

Example 10 : Solve differential equation

(a) y 4  9 y ''  sec2 3x


(b) y ''' y ''  e x cos x
(c) y 4  y ''  4x  2xe  x
(d) y ''' 6 y '' 14 y ' 104 y  111e x

Solution : (a) y    9 y ''  sec2 3x


4

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 44

Solution : (b) y ''' y ''  e x cos x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 45

Solution : (c) y    y ''  4x  2xe  x


4

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 46

Solution : (d) y ''' 6 y '' 14 y ' 104 y  111e x

H.W 9 : Solve differential equation

(a) y 4  y  5  x  cos x  (b) y ''' y ''  e x


(c) y (4)  16 y  1 (d) y (5)  y (4)  1
(e) y (4)  9 y ''  1 (f) y ''' 10 y '' 34 y ' 40 y  xe 4 x  2e 3x cos x
(g) y ''' 6 y '' 11y ' 6 y  2e 3x  xe x (h) y ''' 3y '' 3y ' y  x  4e x
(i) y 4  4 y ''  sec2 2x (j) y (4)  10 y ''' 38y '' 64 y ' 40 y  153e  x
(k) y 4  4 y ''  tan2 2x (l) y ''' 9 y '  sec2 2x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 47

6.2.3 The Differential Operator (D) Method

F x  Differential Operator D

xm D m 1

D  k 
m 1
x me kx

x me kx cos cx  D 2
 2kD  k 2  c 2 
m 1

x me kx sin cx 

Example 11 : Solve differential equation


(a) y ''' 4 y '' 4 y '  5x 2  6x  4x 2e 2 x  3e 5x
(b) y 4  2 y ''' y ''  e x  1
(c) y ''' 2 y '' 13y ' 10 y  xe  x
(d) y ''' 8y '  e x cos2x

Solution : (a) y ''' 4 y '' 4 y '  5x 2  6x  4 x 2e 2 x  3e 5x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 48

Solution : (b) y    2 y ''' y ''  e x  1


4

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 49

Solution : (c) y ''' 2 y '' 13y ' 10 y  xe  x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 51

Solution : (d) y ''' 8y '  e x cos2x

H.W 10 : Solve differential equation


(a) y ''' 8y ''  2  9x  6x 2 (b) y ''' y '' y ' y  xe x  e  x  7
(c) y ''' 3y '' 3y '' y  e x  x  16 (d) 2 y ''' 3y '' 3y ' 2 y  e x  e  x 
2

(e) y 4  4 y ''  5x 2  e 2 x (f) y ''' 10 y '' 25y '  e x


(g) y 4  8y '  4 (h) y ''' 4 y '' 3y '  x 2 cos x  3x
(i) y 4  8 y '' 16 y   x 3  2x e 4 x (j) y (4)  10 y ''' 38y '' 64 y ' 40 y  153e  x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 51

6.3- CAUCHY-EULER EQUATION

Cauchy-Euler Equation is a linear differential equation of the form


n 1 n 2
d ny n 1 d y n 2 d y dy
an x n n
 an 1x n 1
 an 2 x n 2
 ..........  a1x  ao y  f  x 
dx dx dx dx
d
Let x  e z  z  ln x and new differential operator D  and y  y  z 
dz
dy
a1x  a1Dy
dx
d 2y
a2 x 2  a2 D  D  1 y
dx 2
d 3y
a3x 3 3  a3D  D  1 D  2  y
dx

dky
ak x k  ak D  D  1 D  2  D  3 ... ...   D  k  1 y where k  n  Order of D .E
dx k

Example 12 : Solve differential equation


(a) x 2 y '' 2xy ' 4 y  0
(b) x 3 y ''' 5x 2 y '' 7xy ' 8y  0
(c) x 2 y '' 3xy ' 3y  2x 4e x
(d) x 4 y (4)  6x 3 y ''' 9x 2 y '' 3xy ' y  0

Solution : (a) x 2 y '' 2xy ' 4 y  0

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 52

Solution : (b) x 3 y ''' 5x 2 y '' 7xy ' 8y  0

Solution : (c) x 2 y '' 3xy ' 3y  2x 4e x

Mr.Munther 2015
Engineering Analysis Higher Order Differential Equations 53

Solution : (d) x 4 y (4)  6x 3 y ''' 9x 2 y '' 3xy ' y  0

H.W 11 : Solve differential equation


(a) x 2 y '' xy ' y  ln x (b) x 3 y ''' 6 y  0
(c) xy (4)  6 y '''  0 (d) x 3 y ''' 3x 2 y '' 6xy ' 6 y  3  ln x 3
(e) x 2 y '' 4xy ' 6 y  ln x 2 (f) x 2 y '' (x 2  2x ) y ' (x  2) y  x 3
1
(g) x 2 y '' xy ' y  (h) (x  2)2 y '' (x  2) y ' y  0
1 x

Mr.Munther 2015
Engineering Analysis :System Linear Differential Equations 54

x  g x  aDx  bDy  F1  x 
d
y  f x  D cDx  aDy  F2  x 
dt

F1  x  bD aD F1  x 
aD bD  x   F1  x   F2  x  dD cD F2  x 
   x  y 
cD dD  y   F2  x   aD bD aD bD
cD dD cD dD

Example 13 : Solve the system of differential equation


dx dy
2 x  t
dt dt
dx dy
3 2 y 0
dt dt

Mr.Munther 2015
Engineering Analysis :System Linear Differential Equations 55

Example 14 : Solve the system of differential equation


dx dy
2 x   et
dt dt
dx dy
3 2  y t
dt dt

Mr.Munther 2015
Engineering Analysis :System Linear Differential Equations 56

Example 15 : Solve the system of differential equation

 2D 2
 3D  9  x   D 2  7 D  14  y  4
 D  1 x   D  2 y  8e 2t

Mr.Munther 2015
Engineering Analysis :System Linear Differential Equations 57

Example 16 : Solve the system of differential equation

 D  1 x   D  2  y   D  3 z  e t
 D  2  x   D  3 y   2D  3 z  e t
 4D  6 x  5D  4  y   20D  12  z  7e t

Mr.Munther 2015
Engineering Analysis :System Linear Differential Equations 58

Mr.Munther 2015
Engineering Analysis Partial differential equation 59

A partial differential equation is a relationship between a dependent variable u and two or


more independent variables (x,y,t … ) and partial derivatives of u with respect to these
independent variables. The solution is therefore of the form u=f(x,y,t,….).
u u u
ux  uy  ut 
x y t
 2u  2u  2u
u xx  2 u yy  2 utt  2
x y t
 2u  2u  2u
u xy  u yx  u xt  utx  u yt  uty 
x y x t y t

8.1- Direct Partial Integration

The simplest form of partial differential equation is such that a solution can be determined
by partial integration.
Example 17 : Solve the partial differential equation

 2u
 12x 2 t  1 u x 0  cos 2t , u x  sin t
x 2 x 0

Solution :

B .C . ux  sin t
 2u x 0
 12x 2 t  1
sin t  4  0  t  1  k 1 t 
3
x 2

u xx dx   12x 2 t  1 dx  k 1 t   sin t
 4x 3 t  1  sin t  dx
t is constant

u x  4x 3
t  1  k 1 t   u dx x  
t is constant

u  x 4 t  1  x sin t  k 2 t 
B .C . u x 0
 cos 2t
cos 2t   0  t  1   0  sin t  k 2 t 
4

 k 2 t   cos 2t
 u  x ,t   x 4 t  1  x sin t  cos 2t

H.W 12 : Solve the partial differential equation


(a) ut  5cos x sin t
(b) u xy  cos  x  y  u x 0  y 2 , ux y 0
 2 xy (4)  6 y '''  0
(c) u xy  8e y sin 2x u x   2 y 2 , ux y 0
 sin x
2

Mr.Munther 2015
Engineering Analysis Partial differential equation 61

8.2- Separating the Variables

A partial differential equation is an equation that contains one or more partial derivatives.
Examples include:
u u
i- a b c
x y

 2u 1 u
ii-  2
x 2
c t

 2u  2u
iii-  0
x 2 y 2

Equation (i) is a first-order partial differential equation, and equations (ii) and (iii) are
second-order partial differential equations since the highest power of the differential is 2.
Let u(x, y)= F(x)G(y), where F(x) is a function of x only and G(y) is a function of y only, then
u x , y   F x  G  y 
u  FG
u x  F' G u xx  F'' G
uy  F G' u yy  F G''

Then, simplified to PDE.


Example 18 : Solve the partial differential equation
(a) y u x u y
(b) 3u x  2u y  x u x , y   1
(c) u x  u u y  u  0 u  0, y   1  y
 2u 1  2u
(d) 
x 2 c 2 t 2
 2u  2u
(e)  0
x 2 y 2

Solution : (a) y u x u y

Mr.Munther 2015
Engineering Analysis Partial differential equation 61

Solution : (b) 3u x  2u y  x u x , y   1

Solution : (c) u x  u u y  u  0 u  0, y   1  y

Mr.Munther 2015
Engineering Analysis Partial differential equation 62

 2u 1  2u
Solution : (d) 
x 2 c 2 t 2

Mr.Munther 2015
Engineering Analysis Partial differential equation 63

 2u  2u
Solution : (e)  0
x 2 y 2

H.W 13 : Solve the partial differential equation


(a) u x  u y  e u u  0, y   y
(b) u x  3u y  2u u  x , 0  e x
(c) u x  u y  2  x  y u u  0, 0   2 u 1, 0  15
(d) u x  3u y  2u u  x , 0  e x
(e) u xy  u  0
(f) ut  x u x  u  1 u  x , 0  tanh x
(g) ut  x u x  u u  x , 0  sin x
 2u 1 u
(h)  2
x 2
c t
(i) u x  u xy  u y  0
Mr.Munther 2015
Engineering Analysis FOURIER SERIES 64

A Fourier series is a representation of a function as a series of constant multiples of sine


and/or cosine functions of different frequencies.

9.1- Fourier series for periodic functions over range 2L

A function f(x) is said to be periodic if f(x +T )= f(x) for all values of x, where T is some
positive number. T is the interval between two successive repetitions and is called the period
of the functions f(x).

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 65

Let the function f(x) be defined on the interval { −L ≤ x ≤ L } .Then the Fourier coefficients
an and bn in the Fourier series representation of f(x) :

F  x   ao 
 a cos nLx  b sin nLx 
n 1
n n

 f  x dx
1
ao 
2L
L
L


1 n x
an  f  x  cos dx
L L
L
L


1 n x
bn  f  x  sin dx
L L
L

9.2- Half-range Fourier series

A function f(x) is said to be even if f(-x) = f(x) for all values of x. Graphs of even functions
are always symmetrical about the y-axis (i.e. a mirror image).
Fourier series of even functions

F  x   ao 
 n 1

 an cos

n x 
L 


1
ao  f  x  dx
L
0
L


2 n x
an  f  x  cos dx
L L
0

A function f(x) is said to be odd if f(-x) = -f(x) for all values of x. Graphs of even functions
are always symmetrical about the origin point.
Fourier series of odd functions

F x  
 n 1

 bn sin

n x 
L 


2 n x
bn  f  x  sin dx
L L
0

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 66

Example 19 : Find the Fourier series for the periodic function defined by :
(a) f t   t 0t  3
x 0  x  
(b) f  x   
 0   x  2
(c) f     2 0    2
x 2  x  0
(d) f  x   
x 0x 2
(e) f  x   x 2  x  2

0 2  x  1

(f) f  x   5 1  x  1
0 1  x  2

Solution: (a) f t   t 0t  3

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 67

x 0  x  
Solution: (b) f  x   
 0   x  2

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 68

Solution: (c) f     2 0    2

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 69

x 2  x  0
Solution: (d) f  x   
x 0x 2

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 71

Solution: (e) f  x   x 2  x  2

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 71

0 2  x  1

Solution: (f) f  x   5 1  x  1
0 1  x  2

Mr.Munther 2015
Engineering Analysis FOURIER SERIES 72

H.W 14 : Find the Fourier series for the periodic function defined by :

0 2  x  0

(a) f  x   1 0  x  1
2 1  x  2

0   x  0
(b) f  x   
x
2
0 x 
x 2 0  x  
(c) f  x   
    x  2
 x 5  x  0
(d) f  x   
1  x 0x 5
2

2x 3  x  2

(e) f  x    0 2  x  1
x 2 1 x  3

cos x 2  x  0
(f) f  x   
 sin x 0x 2
 1 0  x 1

(g) f  x    0 1  x  3
 1 3  x  5

 2 4  x  2

(h) f  x   1  x 2
2  x  2
 0 2x 4

e x  x   x  0
(i) f  x   
e  x
x
0 x 
 
 0   x  
2

 
 2x  x 0

(j) f  x   
2
 
 2x 0x 
 2
 
 0  x 
 2

Mr.Munther 2015
Engineering Analysis Numerical Analysis 73

Numerical analysis is the study of algorithms that use numerical for the problems of
mathematical analysis

10.1- Interpolation and Curve Fitting

In the mathematical field of numerical analysis, interpolation is a method of constructing


new data points within the range of a discrete set of known data points.
Curve fitting is the process of constructing a curve, or mathematical function, that has the
best fit to a series of data points, possibly subject to constraints. Curve fitting can involve either
interpolation, where an exact fit to the data is required, or smoothing, in which a "smooth"
function is constructed that approximately fits the data.

Plot of the data with polynomial interpolation applied Polynomial curves fitting points generated with a sine
function. Red line is a first degree polynomial, green line
is second degree, orange line is third degree and blue is
fourth degree

y 2  y1 y  y1

x 2  x1 x  x1
y 2  y1
y  y1  x  x 1
x 2  x1
f  x   f 1  11f x  x1

Mr.Munther 2015
Engineering Analysis Numerical Analysis 74

10.1.1 Lagrange Interpolation

Given a set of n data points

x 1 ,f  x 1   ,  x 2 ,f  x 2   ,................  x n ,f  x n  

The interpolation polynomial in the Lagrange form is a linear combination

 
n n
x xk
f x   f  x i  Li Where Li 
xi xk
i 1 k 1
i k

10.1.2 Newton Interpolation (Divided Differences)

Given a set of n data points

x 1 ,f  x 1   ,  x 2 ,f  x 2   ,................  x n ,f  x n  

The interpolation polynomial in the Newton form is


n 1

 f N x  x 
k

f x   f 1 k
1 k Where Nk  i
k 1 i 1

i xi fi 1i f  i2 f  3i f  i4f 5i f  6i f

1 x1 f1
f 2 f1
2 x2 f2 x 2  x1 12f  11f
f3 f2 x 3  x1  22f  12f
3 x3 f3 x3 x2 13f  12f x 4  x1  32f  13f
f4 f3 x4 x2  32f   22f x 5  x1  42f  14f
4 x4 f4 x4 x3 14f  13f x5 x2  33f   32f x 6  x1  52f  15f
f5 f4 x5 x3  24f   32f x6 x2  34f   42f x 7  x1
x5 f5 x5 x4 x6 x3 x7 x2
5 15f  14f  34f   33f
f6 f5 x6 x4 x7 x3
 52f   24f
x6 x5
6 x6 f6 16f  15f x7 x4
f7 f6
x7 x5
7 x7 f7 x7 x6

Mr.Munther 2015
Engineering Analysis Numerical Analysis 75

Example 20 : The set of the following five data points is given :


i 1 2 3 4 5
xi 1 2 4 5 7
fi 52 5 -5 -40 10
(a) Determine the polynomial in the Lagrange form that passes through the points.
(b) Determine the polynomial in the Newton form that passes through the points.
(c) Determine the interpolated value for x = 3, using a Lagrange and Newton polynomial
(a) Lagrange polynomial:

 
n n
x xk
f x   f  x i  Li Where Li 
xi xk
i 1 k 1
i k

f x   f 1
x  x 2  x  x 3  x  x 4  x  x 5 
f2
 x  x 1  x  x 3  x  x 4  x  x 5 
 x 1  x 2  x 1  x 3  x 1  x 4  x 1  x 5   x 2  x 1  x 2  x 3  x 2  x 4  x 2  x 5 
f 3
x  x 1  x  x 2  x  x 4  x  x 5 
f4
 x  x 1  x  x 2  x  x 3  x  x 5 
 x 3  x 1  x 3  x 2  x 3  x 4  x 3  x 5   x 4  x 1  x 4  x 2  x 4  x 3  x 4  x 5 
f 5
x  x 1  x  x 2  x  x 3  x  x 4 
 x 5  x 1  x 5  x 2  x 5  x 3  x 5  x 4 

f  x   52
 x  2  x  4  x  5 x  7   5  x  1 x  4  x  5 x  7   5  x  1 x  2  x  5 x  7 
 
1  2 1  4 1  51  7   2  1 2  4  2  5 2  7   4  1 4  2  4  5 4  7 
  40 
 x  1 x  2  x  4  x  7   10  x  1 x  2  x  4  x  5
 5  15  2 5  4 5  7  7  17  2 7  4 7  5

 13 1 5 5 1 
 18 
f  x    x  1 x  2  x  4  x  5 x  7    6  18  3  18 
  x  1  x  2   x  4   x  5  x  7  
 

1  13 3 5 30 1 
f x    x  1 x  2 x  4  x  5 x  7       
18   x  1  x  2   x  4   x  5  x  7  

Mr.Munther 2015
Engineering Analysis Numerical Analysis 76

(b) Newton polynomial :


i xi fi 1i f  i2 f  3i f  i4f

1 1 52
5  52
 47
2 2 5
2 1  5   47   14
 5   5  5 4 1 10  14
 6
5
42  35   5  10 5 1 6   6 
3 4
 40    5  35 20   10   2
52 7 1
6
54 25   35 72
4 5 40 10   40   20
 25 74
75
5 7 10

n 1

 f N x  x 
k

f x   f 1 k
1 k Where Nk  i
k 1 i 1

f  x   f 1  11f  x  x 1   12f  x  x 1  x  x 2   13f  x  x 1  x  x 2  x  x 3 


14f  x  x 1  x  x 2  x  x 3  x  x 4 

f  x   52   47 x  1  14  x  1 x  2    6 x  1 x  2  x  4   2  x  1 x  2  x  4  x  5

(b) Value of f (3) :


(1) Lagrange polynomial:

1  13 3 5 30 1 
f x    3  1 3  2  3  4  3  5 3  7        6 Ans.
18   3  1  3  2   3  4   3  5   3  7  

(2) Newton polynomial :

f  x   52   47 3  1  14  3  1 3  2    63  13  2 3  4   2 3  13  2 3  4 3  5  6 Ans.

Example 15 : The set of the following five data points is given :


i 1 2 3 4 5
xi 8 11 15 18 22
fi 5 9 10 8 7
(a) Determine the polynomial in the Lagrange form that passes through the points.
(b) Determine the polynomial in the Newton form that passes through the points.
(c) Determine the interpolated value for x = 12.7, using a Lagrange and Newton polynomial

Mr.Munther 2015

You might also like