Step by step
The question
Question: solve y″ + y = 5sin(2x).
The answer has two parts: the plain part, which solves the equation with 0 on the right, plus one extra solution that makes 5sin(2x).
1 Solve with 0 on the right
Try y = e^(rx): the characteristic equation is r² + 1 = 0.
It does not factor nicely, so we use the formula, with a = 1, b = 0, c = 1.
Put the numbers in.
Under the root: −4.
A minus under the root: √(−4) = 2i, because i = √(−1).
Divide both parts by 2: r = ±i.
Two complex roots.
Complex roots give cosines and sines.
The real part 0 goes in the e, the 1 goes inside cos and sin.
So the plain part is C₁cos x + C₂sin x.
2 Guess the extra part
The extra part has the same shape: a cosine and a sine, both, with the same 2x inside.
Careful!
Both cos and sin are needed: each derivative turns one into the other.
So we guess Acos(2x) + Bsin(2x) for the extra part.
A and B are the numbers we must find.
3 Put the guess in
Its derivative.
And once more.
Put them into the left side.
Multiply out and put like parts together.
4 Match the parts
The two sides must match, part by part: the same amount of each shape.
So B = −5/3.
So A = 0.
So the extra part is −5/3 × sin(2x).
5 Add the parts
Add the parts: y = C₁cos x + C₂sin x − 5/3 × sin(2x).
6 Check
Let's check the extra part: put −5/3 × sin(2x) into the left side.
It gives 5sin(2x): the right side.
Right!
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.