I'm trying calculating the work of weight force of a punctiform mass, free falling from an height L . We know that total work along the path is given by dot product between force and displacement, integrated all over the path. Then considering an ascendent z axis of a reference frame with origin on the ground, and integrating the dot product of force along small displacements dz, we have:
$$ W = \int_L^0 |-mg||dz|\cos(0) = \int_L^0 mg |dz| \cos(0) $$
First question: is $dz$ a real number, such as can I transform $|dz|$ to $-dz$, assuming $dz < 0$ ?(fact that $dz < 0$ might be because mass is falling against the z axis’ direction, but I'm not sure we can make such kind of consideration).
If so, my integral would become:
$$ W = \int_L^0 mg (-dz) = -\int_0^L mg (-dz) = mg (L - 0) = mgL $$
Which is the correct answer since work W, when gravitational force is parallel and equiverse with respect to displacement, is positive. But is it my process correct to derive W?
Are we allowed to treat infinitesimals as real numbers, and assign positive or negative signs to them?
Since the positive direction for height is up, and the gravity is down, the angle between the two is $\pi$. So $$(m\vec g)\cdot d\vec z=mgdz\cos \pi=-mgdz$$ You wil get the right answer with your approach as well, but I think it's easier this way. Keep the directions consistent.