We know $p a^2+q b^2+r ab$ can be represented as square (trivially) when $$p,q\geq0$$
$$r^2=|4pq|$$
holds and as a sum of squares (again trivially) of form $(m a+n b)^2$ under readily explainable conditions on $p,q,r$.


Are there other non trivial sum of squares form with higher powers being cancelled off and leaving only $p a^2+q b^2+r ab$ in final sum for other regimes of $p,q,r$?



On a sum of squares representation
Notice that for a form to be expressible as a sum of squares it must be nonnegative everywhere. In particular setting $a=0$ or $b=0$ tells you $p,q\geq 0$ and setting $a=\pm \sqrt{q}, b=\sqrt{p}$ tells you $|r|\le 2\sqrt{pq}$. Therefore the only regimes of $p,q,r$ where your form is a sum of squares are the ones you already knew by looking at sums of terms of the form $(am+bn)^2$.


An alternative route to the same conclusion is to realize that the coefficient of the deg-lex largest term in the square of a multivariate polynomial is positive, therefore when you take a sum of squares of higher degree there will always be one term of degree higher than 2 that does not cancel out.


