Answer: The general solution is \(x=\mathrm{e}^{-t}(A\cos 2t+B\sin 2t)+\frac{22}{25}+\frac{4}{5}t-t^{2}\), where \(A\) and \(B\) are arbitrary constants.
We solve the homogeneous equation first:
\(\frac{\mathrm{d}^{2}x}{\mathrm{d}t^{2}}+2\frac{\mathrm{d}x}{\mathrm{d}t}+5x=0\).
Try \(x=\mathrm{e}^{mt}\). Then
\(m^{2}+2m+5=0\).
Solving gives
\(m=\frac{-2\pm\sqrt{4-20}}{2}=-1\pm 2\mathrm{i}\).
So the complementary function is
\(x_c=\mathrm{e}^{-t}(A\cos 2t+B\sin 2t)\).
Now find a particular integral. Since the right-hand side is a quadratic polynomial, take
\(x_p=pt^{2}+qt+r\).
Then
\(\frac{\mathrm{d}x_p}{\mathrm{d}t}=2pt+q\), \(\frac{\mathrm{d}^{2}x_p}{\mathrm{d}t^{2}}=2p\).
Substitute into the differential equation:
\(2p+2(2pt+q)+5(pt^{2}+qt+r)=4-5t^{2}\).
Expand and collect powers of \(t\):
\(5pt^{2}+(4p+5q)t+(2p+2q+5r)=4-5t^{2}\).
Equating coefficients gives
- \(5p=-5\), so \(p=-1\),
- \(4p+5q=0\), so \(-4+5q=0\) and \(q=\frac{4}{5}\),
- \(2p+2q+5r=4\), so \(-2+\frac{8}{5}+5r=4\), hence \(5r=\frac{22}{5}\) and \(r=\frac{22}{25}\).
Therefore
\(x_p=-t^{2}+\frac{4}{5}t+\frac{22}{25}\).
Adding the complementary function and the particular integral gives the general solution above.