1 Solving ODEs using Laplace transforms

We begin with a straightforward initial value problem involving a first order constant coefficient differential equation. Let us find the solution of

d y d t + 2 y = 12 e 3 t y ( 0 ) = 3

using the Laplace transform approach.

Although it is not stated explicitly we shall assume that y ( t ) is a causal function (we have no interest in the value of y ( t ) if t < 0 .) Similarly, the function on the right-hand side of the differential equation ( 12 e 3 t ) , the ‘forcing function’, will be assumed to be causal. (Strictly, we should write 12 e 3 t u ( t ) but the step function u ( t ) will often be omitted.) Let us write L { y ( t ) } = Y ( s ) . Then, taking the Laplace transform of every term in the differential equation gives:

L { d y d t } + L { 2 y } = L { 12 e 3 t }

Now

L { d y d t } = − y ( 0 ) + s Y ( s ) = − 3 + s Y ( s ) L { 2 y } = 2 Y ( s )  and L { 12 e 3 t } = 12 s − 3

Substituting these expressions into the transformed version of the differential equation gives:

[ − 3 + s Y ( s ) ] + 2 Y ( s ) = 12 s − 3

Solving for Y ( s ) we have

( s + 2 ) Y ( s ) = 12 s − 3 + 3 = 3 + 3 s s − 3

Therefore

Y ( s ) = 3 ( s + 1 ) ( s + 2 ) ( s − 3 )

Now, using partial fractions, this last expression can be written in a more convenient form:

Y ( s ) = 3 ∕ 5 ( s + 2 ) + 12 ∕ 5 ( s − 3 )

and then, inverting:

y ( t ) = L − 1 { Y ( s ) } = 3 5 L − 1 { 1 s + 2 } + 12 5 L − 1 { 1 s − 3 }

thus

y ( t ) = 3 5 e − 2 t u ( t ) + 12 5 e 3 t u ( t )

This is the solution to the given initial value problem.

Task!

The equation governing the build up of charge, q ( t ) , on the capacitor of an RC circuit is R d q d t + 1 C q = v 0

The image displays an electrical circuit containing a resistor and a capacitor connected in series across a closed loop.

Long description

where v 0 is the constant d.c. voltage. Initially, the circuit is relaxed and the circuit is then ‘closed’ at t = 0 and so q ( 0 ) = 0 is the initial condition for the charge.

Use the Laplace transform method to solve the differential equation for q ( t ) .

Assume the forcing term v 0 is causal.

Begin by finding an expression for Q ( s ) = L { q ( t ) } :

Q ( s ) = v 0 C s ( R C s + 1 ) since, taking the Laplace transform of each term in the differential equation:

R L { d q d t } + 1 C L { q } = L { v 0 }  i.e. R [ − q ( 0 ) + s Q ( s ) ] + 1 C Q ( s ) = v 0 s

where, we emphasize, the Laplace transform of the constant term v 0 is v 0 s .

Inserting q ( 0 ) = 0 we have, after some rearrangement,

Q ( s ) = v 0 C s ( R C s + 1 )

fractions:

You should obtain Q ( s ) = v 0 C 1 s − R C R C s + 1 Now obtain q ( t ) by taking inverse Laplace transforms:

q ( t ) = v 0 C ( 1 − e − t ∕ R C ) u ( t ) since

L − 1 { 1 s } = 1  and L − 1 { R C R C s + 1 } = L − 1 { 1 s + ( 1 ∕ R C ) } = e − t ∕ R C

The solution to this problem is illustrated in the following diagram.

A graph showing a curve that starts at zero on the vertical axis and increases and levels off as the horizontal axis increases.

Long description

The Laplace transform method is also applied to higher-order differential equations in a similar way.

Example 1

Solve the second-order initial-value problem:

d 2 y d t 2 + 2 d y d t + 2 y = e − t y ( 0 ) = 0 , y ′ ( 0 ) = 0

using the Laplace transform method.

Solution

As usual we shall assume the forcing function is causal (i.e. is really e − t u ( t ) .0 Taking the Laplace transform of each term:

L { d 2 y d t 2 } + 2 L { d y d t } + 2 L { y } = L { e − t }

that is,

[ − y ′ ( 0 ) − s y ( 0 ) + s 2 Y ( s ) ] + 2 [ − y ( 0 ) + s Y ( s ) ] + 2 Y ( s ) = 1 s + 1

Inserting the initial conditions and rearranging:

Y ( s ) [ s 2 + 2 s + 2 ] = 1 s + 1  i.e. Y ( s ) = 1 ( s + 1 ) ( s 2 + 2 s + 2 )

Then, using partial fractions:

1 ( s + 1 ) ( s 2 + 2 s + 2 ) ≡ 1 s + 1 − ( s + 1 ) s 2 + 2 s + 2 ≡ 1 s + 1 − ( s + 1 ) ( s + 1 ) 2 + 1

where we have completed the square in the second term of the right-hand side. We can now take the inverse Laplace transform:

y ( t ) = L − 1 { Y ( s ) } = L − 1 { 1 s + 1 } − L − 1 { s + 1 ( s + 1 ) 2 + 1 } = ( e − t − e − t cos t ) u ( t )

which is the solution to the initial value problem.

Exercises

Use Laplace transforms to solve:

  1. d x d t + x = 9 e 2 t x ( 0 ) = 3
  2. d 2 x d t 2 + x = 2 t x ( 0 ) = 0 x ′ ( 0 ) = 5
  1. x ( t ) = 3 e 2 t
  2. x ( t ) = 3 sin t + 2 t
Example 2

A damped spring, constrained to move in one direction, such as might be found in a railway buffer, is subjected to an impulse of duration 5 seconds. The spring constant divided by the mass causing the impulse is 10 m − 2 s − 2 and the frictional force divided by this mass is 2 m − 2 s − 2 .

  1. Write down the equation governing the motion in terms of the displacement x m and time t seconds including the impulse u ( t ) .
  2. Write down the initial conditions on the displacement ( x ) and velocity.
  3. Solve the equation for displacement as a function of time.
  4. Draw a graph of the oscillations for t = 0 to 10 s.
Solution
  1. Since the system involves a restoring force and friction, after dividing through by the mass, the equation of motion may be written:

    d 2 x d t 2 + 2 d x d t + 10 x = u ( t ) − u ( t − 5 )

    where the right-hand side represents the impulse being switched on at t = 0 s and switched off at t = 5 s.

  2. Since the system starts from rest x ( 0 ) = x ′ ( 0 ) = 0 .
  3. Taking the Laplace Transform of each term of the differential equation gives

    L d 2 x d t 2 + 2 L d x d t + 10 L x = L u ( t ) − L u ( t − 5 )

    i.e. s 2 x ̄ ( s ) − x ( 0 ) − s x ′ ( 0 ) + 2 ( s x ̄ ( s ) − x ( 0 ) ) + 10 x ̄ ( s ) = 1 s − 1 s e − 5 s

    but as x ( 0 ) = x ′ ( 0 ) = 0 , this simplifies to s 2 x ̄ ( s ) + 2 s x ̄ ( s ) + 10 x ̄ ( s ) = 1 s − 1 s e − a s

    i.e. x ̄ ( s ) = 1 s 2 + 2 s + 10 1 s 1 − e − 5 s = 1 10 1 s − 1 10 s + 2 s 2 + 2 s + 10 1 − e − 5 s = 1 10 1 s − 1 10 s + 1 ( s + 1 ) 2 + 3 2 − 1 30 3 ( s + 1 ) 2 + 3 2 1 − e − 5 s = 1 10 1 s − 1 10 s + 1 ( s + 1 ) 2 + 3 2 − 1 30 3 ( s + 1 ) 2 + 3 2 − 1 10 1 s e − 5 s + 1 10 s + 1 ( s + 1 ) 2 + 3 2 e − 5 s + 1 30 3 ( s + 1 ) 2 + 3 2 e − 5 s

    so, on taking inverse Laplace Transforms,

    x ( t ) = 1 10 − 1 10 e − t cos 3 t − 1 30 e − t sin 3 t − 1 10 u ( t − 5 ) + 1 10 e − ( t − 5 ) cos 3 ( t − 5 ) u ( t − 5 ) + 1 30 e − ( t − 5 ) sin 3 ( t − 5 ) u ( t − 5 )
  4. Figure 16

    A graph showing a function \(x(t)\) plotted against time \(t\), which exhibits oscillations that decrease in amplitude over time.

    Long description

    According to the graph the damped spring has a damped oscillation about a displacement of 0.1 m after the start of the impulse and a damped oscillation about a displacement of zero after the impulse has finished.