As an example, take the following expression:
$\frac{x^2}{k(\frac{x^2}{2k^2}+\frac{5y^2}{4})}-k$
Then:
- Define a new variable $K := \frac{ky}{x}$ such that $k = \frac{Kx}{y}$
- Plug k into expression and multiply everything by $\frac{y}{x}$
In conclusion, non-dimensionalization allows rewriting in terms of only $K$:
$\frac{-5K^3+2K}{5K^2+2}$
Somehow, I am not able to "non-dimensionalize" a (only) slightly harder expression:
$\frac{a^2}{2k(\frac{b^2}{4k^2}+\frac{5c^2}{4})}-k$
How so? Which $K$ would allow the non-dimensionalization?
To treat this systematically, note that there’s a linear duality between the combinations of the variables that are needed to represent the expression and rescalings of the variables that leave the expression invariant. If the rescaling $x\to\lambda^Xx$, $y\to\lambda^Yy$, $k\to\lambda^K k$ leaves the expression invariant, then the expression can only depend on the combination $z=x^\xi y^uk^\kappa$, which gets rescaled to $\lambda^{\xi X}x^\xi\lambda^{uY}y^u\lambda^{\kappa K}k^\kappa=\lambda^{\xi X+uY+\kappa K}z$, if $\xi X+uY+\kappa K=0$. Thus, every linear constraint on rescalings corresponds to a combination of the variables on which the expression depends.
To illustrate with the extreme cases: If there are no constraints on the rescalings (that is, if all rescalings leave the expression invariant), then the expression depends on nothing and is constant; if there are no non-trivial rescalings that leave the expression invariant (that is, if the vector space of such rescalings is constrained to the null space), then three combinations of the variables (e.g., the three variables themselves) are needed to represent the expression.
This is useful because it’s slightly easier to systematically determine which rescalings leave the expression invariant than to figure out which combinations of variables to use: Go through the expression from the inside out (if you consider it as an expression tree, from the leaves to the root) and in each step derive a relationship between the exponents that would allow the scale factor to be moved out (or upwards in the tree).
For the innermost expression, this leads to
$$ \frac{x^2\lambda^{2X}}{2k^2\lambda^{2K}}+\frac{5y^2\lambda^{2Y}}4\;. $$
To allow $\lambda$ to be factored out, we need $2X-2K=2Y$, i.e. $X-K=Y$, which leads to
$$ \lambda^{2X-2K}\left(\frac{x^2}{2k^2}+\frac{5y^2}4\right) $$
and thus to
$$ \frac{x^2\lambda^{2X}}{k\lambda^K\lambda^{2X-2K}\left(\frac{x^2}{2k^2}+\frac{5y^2}4\right)}-k\lambda^K=\lambda^K\left(\frac{x^2}{k\left(\frac{x^2}{2k^2}+\frac{5y^2}4\right)}-k\right)\;. $$
If you hadn’t allowed multiplying through by $\frac yx$, we would now have to add the constraint $K=0$ to ensure that the rescaling leaves the expression invariant, but since you did we can skip that last step.
So we have a single linear constraint, $1\cdot K+1\cdot Y-1\cdot X=0$, and this corresponds to a single combination $z=k^1y^1x^{-1}=\frac{ky}x$ needed to represent the expression. If we’d added the constraint $K=0$, that is $1\cdot K+0\cdot Y+0\cdot X=0$, we’d have to use a second combination $t=k^1y^0x^0=k$ to represent the expression.
Applying this to your second expression, where we have four variables and thus a four-dimensional vector space of rescalings and its dual four-dimensional vector space of combinations of variables, we need to consider rescalings $a\to\lambda^Aa$, $b\to\lambda^Bb$, $c\to\lambda^Cc$, $k\to\lambda^Kk$ and factor $\lambda$ out of
$$ \frac{b^2\lambda^{2B}}{4k^2\lambda^{2K}}+\frac{5c^2\lambda^{2C}}4\;. $$
This is possible if $B-K=C$, that is, $1\cdot K+1\cdot C-1\cdot B=0$, corresponding to a combination $z=k^1c^1b^{-1}=\frac{kc}b$. Now that innermost expression is
$$ \lambda^{2C}\left(\frac{b^2}{4k^2}+\frac{5c^2}4\right)\;, $$
so now we have to factor $\lambda$ out of
$$ \frac{a^2\lambda^{2A}}{2k\lambda^K\lambda^{2C}\left(\frac{b^2}{4k^2}+\frac{5c^2}4\right)}-k\lambda^K\;. $$
That’s possible if $2A-K-2C=K$, that is, if $A-K=C$. Subtracting this from the previous constraint yields $A=B$, or $1\cdot A-1\cdot B=0$, so we need another combination $t=a^1b^{-1}=\frac ab$. Again, if we weren’t allowed to multiply the entire expression by some combination of the variables, we’d now have to add a third constraint $K=0$ and a corresponding combination $u=k^1=k$.
As it is, we’ve identified two combinations of the variables that suffice to represent the expression, $z=\frac{kc}b$ and $t=\frac ab$. Substituting $k=\frac{zb}c$ and $a=bt$ leads to
\begin{eqnarray*} \frac{(bt)^2}{2\frac{zb}c\left(\frac{b^2}{4(zb/c)^2}+\frac{5c^2}4\right)}-\frac{zb}c &=& \frac bc\left(\frac{t^2}{2z\left(\frac1{4z^2}+\frac54\right)}-z\right) \\ &=& \frac bc\cdot z\left(\frac{2t^2}{5z^2+1}-1\right)\;, \end{eqnarray*}
and then multiplying by $\frac cb$ yields
$$ z\left(\frac{2t^2}{5z^2+1}-1\right)\;. $$