You are on page 1of 4

# 2/3/2014

Examples of solving linear ordinary differential equations using an integrating factor - Math Insight

Math Insight
Examples of solving linear ordinary differential equations using an integrating factor
Example 1
Solv e the ODE
dx cos(t)x (t) = cos(t) dt (1)

## for the initial conditions x (0)

= 0

Solution : Since this is a first order linear ODE, we can solv e it by finding an integrating factor (t) . If we choose (t) to be
(t) = e
cos(t)

= e

sin(t)

(e
sin(t)

d dt

x (t)) = e

sin(t)

cos(t).

e
sin(t)

x (t) =

sin(t)

cos(t)dt + C

= e

sin(t)

+ C,
sin(t)

= sin(t)

, we calculate

x (t) = 1 + C e
sin(t)

## We v erify that we hav e a solution to equation (1). Since

dx = Ce dt
sin(t)

cos(t)

we calculate that
dx cos(t)x (t) = C e dt
sin(t)

cos(t) cos(t)(1 + C e

sin(t)

) = cos(t),

## demonstrating that we hav e found the general solution to the ODE.

http://mathinsight.org/ordinary_differential_equation_linear_integrating_factor_examples 0
= x (0) = 1 + C
0

= 1 + C

1/4

2/3/2014

Examples of solving linear ordinary differential equations using an integrating factor - Math Insight
= x (0) = 1 + C e
0

We determine the integration constant C by the condition 0 Our specific solution to the ODE of (1) is
x (t) = 1 + e

= 1 + C

, so that C

= 1

sin(t)

Example 2
Solv e the ODE
dx = dt 1 ( x + I (t)) (2)

= x0

dx + dt
t/

x =

I (t) .

= e

(1/ )dt

= e

(t)

## , we can rewrite our

d (e dt

t/

I (t) x (t)) = e

t/

For this ex ample, let's integrate from t 0 to t , rather than calculate the indefinite integral as in prev ious ex amples.
t

d dt

t0

(e

t /

x ( t ) )d t

I (t ) e
t

=
t0

t /

dt

t/

x (t) e

t0 /

1 x( t 0 ) =
t0

t /

I (t )dt

t/

x (t) = e
(t t0 )/

= x0

## , the solution to the ODE of (2) is

1 x0 +
t0

(t t )/

I (t )dt .

(3)

To v erify this solution, we differentiate equation (3) with respect to t , obtaining three terms (two from the ex ponentials and one from the upper integration limit),
dx = dt 1 = 1 = x (t) + 1 I (t). (e 1 e
(t t0 )/

1 x0

1 1
t0 t

(t t )/

I (t ) d t +

1 e

0/

I (t)

(t t0 )/

x0 +

t0

(t t )/

I ( t )d t ) +

1 I (t)

0

t0

## into equation (3), the integral is from t 0 to

t0

, so is zero.
2/4

http://mathinsight.org/ordinary_differential_equation_linear_integrating_factor_examples = 1

2/3/2014

Examples of solving linear ordinary differential equations using an integrating factor - Math Insight
= 1

## , and we confirm that x (t 0 )

= x0

Example 3
Solv e the ODE
dx dt + e x (t) = t
t 2

cos(t)

(4)

= 5

## Solution : The first step is to find the integrating factor

(t) = e
e dt
t

= e

= exp(e ),

where exp(x ) is another way of writing ex . Multiply ing equation (4) by deriv ativ e of (t)x (t) . We can write it as
d dt (exp( e )x (t)) = t
t 2

(t)

## , then the left hand side is the

cos(t) exp(e ).

To solv e the ODE in terms of the initial conditions x (0), we integrate from 0 to t , obtaining
t

d ds

(exp( e )x (s))ds =
0 t

0

## cos(s) exp(e )ds.

Ev en though we cannot compute the integral analy tically , we still consider the ODE solv ed. Plugging in the initial conditions x (0)
= 5

## , we can write the solution of the ODE (4) as

t t 2 s t

x (t) = 5 exp(1 e ) +
0

cos(s) exp(e

e )ds.

Y ou can easily check that x (t) satisfies the ODE (4) and the initial conditions x (0)

= 5

Solv ing linear ordinary differential equations using an integrating factor An introduction to ordinary differential equations

Cite this as
Ny kamp DQ, Ex amples of solv ing linear ordinary differential equations using an integrating factor. From Math Insight . http://mathinsight.org/ordinary _differential_equation_linear_integrating_factor_ex amples Key words: differential equation, integrating factor, ordinary differential equation
http://mathinsight.org/ordinary_differential_equation_linear_integrating_factor_examples 3/4

2/3/2014

Examples of solving linear ordinary differential equations using an integrating factor - Math Insight