When does the principle of superposition apply? I assumed from my general physics courses that the principle of superposition was just an empirical fact about forces.  Then I could understand that derived quantities like the $E$ and $B$ fields would also obey it because, for instance: $$F_1 + F_2 = qE_1 + qE_2 = q(E_1+E_2) = F_{total} \\ \implies E_1 + E_2 = E_{total}$$But yesterday I saw that the Wikipedia page on gravitational potential stated that "the potential associated with a mass distribution is the superposition of the potentials of point masses."  So apparently gravitational potential energy also obeys the superposition principle.
This leads me to wonder what all are the quantities that obey superposition.  Do all types of energy obey it, for example?  Better yet, is there some way of determining whether a given quantity (number/ vector/ etc) will obey the principle of superposition theoretically or do we need an empirical law for each?
Looking at the Wikipedia page on the superposition principle didn't help as it stated that all linear systems obeyed it.  But how do we know whether a system is linear?  I know how to determine whether a function is linear, but let's take for example gravitational potential energy:  $$U_g = - \frac{GMm}{r}$$  This law has $3$ independent variables.  It is linear in $M$ and $m$ but not in $r$.  So how would I determine which of those variables needs to be linear for the gravitational potential energy to obey the principle of superposition?
 A: You got it all backwards.
Forces add as vectors. That's the addition going on for linearity. If your forces are the sum of pairwise forces due to two bodies at a time, and they each have a pairwise potential or a pairwise field then because the forces add we can conclude that the effective multiparticle potential or the effective multiparticle field is the sum of the individual potentials or fields.
So don't use linearity to prove that forces add. Use the fact that forces add to find the multiparticle potentials and fields.
So for your Newtonian gravity example the potential energy is a scalar field in configuration space:
$$U(\vec r_1,\vec r_2,\vec r_3)=-\frac{GM_1M_2}{|\vec r_1-\vec r_2|}-\frac{GM_1M_3}{|\vec r_1-\vec r_3|}-\frac{GM_3M_2}{|\vec r_3-\vec r_2|}.$$
A: The principle of superposition is not obvious in any sense. However, it is an experimentally verified fact to a certain accuracy. If you look at Newton's law or Coulomb's law, it does not say anything about the fact that the net force is the sum of individual forces as if all other particles were absent. There is no reason for the net force not to be related non-linearly.
It is one of those fundamental principles that is taken for granted, similar to the Equivalence principle or Hamilton's principle.
