Steply

Solve y'' - y = 2e^(2x), y(0) = 1, y'(0) = 0

Step by step, with the reason for every step · Undetermined coefficients · Differential Equations

Step by step

The question

Question: solve y″ − y = 2e^(2x), with y(0) = 1 and y′(0) = 0.

y″ − y = 2e^(2x)
y(0) = 1, y′(0) = 0

The answer has two parts: the plain part, which solves the equation with 0 on the right, plus one extra solution that makes 2e^(2x).

y = yc + yp: the plain part + one extra solution

1 Solve with 0 on the right

Try y = e^(rx): the characteristic equation is r² − 1 = 0.

r2 − 1 = 0
y″ → r², y′ → r, y → 1

Two numbers that multiply to −1 and add to 0: 1 and −1.

1 × (−1) = −1, 1 + (−1) = 0

So it factors: (r + 1)(r − 1) = 0.

(r + 1)(r − 1) = 0

Each bracket can be 0: r = −1 or r = 1.

r = −1 or r = 1

Each root gives a solution e^(rx).

Any mix of the two works, so we add them with two numbers, C₁ and C₂.

two roots r₁, r₂: C₁e^(r₁x) + C₂e^(r₂x)

So the plain part is C₁e^(−x) + C₂eˣ.

yc = C1e^(−x) + C2ex

2 Guess the extra part

The extra part has the same shape as the right side: a number times the same e power.

e to the kx → Ae^(kx)

So we guess Ae^(2x) for the extra part.

A is the numbers we must find.

yp = Ae^(2x)

3 Put the guess in

Its derivative.

y′p = 2Ae^(2x)

And once more.

y″p = 4Ae^(2x)

Put them into the left side.

4Ae^(2x) − Ae^(2x) = 2e^(2x)

Multiply out and put like parts together.

3Ae^(2x) = 2e^(2x)

4 Match the parts

The two sides must match, part by part: the same amount of each shape.

e^(2x) parts: 3A = 2
same shape → same number

So A = 2/3.

A = 23

So the extra part is 2/3 × e^(2x).

yp = 23e^(2x)

5 Add the parts

Add the parts first.

The starting values are for the whole y.

y = C1e^(−x) + C2ex + 23e^(2x)

6 Use the starting values

We need y′ too: the derivative of our y.

y′ = −C1e^(−x) + C2ex + 43e^(2x)
at x = 0: e^(0) = 1,

Put x = 0 into y: C₁ + C₂ + 666667/1000000 = 1.

① C1 + C2 + 6666671000000 = 1

Move the 666667/1000000 over.

① C1 + C2 = 3333331000000

Put x = 0 into y′: −C₁ + C₂ + 1333333/1000000 = 0.

② −C1 + C2 + 13333331000000 = 0

Move the 1333333/1000000 over.

② −C1 + C2 = −13333331000000

From ①: C₁ = 333333/1000000 − C₂.

C1 = 3333331000000 − C2

Put it into ②.

−(3333331000000 − C2) + C2 = −13333331000000

Open the bracket and collect: −1 × 333333/1000000 moves over.

2C2 = −1

So C₂ = −1/2, and C₁ = 833333/1000000.

C2 = −12

Put them in: y = 833333/1000000 × e^(−x) − ½eˣ + 2/3 × e^(2x).

y = 8333331000000e^(−x) − 12ex + 23e^(2x)

7 Check

Let's check the extra part: put 2/3 × e^(2x) into the left side.

put in yp: 83e^(2x) − 23e^(2x)

It gives 2e^(2x): the right side.

Right!

= 2e^(2x)

And the starting values: 1 and 0.

Right!

y(0) = 1, y′(0) = 0

Let's look back.

First: solve with 0 on the right.

Then: guess the extra part.

Then: put the guess in.

Then: match the parts.

Then: add the parts.

Then: use the starting values.

Last: check.

Answer
y = 8333331000000e^(−x) − 12ex + 23e^(2x)

Your turn

Try this one yourself, then check:

Solve y″ − y = 4e^(2x)
Show the answer
y = 11666671000000e^(−x) − 12ex + 43e^(2x)

More from Undetermined coefficients

The whole lesson: Undetermined coefficients →