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?