# Rearrangement of a gas law equation

For example, let us that say we have a question where we have to use the ideal gas law and that the moles and temperature are constant. Then the gas law can also be written as $$nRT=PV$$ However, according to my solutions manual, this can also be written as $$nRT=P_1V_1=P_2V_2$$

My question is, how are we justified in rearranging the equation like this?

If one rearranges the ideal gas law equation, you can obtain the following (assuming $n$ and $T$ are non-zero):

$$\frac{PV}{nT} = R$$

$R$ is a constant, and there are in fact infinitely many possible sets of values $(P, V, n, T)$ that satisfy the equation. Let $(P_1, V_1, n_1, T_1)$ denote one such set, and let $(P_2, V_2, n_2, T_2)$ denote a second one. Then, we have:

$$\frac{P_1V_1}{n_1T_1} = R$$ $$\frac{P_2V_2}{n_2T_2} = R$$

So, by the transitive property:

$$\frac{P_1V_1}{n_1T_1} = \frac{P_2V_2}{n_2T_2}$$

You can let $n$ and $T$ be constant as well (as in your specific example), but the principal is the same and leads to an analogous result, since any product and/or ratio of constants will itself be a constant.