Worked examples
The question
Question: solve y″ − 5y′ + 6y = 12.
y″ − 5y′ + 6y = 12
The answer has two parts: the plain part, which solves the equation with 0 on the right, plus one extra solution that makes 12.
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² − 5r + 6 = 0.
r2 − 5r + 6 = 0
y″ → r², y′ → r, y → 1
Two numbers that multiply to 6 and add to −5: −2 and −3.
−2 × (−3) = 6, −2 + (−3) = −5
So it factors: (r − 2)(r − 3) = 0.
(r − 2)(r − 3) = 0
Each bracket can be 0: r = 2 or r = 3.
r = 2 or r = 3
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^(2x) + C₂e^(3x).
yc = C1e^(2x) + C2e^(3x)
2 Guess the extra part
The extra part has the same shape as the right side: just a number.
a number → A
So we guess A for the extra part.
A is the numbers we must find.
yp = A
3 Put the guess in
Its derivative.
y′p = 0
And once more.
y″p = 0
Put them into the left side.
0 − 5(0) + 6 × A = 12
Multiply out and put like parts together.
6A = 12
4 Match the parts
The two sides must match, part by part: the same amount of each shape.
number parts: 6A = 12
same shape → same number
So A = 2.
A = 2
So the extra part is 2.
yp = 2
5 Add the parts
Add the parts: y = C₁e^(2x) + C₂e^(3x) + 2.
y = C1e^(2x) + C2e^(3x) + 2
6 Check
Let's check the extra part: put 2 into the left side.
put in yp: 0 − 5(0) + 6 × 2
It gives 12: the right side.
Right!
= 12
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^(2x) + C2e^(3x) + 2
▶ Watch it solved
The question
Question: solve y″ + 4y = 8x.
y″ + 4y = 8x
The answer has two parts: the plain part, which solves the equation with 0 on the right, plus one extra solution that makes 8x.
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² + 4 = 0.
r2 + 4 = 0
y″ → r², y′ → r, y → 1
It does not factor nicely, so we use the formula, with a = 1, b = 0, c = 4.
r = −b ± √b² − 4ac2a
Put the numbers in.
r = 0 ± √0² − 4 × 1 × 42 × 1
Under the root: −16.
r = 0 ± √−162
A minus under the root: √(−16) = 4i, because i = √(−1).
√−16 = √16 × √−1 = 4i
r = 0 ± 4i2
Divide both parts by 2: r = ±2i.
Two complex roots.
r = ±2i
Complex roots give cosines and sines.
The real part 0 goes in the e, the 2 goes inside cos and sin.
α ± βi: e^(αx)(C₁cos βx + C₂sin βx)
So the plain part is C₁cos(2x) + C₂sin(2x).
yc = C1cos(2x) + C2sin(2x)
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 + B
Careful!
Every lower power is needed too: the derivatives make them.
Careful: not yp = Ax ✗
So we guess Ax + B for the extra part.
A and B are the numbers we must find.
yp = Ax + B
3 Put the guess in
Its derivative.
y′p = A
And once more.
y″p = 0
Put them into the left side.
0 + 4(Ax + B) = 8x
Multiply out and put like parts together.
4Ax + 4B = 8x
4 Match the parts
The two sides must match, part by part: the same amount of each shape.
x parts: 4A = 8
number parts: 4B = 0
same shape → same number
So A = 2.
A = 2
So B = 0.
B = 0
So the extra part is 2x.
yp = 2x
5 Add the parts
Add the parts: y = C₁cos(2x) + C₂sin(2x) + 2x.
y = C1cos(2x) + C2sin(2x) + 2x
6 Check
Let's check the extra part: put 2x into the left side.
put in yp: 0 + 4 × 2x
It gives 8x: the right side.
Right!
= 8x
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 = C1cos(2x) + C2sin(2x) + 2x
▶ Watch it solved
The question
Question: solve y″ − 3y′ + 2y = 6eˣ.
y″ − 3y′ + 2y = 6ex
The answer has two parts: the plain part, which solves the equation with 0 on the right, plus one extra solution that makes 6eˣ.
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² − 3r + 2 = 0.
r2 − 3r + 2 = 0
y″ → r², y′ → r, y → 1
Two numbers that multiply to 2 and add to −3: −1 and −2.
−1 × (−2) = 2, −1 + (−2) = −3
So it factors: (r − 1)(r − 2) = 0.
(r − 1)(r − 2) = 0
Each bracket can be 0: r = 1 or r = 2.
r = 1 or r = 2
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ˣ + C₂e^(2x).
yc = C1ex + C2e^(2x)
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)
But eˣ is already in the plain part: it gives 0 on the left.
So we multiply it by x.
already in yc → times x
Careful!
That one is already in the plain part, so it can only give 0.
Times x.
Careful: not yp = Aex ✗
So we guess Ax eˣ for the extra part.
A is the numbers we must find.
yp = Axex
3 Put the guess in
Its derivative.
y′p = Aex + Axex
And once more.
y″p = 2Aex + Axex
Put them into the left side.
2Aex + Axex − 3(Aex + Axex) + 2 × Axex = 6ex
Multiply out and put like parts together.
−Aex = 6ex
4 Match the parts
The two sides must match, part by part: the same amount of each shape.
ex parts: −A = 6
same shape → same number
So A = −6.
A = −6
So the extra part is −6x eˣ.
yp = −6xex
5 Add the parts
Add the parts: y = C₁eˣ + C₂e^(2x) − 6x eˣ.
y = C1ex + C2e^(2x) − 6xex
6 Check
Let's check the extra part: put −6x eˣ into the left side.
put in yp: −12ex − 6xex − 3(−6ex − 6xex) + 2(−6xex)
It gives 6eˣ: the right side.
Right!
= 6ex
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 = C1ex + C2e^(2x) − 6xex
▶ Watch it solved