When a gas expands against an external pressure of 0, must the stopper on the cylinder be massless? Basically, I need to conceptually understand why the work a gas does is the integral $\int p_\mathrm{external}dv$ and is 0 when pressure external is 0. I understand why $\mathrm{d}w = - p_\mathrm{externa } \mathrm{d}v$ and so obviously I understand why the math says the work is 0; I need to conceptually understand it.
When you have isothermal expansion in a cylinder where the external volume outside the gas has pressure 0, a.k.a. vacuum, must the movable top of the cylinder be massless? The equations obviously say the work is 0, but I think of the stopper itself as being resistance. Could I think of isothermal expansion in a vacuum as the top basically "disappearing" when the gas is released?
This is difficult to phrase for me, so please ask if you don't understand. I also am only a sophomore in high school, so I have a limited understanding of calculus. Like I said, conceptually for the pressure against the gas to be 0, the lid must be frictionless and massless, right? Thank you.
 A: You can indeed think of expansion in a vacuum as the top disappearing when the gas is released.
Imagine you take a powerful microscope and watch the gas molecules hitting the lid of your cylinder. If the lid isn't moving the gas molecules will bounce off with the same speed as they hit i.e. no energy is lost, so no work is done and the internal energy of your gas stays the same.
Now suppose you're allowing the gas to expand reversibly. If you watch a gas molecule hitting the lid, then because the lid is moving the gas molecule will bounce off with less speed than it hit. The difference in the energy of the gas molecule is transferred to the lid, and if you add up the energy transferred by all the molecules this gives you the work done.
Now imagine suddenly removing the lid so the gas is expanding into a vaccum. The gas molecules now don't bounce off the lid because it isn't there, so their speed doesn't change. Because their speed doesn't change no work can be done. That's why the work done in this case is zero.
A: Treat your cylinder as being on it's side.[+] If it is vertical that the weight of the piston does contribute to the pressure. In that event the pressure can't be zero unless the mass of the stopper vanishes (which is also a way to imagine the situation if you prefer).

[+] Even at that we need to assume no friction between the wall and piston.
A: This a case of sudden expansion of cylinder, it is an "irreversible process" as it does not have any "quasi equillibrium state"( like when you place sand on top of cylinder and then keep on removing it the piston moves upwards, and at every instant weight of sand is in equillibrium witheversible process inside pressure since previous state can be restored by adding the removed sand hence its a r ). 
p.dv is applicable for reversible processes only as you cant create initial state on reversing the process.
hence in this process p.dv wont be applicable.
A: In equations and theoretical set ups, everything that is not specified or explicitly stated as being there, doesn't exist. That is a precondition of all equations. The confusion starts when an equation or set up simulates a real life situation in which common sense tells you to expect certain conditions to exist. They don't.
The first sentence of John Rennie's answer illustrates that.
"You can indeed think of expansion in a vacuum as the top disappearing when the gas is released." He apparently doesn't have any problem considering strictly imaginary mass-less lids or even lids that simply cease to exist on command.
Every time you take a blank page and start to write or draw, you basically create a new imaginary universe with new laws and variables, which you yourself can just make up. This allows for calculation of variables that really do not exist in real life like your lid and complex variables like inverted gravity.
As a rule, if you have to guess if its there, it is probably not meant to be considered.
