Can I get from $\frac{d^2 x}{dt^2} = g$ to $\iint d^2 x = \iint g\,dt^2$? The second law of Newton is
$$a = \frac{F}{m}$$
and so in a constant gravitational field with gravity $g$ I have
$$a = \frac{d^2x}{dt^2} = g$$
To solve this I multiply with $dt^2$ and get
$$d^2x=g\,dt^2$$
and integrate
$$\iint d^2x = g\,\iint dt^2$$
and so I get
$$\frac{1}{2}x^2=\frac{1}{2}g\,t^2$$
which is wrong! The solution must be $x=\frac{1}{2}g\,t^2$. What am I missing? And what is the difference between $dx^2$ and $d^2x$?
I know it is a trivial question but I got a bit rusty with integrations...
 A: To avoid confusions, note that in this case Newtons second law can be reformulated as
$$\dfrac{dv}{dt}=g, \qquad \dfrac{dx}{dt}=v$$
Where $v$ is the velocity of the object.
Now you can integrate the velocity to obtain $v(t)=gt+v_0$.
Where $v_0$ is the initial velocity of the object.
Substituting $v(t)$, you have that $\dfrac{dx}{dt}=gt+v_0$
Now integrate to obtain
$$x(t)=x_0+v_0t+\dfrac{1}{2}gt^2$$
Where $x_0$ is the initial position of the object.
Also, note that you are measuring downward.
A: Consider
$$\iint \dfrac{\text{d}^2x(t)}{\text{d}t^2}\ \text{d}t = \iint g\ \text{d}t$$
$$\int \dfrac{\text{d}x(t)}{\text{d}t} = \int gt \ \text{d}t$$
$$x(t) = \dfrac{1}{2}gt^2 + C$$
Just use the fundamental theorem of calculus.
A: Second derivatives and higher are where you cannot treat the differentials as fractions anymore. This is because the first derivative separation of variables
$$\frac{dy}{dx} = f(x) \implies dy = f(x) dx$$
is a shorthand for the chain rule
$$\frac{dy}{dx} = \frac{\frac{dy}{dt}}{\frac{dx}{dt}} = f(x(t)) \implies \frac{dy}{dt} = f(x(t))\frac{dx}{dt}$$
where both sides can now be integrated with respect to the parametric variable
$$\int \frac{dy}{dt}dt = \int f(x(t))\frac{dx}{dt}dt \implies \int dy = \int f(x) dx$$
which is exactly where the shorthand consistently lands and lines up with the rigorous treatment by simple $u$ substitution. However, the chain rule for the second derivative even looks like
$$\frac{d^2y}{dx^2} = \frac{1}{\frac{dx}{dt}}\frac{d}{dt}\left(\frac{\frac{dy}{dt}}{\frac{dx}{dt}}\right) = \frac{\frac{dx}{dt}\frac{d^2y}{dt^2}-\frac{dy}{dt}\frac{d^2x}{dt^2}}{\left(\frac{dx}{dt}\right)^3}$$
which cannot be multiplied like a simple fraction as the original post does. This only gets more complicated for higher derivatives, so the same heuristic does not work.
