system
Given the following post, respond as if you're commenting on Reddit:
human
How could the proton and neutron have the same approximate mass if the down quark weighs about twice as much as the up quark? (~4.8 vs ~2.3 MeV/c^2)

Does the neutron lose mass when it binds with a proton in a nucleus?
gpt
You may notice that the masses of the proton and neutron are both almost 1 GeV/c^(2), where the sums of the quark masses amount to a few MeV/c^(2).

The majority of the mass of a hadron is "dynamical mass" caused by the quark and gluon dynamics going on inside, rather than simply the sum of the bare masses of the valence quarks.

So the masses of the quarks alone cannot explain the mass of the entire nucleon, and therefore the difference between the up and down quark masses cannot be assumed to fully explain the difference between the proton and neutron masses.

>Does the neutron lose mass when it binds with a proton in a nucleus?

You can consider the protons and neutrons within a nucleus to retain their individual masses, but the mass of the entire bound system will be different than the sum of the masses of individual free nucleons. This difference is all swept into a quantity called the "mass defect" (equivalent to the binding energy by E = mc^(2)).