You are on page 1of 39

1.

FIRST-ORDER DIFFERENTIAL EQUATIONS


Example: y   y  2  y( x)  2  ce  x

xy    y  y ( x)  c / x

y   cos x  0  y( x)  sin x  c

2 xy 3  2
Example: y     x 2 y 3  2 x  2e 4 y  c
3x 2 y 2  8e 4 y

Example: y   3 y, y(0)  5.7  y( x)  5.7e 3 x

Separable differential equation: y'  A( x) B( y)

1
Example: y   y 2 e  x  y x
e c

Q
RC circuits: Charging: E  IR   Q  CE (1  e t / RC )
C

Q
Discharging: IR   Q  Q0 e t / RC
C

Linear Differential Equations: y' ( x)  p( x) y( x)  q( x) , integrating factor: e 


p ( x ) dx

1 y
Example: y   y  sin( x)  y  [sin( x)  cos(x)]  Ce  x . y   3x 2  , y (1)  5 .
2 x

Exact Differential Equations


Potential function: For M ( x, y)  N ( x, y) y'  0 , we can find a  ( x, y) such that M
x

and  N ;  is the potential function; M ( x, y)  N ( x, y) y'  0 is
y
exact.
Exact differential equation: a potential function exists; general solution:  ( x, y)  c .

2 xy 3  2
Example: y    .
3x 2 y 2  8e 4 y

M N
Theorem: Test for exactness: 
y x

Example: , x 2  3xy  (4 xy  2 x) y   0 . e x sin y  2 x  (e x cos y  1) y   0 .

Integrating factor:  ( x, y)  0 such that M ( x, y)  N ( x, y) y'  0 is exact.

Example: y 2  6 xy  (3xy  6 x 2 ) y   0 .

 ( M )  ( N )
How to find integrating factor: 
y x

Example: x  xy  y   0 .

1
Separable equations and integrating factors:  
B

Linear equations and integrating factors:   e 


p ( x ) dx

y
Homogeneous differential equation: y '  f ( ) ; let y  ux  separable.
x

y2
Example: xy    y.
x

y' P( x) y  R( x) y  ;   0  linear;   1  separable; otherwise, let v  y 1  linear

y
Example: y    3x 2 y 3 .
x
2. SECOND-ORDER DIFFERENTIAL EQUTIONS
Example: y   y  0  y1  cos x, y 2  sin x .

Example: y   4 y   4 y  0, y1  e 2 x  y 2  xe 2 x .

The Constant Coefficient Homogeneous Linear Equation: y" Ay ' By  0 , A and B are numbers.

1. Characteristic equation: 2  A  B  0 obtained by substituting y  e x into


y" Ay ' By  0 .

 A  A2  4B
2. Case 1. A2  4B  0 : The general solution is y( x)  c1e ax  c2 e bx ; a  ,
2

 A  A2  4B
b .
2

Example: y   y   6 y  0  y  c1e 2 x  c2 e 3 x .

A
3. Case 2. A2  4B  0 : The general solution is y ( x)  c1e ax  c2 xe ax ; a   .
2

Example: y   6 y   9 y  0  y  c1e 3 x  c2 xe 3 x .

A
4. Case 3. A2  4B  0 : The general solution is y( x)  c1e ( p iq ) x  c2 e ( p iq ) x ; p   ,
2

4B  A2
q .
2

Example: y   2 y   6 y  0  y  c1e ( 1 5i ) x


 c2 e ( 1 5i ) x
.

Example: y  2 y  6 y  0  y  e  x (c1 cos( 5x)  c2 sin( 5x)) .

Example: x 2 y   2 xy   6 y  0  y  c1 x 3  c2 x 2 .

Example: x 2 y   5 xy   9 y  0  y  c1 x 3  c2 x 3 ln x .
Example: x 2 y   0.6 xy   16.04 y  0  y  x 0.2 (c1 cos(4 ln x)  c2 sin( 4 ln x)) .

2. The method of undetermined coefficients: only applied while p(x) and q(x) are constant,
i.e., y" Ay ' By  f ( x) .

1
Example: y   4 y  8 x 2  2 x  y  c1e 2 x  c 2 e  2 x  2 x 2  x 1 .
2

Example: y   2 y   3 y  8e x  y  c1e 3 x  c2 e x  2 xe x .

5 2 3x
y   6 y   9 y  5e 3 x  y  c1e 3 x  c 2 xe 3 x  x e
2

1
Example: y   4 y  x  2e  2 x  y  c1 cos 2 x  c 2 sin 2 x  ( x  e 2 x ) .
4

Find the general solution of the following differential equations.


dy 1
 y  ex b) y  2 y  y  e x
2
a)
dx x

Solutions
1
 dx
a) Integrating Factor Method: v( x)  e x  eln x  x
1 du
y   xe x dx . Let u  x 2  du  2 xdx  dx 
2

x 2x
1 e  1e 
2
u x
 y     du  y   C
x 2 x  2 

1
b) yg  c1e x  c2 xe x  x 2e x
2
A tank contains 10,000 liters of a solution consisting of 100 kg of salt dissolved in water. Pure
rocky mountain spring water is pumped into the tank at the rate of 10 liters/second. (The
mixture is kept uniform by stirring.) The mixture is pumped out of the tank at the same rate it
enters.
c) Set up the initial value problem for the amount of salt, S(t), in the tank at time t.
d) Solve this problem for S(t).
e) How long will it be before only 50 kg of salt remain in the tank?

Solutions
a) Salt inflow is 0
 S (t ) kg   liters 
Salt outflow is   * 10 s 
 10, 000 liters   
 S (t ) kg
S (t ) 
1000 s
S (0)  100kg

dS (t ) 1 1
b)
 S (t )

1000
dt  ln S (t ) 
1000
t C

 S (t )  Ce  t /1000
Using the initial condition, C  100  S (t )  100et /1000

t
c) 50  100et /1000  ln(0.5)   t  1000 ln(0.5)  693s
1000

Example 1
Solve
dy
3  2 y  e  x , y(0)  5
dx
Solution
The homogeneous solution for the above equation is given by
3D  2 y  0
The characteristic equation for the above equation is given by
3r  2  0
The solution to the equation is
r  0.666667
y H  Ce 0.666667x
The particular part of the solution is of the form Ae  x
3

d Ae  x 
 2 Ae  x  e  x
dx
 3 Ae  x  2 Ae  x  e  x
 Ae  x  e  x
A  1
Hence the particular part of the solution is
y P  e  x
The complete solution is given by
y  yH  yP
 Ce 0.666667x  e  x
The constant C can be obtained by using the initial condition y(0)  5
y0  Ce0.6666670  e 0  5
C 1  5
C6
The complete solution is
y  6e 0.666667x  e  x

Example 2
Solve
dy
2  3 y  e 1.5 x , y(0)  5
dx
Solution
The homogeneous solution for the above equation is given by
2 D  3 y  0
The characteristic equation for the above equation is given by
2r  3  0
The solution to the equation is
r  1.5
y H  Ce 1.5 x
Based on the forcing function of the ordinary differential equations, the particular part of the
solution is of the form Ae 1.5 x , but since that is part of the form of the homogeneous part of the
solution, we need to choose the next independent solution, that is,
y P  Axe 1.5 x
To find A , we substitute this solution in the ordinary differential equation as
d Axe 1.5 x 
2  3 Axe 1.5 x  e 1.5 x
dx
2 Ae 1.5 x  3 Axe 1.5 x  3 Axe 1.5 x  e 1.5 x
2 Ae 1.5 x  e 1.5 x
A  0.5
Hence the particular part of the solution is
y P  0.5 xe 1.5 x
The complete solution is given by
y  yH  yP
 Ce1.5 x  0.5xe 1.5 x
The constant C is obtained by using the initial condition y(0)  5 .
y0  Ce 1.5( 0)  0.5(0)e 1.5( 0)  5
C0 5
C 5
The complete solution is
y  5e 1.5 x  0.5 xe 1.5 x

Sample Case 2
When
X  sin(ax) or cos(ax) ,
the particular part of the solution is of the form
A sin( ax)  B cos(ax) .
We can get A and B by substituting y  A sin( ax)  B cos(ax) in the left hand side of the
differential equation and equating coefficients.

Example 3
Solve
d2y dy dy
2 2  3  3.125 y  sin x , y (0)  5, ( x  0)  3
dx dx dx
Solution
The homogeneous equation is given by
(2D 2  3D  3.125) y  0
The characteristic equation is
2r 2  3r  3.125  0
The roots of the characteristic equation are
 3  3 2  4  2  3.125
r
2 2
 3  9  25

4
 3   16

4
 3  4i

4
 0.75  i
Therefore the homogeneous part of the solution is given by
y H  e 0.75x ( K1 cos x  K 2 sin x)
The particular part of the solution is of the form
y P  A sin x  B cos x
d2
2 2
 A sin x  B cos x   3 d  A sin x  B cos x   3.125( A sin x  B cos x )  sin x
dx dx
2  A cos x  B sin x   3( A cos x  B sin x)  3.125( A sin x  B cos x)  sin x
d
dx
2( A sin x  B cos x)  3( A cos x  B sin x)  3.125( A sin x  B cos x)  sin x
(1.125 A  3B) sin x  (1.125 B  3 A) cos x  sin x
Equating coefficients of sin x and cos x on both sides, we get
1.125 A  3B  1
1.125 B  3 A  0
Solving the above two simultaneous linear equations we get
A  0.109589
B  0.292237
Hence
y P  0.109589 sin x  0.292237 cos x
The complete solution is given by
y  e 0.75x ( K1 cos x  K 2 sin x)  (0.109589 sin x  0.292237 cos x)
To find K 1 and K 2 we use the initial conditions
dy
y (0)  5, ( x  0)  3
dx
From y(0)  5 we get
5  e 0.75(0) ( K1 cos(0)  K 2 sin( 0))  (0.109589 sin( 0)  0.292237 cos(0))
5  K 1  0.292237
K 1  5.292237
dy
 0.75e 0.75x ( K1 cos x  K 2 sin x)  e 0.75x ( K1 sin x  K 2 cos x)
dx
 0.109589 cos x  0.292237 sin x
From
dy
( x  0)  3,
dx
we get
3  0.75e 0.75( 0) ( K1 cos(0)  K 2 sin( 0))  e 0.75( 0) ( K1 sin( 0)  K 2 cos(0))
 0.109589 cos(0)  0.292237 sin( 0)
3  0.75 K 1  K 2  0.109589
3  0.75(5.292237 )  K 2  0.109589
K 2  6.859588
The complete solution is
y  e 0.75x (5.292237 cos x  6.859588 sin x)  0.109589 sin x  0.292237 cos x

Example 4
Solve
d2y dy dy
2 2
 6  3.125 y  cos(x) , y (0)  5, ( x  0)  3
dx dx dx
Solution
The homogeneous part of the equations is given by
(2 D 2  6 D  3.125) y  0
The characteristic equation is given by
2r 2  6r  3.125  0
 6  6 2  4(2)(3.125)
r
2(2)
 6  36  25

4
 6  11

4
 1.5  0.829156
 0.670844 ,2.329156
Therefore, the homogeneous solution y H is given by
y H  K1e 0.670845x  K 2 e 2.329156x
The particular part of the solution is of the form
y P  A sin x  B cos x
Substituting the particular part of the solution in the differential equation,
d2 d
2 2 ( A sin x  B cos x)  6 ( A sin x  B cos x)
dx dx
 3.125( A sin x  B cos x)  cos x
d
2 ( A cos x  B sin x)  6( A cos x  B sin x)
dx
 3.125( A sin x  B cos x)  cos x
2( A sin x  B cos x)  6( A cos x  B sin x)
 3.125( A sin x  B cos x)  cos x
(1.125 A  6B) sin x  (1.125 B  6 A) cos x  cos x
Equating coefficients of cos x and sin x we get
1.125 B  6 A  1
1.125 A  6 B  0
The solution to the above two simultaneous linear equations are
A  0.161006
B  0.0301887
Hence the particular part of the solution is
y P  0.161006 sin x  0.0301887 cos x
Therefore the complete solution is
y  yH  yP
y  ( K1e 0.670845x  K 2 e 2.329156x )  0.161006 sin x  0.0301887 cos x
Constants K 1 and K 2 can be determined using initial conditions. From y(0)  5 ,
y (0)  K 1  K 2  0.0301887  5
K 1  K 2  5  0.0301887  4.969811
Now
dy
 0.670845 K1e ( 0.670845) x  2.329156 K 2 e ( 2.329156) x
dx
 0.161006 cos x  0.0301887 sin x
dy
From ( x  0)  3
dx
 0.670845 K 1  2.329156 K 2  0.161006  3
0.670845 K 1  2.329156 K 2  3  0.161006
0.670845 K 1  2.329156 K 2  2.838994
We have two linear equations with two unknowns
K 1  K 2  4.969811
0.670845 K 1  2.329156 K 2  2.838994
Solving the above two simultaneous linear equations, we get
K 1  8.692253
K 2  3.722442
The complete solution is
y  (8.692253 e 0.670845x  3.722442 e 2.329156x )
 0.161006 sin x  0.0301887 cos x.

Example 5
Solve
d2y dy dy
2 2  5  3.125 y  e  x sin x , y (0)  5, ( x  0)  3
dx dx dx
Solution
The homogeneous equation is given by
(2 D 2  5D  3.125) y  0
The characteristic equation is given by
2r 2  5r  3.125  0
 5  5 2  4(2)(3.125)
r
2(2)
 5  25  25

4
50

4
 1.25,1.25
Since roots are repeated, the homogeneous solution y H is given by
y H  ( K1  K 2 x)e ( 1.25) x
The particular part of the solution is of the form
y P  e  x ( A sin x  B cos x)
Substituting the particular part of the solution in the ordinary differential equation
d 2 x d
2 2
{e ( A sin x  B cos x)}  5 {e  x ( A sin x  B cos x)}
dx dx
 3.125{e ( A sin x  B cos x)}  e  x sin x
x

d
2 {e  x ( A sin x  B cos x)  e  x ( A cos x  B sin x)}
dx
 5{e  x ( A sin x  B cos x)  e  x ( A cos x  B sin x)}  3.125e  x ( A sin x  B cos x)  e  x sin x
2{e  x ( A sin x  B cos x)  e  x ( A cos x  B sin x)  e  x ( A cos x  B sin x)  e  x ( A sin x  B cos x)}
 5{e  x ( A sin x  B cos x)  e  x ( A cos x  B sin x)}  3.125e  x ( A sin x  B cos x)  e  x sin x
 1.875e  x ( A sin x  B cos x)  e  x ( A cos x  B sin x)  e  x sin x
 1.875( A sin x  B cos x)  ( A cos x  B sin x)  sin x
 (1.875 A  B) sin x  ( A  1.875 B) cos x  sin x
Equating coefficients of cos x and sin x on both sides we get
A  1.875 B  0
1.875 A  B  1
Solving the above two simultaneous linear equations we get
A  0.415224 and
B  0.221453
Hence,
y P  e  x (0.415224 sin x  0.221453 cos x)
Therefore complete solution is given by
y  yH  yP
y  ( K1  xK 2 )e 1.25x  e  x (0.415224 sin x  0.221453 cos x)
Constants K 1 and K 2 can be determined using initial conditions,
From y(0)  5, we get
K 1  0.221453  5
K 1  5.221453
Now
dy
 1.25 K1e 1.25x  1.25 K 2 xe 1.25x  K 2 e 1.25x 
dx
e  x (0.415224 cos x  0.221453 sin x)  e  x (0.415224 sin x  0.221453 cos x)
dy
From (0)  3, we get
dx
 1.25 K 1e 1.25( 0)  1.25 K 2 (0)e 1.25( 0)  K 2 e 1.25( 0)
 e 0 (0.415224 cos(0)  0.221453 sin( 0))  e 0 (0.415224 sin( 0)  0.221453 cos(0)  3
 1.25 K 1  K 2  0.221453  0.415224  3
 1.25 K 1  K 2  3.193771
 1.25(5.221453 )  K 2  3.193771
K 2  9.720582
Substituting
K 1  5.221453 and
K 2  9.720582
in the solution, we get
y  (5.221453  9.720582 x)e 1.25x  e  x (0.415224 sin x  0.221453 cos x)

dy
[Example] dx =x 1  y2

dy
[Solution] = x dx
1  y2

 dy
 =
 xdx + c
 1  y2

x2
or sin–1y = 2 + c implicit solution

2
or y = sin ( x2 + c ) explicit solution

[Example]

y  ky

[Solution]

dy
 kdx  ln | y | kx  c
y
 
y0  ln y    ln y   y / y 
 
y0
  ln y    ln( y)    y /  y  y / y 

| y | ec e kx  y  ce kx
where
 ec y0

c   e c y0
 0 y0

Trivial solution!
[Example] y' = – 2 x y

dy
[Solution] dx =2xy

dy
y =  2x dx

ln |y| = – x2 + c

2
or |y| = exp{ -x + c }
2
or y = c' e–x

Note that if c' = 0, we have a trivial solution y = 0.

[Example]

y   y / x y(1)  1

[Solution]

dy dx
 ln | y |  ln | x | c
y x
c
y
x
where
 ec x, y  0 or x, y  0
c c
 e x  0, y  0 or x  0, y  0

y(1)  c  1
 xy  1
[Exercises] Please solve the following equations

dy
(i) ex-y dx + 1 = 0

(ii) y’ = 2 x y ; y(0) = 1

xy + 3x - y - 3
(iii) y' = xy - 2x + 4y - 8

[Example] ( x2 +1 ) y' + ( y2 +1 ) = 0 y(0) = 1

dy dx
[Solution] 2 =  2
y +1 x +1

tan–1y = – tan–1x + c

or tan–1x + tan–1y = c

tan(tan–1x + tan–1y) = tan c

x+y
or = tan c = c'  general solution
1  xy

Since y(0) = 1, we have tan c = 1


x+y
 =1
1  xy

1x
or y = 1+x #  particular solution

[Example] y' = (x + y)2+ a2 a = constant

Let u=x+y  y  u 2  a 2

du dy
dx = 1 + dx

du 2 2
 dx = 1+u + a

du
 = dx
u + a2 + 1
2

 du
and  2 2 = x+c
 u +a +1

1 u
tan–1 = x+c
1+a2 1+a2

u= 1+a2 tan( x 1+a2 + c')

where c  c 1  a 2

 y= 1+a2 tan( x 1+a2 + c')  x #

y  kx
[Example] y' = x + ky where k = constant

Let y/x = u or y=xu

 y' = u + x u'

uk k (1 + u2)
u + x u' = 1 + ku ; or x u' = - 1 + ku
 1 u  dx
  2 + 2  du + x = 0
 k( 1 + u ) 1 + u 

1 –1
 k tan u + ln 1+u2 + ln |x| = c

1 –1 y
or k tan x + ln x2+y2 = c#

[Exercises] Please solve the following equations:

xy + 2y2
(i) y' = 2
x
y-x
(ii) y' = y + x

2 x-1 y - 3
(iii) y' =
2 y-1 x - 3

[Example] (7y  3x + 3) y' + 3y  7x + 7 = 0

[Solution] The above ODE can be written as

7x  3y  7
y' =
 3x + 7y + 3

and t = x1 z = y

dy dz 7(x  1)  3y 7t3z
 = = =
dx dt 3(x  1) + 7y 3 t + 7 z

dz 7t  3z
thus dt = –3t + 7z  Case (2)

Ans: ( y + x  1 )5 ( y  x + 1 )2 = C #

[Example] (y  x + 5 ) y' = y  x + 1

[Solution

u
Let u = y  x + 1  y 
u4
du dy
dx = dx – 1 = y' 1

 y' = 1 + u'

 (u + 4) (1 + u') = u

or ( u + 4 ) u' = –4

 (u + 4) du = 
  4 dx + c

1 2
 2 u + 4u + 4x = c

i.e., (y  x)2+ 10 y  2 x = c'

1 - 2y - 4x
[Exercise] Solve y' = 1 + y + 2x

Time required for draining a tank  Torricelli's Law

h(t)

Outlet

V = A v t

where V = volume of water flows out during t


A = cross-sectional area of the outlet = 0.7854 cm2
v = velocity of the out-flowing water

Torricelli's law states that

v = 0.6 2gh
2
where g = acceleration of gravity = 980 cm/sec
h = height of water above the outlet

Note that V must equal to change of the volumes of water in the tank,
i.e.,

V =  B h (Mass Balance)

where B = cross-sectional area of the tank = 7854 cm2


h = decrease of the height h(y) of the water

i.e., A v t = – B h

h Av A 0.6 2gh
or =  B = 
t B

Letting t  0, we obtain the differential equation

dh A 0.6 2gh
dt =  B =  0.00266 h

Initially, the height of the water is 150 cm, i.e.,

h(0) = 150 cm  Initial Condition

we then have

h(t) = (12.25  0.00133 t)2

[Example] Solve x y' + y + 4 = 0

[Solution] (y + 4) dx + x dy = 0

or M = y+4 ; N = x

Check the exactness by

M N
=1=  Exact Differential
y x
Solve for u=
 M dx + k(y)

u=
 (y + 4) dx + k(y) = x y + 4x + k(y)

u
But = N(x,y)
y

or x + k'(y) = x

we have k'(y) = 0 or k(y) = c*

Thus, we have the solution u = c or

x y + 4x + c* = c

or x y + 4x = c'

Differentiate with respect to x, i.e.

du
 y  xy  4  0
dx
y4 M
y   
x N

[Example] (1  sin x tan y) dx + (cos x sec2 y) dy = 0

[Solution] M = 1  sin x tan y

N = cos x sec2 y

M N
=  sin x sec2 y =  Exact Differential
y x

The solution is

u=
 M dx + k(y)

=
 (1  sin x tan y) dx + k(y)
= x + cos x tan y + k(y)
u
= N(x,y)
y

or cos x sec2 y + k(y)' = cos x sec2 y

 k'(y) = 0 or k(y) = c*

The solution u = c becomes

x + cos x tan y = c'

[Example] (4 x + 3 y2) dx + 2 x y dy = 0

P = 4 x + 3 y2 Q=2xy

P Q
=6y2y=  not exact
y x

 P Q 
  
 y x  6y2y 2
Check Q = 2xy = x = f(x)

Thus, the integrating factor F(x) is

2

 x dx
F(x) = ef(x)dx = e = x2

Multiply F(x) on both sides of the differential equation, we have

(4 x3 + 3 x2 y2) dx + 2 x3 y dy = 0  Exact

 x4+ x3 y2 = c

[Example] 2 cosh x cos y dx  sinh x sin y dy = 0

ex + e-x
Note that cosh x  2
ex - e-x
sinh x  2
and d cosh x/dx = sinh x
d sinh x/dx = cosh x
P = 2 cosh x cos y

Q = – sinh x sin y

P Q
= 2 cosh x sin y   cosh x sin y =
y x

 P Q 
  
 y x   2 cosh x sin y + cosh x sin y
Check =
Q  sinh x sin y

cosh x
= sinh x = f(x)

Thus, the integrating factor F(x) is

cosh x

 sinh x dx
F(x) = ef(x)dx = e = sinh x

Multiply sinh x on both sides of the differential equation, we have

2 sinh x cosh x cos y dx  sinh2 x sin y dy = 0

which can be solved by

u   FPdx  k ( y )   2sinh x cosh x cos y dx  k ( y )

 sinh 2 x cos y  k ( y )

u
and =FQ   sinh2x sin y + k'(y) = - sinh2 x sin y
y

 k   0  k(y) = constant

Thus the solution to the above ODE is

sinh2x cos y = c

[Exercise] x y dx + ( x2 + y2 + 1 ) dy = 0
2 2
[Exercise] ( y + x y + 1 ) dx + ( x + x y + 1 ) dy = 0

[Example] y' = y + x2 , y(0) = 1

y'  y = x2  y' + p(x) y = r(x)

thus, the integrating factor is

 p(x) dx = e
e  - 1 dx = e– x

Multiply both sides of the differential equation according to the alternative


procedure, we have

e– x (y'  y) = x2 e– x

or ( y e– x)' = x2 e– x

Integrating both sides, we have

y e–x = 
 x2 e–x dx + c = c  ( x2 + 2 x + 2 ) e–x

Thus, y = c ex  (x2 + 2 x + 2)  general solution

Since y(0) = 1  c = 3

thus y = 3 ex  ( x 2 + 2 x + 2 )  particular solution for y(0) =


1

The general solution can also be obtained by the general formula

 
y = e- 

p(x) dx   r(x) e p(x) dx
dx + c

  
 
 
= ex  
 x2 e–x dx + c 
 
= c ex  (x2 + 2x + 2)

dy 3
[Example] dx = x  2 x y y(1) = 1

[Solution] y' + 2 xy = x3  y' + p(x) y = r(x)

 The integrating factor is

 p(x) dx  2x dx
e = e = ex 2

Multiply both sides by ex2 and integrating, we have

ex2 ( y' + 2 x y ) = x3 ex2

or ( ex2 y)' = x3 ex2

ex 2 y =  3 2
 x ex dx + c

 
y = ex2  
 x ex dx + c
3 2
or
 
 x 2  x 2 -1  
 e - x2
e    c  (integration by parts)
  2  

x2  1 -x2
 y= 2 + c e

1 1
Since y(1) = 1   ce 1 , we have c = e
2

x2  1 1-x2
thus, y = +e
2
4. LAPLACE TRANSFORM

4.1 Definition and Basic Properties: initial value problem  algebra problem  solution of the
algebra problem  solution of the initial value problem


1. Definition (Laplace Transform): The Laplace transform L[ f ]( s )   e  st f (t )dt  F ( s ) ,
0

for all s such that this integral converges.

1 1
Examples: f (t )  e at  L[ f ]( s )  , s  a . g (t )  sin t  L[ f ]( s )  2 .
sa s 1

2. Table of Laplace transform of functions

3. Theorem (Linearity of the Laplace transform): Suppose L[ f ]( s) and L[ g ]( s) are defined


for s  a , and  and  are real numbers. Then
L[f  g ]( s)  F (s)  G(s) for s  a .

4. Definition (Inverse Laplace transform): Given a function G, a function g such that


L[ g ]  G is called an inverse Laplace transform of G. In this event, we write

g  L1[G] .

5. Theorem (Lerch): Let f and g be continuous on [0, ) and suppose that L[ f ]  L[ g ] .


Then f  g .

6. Theorem: If L1 [ F ]  f and L1[G]  g and  and  are real numbers, then

L1[F  G]( s)  f  g .

Theorem (Laplace transform of a derivative): Let f be continuous on [0, ) and suppose f '
is piecewise continuous on [0, k ] for every positive k. Suppose also that

lim e  sk f (k )  0 if s  0 . Then L[ f ' ]( s)  sF (s)  f (0) .


k 

Theorem (Laplace transform of a higher derivative): Suppose f , f ' , , f n1 are continuous

on [0, ) and f (n ) is piecewise continuous on [0, k ] for every positive k.

Suppose also that lim e  sk f ( j ) (k )  0 for s  0 and for j  1, 2, , n  1 . Then


k 

L[ f ( n ) ]( s)  s n F ( s)  s n1 f (0)  s n2 f ' (0)    sf ( n2)


(0)  f ( n1) (0) .

5 4t 1
Examples: y'4 y  1; y(0)  1  y  e  .
4 4

1 3 7
y"4 y'3 y  e t ; y(0)  0, y' (0)  2  y  e t  e t  e 3t .
8 4 8

Theorem (First shifting theorem, or shifting in the s variable): Let L[ f ]( s)  F ( s) for

s  b  0 . Let a be any number. Then L[e at f ]( s)  F ( s  a) for s  a  b .

 L1[ F ( s  a)]  e at L1[ F ( s)]  e at f (t ) .


sa  4 
Examples: L[e at cos(bt)]  . Find L1  2   e 2t sin 4t .
( s  a)  b
2 2
 s  4s  20 

Convolution

Definition (Convolution): If f and g are defined on [0, ) , then the convolution f  g of f


t
with g is the function defined by ( f  g )(t )   f (t   ) g ( )d for t  0 .
0

Theorem (Convolution theorem): If f  g is defined, then L[ f  g ]  L[ f ]L[ g ]  F (s)G(s) .

Theorem: Let L1 [ F ]  f and L1[G]  g . Then L1[ FG]  f  g .

 1  1 1 1
Example: L1  2 
 te 4t  e 4t  .
 s ( s  4)  4 16 16

t 2
Determine f such that f (t )  2t 2   f (t   )e  d  2t 2  t 3 .
0 3

Theorem: If f  g is defined, so is g  f , and f  g  g  f .

Example: Solve y"2 y'8 y  f (t ); y(0)  1, y' (0)  0 


1 1 1 2
f  e 4t  f  e  2t  e 4t  e  2t .
6 6 3 3

Laplace Transform Solution of Systems

x"2 x'3 y '2 y  4, 7 1 10


x    3t  e  2t  et
Example: Solve the system: 2 y ' x'3 y  0,  2 6 3
1  2t 2 t
x(0)  x' (0)  y (0)  0. y  1  e  e
3 3

Theorem: Let L[ f ]( s)  F ( s) for s  b and suppose that F is differentiable. Then


L[tf (t )]( s)   F ' (s) for s  b .

Corollary: Let L[ f ]( s)  F ( s) for s  b and let n be a positive integer. Suppose F is n times


dn
differentiable. Then L[t n f (t )]( s)  (1) n F ( s) for s  b .
ds n

Example: ty"(4t  2) y'4 y  0; y(0)  1 

 1 1 1 1 
y  e 4t  2te 4t  c   t  e 4t  te 4t  .
 32 16 32 16 

1 2
Example: y"2ty '4 y  1; y(0)  y' (0)  0  y  t .
2
Example 6
Solve
dy
3  2 y  e  x , y(0)  5
dx
Solution
Taking the Laplace transform of both sides, we get
 dy 
L 3  2 y   L e  x 
 dx 
1
3[ sY ( s )  y (0)]  2Y ( s ) 
s 1
Using the initial condition, y(0)  5 we get
1
3[ sY ( s)  5]  2Y ( s) 
s 1
1
(3s  2)Y ( s )   15
s 1
15s  16
(3s  2)Y ( s) 
s 1
15s  16
Y (s) 
( s  1)(3s  2)
Writing the expression for Y (s) in terms of partial fractions
15s  16 A B
 
( s  1)(3s  2) s  1 3s  2
15 s  16 3 As  2 A  Bs  B

( s  1)(3s  2) ( s  1)(3s  2)
15s  16  3As  2 A  Bs  B
Equating coefficients of s 1 and s 0 gives
3 A  B  15
2 A  B  16
The solution to the above two simultaneous linear equations is
A  1
B  18
1 18
Y (s)  
s  1 3s  2
1 6
 
s  1 s  0.666667
Taking the inverse Laplace transform on both sides
 1  1  6 
L1{Y ( s)}  L1  L  
 s  1  s  0.666667 
Since
 1 
L1  e
 at

 s  a 
The solution is given by
y( x)  e  x  6e 0.666667x

Example 7
Solve
dy
2  3 y  e 1.5 x , y(0)  5
dx
Solution
Taking the Laplace transform of both sides, we get
 dy 

L 2  3 y   L e 1.5 x 
 dx 
1
2[ sY ( s)  y (0)]  3Y ( s) 
s  1.5
Using the initial condition y(0)  5 , we get
1
2[ sY ( s)  5]  3Y ( s) 
s  1.5
1
(2s  3)Y ( s)   10
s  1.5
10 s  16
(2s  3)Y ( s) 
s  1.5
10 s  16
Y (s) 
( s  1.5)(2s  3)
10 s  16

2( s  1.5)( s  1.5)
10 s  16

2( s  1.5) 2
5s  8

( s  1.5) 2
Writing the expression for Y (s) in terms of partial fractions
5s  8 A B
 
( s  1.5) 2
s  1.5 ( s  1.5) 2
5s  8 As  1.5 A  B

( s  1.5) 2
( s  1.5) 2
5s  8  As  1.5 A  B
Equating coefficients of s 1 and s 0 gives
A5
1.5 A  B  8
The solution to the above two simultaneous linear equations is
A5
B  0.5
5 0.5
Y ( s)  
s  1.5 ( s  1.5) 2

Taking the inverse Laplace transform on both sides


 5  1  0.5 
L1{Y ( s)}  L1    L  
2 
 s  1.5   ( s  1.5) 
Since
 1  1  1 
L1    e and L    xe  ax
 ax
2 
sa  ( s  a) 
The solution is given by
y( x)  5e 1.5 x  0.5 xe 1.5 x

Example 8
Solve
d2y dy dy
2 2
 3  3.125 y  sin x , y (0)  5, ( x  0)  3
dx dx dx
Solution
Taking the Laplace transform of both sides
 d2y 
L 2 2  3  3.125 y   Lsin x 
dy
 dx dx 
and knowing
d2y
L 2   s 2Y s   sy 0  x  0
dy
 dx  dx
 dy 
L   sY s   y 0 
 dx 
1
L(sin x)  2
s 1
we get
 
2s 2Y ( s)  sy (0)  ( x  0)  3sY ( s)  y (0)  3.125Y ( s)  2
dy 1
 dx  s 1
 
2 s 2Y ( s )  5s  3  3sY ( s )  5  3.125Y ( s)  2
1
s 1
s2s  3  3.125Y (s)  10 s  21  2 1
s 1
s2s  3  3.125Y (s)  2  10 s  21
1
s 1
2s 2  3s  3.125 Y ( s)  
22  10 s 3  10 s  21s 2
( s 2  1)
10 s 3  21s 2  10 s  22
Y ( s) 
s 2  12s 2  3s  3.125
Writing the expression for Y (s) in terms of partial fractions
As  B Cs  D 10 s 3  21s 2  10 s  22
2s 2  3s  3.125  s 2  1  s 2  12s 2  3s  3.125
As 3  As  Bs 2  B  2Cs 3  3Cs 2  3.125Cs  2 Ds 2  3Ds  3.125 D

2s 2  3s  3.125 s 2  1  
10 s  21s  10 s  22
3 2

 
s 2  1 2s 2  3s  3.125 
 A  2C s 3
 B  3C  2 D s   A  3.125C  3D s  B  3.125 D 
2

 
s 2  1 2s 2  3s  3.125 
10 s  21s  10 s  22
3 2

 
s 2  1 2s 2  3s  3.125 
3 2 1 0
Equating terms of s , s , s and s gives
A  2C  10
B  3C  2D  21
A  3.125C  3D  10
B  3.125 D  22
The solution to the above four simultaneous linear equations is
A  10.584474
B  21.657534
C  0.292237
D  0.109589
Hence
10.584474 s  21.657534  0.292237 s  0.109589
Y ( s)  
2s 2  3s  3.125 s2 1
 
2s 2  3s  3.125  2{( s 2  1.5s  0.5625)  1}  2{( s  0.75) 2  1}
10.584474 ( s  0.75)  13.719179  0.292237 s  0.109589
Y ( s)  
2{( s  0.75) 2  1} s2 1
5.292237 ( s  0.75) 6.859589 0.292237 s 0.109589
   
{( s  0.75)  1}
2
{( s  0.75)  1}
2
( s 2  1) ( s 2  1)
Taking the inverse Laplace transform of both sides
 5.292237 ( s  0.75)   6.859589 
L1{Y ( s )}  L1    L1  
 {( s  0.75)  1}   {( s  0.75)  1 
2 2

 0.292237 s  1  0.109589 
 L1  L  2 
 s 1   s 1 
2

 s  0.75   1 
L1{Y ( s )}  5.292237 L1    6.859589 L1  
 {( s  0.75)  1}   {( s  0.75)  1 
2 2

 s  1  1 
 0.292237 L1  2   0.109589 L  2 
 s  1  s  1
Since
 sa 
L1    e  ax cosbx
2 
 s  a   b 
2

 b 
L1    e ax sin bx
2 
 s  a   b 
2

 1 
L1  2 2 
 sin ax
s a 
 s 
L1  2 2 
 cos ax
s a 
The complete solution is
y ( x)  5.292237 e 0.75x cos x  6.8595859 e 0.75x sin x
 0.292237 cos x  0.109589 sin x
 e 0.75x 5.292237 cos x  6.859589 sin x   0.292237 cos x  0.109589 sin x

Example 9
Solve
d2y dy dy
2 2
 6  3.125 y  cos x , y (0)  5, ( x  0)  3
dx dx dx
Solution
Taking the Laplace transform of both sides
 d2y 
L 2 2  6  3.125 y   Lcos x 
dy
 dx dx 
and knowing
d2y
L 2   s 2Y s   sy 0  x  0
dy
 dx  dx
 dy 
L   sY s   y 0 
 dx 
s
L(cos x)  2
s 1
we get
 
2s 2Y ( s)  sy (0)  ( x  0)  6sY ( s)  y (0)  3.125Y ( s)  2
dy s
 dx  s 1
 
2 s 2Y ( s)  5s  3  6sY ( s)  5  3.125Y ( s)  2
s
s 1
s(2s  6)  3.125Y (s)  2  10 s  36
s
s 1

2s 2  6s  3.125 Y ( s )   36  10 s 3  11s  36 s 2
s2 1
10 s 3  36 s 2  11s  36
Y (s)  2
s  12s 2  6s  3.125
Writing the expression for Y (s) in terms of partial fractions
As  B Cs  D 10 s 3  36 s 2  11s  36
 
2s 2  6s  3.125 s 2  1 s 2  12s 2  6s  3.125
As 3  As  Bs 2  B  2Cs 3  6Cs 2  3.125Cs  2 Ds 2  6 Ds  3.125 D

2s 2  6s  3.125 s 2  1  
10 s 3  36 s 2  11s  36

 
s 2  1 2s 2  6s  3.125 
 A  2C s 3  B  6C  2 D s 2   A  3.125C  6 D s  B  3.125 D 
s 2

 1 2s 2  6s  3.125 
10 s 3  36 s 2  11s  36

 
s 2  1 2s 2  6s  3.125 
3 2 1 0
Equating terms of s , s , s and s gives
A  2C  10
B  6C  2D  36
A  3.125C  6D  11
B  3.125 D  36
The solution to the above four simultaneous linear equations is
A  9.939622
B  35.496855
C  0.0301886
D  0.161006
Then
9.939622 s  35.496855 0.0301886 s  0.161006
Y ( s)  
2s 2  6s  3.125 s2 1
 
2s  6s  3.125  2{( s  3s  2.25)  0.6875}  2{( s  1.5) 2  0.829156 2 }
2 2
9.939622 ( s  1.5)  20.587422 0.0301886 s  0.161006
Y ( s)  
2{( s  1.5) 2  0.829156 2 } s2 1
4.969811( s  1.5) 10.293711
 
{( s  1.5)  0.829156 } {( s  1.5) 2  0.829156 2 }
2 2

0.0301886 s 0.161006
 
s2 1 s2 1
Taking the inverse Laplace transform on both sides
 4.969811( s  1.5)   10.293711 
L1{Y ( s )}  L1    L1 
2 

 {( s  1.5)  0.829156 }   {( s  1.5)  0.829156
2 2 2

 0.0301886 s  1  0.161006 
 L1  L  2 
 s 1   s 1 
2

 ( s  1.5)   1 
 4.969811 L1    10.293711 L1 
2 

2 
 ( s  1.5)  0.829156   ( s  1.5)  0.829156 
2 2

 s   1 
 0.0301886 L1  2   0.161006 L1  2 
 ( s  1)   ( s  1) 
Since
 sa 
L1    e  ax coshbx
2 
 s  a   b 
2

 1  1  ax
L1    e sinh bx
2 
 s  a   b  b
2

 1  1
L1  2 2 
 sin ax
s a  a
 s 
L1  2 2 
 cos ax
s a 
The complete solution is
10.293711 1.5 x
y( x)  4.969811e 1.5 x cosh(0.829156 x)  e sinh( 0.829156 x)
0.829156
 0.0301886 cos x  0.161006 sin x
  e 0.829156x  e 0.829156x   e 0.829156x  e 0.829156x 
 e 1.5 x  4.969811   12.414685   

  2   2 
 0.030188 cos x  0.161006 sin x

 
 e 1.5 x 8.692248 e 0.829156x  3.722437 e 0.829156x  0.0301886 cos x
 0.161006 sin x

Example 10
Solve
d2y dy dy
2 2
 5  3.125 y  e  x sin x , y (0)  5, ( x  0)  3
dx dx dx
Solution
Taking the Laplace transform of both sides
 d2y 
dy
L 2 2  5  3.125 y   L e  x sin x  
 dx dx 
knowing
d2y
L 2   s 2Y s   sy 0  x  0
dy
 dx  dx
 dy 
L   sY s   y 0 
 dx 
1
L(e  x sin x) 
( s  1) 2  1
we get
 
2 s 2Y ( s)  sy (0)  ( x  0)  5sY ( s)  y (0)  3.125Y ( s) 
dy 1
 dx  ( s  1) 2  1

 
2 s 2Y ( s)  5s  3  5sY ( s)  5  3.125Y ( s) 
1
( s  1) 2  1

s2s  5  3.125Y (s)  10s  31  1


( s  1) 2  1

s(2s  5)  3.125Y (s)  1


 10 s  31
( s  1) 2  1

2s 2
 63  10 s 3  82 s  51s 2
 5s  3.125 Y ( s ) 
s 2  2s  2
10 s 3  51s 2  82 s  63
Y ( s)  2
 
s  2s  2 2s 2  5s  3.125 
Writing the expression for Y (s) in terms of partial fractions
As  B Cs  D 10 s 3  51s 2  82 s  63
 
2s 2  5s  3.125 s 2  2s  2 s 2  2s  22s 2  5s  3.125 
2Cs 3  5Cs 2  3.125Cs  2 Ds 2  5Ds  3.125 D  As 3  2 As 2  2 As  Bs 2  2 Bs  2 B

2s 2  5s  3.125 s 2  2s  2 
10 s  51s  82 s  63
3 2

 
s  2s  2 2s 2  5s  3.125
2

2C  As 3  5C  2 D  2 A  B s 2  3.125C  5D  2 A  2 B s  3.125 D  2 B 
s 2

 2s  2 2s 2  5s  3.125 
10 s 3  51s 2  82 s  63

 
s 2  2s  2 2s 2  5s  3.125 
3 2 1 0
Equating terms of s , s , s and s gives four simultaneous linear equations
2C  A  10
5C  2D  2 A  B  51
3.125C  5D  2 A  2B  82
3.125 D  2B  63
The solution to the above four simultaneous linear equations is
A  10.442906
B  32.494809
C  0.221453
D  0.636678
Then
10.442906 s  32.494809  0.221453 s  0.636678
Y ( s)  
2s 2  5s  3.125 s 2  2s  2
 
2s  5s  3.125  2{( s  2.5s  1.5625)}  2( s  1.25) 2
2 2

10.442906 ( s  1.25)  19.441176  0.221453 ( s  1)  0.415225


Y ( s)  
2( s  1.25) 2 ( s  1) 2  1
5.221453 ( s  1.25) 9.720588 0.221453 ( s  1) 0.415225
   
( s  1.25) 2 ( s  1.25) 2 ( s  1) 2  1 ( s  1) 2  1
Taking the inverse Laplace transform on both sides
 5.221453   9.720588 
L1{Y ( s )}  L1    L1  
2 
 ( s  1.25)   ( s  1.25) 
 0.221453 ( s  1)  1  0.415225 
 L1  
  L  
 ( s  1) 2
 1   ( s  1) 2
 1 
 1   1 
 5.221453 L1    9.720588 L1  
 ( s  1.25)   ( s  1.25)
2

 ( s  1)  1  1 
 0.221453 L1  
  0.415225 L 
 ( s  1) 2  1 
 ( s  1) 2
 1   
Since
 sa 
L1  2 
  e  ax cosbx
 s  a   b 
2

 b 
L1  2 
  e ax sin bx
 s  a   b 
2

 1 
L1  e
 ax

 s  a 
 1  e  ax x n 1
L1  
n 
 ( s  a)  (n  1)!
The complete solution is
y ( x)  5.221453 e 1.25x  9.720588 e 1.25x x  0.221453 e  x cos x
 0.415225 e  x sin x
 e 1.25x 5.221453  9.720588 x   e x (0.221453 cos x  0.415225 sin x)

INITIAL VALUE PROBLEMS

First-order linear equations


dy
 f ( x , y ) , y ( x0 )  y 0 y
dx
Numerical solution

Exact
solution
y0 y1 y2
x
x0 x1 x2 x3 ……

Note: x 0 is the point where the ‘dynamics’ defined by the


differential equation starts or where the information about the
unknown ( y 0 in this case) is known. It does not have to be zero.

Integrating the differential equation yields


xi 1x
dy i 1

yi 1  yi   dx   f ( x, y) dx
x dx i x i

A recursive (recurrence) formula can be formed as

xi 1
yi 1  yi   f ( x, y )dx
xi

The problem now becomes that of numerical integration.


Euler’s Method (rectangle rule for f )

yi 1  yi  hf ( xi , yi ) with h  xi 1  xi
y

yi yi+1

x
xi xi+1

Modified Euler’s Method (average) (‘trapezium rule’ for f )

h
yi 1  yi  hf ( xi , yi ) , yi 1  yi  [ f ( xi , yi )  f ( xi 1 , yi 1 )]
2

Mid-point Method (‘trapezium rule’ for f )


h h
yi  1  yi  f ( xi , yi ) , yi 1  yi  hf ( xi  , yi  1 )
2 2 2 2

Runge-Kutta Methods (for information only)


h K
K 0  hf ( xi , yi ) K1  hf ( xi  , yi  0 )
2 2
h K
K 2  hf ( xi  , yi  1 ) K 3  hf ( xi  h, yi  K 2 )
2 2
1
yi 1  yi  ( K 0  2 K1  2 K 2  K 3 )
6
Example

Differential equation

π π
xy  y  2 x 2 cos 2 x  0 , y ( ) 
4 4

Its analytical solution is

y ( x)  x sin 2 x

First convert the original differential equation into the standard


format as
y  2 x 2 cos 2 x
y   f ( x, y ) 
x
y 1.5

0.5

0
Exact
0.5 1.5 2.5 Euler
-0.5
Modified Euler
Mid-point Euler
-1

-1.5

-2

-2.5 x

You might also like