You are on page 1of 10

Week 7

Topic 1. Differential Equations (


Stewart, bl. 643–650, 659–667, 679–686
Zill, bl. 43–59)
General Differential Equations
A differential equation is an equations which contains an unknown function and one or more of
its derivatives
The orderof a differential equation is the highest derivative which occurs in the differential equation.
A solution of a differential equation is a function which satisfies the differential equation.
Example 1.
dy √
(a) = x y is a first order differential equation
dx
1 4
y= 16 x is a solution. Indeed,

dy
= 14 x3 ,
dx
√ dy
q
x y = x 16 x = x · 14 x2 = 14 x3 =
1 4
dx

(b) y ′′ − 2y ′ + y = 0 is a second order differential equation.


For y = xex , is y ′ = (x + 1)ex en y ′′ = (x + 2)ex
Consequently,

y ′′ − 2y ′ + y = (x + 1)ex + (−2x − 2)ex + xex = 0

and thus y = xex is a solution.


(c) y ′′′ + y ′′ + 9y ′ + 9y = 0 is a third order differential equation. y = cos(3x) is a solution (verify
this!)
dy
(d) dx = − xy is a first order differential equation.

y 2 + x2 = 25 is an implicit solution. Indeed, with implicit differentiation, it follows that


d dy dy x
y 2 + x2 = 2y

+ 2x = 0 =⇒ =−
dx dx dx y

Example 2. Consider the equation

y ′′ + 2y ′ + 4y = 5 sin(t)

1
Since the derivatives of sin and cos could give us a sin, a good guess for a solution is a function of
the form
y = A cos(t) + B sin(t), where A and B are constants.
Determine the values for A and B so that y = A cos t + B sin t is a solution

Solution: We have
y = A cos t + B sin t
y ′ = −A sin t + B cos t
y ′′ = −A cos t − B sin t
Thus
y ′′ +2y ′ +4y = (−A+2B+4A) cos t+(−B−2A+4B) sin t = (3A+2B) cos t+(−2A+3B) sin t = 5 sin t
Thus
3A + 2B = 0
−2A + 3B = 5
(A, B) = − 10 15

13 , 13 is the unique solution of this system. Thus
y = − 10
13 cos t +
15
13 sin t
is a solution of y ′′ + 2y ′ + 4y = 5 sin t

Separable Differential Equations

A separable differential equation is a first order equation of the form

dy dy g(x)
= g(x)f (y) of =
dx dx h(y)

If f (y) ̸= 0, we can rewrite the equation as


dy g(x) 1
= , where h(y) =
dx h(y) f (y)

Method of solving. If y = ϕ(x) is a solution of the separable differential equation above, then
dy g(x)
=
dx h(y)
dy
=⇒ h(y) = g(x)
 ′ dx
=⇒ h ϕ(x) ϕ (x) = g(x)
Z Z
 ′
=⇒ h ϕ(x) ϕ (x) dx = g(x) dx
Z Z
=⇒ h(y) dy = g(x) dx, according the the substitution rule with y = ϕ(x)

2
By determining these integrals, we will get an (implicit) equation which the solution y = ϕ(x)
satisfies. Conversely, with implicit differentiation, we can verify that any function which satisfies
this integral equation, will be a solution of our differential equation.
Briefly, we can remember this method as follows: multiply with h(y) and dx on both sides, and
then write integral signs,
Z Z
dy g(x)
= =⇒ h(y) dy = g(x) dx =⇒ h(y) dy = g(x) dx
dx h(y)

and determine the integrals.


Example 3. Determine the general solution of the following differential equation.

dy e2y sin3 θ
=
dθ 1 + cos θ

Solution:
sin3 θ sin3 θ
Z Z
dy −2y
= e2y =⇒ e dy = dθ
dθ 1 + cos θ 1 + cos θ
We have
Z
e−2y dy = − 21 e−2y + k1 ,

en
1 − cos2 θ sin θ

sin3 θ u = 1 + cos θ,
Z Z
dθ = dθ, du
1 + cos θ 1 + cos θ dθ = − sin θ
2

1 − (u − 1)
Z
=− du
u
Z 2
u − 2u
Z
= du = (u − 2) du = 12 u2 − 2u + k2
u
= 2 (1 + cos θ)2 − 2 − 2 cos θ + k2 = 12 cos2 θ − cos θ −
1 3
2 + k2

Thus the general solution of the differential equation is

=⇒ − 12 e−2y = 1
2 cos2 θ − cos θ + K
=⇒ e−2y = − cos2 θ + 2 cos θ + C, where C = −2K
2

=⇒ −2y = ln − cos θ + 2 cos θ + C
y = − 12 ln − cos2 θ + 2 cos θ + C

=⇒

Example 4. Determine the general solution of the following differential equation.


dy
= y 1 − y 2 tan x

dx

3
Solution: By taking y 1 − y 2 to the left and dx to the right, and writing the integral signs, we


get
Z Z
1
dy = tan x dx
y (1 − y 2 )

We already know that


Z
tan x dx = − ln | cos x| + k1

Partial fraction decomposition:


1 1
2
=
y (1 − y ) y(1 − y)(1 + y)
A B C
= + +
y 1−y 1+y
=⇒ 1 = A(1 − y)(1 + y) + By(1 + y) + Cy(1 − y)

y=0: 1 = A(1)(1) + 0 + 0 =⇒ A=1


y=1: 1 = 0 + B(1)(2) + 0 =⇒ B = 21
1
y = −1 : 1 = 0 + 0 + C(−1)(−2) =⇒ C= 2
Now the integral becomes
Z Z  
1 1 1 1
dy = + + dy
y (1 − y 2 ) y 2(1 − y) 2(1 + y)
= ln |y| − 12 ln |1 − y| + 12 ln |1 + y| + k2

The general solution is thus,

ln | cos x| + ln |y| − 21 ln |1 − y| + 12 ln |1 + y| = K

We can further simplify this with manipulations,


1
2 ln | cos x|2 + 21 ln |y|2 − 21 ln |1 − y| + 12 ln |1 + y| = K
y 2 cos2 (x)(1 + y)
=⇒ ln = 2K
1−y
y 2 cos2 (x)(1 + y)
=⇒ = ±e2K = A, where A is a constant
1−y
of y 2 cos2 (x)(1 + y) = A(1 − y),

Example 5. Solve the initial value problem


dy
e−t · = t 1 + y2 ,

y(0) = 1
dt

4
Solution: Manipulate the separable differential equation to
Z Z
1
dy = tet dt
1 + y2
We know that
Z
1
dy = arctan(y) + k1
1 + y2
and with integration by parts
Z Z
te dt = te − 1 · et dt
t t

= tet − et + k2

Consequently, the general solution is

arctan(y) = tet − et + K y = tan tet − et + K



=⇒

By the initial value y(0) = 1 (if t = 0, then y = 1), we can determine the value of K.

arctan(1) = 0 · e0 − e0 + K
=⇒ K = arctan(1) + e0 = π
4 +1

The given equation has thus only one solution,

arctan(y) = tet − et + π
y = tan tet − et + π

4 +1 of 4 +1

Exercise. Solve the differential equations


dy xy sin x dy t
(a) = , y(0) = 1 (b) = y+t2
dx y+1 dt ye

Answer:
2
(a) y + ln |y| = −x cos x + sin x + 1 (b) yey − ey = − 12 e−t + C

Example 6 (Exercise 46, p. 664, Stewart). A tank contains 1000 L of brine with 15 kg of dissolved
salt. pure water enters the tank at a rate of 10 L/min. The solution is kept thoroughly mixed and
drains from the tank at the same rate. How much salt is in the tank (a) after t minutes and (b)
after 20 minutes?

Solution: Let S(t) denote the amount of salt (in kg) in the tank after t minutes.
Initially (after 0 minutes) there is 15 kg salt. Thus S(0) = 15.
Further

5
dS
= (rate in) − (rate out)
dt
10 S
=0−S· =−
Z Z 1000 10
1 1
=⇒ dS = − dt
S 10
1
=⇒ ln S = − 10 t + C, S > 0
=⇒ S = eC e−t/10 = Ae−t/10

With the initial value of S(0) = 15, is

15 = Ae0 =⇒ A = 15

Thus the amount of salt after t minutes in the tank, is

(a) S(t) = 15e−t/100

And after 20 minutes, the amount of salt in the tank is

(b) S(20) = 15e−20/100 = 15e−0.2 ≈ 12.3 kg

Linear Differential Equations

A first order linear differential equation is one of the form


dy
+ P (x) · y = Q(x), where P (x) and Q(x) are continuous functions
dx
The integrating factor of this linear differential equation is
Z 
I(x) = exp P (x) dx

Notice that
Z  Z Z 
′ d
I (x) = exp P (x) dx · P (x) dx = exp P (x) dx · P (x) = P (x)I(x)
dx

Consequently
 
d dy dI dy dy
(yI) = I +y = I + yP I = + Py I
dx dx dx dx dx

This property of I allows us to solve a linear differential equation as follows

6
Method of solving.
dy
+ P (x)y = Q(x)
dx
dy
=⇒ I(x) + P (x)yI(x) = Q(x)I(x)
dx
d 
=⇒ yI(x) = Q(x)I(x)
dx Z
=⇒ yI(x) = Q(x)I(x) dx

R
Remark. To determine P (x) dx in I(x), we usually take the integrating constant C as 0.
Example 7. Solve the following linear differential equation
 dy p
2 + x2 + xy = x 2 + x2
dx
Solution: First rewrite the differential equation in standard form
dy x x
+ 2
y=√
dx 2 + x 2 + x2
x x
Here P (x) = 2
and Q(x) = √
2+x 2 + x2
Thus, the integrating factor is
Z   Z 
x 1 2x
I(x) = exp dx = exp dx
2 + x2 2 2 + x2
 p  p
= exp 12 ln 2 + x2 = exp ln 2 + x2 = 2 + x2


With the standard form and I, follows


dy x x
+ 2
y = x√
dx 2 + x 2 + x2
dy p x p x p
=⇒ 2 + x2 + y 2 + x 2 = x√ 2 + x2
dx 2 + x2 2 + x2
d  p 
=⇒ y 2 + x2 = x
dx Z
p
=⇒ y 2 + x2 = x dx = 12 x2 + K

x2 K
=⇒ y= √ +√
2 2+x 2 2 + x2

Example 8. Solve the following linear differential equation.

y ′ − (tan x)y = sin(2x), x ∈ − π2 , π2




7
Solution: The given linear differential equation is already in standard form. Thus,
Z 

I(x) = exp − tan(x) dx = exp (ln(cos x)) = cos x

Now
d
(y cos x) = y(− sin x) + y ′ cos x (Product Rule)
dx 
= y(− sin x) + (tan x)y + sin(2x) cos x (From the differential equation)
= y(− sin x) + (sin x)y + sin(2x) cos x
= 2 sin x cos2 x

Thus, with integration on both sides, it follows that

2 cos3 x
Z
y cos x = 2 cos2 x sin x dx = − +K
3
2 cos3 x K
=⇒ y=− + = − 23 cos2 x + K sec x
3 cos x cos x

Example 9. Solve the following initial value problem.


dy 2y x
− = , where x>0 and y(1) = 0
dx x 1 + x2

Solution:
Z 
−2 1
= exp(−2 ln x) = exp ln x−2 = x−2 =

I(x) = exp dx
x x2

Now
dy 1 2y 1 x 1
· 2− · 2 = 2
· 2
dx x x x 1+x x
d y 1
=⇒ 2
=
dx x x (1 + x2 )
Z
y 1
=⇒ = dx
x2 x (1 + x2 )

Partial Fraction Decomposition:


1 A Bx + C
2
= +
x (1 + x ) x 1 + x2
1 = A 1 + x2 + (Bx + C)x

=⇒

Determining constants:

x=0 =⇒ 1=A
x=i =⇒ 1 = (Bi + C)i = −B + Ci =⇒ B = −1, C=0

8
Thus
Z  
y 1 x 1 2

= − dx = ln x − 2 ln 1 + x +K
x2 x 1 + x2
x2
y = x2 ln x − ln 1 + x2 + Kx2

=⇒
2
To determine the value of K, use the initial value y(1) = 0 (that is, y = 0 if x = 1):
ln 2
0 = y(1) = 0 − 12 ln(2) + K =⇒ K=
2
Thus the solution is
x2 ln 1 + x2

2 x2 ln 2
y = x ln x − +
2 2

Example 10 (Exercise 37, p. 685, Stewart). A tank contains 100 L of water. A solution with a salt
consentration of 0.4 kg/L is added at a rate of 5 L/min. The solution is kept mixed and is drained
from the tank at a rate of 3 L/min. If y(t) is the amount of salt (in kilograms) after t minutes,
show that y satisfies the differential equation
dy 3y
=2−
dt 100 + 2t
Solve this equation and find the concentration after 20 minutes.

Solution:
dy
= (rate in) − (rate out)
dt
y
= 0.4 · 5 − ·3
100 + (5 − 3)t
3y
=2−
100 + 2t
In standard form,
dy 3
+ ·y =2
dt 100 + 2t
The integrating factor is
Z 
3 3
ln |100 + 2t| = (100 + 2t)3/2

I(t) = exp dx = exp 2
100 + 2t
Consequently,
d  
y(100 + 2t)3/2 = 2(100 + 2t)3/2
dx Z
=⇒ y(100 + 2t)3/2 = 2(100 + 2t)3/2 dt = 25 (100 + 2t)5/2 + K
K
=⇒ y = 25 (100 + 2t) +
(100 + 2t)3/2

9
Our initial value is y(0) = 0 [started with fresh water!]. Thus

0= 2
5 · (100)5/2 + K = 2
5 · 100 000 =⇒ K = −40 000

So after t minutes, the amount of salt is


40 000
y(t) = 25 (100 + 2t) −
(100 + 2t)3/2

Consequently, after 20 minutes, the amount of salt in the tank is


40 000
y(20) = 25 (100 + 2 · 20) − ≈ 56 − 24.1 = 31.9 kg salt
(100 + 2 · 20)3/2

In the tank, there is 100 + 2 · 20 = 140 L brine after 20 minutes. Thus, the consentration after 20
minutes is
y(20) 2 40 000
= − ≈ 0.2275 kg/L
140 5 1405/2

10

You might also like