Step by step
The question
Question: solve y″ + y′ = 2sin x.
The answer has two parts: the plain part, which solves the equation with 0 on the right, plus one extra solution that makes 2sin x.
1 Solve with 0 on the right
Try y = e^(rx): the characteristic equation is r² + r = 0.
Every term has an r: take it out.
A product is 0 when one part is 0: r = 0 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₂.
So the plain part is C₁e^(−x) + C₂.
2 Guess the extra part
The extra part has the same shape: a cosine and a sine, both, with the same 1x inside.
Careful!
Both cos and sin are needed: each derivative turns one into the other.
So we guess Acos x + Bsin x 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.
From the first: B in terms of A.
Put it into the second and collect.
So A = −1.
Put in what we know.
So B = −1.
So the extra part is −cos x − sin x.
5 Add the parts
Add the parts: y = C₁e^(−x) + C₂ − cos x − sin x.
6 Check
Let's check the extra part: put −cos x − sin x into the left side.
It gives 2sin x: 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.