Don't see that you ever received an answer to your physics question.
Below is what the powder charge weight differences will produce as regards pushing the pill down the tube, assuming the length of the barrel is just about the same for both firearms.
Differing bullet weights and metallurgical make-up as well as shape, the total capacity (volume) of the cartridge case, burn rate of the powder used, the type of primer, will produce an infinite number of variables that determine a powder charge weight and what may be optimal in any individual firearm. Its made even some of the best of us a little, well, odd/more eccentric (for those that are independently wealthy)!
In the example youve chosen the data should stack up as follows
4.7 grains of Tight Group powder, with a 165 grain bullet, in .40 Short & Weak will produce a velocity of about 980 to 1000 F.P.S.
Where as in 9mm Luger with a 115-grain bullet 4.7 grains of Tight Group will give you a velocity of around 1140 F.P.S.
As for cjochetz's 4.3-grain load with a Rainier 115 grain RN bullet, it's likely moving out the tube in the range of 1050 to 1080 F.P.S.
The 9mm Luger and .40 S&W cartridges are both in the same ballpark, dimensionally speaking. Meaning that the volume/case capacities are very close and so the amounts of their powder charges will be close as well. Only the velocities of the bullets will very widely as the .40 caliber round uses a heavier bullet.