Infinitesimal squared in metrics Metrics are often formulated by appealing to the square of an infinitesimal quantities. Examples of such are: 
$$
(ds)^2=(dx)^2+(dy)^2
$$
or 
$$
ds^2=dx^2+dy^2
$$
or
$$
d(s^2)=d(x^2)+d(y^2)
$$
or 
$$
(\Delta s)^2=(\Delta x)^2+(\Delta y)^2
$$
What is the difference between each of these relations.
Finally, how does one integrates $(dx)^2$ (both as an indefinite and a definite integral)?
 A: Given a Riemaniann manifold $(M, g)$, the line element is defined as:
$$
\phi\colon T^*M\times T^*M\to \mathbb{C}, \quad ds^2 = g(du, du).
$$
This is consistent with the original idea of calculating line lengths by extending the Pythagorean theorem and therefore in the literature one states that $ds^2 = dx^2 + dy^2 +\ldots$.
The notation $d(s^2)$ represents, on the other hand, the exterior derivative (or whatever derivative you have at hand) of the function $s^2$, $s$ being calculated as 
$$
s = \int_{\gamma} ds
$$
with consistent understanding of the symbol above; as such, it follows that $d(s^2) = 2s\, ds$. 
The finite element $\Delta s^2$ is defined through
$$
\Delta s = \int^A_B ds
$$
along a line $\gamma$. Using the definition of $ds$ in terms of metric tensor one can show that the integral can be split into the sum of individual pieces along each direction, therefore the single components $\Delta x^2$ and $\Delta y^2$, respectively.
A: The notations can be confusing. These are ok: $$(ds)^2=(dx)^2+(dy)^2,$$$$ds^2=dx^2+dy^2,$$$$(\Delta s)^2=(\Delta x)^2+(\Delta y)^2.$$ But this one $$d(s^2)=d(x^2)+d(y^2)$$ is just weird. I explain this weird one first.
What it says is that there are real-valued functions $s,x,y$ such that you can square each of them, take their exterior derivative, and the derivatives would satisfy the equation $$d(s^2)=d(x^2)+d(y^2).$$ This equation is not quite defining the function $s$. Instead you have to solve the equation for $s$.
The equation $$(\Delta s)^2=(\Delta x)^2+(\Delta y)^2$$ is usually meant to describe the length $\Delta s$ of a straight line and how it is related to its $x$-component of displacement $\Delta x$ and $y$-component of displacement $\Delta y$. You can see it is just Pythagorean theorem. (And, they are obviously not infinitesimals as they are just lengths of some straight lines.)
I consider the two equations $$(ds)^2=(dx)^2+(dy)^2,$$$$ds^2=dx^2+dy^2$$ the same, as they are both defining an object $(ds)^2$ or $ds^2$ (whether or not you use parentheses around $ds$ is a matter of taste, but I think most people do not use parentheses). Be careful that $ds^2$ is not the square of some other object $ds$, because $ds$, even if you allow abuse of notation, is defined using $ds^2$ (if you don't allow abuse of notation, you do not write $ds$ at all).
But $dx^2$, $dy^2$ ARE "squares" of some object $dx$, $dy$. Specifically, $dx^2$ (respectively $dy^2$) are tensor products of $dx$ (respectively $dy$) with itself.
To do integration with $ds^2$, you want to do it on a curve, to find the length of the curve. The length of a curve $\gamma:[a,b]\to\Bbb R^2,\ \gamma(t)=(\gamma_1(t),\gamma_2(t))$ is given by $$\int_a^b\sqrt{\left(\frac{d\gamma_1}{dt}\right)^2+\left(\frac{d\gamma_2}{dt}\right)^2}dt,$$ which you would have seen already. This formula is rather unamazing, because the metric you gave me is simple.
You do not indefinitely integrate $dx^2$ or $ds^2$. Remember, indefinite integrate a function $f$ is to find a function $F$ whose "derivative" is $f$. You need to specify what "derivative" is. If you are thinking exterior derivative, then since $dx^2$ and $ds^2$ are not differential forms, they cannot be the exterior derivatives of some other functions.
