Solve $\ddot{x}=-x-2\dot{x}$

ordinary differential equations

I am currently dealing with the harmonic oscillator and for the case of critical damping, i need to solve the equation $$\ddot{x}=-x-2\dot{x}.$$
I can write the problem as a system of equations
$$\begin{pmatrix}\dot{x}\\\dot{v}\end{pmatrix}=\begin{pmatrix}0&1\\-1&-2\
\end{pmatrix}\begin{pmatrix}x\\v\end{pmatrix},$$

but the matrix is not diagonalizable, so this doesn't bring me any further.

Is there some way to simplify the problem?

My goal is to determine the set of all functions $x$ (for example defined on an open interval $I$) with $\ddot{x}=-x-2\dot{x}$.

Best Answer

Using the differential operator, the equation can be written

$$(D+1)^2x=0$$ and you can proceed by solving two first order equations. With $y:=(D+1)x$,

$$(D+1)y=0$$ is separable and is easily found to have the general solution $$y=Ce^{-t}.$$

Now

$$\dot x+x=Ce^{-t}$$

and by variation of the constant, this amounts to

$$\dot xe^t+xe^t=\dot{(xe^t)}=C=\dot{(Ct+C^*)}$$

and

$$x=(Ct+C^*)e^{-t}.$$