= Solution
The <characteristic polynomial> of the homogeneous constant-coefficient equation is $r^2+2r+2$, with roots $-1\pm i$. Its real <complementary function> is therefore $e^{-x}(C_1\cos x+C_2\sin x)$. The forcing $e^{-x}$ is not resonant because $r=-1$ is not a root. Substituting $y_p=Ae^{-x}$ into the differential operator gives $Ae^{-x}$, so $A=1$. Hence
$$
\boxed{y=e^{-x}\left(C_1\cos x+C_2\sin x+1\right).}
$$
A useful independent check is the substitution $y=e^{-x}v$: the equation becomes $v''+v=1$, whose general solution is $v=C_1\cos x+C_2\sin x+1$.
Back to article page