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 involve y either as the derivative dy/dx OR through a single factor of y.

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

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

- where P(x) and Q(x) are functions of x, and in some cases may be constants.

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':

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

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

Integrating both sides with respect to x gives:

IF z = IF Q1(x) dx

Finally, division by the integrating factor (IF) gives y explicitly in terms of x, i.e. gives the solution to the equation.

2. Exercises

In each case, derive the general solution. When a boundary condition is also given, derive the particular solution.

Click on questions to reveal their solutions

Exercise 1:

dy/dx + y = x ; y(0) = 2

Solution:

Compare with the form: dy/dx + P(x) y = Q(x)   ⇒   P(x) = 1.

Integrating factor:   IF = eP(x) dx = edx = ex
Multiply equation by IF:   ex dy/dx + exy = exx
  i.e. d /dx [ exy] = exx
Integrate both sides with respect to x:   exy = ex(x − 1) + C
{ Note: integrate by parts, i.e.: u dv/dxdx = uvdu/dxdx  withux and dv/dx ≡ ex
      xexexdx
      xex − ex = ex(x - 1) }
  i.e. y = (x − 1) + Cex

Particular solution with y(0) = 2:

  2 = (0 − 1) + Ce0
    = −1 + C
i.e. C = 3
y = (x − 1) + 3 ex 

Exercise 2:

dy/dx + y = ex ; y(0) = 1

Solution:

P(x) = 1.

Integrating factor:   IF = eP(x) dx = edx = ex
Multiply equation by IF:   ex dy/dx + exy = ex ex
  i.e. d/dx [ exy] = 1
Integrate:   exy = x + C
  i.e. y = ex (x + C)

Particular solution with x = 0, y = 1:

  1 = e0 (0 + C) 
    = 1⋅C
i.e. C = 1
y = ex (x + 1) 

Exercise 3:

xdy/dx + 2y = 10x2 ; y(1) = 3

Solution:

Equation is linear, 1st order, i.e. dy/dx + P(x) y = Q(x)   ⇒   dy/dx + 2/xy = 10x,  so:  P(x) = 2/x, Q(x) = 10

Integrating factor:   IF = eP(x) dx = e2 dx/x = e2 ln x = e ln x2 = x2
Multiply equation by IF:   x2dy/dx + 2xy = 10x3
  i.e. d/dx [ x2y] = 10x3
Integrate:   x2y = 5/2x4 + C
  i.e. y = 5/2x2 + C/x2

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

i.e. 3 = 5/2⋅1 + 1/2
i.e. 6/2 = 5/2 + C
i.e. C = 1/2
y = 5/2x2 + 1/2x2 = 1/2 (5x2 + 1/x2)

Exercise 4:

xdy/dxy = x2 ; y(1) = 3

Solution:

Put the equation into standard form: dy/dx( 1/x)y = x

Compare with: dy/dx + P(x) y = Q(x)   ⇒  P(x) = − 1/x

Integrating factor:   IF = eP(x) dx = e−  dx/x = e− ln x = e ln (x−1) = 1/x
Multiply equation by IF:   1/x dy/dx1/x2 y = 1
  i.e. d/dx [ 1/xy] = 1
Integrate:   1/xy = x + C
  i.e. y = x2 + Cx

Particular solution with y(1) = 3:

i.e. 3 = 1 + C
i.e. C = 2
y = x2 + 2x)

Exercise 5:

xdy/dx − 2y = x4 sin x

Solution:

Make equation linear in y: dy/dx2/xy = x3 sin x   ⇒   P(x) = − 2/x .

Integrating factor:   IF = eP(x) dx = e−2dx/x = e−2 ln x = e ln (x−2) = 1/x2
Multiply equation by IF:   1/x2 dy/dx2/x3 y = x sin x
  i.e. d /dx [ 1/x2y ] = x sin x
Integrate:   y/x2 = x cos x1⋅(− cos x) dx + C'
{ Note: integrate by parts, i.e.: u dv/dxdx = uvdu/dxdx  withux and dv/dx ≡ sin x}
  i.e. y/x2 = x cos x + sin x + C
  i.e. y = x3 cos x + x2 sin x + Cx2

Exercise 6:

xdy/dx − 2y = x2

Solution:

Standard form: dy/dx − (2/x)y = x   ⇒   P(x) = − 2/x .

Integrating factor:   IF = eP(x) dx = e−2  dx/x = e−2 ln x = e ln (x−2) = 1/x2
Multiply equation by IF:   1/x2 dy/dx2/x3 y = 1/x
  i.e. d /dx [ 1/x2y ] = 1/x
Integrate:   1/x2y = dx/x
  i.e. 1/x2y = ln x + C
  i.e. y = x2 ln x + Cx2 

Exercise 7:

dy/dx + y cot x = cosec x

Solution:

The equation is already in standard form: dy/dx + P(x)y = Q(x), i.e. linear 1st order o.d.e. , so P(x) = cot x

Integrating factor:   IF = eP(x) dx = e cos x/sin x dx ≡ e ƒ′(x)/ƒ(x) dx = eln (sin x) = sin x
Multiply equation:   sin xdy/dx + sin x (cos x/sin x) y = sin x/sin x
  i.e. sin xdy/dx + cos xy = 1
  i.e. d/dx [ sin xy ] = 1
Integrate:   sin xy = x + C

Exercise 8:

dy/dx + y cot x = cos x

Solution:

P(x) = cot x = cos x/sin x

Integrating factor:   IF = eP(x) dx = e cos x/sin x dx ≡ e ƒ′(x)/ƒ(x) dx = eln (sin x) = sin x
Multiply equation:   sin xdy/dx + sin x (cos x/sin x) y = sin x⋅cos x
  i.e. d/dx [ sin xy ] = sin x⋅cos x
Integrate:   y sin x = sin x⋅cos x
{ Note: sin x cos xƒ(x) ƒ′(x) dxƒ(x) /dxdxƒ dƒ = 1/2ƒ2 + C}
  i.e. y sin x = 1/2 sin2x + C
      = 1/21/2 (1 − cos 2x) + C
  i.e. 4y sin x + cos 2x = C' = 4C + 1

Exercise 9:

(x2 − 1)dy/dx + 2xy = x

Solution:

Standard form: dy/dx + (2x/x2 − 1)y = x/x2 − 1   ⇒   P(x) = 2x/x2 − 1

Integrating factor:   IF = eP(x) dx = e2x/x2 − 1dx = eln x2 − 1 = x2 − 1
Multiply equation by IF:   (x2 − 1) dy/dx + 2xy = x
  i.e. d/dx [ (x2 − 1)y ] = x
Integrate:   (x2 − 1)y = 1/2x2 + C

Exercise 10:

dy/dx = y tan x − sec x ; y(0) = 1

Solution:

P(x) = − tan x and Q(x) = − sec x

Integrating factor IF = etan xdx = e sin x/cos xdx = e+ − sin x/cos xdx = eln (cos x) = cos x

Multiply equation by IF:   cos x dy/dx − cos xsin x/cos xy = − cos x⋅sec x
  i.e. d/dx [ cos xy ] = −1
Integrate:   y cos x = x + C

Particular solution with y(0) = 1, i.e. y = 1 when x = 0:

  cos 0 = 0 + C
C = 1
i.e. y cos x = x + 1

4. Standard Integrals

ƒ(x) ƒ(x) dx   ƒ(x) ƒ(x) dx
xn xn+1/ n+1 (n ≠ −1)   [g(x)]ng'(x) [g(x)]n+1/ n+1 (n ≠ −1)
1/x ln x   g'(x)/g(x) ln g(x)
ex ex   ax ax/ln a (a > 0)
sin x −cos x   sinh x cosh x
cos x sin x   cosh x sinh x
tan x − ln cosx   tanh x ln cosh x
cosec x ln tan  x/2   cosech x ln tanh  x/2
sec x ln sec x + tan x   sec x 2 tan−1ex
sec2x tan x   sec2x tanh x
cot x ln sin x   cot x ln sinh x
sin2x x/2sin 2x/4   sinh2x sinh 2x/4x/2
cos2x x/2 + sin 2x/4   cosh2x sinh 2x/4 + x/2
1/ a2 + x2 1/ a tan −1x/ a   (a > 0)   a2 + x2 a2/ 2 [ sinh−1( x/ a ) + x a2x2 / a2 ]
1/ a2x2 1/ 2a ln  a + x/ ax    (0 < x < a)   a2x2 a2/ 2 [ sin−1( x/ a ) + x a2x2 / a2 ]
1/ x2a2 1/ 2a ln  xa/ x + a   (x > a > 0)   x2a2 a2/ 2 [−cosh−1( x/ a ) + x x2a2 / a2 ]
1/ a2 + x2 ln  x + a2 + x2 / a    (a > 0)      
1/ a2x2 sin−1x/ a     (−a < x < a)   1/ x2a2 ln  x + x2a2 / a   (x > a > 0)

4. Alternative Notation

The linear first order differential equation:

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

has the integrating factor IF = eP(x) dx.

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:

a dy/dx + bP(x) y = Q(x)

In our standard form this is:

dy/dx + b/a y = Q(x)/a

- with an integrating factor of:

IF = e b/adx = ebx/a

PPLATO material © copyright 2004, University of Salford