# ternary quadratic form as a sum two squares of linear forms

Let $$\phi(x,y)=ax^2+2bxy+cy^2$$ be a binary quadratic form with integer coefficients.

Pall proved in 1951 that $$\phi(x,y)$$ can be written as the sum of two squares of two linear forms if and only if $$ac-b^2=m^2$$ is a perfect square and $$r_2(d)>0$$, where $$r_2(d)$$ denotes the number of representations of $$d=\gcd(a,2b,c)$$ as the sum of two squares.

Moreover, the number of representations of $$\phi(x,y)$$ as a sum of the squares of two linear forms is exactly $$2r_2(d)$$ if $$ac-b^2=m^2>0$$. Williams gave in 1972 a simpler proof of this result.

My question is whether a similar result is known for ternary quadratic forms. More precisely, let

$$\psi(x,y,z)=ax^2+by^2+cz^2+2dxy+2exz+2fyz$$ be such a form with integer coefficients.

Are there any necessary and sufficient conditions on the coefficients which guarantee that $$\psi(x,y,z)$$ can be written as

$$\psi(x,y,z) =(a_1x+b_1y+c_1z)^2+(a_2x+b_2y+c_2z)^2$$ for some integers $$a_i, b_i, c_i$$?

Moreover, assuming that $$\gcd(a,b,c,d,e,f)=1$$, is it possible that $$\psi(x,y,z)$$ can be written as a sum of two squares in more than one way?