In my textbook W=∫p.dV is only proved for a syringe with a piston. This is quite easily done but the book never explains how it extrapolates to the general situation for a gas expanding in any deformable container. It seems the point is to prove dV= S.h where S is the surface area of a given container and h is a small displacement alone the direction of the normal to the surface. I tried in this line of thought but things soon get really mathematical and confusing. How can prove this formula in any deformable containers? Thanks in advance!