Why can terms of a spacetime metric only have 2 differential factors? In my general relativity textbook, the following equation is given:
$$ds^2 = g_{\alpha \beta}(x)dx^{\alpha}dx^{\beta}$$
Which describes the line element $ds^2$ for a metric. $g_{\alpha \beta}$ is a matrix that is the metric itself. This equation implies that a given term of the equation for a line element can only have two differential factors. Either two different linear variables (For example: $dtdr$) or one variable squared (For example: $d\theta^2$).
Intuitively, this makes some sense. Our line element is $ds^2$, so that exponent of 2 could explain why, when you multiply things out, you can only get two differential factors per term, just like squaring any polynomial.
But this doesn't really make sense to me from a more formal perspective. I suppose the issue is that I don't really understand what the exponent of 2 is actually doing. So what is it doing? And what is the exact reason that we can only have two differential factors per term?
(Reading back this question, I'm not sure if everything is clear, so let me know if I can clarify anything or otherwise improve this question).
 A: The expression for the line element is a generalization of the Pythagorean Theorem of 2D Euclidean space,
$$c^2=a^2+b^2,$$
to 4D curved spacetime, on an infinitesimal scale. So the squares shouldn’t be surprising.
In 3D Euclidean space, you have probably seen that infinitesimal arc length along a curve is just
$$ds^2=dx^2+dy^2+dz^2.$$
In the flat (Minkowskian) spacetime of Special Relativity it is just
$$ds^2=-dt^2+dx^2+dy^2+dz^2.$$
For a general 4D curved spacetime, your expression, written out in $txyz$ coordinates, is
$$\begin{align}ds^2&=g_{tt}(t,x,y,z)\,dt^2+g_{xx}(t,x,y,z)\,dx^2+g_{yy}(t,x,y,z)\,dy^2+g_{zz}(t,x,y,z)\,dz^2 \\
&+2g_{tx}(t,x,y,z)\,dt\,dx+2g_{ty}(t,x,y,z)\,dt\,dy+2g_{tz}(t,x,y,z)\,dt\,dz\\
&+2g_{xy}(t,x,y,z)\,dx\,dy+2g_{xz}(t,x,y,z)\,dx\,dz+2g_{yz}(t,x,y,z)\,dy\,dz.
\end{align}$$
The essential idea is that curved space(time) should be, over sufficiently small regions, very similar to flat space(time), in the same way a small patch of the Earth’s spherical surface seems like a plane. This means that you can't have something weird with different powers like
$$ds^2=-A dt^3+B dx^4+C dy^5+D dz^6.$$
