Solutions for differential equation The motion of a particle moving along the x-axis obeys the differential equation:
$ \ddot x - 4 \dot x + 4x =-t^2 $
Find the solution for $ x(t)$, given $ x(0)=0 $ and $ \dot x (0) = 0 $.

Can this be solved by treating it as a second-order non-homogenous differential equation? If so, re-formatting the questions equation, would it be:
$ \frac{d^2x}{dt^2} - 4 \frac{dx}{dt}+4x=-t^2$  ?
 A: As usual you must solve the homogenous equation and then find the particular solution to the non-homogeneous equation.
For the homogeneous part you use the ansatz $x=e^{rt}$
For the non-homogenous part, you can make a different ansatz, such as $x=At^2+Bt+C$.
Hopefully this is familiar.
A: Using constant coefficient method we solve for two solutions $x_h$ and $x_p$ where the general solution is $x_g=x_h+x_p$
Solving for $x_h$ implies that we solve the homogeneous system $x'' -4x'+ 4x=0$ which has the characteristic equation 
$$\lambda^2 -4\lambda +4 = 0 \implies ( \lambda-2)^2=0 \implies \lambda_{1,2}=2 $$
So, $$x_h(t)=c_1e^{2t}+c_2te^{2t}$$
Solving for $x_p$ we use the method of undetermined coefficients and we let $$x_p(t)= \alpha t^2+\beta t +\omega $$ and we solve the original DE.
We have:
$$x_p'=2\alpha t+\beta$$  $$x''_p=2\alpha$$
PLugging that into the non homogeneous DE:
$$ 2\alpha - 4( 2\alpha t+\beta ) + 4(\alpha t^2+\beta t +\omega) = -t^2$$
$$ (4\alpha)t^2 + (-8\alpha+4\beta) t + (2\alpha - 4\beta+4\omega) = -t^2$$
$$ \implies 4\alpha = -1 \implies \alpha= \frac{-1}{4}$$$$ \implies-8\alpha+4\beta=0 \implies \beta = \frac{-1}{2} $$$$ \implies 2\alpha - 4\beta+4\omega=0 \implies \omega= \frac{-3}{8}$$
So in we have $$ x_p(t)= \frac{-1}{4}t^2 - \frac{1}{2}t -\frac{3}{8} $$
So the general solution is:
$$x_g(t)= x_h + x_p = c_1e^{2t}+c_2te^{2t} + \frac{-1}{4}t^2 - \frac{1}{2}t -\frac{3}{8} $$
Finally, given the initial conditions $x(0)=0$  and  $x'(0)= 0 $, we find that the constants are $c_1=3$ and$ c_2=-2$ to get the unique solution:
$$ x(t)=  3e^{2t}-2te^{2t} + \frac{-1}{4}t^2 - \frac{1}{2}t -\frac{3}{8} $$
