I stumbled on a very simple problem yet I was awestruck when I saw the integral. This is a solution of work done by our muscle when we move horizontally in air a distance $S$. I couldn't see the solution. Please help me understand the integral and the calculations involved!
Thanks!
$$\int mgdy=\int_{0}^S mg \frac{1}{2}g\frac{(dx)^2}{v^2}$$
Looking at the link posted in the last comment, the formula is obtained by assuming a horizontal movement with constant velocity $v$, and taking into account that - due to gravity $g $ - the arm falls by a distance $y$ as it moves horizontally by a distance $x$. In particular, the time taken to fall by a distance $y$ is correctly estimated as $t=x/v$, so that the magnitude of $y $ is $1/2 \, g t^2=1/2 \, g \,(x^2/v^2) $.
Therefore, the work $W=mgy $, where $m $ indicates the mass, is
$$W(x)= mg \cdot 1/2 \, g \, (x^2/v^2)$$
$$ = 1/2 \,\frac {mg^2}{v^2} x^2$$
Note that, since the horizontal velocity as well as the vertical effect of gravity are both constant during the movement, the work $W $ can be directly calculated without integration as
$$W = 1/2 \frac {mg^2}{v^2} S^2$$
Also note that, if we decide to follow the integration procedure, this simply reduces to differentiating the $W (x) $ formula as
$$dW = 1/2 \frac {mg^2}{v^2} 2x dx$$
and then integrating it between $0$ and $S $. Because $\int x dx = 1/2 \, x^2$, we get again the same formula above. Lastly, note that the quantity expressed as $(dx)^2$ used in your calculations corresponds to the $2x dx $ term.