Let $\ddot x=2x$. If $\dot x$ is $0$ when $x=1$. Find $\dot x(x=3)$. I was given this problem in a physics class, and below is the answer by the professor. ($x$ is position, $v=\dot x$ is velocity, $a=\dot v=\ddot x$ acceleration).

Let $a=2x$. If $v$ is $0$ when $x=1$. Find $v$ when $x=3$.

Professor's answer:

We can rewrite $a=\frac {dv}{dt}=\frac{dv}{dx}\cdot\frac{dx}{dt}=\frac {dv}{dx}v(t)$, thus $$\frac {dv}{dx}v(t)=2x\iff vdv=2xdx\iff \int_0^vvdv=2\int_1^3xdx\iff \frac{v^2(3)}2=8\\
\therefore v(3)=\pm2$$

I belive this answer is an atrocity: He allegedly arrived at the correct answer, but I have no idea why: Besides the horrendous differential 'tricks', why can he integrate on one side from "$ 0$ to $v$" and on the other from "$0$ to $3$"?
Is there anyway to solve this in a mathematically correct manner (I really don't want to use the differential thing he's doing).
I tried to solve this solving the DE $\ddot x = 2x$, getting $x=ce^{\sqrt 2 t}+de^{-\sqrt 2 t}$, but I think the initial condition given is insufficient to determine $c,d$.
 A: The characteristic polynomial is $z^2-2$. Hence the general solution of your equation is $$x(t) = Ae^{\sqrt{2}t}+Be^{-\sqrt{2}t}.$$ Then $$v(t) = x'(t) =A\sqrt{2}e^{\sqrt{2}t}-B\sqrt{2}e^{-\sqrt{2}t}.$$ Now by hypothesis there is $t_0$ such that $x(t_0)=1$ and $v(t_0)=0.$ Replace that in the two equations and sum them to find $1 = 2Ae^{\sqrt{2}t_0}$, hence $A =\frac{1}{2}e^{-\sqrt{2}t_0}.$ Now make a substraction and you find similarly $B = \frac{1}{2}e^{\sqrt{2}t_0}.$ Finally $$x(t) = \frac{1}{2}e^{\sqrt{2}(t-t_0)}+\frac{1}{2}e^{-\sqrt{2}(t-t_0)}=\cosh(\sqrt{2}(t-t_0))$$ and $$v(t) =\sqrt{2}\sinh(\sqrt{2}(t-t_0)).$$ Now, if $x=3$ we find $t =t_0\pm\frac{\cosh^{-1}{(3)}}{\sqrt{2}}.$ Injecting this in $v$ you finally find $$v(t) = \sqrt{2}\sinh(\pm\cosh^{-1}(3)) = \pm 4.$$
A: What your teacher means is that $\int_{v(x=1)}^{v(x=3)} v dv = \frac{v(x=3)^2}{2}$ since $v(x=1)=0$.
To really make sense of all that, you would need to use differential forms. You can say that $v$ and $x$ are functions defined on the phase space of your problem.
And actually in both integrals, you really integrate differential $1$-forms over a path in this phase state, which is the path of your particle between position $x=1$ and $x=3$. Now since $xdx$ and $vdv$ are exact differential forms, it only depends on the integral bounds, meaning the points of the phase space corresponding to the position $x=1$ and $x=3$ of your particle, and this gives the above formulas.
Basically, what you can remember is that it does make sense, but the maths behind are a little bit tricky, so when in physics class you can freely use those tricks without worrying too much about the rigourous definitions.
Note that the fact that $2vdv = d(v^2)$ is an exact form is essential to the process, it is very similar to how you can compute the work of the gravity force in a mechanics problem simply by knowing the final variation of height, without worrying about the actual path of your object.
A: The differential equation implies that 
$$
\frac{1}{2} \frac{d}{dt} \left((\dot x(t))^2 - x(t)^2 \right) = 0 
$$
which implies that  $(\dot x(t))^2 - x(t)^2  = const$. Since $x = 1$ when $\dot x = 0$, the constant must be -1. Therefore if $x = 3$, then $(\dot x)^2 = 16$ and $\dot x = \pm 4$. The solution of the ODE is $x(t) = \cosh \sqrt{2}t$, and indeed $x(t) = 3$ at the values $t = \pm \frac{\cosh^{-1}(3)}{\sqrt{2}}$. At these points, $\dot x = \pm 4$.
A: Normally those integrations are done with indeterminate boundaries, so 
$\int v.dv = \int 2x.dx$
$\implies v^2/2 + c = x^2$, where c is a constant. Then we put the initial condition $v = 0$ at $x=1$.
Then $c = 1$ and we have $v^2/2 = x^2 - 1$
Setting $x = 3$, $v(3)^2/2 = 8 \implies v(3) = \pm 4$
A: Let me just address your professor's thought process. When he goes from $vdv = 2xdx$ to $\int_0^v vdv = 2\int_1^3 2xdx$, he thinks as follows: It is given that when when $x=1$, then $v=0$, and when $x=3$, then $v=v$ (with an abuse of notation, the $v$ on the left-hand-side is the symbol for velocity, and the $v$ on the right-hand-side is the value of the velocity at $x=3$.
So when $x$ runs from $1$ to $3$, $v$ will run from $0$ to $v$.
This is why the integration bounds $\int_0^v$ on the $dv$ integral correspond to the integration bounds $\int_1^3$ on the $dx$ integral.
