= Solution
The <characteristic polynomial> of the homogeneous equation factors as $(r-1)(r-3)$, giving the <complementary function> $C_1e^x+C_2e^{3x}$. For a particular solution take $A\cos x+B\sin x$. Comparing cosine and sine coefficients gives $2A-4B=10$ and $4A+2B=0$, hence $A=1,B=-2$. Therefore
$$
y=C_1e^x+C_2e^{3x}+\cos x-2\sin x.
$$
The initial conditions imply $C_1+C_2=2$ and $C_1+3C_2=2$, so $C_1=2,C_2=0$. The required solution is
$$
\boxed{y=2e^x+\cos x-2\sin x.}
$$
It has $y(0)=3$ and $y'(0)=0$, and direct <differentiation> verifies $y''-4y'+3y=10\cos x$.
Back to article page