Steply

Solve y'' - y = 3x^2

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

Step by step

The question

Question: solve y″ − y = 3x².

y″ − y = 3x2

The answer has two parts: the plain part, which solves the equation with 0 on the right, plus one extra solution that makes 3x².

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 polynomial of the same size, with every lower power too.

x² → Ax² + Bx + C

Careful!

Every lower power is needed too: the derivatives make them.

Careful: not yp = Ax2 ✗

So we guess Ax² + Bx + C for the extra part.

A, B and C are the numbers we must find.

yp = Ax2 + Bx + C

3 Put the guess in

Its derivative.

y′p = 2Ax + B

And once more.

y″p = 2A

Put them into the left side.

2A − (Ax2 + Bx + C) = 3x2

Multiply out and put like parts together.

−Ax2 − Bx + 2A − C = 3x2

4 Match the parts

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

x2 parts: −A = 3
x parts: −B = 0
number parts: 2A − C = 0
same shape → same number

So A = −3.

A = −3

So B = 0.

B = 0

Put in what we know.

−C = 6

So C = −6.

C = −6

So the extra part is −3x² − 6.

yp = −3x2 − 6

5 Add the parts

Add the parts: y = C₁e^(−x) + C₂eˣ − 3x² − 6.

y = C1e^(−x) + C2ex − 3x2 − 6

6 Check

Let's check the extra part: put −3x² − 6 into the left side.

put in yp: −6 − (−3x2 − 6)

It gives 3x²: the right side.

Right!

= 3x2

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.

Last: check.

Answer
y = C1e^(−x) + C2ex − 3x2 − 6

Your turn

Try this one yourself, then check:

Solve y″ − y = 6x2
Show the answer
y = C1e^(−x) + C2ex − 6x2 − 12

More from Undetermined coefficients

The whole lesson: Undetermined coefficients →