How to justify this differential manipulation while integrating?

Some time ago I had a physics test where I had the following integral: $\int y'' \ \mathrm{d}y$. The idea is that I had a differential equation, and I had acceleration (that is, $y''$) given as a function of position ($y$). The integral was actually equal to something else, but that's not the point. I needed to somehow solve that. I can't integrate acceleration with respect to position, so here's what I did:

$$\int y'' \ \mathrm{d}y = \int \frac{\mathrm{d}y'}{\mathrm{d}t} \ \mathrm{d}y = \int \mathrm{d}y' \frac{\mathrm{d}y}{\mathrm{d}t} = \int y' \ \mathrm{d}y' = \frac1{2}y'^2 + C$$

My professor said this was correct and it makes sense, but doing weird stuff with differentials and such never completely satisfies me. Is there a substitution that justifies this procedure?

-
$$\int y''dy=\int y''(t)[y'(t)dt]=\int\frac{1}{2}\left[\frac{d}{dt}(y')^2\right]dt=\frac{(y')^2}{2‌​}+C\;\;?$$ –  anon Jan 5 '12 at 1:12
$\int y{}^\prime{}^\prime dy$ does not make any sense to me. –  AlexE Jan 5 '12 at 10:43
@AlexE: I don't really remember why I did that, but I know that I did. The exercise was to find an expression for velocity in terms of position for an object thrown up from the Earth, taking into account that fact that gravity changes with height: the equation was $y'' = G \frac{m_E}{(y+R_E)^2}$, where $m_E$ is Earth's mass and $R_E$ is its radius. –  Javier Jan 5 '12 at 13:50
$\int y'' dy$ stands for, as anon shows, $\int y''(t) y'(t) dt$. When the differential $df$ appears on its own, where $f$ is a function, it stands for $f'(t) dt$. –  user18063 Jan 5 '12 at 16:19
Since this came up on a physics test, it may be helpful to lay out the physical interpretation. If $y(t)$ gives the motion of an object, then $y''$ is its acceleration, and the work done on the object is $W=\int F dy$, which by Newton's second law equals $m\int y'' dy$. Throwing in the factor of $m$, the result $(1/2)my'^2$ is the kinetic energy. The constant of integration $C$ is the object's initial energy. What is being proved is known as the work-kinetic energy theorem, that the work done by the net force acting on the object equals the change in the object's kinetic energy. –  Ben Crowell Feb 5 '12 at 0:11

I'm doubtfull about what $y''$ and $dy$ stand for in your problem. If you have $y = y(x)$ then clearly $$\int y'' dx = y'+C$$ But you're integrating with respect to $dy = d\{y(x)\} = y'(x) dx$ assuming $y(x)$ has a continuous derivative. So you finally have.
$$\int y''(x) y'(x) dx = \int y'(x) d(y'(x)) = \frac{y'^2}{2}+C$$
Yes. The basic idea is that in Leibniz notation, $dy$ stands for an infinitesimal change in $y$, and $\int$ means a sum with infinitely many terms. This is what Leibniz meant by these notations, and this is what great mathematicians like Gauss and Euler understood them to mean. If you understand them that way, then it becomes obvious that the OP's manipulations are valid. Non-standard analysis (as presented nicely in the Keisler book) clears up concerns about logical problems with infinitesimals -- basically it shows that the concerns were unfounded. –  Ben Crowell Feb 5 '12 at 0:04