deform equation into sum of squares 
I met an equation in a paper:
\begin{equation}
\mu^2(\mu^2-rs)=(\mu^2-rs)(a+b)+2ab\mu+a^2s+b^2r
\end{equation}
we already have known $\mu^2<rs$ and $r>0$.In the paper, the author gives a magical substitution $\alpha=2a-r+\mu,\beta=2b-s+\mu$ and then:
\begin{equation}
r(r+s-2\mu-4\mu^2)(-\mu^2+rs)=(-\mu^2+rs)\alpha^2+(r\beta+\mu\alpha)^2
\end{equation}
directly implying that $r+s-2\mu-4\mu^2\geq 0$.

Here are my questions:

*

*what is the motivation for this substitution? I think more specific details will help a lot.

*Is there such a technique to deform the equation which is always positive into a sum of squares?

Thanks for your help!
 A: Remark: Finding $h$ such that $f + h\cdot g \ge 0$ is a trick in proving some inequalities.

Problem: Let $a, b, \mu, s, r$ be real numbers
such that $r > 0$ and $\mu^2 < rs$
and $\mu^2(\mu^2-rs)=(\mu^2-rs)(a+b)+2ab\mu+a^2s+b^2r$. Prove that
$r+s-2\mu-4\mu^2\geq 0$.
Proof:
Let
$$f := r+s-2\mu-4\mu^2$$
and
$$g :=  (\mu^2-rs)(a+b)+2ab\mu+a^2s+b^2r - \mu^2(\mu^2-rs).$$
We hope to find a function $h$ such that
$$f + h\cdot g \ge 0.$$
(Note: This implies $f \ge 0$.)
We chose $$h = \frac{4}{rs - \mu^2}.$$ (See Remarks at the end for details.)
Note that $f + \frac{4}{rs - \mu^2}\cdot g$ is quadratic in $b$. It is easy to get
\begin{align*}
 f + \frac{4}{rs - \mu^2}\cdot g 
 &= {\frac { \left( 2\,a\mu +2\,br-rs+{\mu}^{2} \right) ^{2}}{r(rs-\mu^2)}}+{\frac {
   \left( 2\,a-r+\mu \right) ^{2}  }{r}}\\
 &= \frac{(r\beta + \mu \alpha)^2}{r(rs- \mu^2)} + \frac{\alpha^2}{r}
\end{align*}
or
$$r\cdot f \cdot (rs - \mu^2) 
+ 4r \cdot g = 
(rs - \mu^2)\alpha^2 + (r\beta + \mu \alpha)^2.$$
In other words, given that $g = 0$, we have
$$r\cdot f \cdot (rs - \mu^2) = (rs - \mu^2)\alpha^2 + (r\beta + \mu \alpha)^2$$
which is exactly the result in the paper.
We are done.

Remarks:
Note that $f + h\cdot g$ is quadratic in $b$, i.e.
$$f + h\cdot g = q_1 b^2 + q_2b + q_3$$
where
\begin{align*}
 q_1 &= r h, \\
 q_2 &= 2\,ah\mu-hrs+h{\mu}^{2}, \\
 q_3 &= hrs{\mu}^{2}-h{\mu}^{4}+{a}^{2}hs-ahrs+ah{\mu}^{2}-4\,{\mu}^{2}+r+s-2\,\mu.
\end{align*}
We hope to find $h$ such that  $q_1 > 0$ and $4q_1q_3 \ge q_2^2$.
Note that $4q_1q_3 - q_2^2$ is quadratic in $a$, i.e.
$$
 4q_1q_3 - q_2^2 = p_1 a^2 + p_2a + p_3
$$
where
\begin{align*}
 p_1 &= 4h^2(rs-\mu^2),\\
 p_2 &= -4\,{h}^{2}{r}^{2}s+4\,{h}^{2}rs\mu+4\,{h}^{2}r{\mu}^{2}-4\,{h}^{2}{\mu}^{3},\\
 p_3 &= 4\,{h}^{2}{r}^{2}s{\mu}^{2}-4\,{h}^{2}r{\mu}^{4}-{h}^{2}{r}^{2}{s}^{2}+2\,
 {h}^{2}rs{\mu}^{2}-{h}^{2}{\mu}^{4}\\
&\qquad -16\,hr{\mu}^{2}+4\,h{r}^{2}+4\,hrs-8\,hr
 \mu.
\end{align*}
We hope to find $h$ such that
$p_1 > 0$ and $4p_1p_3 - p_2^2 \ge 0$.
We have
$$4p_1p_3 - p_2^2 = 16(r + s - 2\mu - 4\mu^2)(rs - \mu^2)r h^3[4 - (rs - \mu^2)h].$$
We let $4 - (rs - \mu^2)h = 0$ to get $h = \frac{4}{rs - \mu^2}$ which is what we want.
