Over $\mathbb{C}$, every homogeneous polynomial of degree $2$ in $x_0,...,x_n$ can be brought into the form $f=x_0^2+...+x_r^2$ for some $0\le r\le n$. This is a part of an exercise of Hartshorne's book.
I want to see it by some example.
Let $g=x_0^2+x_1x_4+x_2x_3\in \mathbb{C}[x_0,...,x_4]$.
Then how can I bring $g$ into $f=x_0^2+...+x_4^2$? How do you base change of variables?
Let $y_0 = x_0$, $y_1=\frac{1}{2}(x_1+x_4)$, $y_4=\frac{1}{2}(x_1-x_4)$, $y_3=\frac{1}{2}(x_2-x_3)$, and $y_2=\frac{1}{2}(x_2+x_3)$.
Transforming the equation gives:
$$x_0^2+x_1x_4+x_2x_3=y_0^2+(y_1+y_4)(y_1-y_4)+(y_2+y_3)(y_2-y_3) = y_0^2+y_1^2-y_4^2+y_2^2-y_3^2.$$
Now replace $y_4$ and $y_3$ with $iy_4$ and $iy_3$, respectively. The above equation becomes:
$$g=y_0^2+y_1^2+y_2^2+y_3^2+y_4^2.$$