I recently encountered the following integral to calculate the work done by a force over a distance $y$. I won't mark down the whole exercise because it is not the point of my question here. It is taken from an exercise book, and I am looking for an explanation for the following derivation:
Knowing that $y=l \sin \theta$ the solution in the book says that $$W=\int_l^0\frac{-F \tan \theta }{2}dy$$ becomes (with $y=l \sin \theta$) $$W=\int _\frac{\pi}{2}^0 \frac{-F \tan \theta}{2}{d(l \sin \theta)}=\int _\frac{\pi}{2}^0 \frac{-F l \sin \theta }{2}d\theta$$
I need your help to understand why this is all correct and what is the transformatrion with $d(l \sin \theta)$.
If $y = l\sin\theta$ then $\frac{dy}{d\theta} = l \cos \theta$ so for any function $H(y)$, $$ \int_{y=a}^b H(y) dy = \int_{\theta = sin^{-1}(a/l)}^{sin^{-1}(b/l)} H(\theta) \cos \theta \, d\theta $$
So the first step in the line you didn't understand is just substituting $l\sin\theta$ for $y$; the function in the integral was already given as a function of $\theta$ so the $\tan\theta$ didn't change.
The second step is the meatier one -- it does the variable substitution described above to write $$ dy = $\frac{dy}{d\theta} d\theta = \cos \theta \,d\theta $$ and then aborbs that $\cos \theta$ by multiplying with the $\tan \theta$ in the function being integrated, to get the $\sin \theta$ you see at the end.