You are on page 1of 28

Differential Equations

INTEGRATING FACTOR METHOD

Graham S McDonald

A Tutorial Module for learning to solve 1st


order linear differential equations

● Table of contents
● Begin Tutorial


c 2004 g.s.mcdonald@salford.ac.uk
Table of contents
1. Theory
2. Exercises
3. Answers
4. Standard integrals
5. Tips on using solutions
6. Alternative notation
Full worked solutions
Section 1: Theory 3

1. Theory
Consider an ordinary differential equation (o.d.e.) that we wish to
solve to find out how the variable y depends on the variable x.

If the equation is first order then the highest derivative involved is


a first derivative.

If it is also a linear equation then this means that each term can
dy
involve y either as the derivative dx OR through a single factor of y .

Any such linear first order o.d.e. can be re-arranged to give the fol-
lowing standard form:

dy
+ P (x)y = Q(x)
dx

where P (x) and Q(x) are functions of x, and in some cases may be
constants.
Toc JJ II J I Back
Section 1: Theory 4

A linear first order o.d.e. can be solved using the integrating factor
method.

After writing the equation in standard form, P (x) can be identified.


One then multiplies the equation by the following “integrating factor”:
R
P (x)dx
IF= e

This factor is defined so that the equation becomes equivalent to:

d
dx (IF y) = IF Q(x),

whereby integrating both sides with respect to x, gives:


R
IF y = IF Q(x) dx

Finally, division by the integrating factor (IF) gives y explicitly in


terms of x, i.e. gives the solution to the equation.
Toc JJ II J I Back
Section 2: Exercises 5

2. Exercises
In each case, derive the general solution. When a boundary
condition is also given, derive the particular solution.
Click on Exercise links for full worked solutions (there are 10
exercises in total)
Exercise 1.
dy
+ y = x ; y(0) = 2
dx
Exercise 2.
dy
+ y = e−x ; y(0) = 1
dx
Exercise 3.
dy
x + 2y = 10x2 ; y(1) = 3
dx

● Theory ● Answers ● Integrals ● Tips ● Notation


Toc JJ II J I Back
Section 2: Exercises 6

Exercise 4.
dy
x − y = x2 ; y(1) = 3
dx

Exercise 5.
dy
x − 2y = x4 sin x
dx

Exercise 6.
dy
x − 2y = x2
dx

Exercise 7.
dy
+ y cot x = cosec x
dx

● Theory ● Answers ● Integrals ● Tips ● Notation


Toc JJ II J I Back
Section 2: Exercises 7

Exercise 8.
dy
+ y · cot x = cos x
dx

Exercise 9.
dy
(x2 − 1) + 2xy = x
dx

Exercise 10.
dy
= y tan x − sec x ; y(0) = 1
dx

● Theory ● Answers ● Integrals ● Tips ● Notation


Toc JJ II J I Back
Section 3: Answers 8

3. Answers

1. General solution is y = (x − 1) + Ce−x , and particular


solution is y = (x − 1) + 3e−x ,

2. General solution is y = e−x (x + C) , and particular solution is


y = e−x (x + 1) ,

3. General solution is y = 25 x2 + C
x2 , and particular solution is
y = 21 (5x2 + x12 ) ,

4. General solution is y = x2 + Cx , and particular solution is


y = x2 + 2x ,

5. General solution is y = −x3 cos x + x2 sin x + Cx2 ,

6. General solution is y = x2 ln x + C x2 ,

Toc JJ II J I Back
Section 3: Answers 9

7. General solution is y sin x = x + C ,

8. General solution is 4y sin x + cos 2x = C ,

x2
9. General solution is (x2 − 1)y = 2 +C ,

10. General solution is y cos x = C − x , and particular solution is


y cos x = 1 − x .

Toc JJ II J I Back
Section 4: Standard integrals 10

4. Standard integrals
R R
f (x) f (x)dx f (x) f (x)dx
n xn+1 n 0 [g(x)]n+1
x n+1 (n 6= −1) [g (x)] g (x) n+1 (n 6= −1)
1 g 0 (x)
x ln |x| g(x) ln |g (x)|
x ax
e ex a x
ln a (a > 0)
sin x − cos x sinh x cosh x
cos x sin x cosh x sinh x
tan x − ln
|cos x| tanh x ln cosh x
cosec x ln tan x2 cosech x ln tanh x2
sec x ln |sec x + tan x| sech x 2 tan−1 ex
sec2 x tan x sech2 x tanh x
cot x ln |sin x| coth x ln |sinh x|
sin2 x x
2 −
sin 2x
4 sinh2 x sinh 2x
4 − x2
cos2 x x
2 +
sin 2x
4 cosh2 x sinh 2x
4 + x2

Toc JJ II J I Back
Section 4: Standard integrals 11

R R
f (x) f (x) dx f (x) f (x) dx

1 1
tan−1 x 1 1 a+x
a2 +x2 a a a2 −x2 2a ln a−x (0 < |x| < a)

1 1 x−a
(a > 0) x2 −a2 2a ln x+a (|x| > a > 0)


2 2
√ 1 sin−1 x √ 1 ln x+ aa +x (a > 0)

a2 −x2 a a2 +x2

2 2
(−a < x < a) √ 1 ln x+ xa −a (x > a > 0)

x2 −a2

√ a2
√ a2
h √ i
sinh−1 x a2 +x2
 −1 x
 x

a2 − x2 2 sin a a2 +x2 2 a + a2

√ i √ h √ i
a2
a2 −x2
− cosh−1
2 2
+x x
+ x xa2−a

a2 x2 −a2 2 a

Toc JJ II J I Back
Section 5: Tips on using solutions 12

5. Tips on using solutions

● When looking at the THEORY, ANSWERS, INTEGRALS, TIPS


or NOTATION pages, use the Back button (at the bottom of the
page) to return to the exercises.

● Use the solutions intelligently. For example, they can help you get
started on an exercise, or they can allow you to check whether your
intermediate results are correct.

● Try to make less use of the full solutions as you work your way
through the Tutorial.

Toc JJ II J I Back
Section 6: Alternative notation 13

6. Alternative notation
The linear first order differential equation:
dy
+ P (x) y = Q(x)
dx
R
P (x) dx
has the integrating factor IF=e .
The integrating factor method is sometimes explained in terms of
simpler forms of differential equation. For example, when constant
coefficients a and b are involved, the equation may be written as:
dy
a + b y = Q(x)
dx
In our standard form this is:
dy b Q(x)
+ y=
dx a a
with an integrating factor of:
b bx
R
dx
IF = e a =ea

Toc JJ II J I Back
Solutions to exercises 14

Full worked solutions


Exercise 1.
dy
Compare with form: + P (x)y = Q(x) (P, Q are functions of x)
dx
Integrating factor: P (x) = 1.

R
Integrating factor, IF = e P (x)dx
R
= e dx
= ex
Multiply equation by IF:
dy
ex + ex y = ex x
dx
d x
i.e. [e y] = ex x
dx

Toc JJ II J I Back
Solutions to exercises 15

Integrate both sides with respect to x:

ex y = ex (x − 1) + C
Z Z
dv du
{ Note: u dx = uv − v dx i.e. integration by parts with
dx dx
dv
u ≡ x, ≡ ex
dxZ
→ xex − ex dx

→ xex − ex = ex (x − 1) }
i.e. y = (x − 1) + Ce−x .
Particular solution with y(0) = 2:
2 = (0 − 1) + Ce0
= −1 + C i.e. C = 3 and y = (x − 1) + 3e−x .
Return to Exercise 1

Toc JJ II J I Back
Solutions to exercises 16

Exercise 2. R R
P dx dx
Integrating Factor: P (x) = 1 , IF = e =e = ex

Multiply equation:
dy
ex + ex y = ex e−x
dx
d x
i.e. [e y] = 1
dx
Integrate:
ex y = x+C
i.e. y = e−x (x + C) .
Particular solution:
y=1
gives 1 = e0 (0 + C)
x=0
= 1.C i.e. C = 1
−x
and y = e (x + 1) .
Return to Exercise 2
Toc JJ II J I Back
Solutions to exercises 17

Exercise 3.
dy
Equation is linear, 1st order i.e. + P (x)y = Q(x)
dy
dx
i.e. dx + x2 y = 10x, where P (x) = x2 , Q(x) = 10x
dx 2
R R
P (x)dx
Integrating factor : IF = e = e2 x = e2 ln x = eln x = x2 .

dy
Multiply equation: x2 + 2xy = 10x3
dx
d  2 
i.e. x ·y = 10x3
dx
5 4
Integrate: x2 y = x +C
2
5 2 C
i.e. y = x + 2
2 x

Toc JJ II J I Back
Solutions to exercises 18

Particular solution y(1) = 3 i.e. y(x) = 3 when x = 1.

5 C
i.e. 3 = 2 ·1+ 1

6 5
i.e. 2 = 2 +C

1
i.e. C= 2

y = 52 x2 + 1 1 1

∴ 2x2 = 2 5x2 + x2 .
Return to Exercise 3

Toc JJ II J I Back
Solutions to exercises 19

Exercise 4.
 
dy 1
Standard form: − y=x
dx x
dy 1
Compare with + P (x)y = Q(x) , giving P (x) = −
dx x
R R dx −1 1
Integrating Factor: IF = e P (x)dx
= e− x = e− ln x = eln(x )
= .
x
Multiply equation:
1 dy 1
− 2 y = 1
x dx  x 
d 1
i.e. y = 1
dx x
Integrate:
1
y = x+C
x
i.e. y = x2 + Cx .

Toc JJ II J I Back
Solutions to exercises 20

Particular solution with y(1) = 3:


3 = 1+C
i.e. C = 2

Particular solution is y = x2 + 2x .
Return to Exercise 4

Toc JJ II J I Back
Solutions to exercises 21

Exercise 5.
dy
Linear in y : dx − x2 y = x3 sin x
dx −2
R
Integrating factor: IF = e−2 x = e−2 ln x = eln x = 1
x2

1 dy 2
Multiply equation: − y = x sin x
x2 dx  x3 
d 1
i.e. y = x sin x
dx x2
Z
y
Integrate: = −x cos x− 1 · (− cos x)dx+C 0
x2
[Note: integration by parts,
R dv
u dx dx = uv − v du dv
R
dx dx, u = x, dx = sin x]
y
i.e. = −x cos x + sin x + C
x2
i.e. y = −x3 cos x + x2 sin x + Cx2 .
Return to Exercise 5

Toc JJ II J I Back
Solutions to exercises 22

Exercise 6.
 
dy 2
Standard form: − y=x
dx x

2
Integrating Factor: P (x) = −
x
R R dx −2 1
IF = e P dx
= e−2 x = e−2 ln x = eln x =
x2

1 dy 2 1
Multiply equation: − y=
x2 dx x3 x
 
d 1 1
i.e. y =
dx x2 x

Toc JJ II J I Back
Solutions to exercises 23
Z
1 dx
Integrate: y=
x2 x

1
i.e. y = ln x + C
x2

i.e. y = x2 ln x + Cx2 .
Return to Exercise 6

Toc JJ II J I Back
Solutions to exercises 24

Exercise 7.
dy
Of the form: + P (x)y = Q(x) (i.e. linear, 1st order o.d.e.)
dx
where P (x) = cot x.
 
R R cos x
R f 0 (x)
P (x)dx sin x dx
dx
Integrating factor : IF = e =e ≡e f (x)

= eln(sin x) = sin x

dy cos x sin x

Multiply equation : sin x · dx + sin x sin x y= sin x

dy
i.e. sin x · dx + cos x · y = 1

d
i.e. dx [sin x · y] = 1

Integrate: (sin x)y = x + C . Return to Exercise 7

Toc JJ II J I Back
Solutions to exercises 25

Exercise 8.
cos x
Integrating factor: P (x) = cot x =
sin x
cos x
R R
P dx sin x dx
IF = e =e = eln(sin x) = sin x

f 0 (x)
 
cos x
Note: ≡
sin x f (x)
Multiply equation:
dy cos x
sin x · + sin x · y · = sin x · cos x
dx sin x
d
i.e. [sin x · y] = sin x · cos x
dx
Z
Integrate: y sin x = sin x · cos x dx

Toc JJ II J I Back
Solutions to exercises 26

Z Z Z
0 df
{ Note: sin x cos x dx ≡ f (x)f (x)dx ≡ f · dx
dx
Z
1 2
≡ f df = f +C }
2

i.e. y sin x = 1
2 sin2 x + C
1
= 2 · 12 (1 − cos 2x) + C

i.e. 4y sin x + cos 2x = C 0

where C 0 = 4C + 1
 
.
= constant
Return to Exercise 8

Toc JJ II J I Back
Solutions to exercises 27

Exercise 9.
 
dy 2x x
Standard form: + y=
dx x2 − 1 x2 − 1
2x
Integrating factor: P (x) =
x2 − 1
2x
R
dx 2
R
IF = e P dx
=e x2 −1 = eln(x −1)
= x2 − 1
dy
Multiply equation: (x2 − 1) + 2x y = x
dx
(the original form of the equation was half-way there!)
d  2 
i.e. (x − 1)y = x
dx
1 2
Integrate: (x2 − 1)y = x +C .
2
Return to Exercise 9

Toc JJ II J I Back
Solutions to exercises 28

Exercise 10.
P (x) = − tan x R R sin x
R − sin x
IF = e− tan x dx
= e− cos x dx = e+ cos x dx
Q(x) = − sec x
= eln(cos x) = cos x
dy sin x
Multiply by IF: cos x dx − cos x · cos x y = − cos x · sec x

d
i.e. dx [cos x · y] = −1 i.e. y cos x = −x + C .

y(0) = 1 i.e. y = 1 when x = 0 gives

cos(0) = 0 + C ∴ C = 1

i.e. y cos x = −x + 1 .
Return to Exercise 10

Toc JJ II J I Back

You might also like