The above equation is factored to (D+1)(D+2)y = sin(ex)
Then if (D+2)y = z, then the top equation becomes (D+1)z = sin(ex)
When you solve for z, you find that z = -e-xcos(ex) + C1e-x
Where C1 = the first constant of integration
Going back to the first equation, we now know that (D+2)y = -e-xcos(ex) + C1e-x
Solving this for y, we find that y = -e-2xsin(ex) + C1e-x + C2e-2x