Answer: \(x=2e^{-3t}+8te^{-3t}+2t^2-2t+1\).
We solve the homogeneous equation first:
\(\frac{\mathrm{d}^2 x}{\mathrm{d} t^2}+6\frac{\mathrm{d}x}{\mathrm{d}t}+9x=0\)
Its auxiliary equation is \(m^2+6m+9=0\), so \((m+3)^2=0\). Hence the complementary function is
\(x_h=(A+Bt)e^{-3t}.\)
Now we seek a particular integral. Since the forcing term is a quadratic, try
\(x_p=pt^2+qt+r.\)
Then
\(\frac{\mathrm{d}x_p}{\mathrm{d}t}=2pt+q, \qquad \frac{\mathrm{d}^2x_p}{\mathrm{d}t^2}=2p.\)
Substitute into the differential equation:
\(2p+6(2pt+q)+9(pt^2+qt+r)=18t^2+6t+1.\)
Collecting powers of \(t\),
\(9pt^2+(12p+9q)t+(2p+6q+9r)=18t^2+6t+1.\)
Equating coefficients gives
\(9p=18, \qquad 12p+9q=6, \qquad 2p+6q+9r=1.\)
So \(p=2\), then \(24+9q=6\), hence \(q=-2\), and finally \(4-12+9r=1\), so \(r=1\). Therefore
\(x_p=2t^2-2t+1.\)
So the general solution is
\(x=(A+Bt)e^{-3t}+2t^2-2t+1.\)
Use the initial conditions. When \(t=0\), \(x=3\), so
\(A+1=3 \Rightarrow A=2.\)
Differentiate the general solution:
\(\frac{\mathrm{d}x}{\mathrm{d}t} = -3Ae^{-3t} + Be^{-3t} - 3Bte^{-3t} + 4t - 2.\)
When \(t=0\), \(\frac{\mathrm{d}x}{\mathrm{d}t}=0\), so
\(-3A+B-2=0.\)
With \(A=2\), this gives \(-6+B-2=0\), hence \(B=8\).
Therefore the required solution is
\(x=2e^{-3t}+8te^{-3t}+2t^2-2t+1.\)