# What is the vector field associated with this ODE $\ddot{x}+p(t)\dot{x}+q(t)x=0$? What is the divergence of the vector field?

What is the vector field associated with this ODE $\ddot{x}+p(t)\dot{x}+q(t)x=0$? What is the divergence of the vector field?

My attempt:

Let $y=\dot{x}$

$\ddot{x}+p(t)\dot{x}+q(t)x=0\ \Rightarrow \frac{d}{dt}\begin{pmatrix} x\\y \end{pmatrix}=\begin{pmatrix}\ y\\ -p(t)y-q(t)x\end{pmatrix}=F$

Then $\nabla\ \cdot F=\frac{\partial y}{\partial x}+\frac{\partial (-py-qx)}{\partial y}=-p(t)$.

Is this correct?

• Give some context. Are you taking a course on differential equations? Why do you have no idea? Have you read the relevant part of the textbook or lecture notes? What exactly do you find confusing? – symplectomorphic Oct 27 '16 at 2:37
• @symplectomorphic Let $y=\dot{x}$, $\ddot{x}+p(t)\dot{x}+q(t)x=0\ \Rightarrow \frac{d}{dt}\begin{pmatrix} x\\y \end{pmatrix}=\begin{pmatrix}\ y\\ -p(t)\dot{x}-q(t)x\end{pmatrix}$. Is $(y,-p(t)\dot{x}-q(t)x)$ the vector field associated with this ODE? – User90 Oct 27 '16 at 3:34
• Not quite. The idea is to transform the second-order equation into a system of first-order equations by setting $y=\dot{x}$. Then $\dot{x}=y$ and $\dot{y}=-py-qx$. So the second row of your matrix should be $-py-qx$, not $-p\dot{x}$. – symplectomorphic Oct 27 '16 at 3:39
• @symplectomorphic So the divergence is $\nabla\ \cdot F=\frac{\partial y}{\partial x}+\frac{\partial (-py-qx)}{\partial y}=-p(t)$. Is this correct? – User90 Oct 27 '16 at 4:41