Variable (mathematics)
Example: the ideal gas law

Consider the equation describing the ideal gas law, P V = N k B T. {\displaystyle PV=Nk_{B}T.} This equation would generally be interpreted to have four variables, and one constant. The constant is k B {\displaystyle k_{B}}, the Boltzmann constant. One of the variables, N {\displaystyle N}, the number of particles, is a positive integer (and therefore a discrete variable), while the other three, P, V {\displaystyle P,V} and T {\displaystyle T}, for pressure, volume and temperature, are continuous variables.

One could rearrange this equation to obtain P {\displaystyle P} as a function of the other variables, P (V, N, T) = N k B T V. {\displaystyle P(V,N,T)={\frac {Nk_{B}T}{V}}.} Then P {\displaystyle P}, as a function of the other variables, is the dependent variable, while its arguments, V, N {\displaystyle V,N} and T {\displaystyle T}, are independent variables. One could approach this function more formally and think about its domain and range: in function notation, here P {\displaystyle P} is a function P: R > 0 × N × R > 0 → R {\displaystyle P:\mathbb {R} _{>0}\times \mathbb {N} \times \mathbb {R} _{>0}\rightarrow \mathbb {R} }.

However, in an experiment, in order to determine the dependence of pressure on a single one of the independent variables, it is necessary to fix all but one of the variables, say T {\displaystyle T}. This gives a function P (T) = N k B T V, {\displaystyle P(T)={\frac {Nk_{B}T}{V}},} where now N {\displaystyle N} and V {\displaystyle V} are also regarded as constants. Mathematically, this constitutes a partial application of the earlier function P {\displaystyle P}.

This illustrates how independent variables and constants are largely dependent on the point of view taken. One could even regard k B {\displaystyle k_{B}} as a variable to obtain a function P (V, N, T, k B) = N k B T V. {\displaystyle P(V,N,T,k_{B})={\frac {Nk_{B}T}{V}}.}
detectable_content:postscript