Why do we consider the algebraic sum of areas when we do definite integration? Taking a very simple example to elaborate my question -
$$\int_0^{2\pi} \sin xdx = [-\cos x]_0^{2\pi}$$
$$=-\cos (2\pi) + \cos(0)$$
$$= -1+1$$
$$= 0$$
Now I understand mathematically why this is true...like the method of integration is clear to me. However, I was also told by my teacher that DI represents the algebraic area under the curve.
Why's it algebraic? Because clearly the area is not zero, if we just look at the graph of $\sin(x)$.
So, I just want to understand this paradox between the formal way of integrating and what we see in the graph.
PS: What actually drove me to this confusion was the fact that my math teacher was considering the algebraic sum of areas when he was teaching the Definite Integration chapter and numerical sum when he was teaching the chapter Area Under a Curve.
 A: Considering that you meant $[0,2\pi]$ and not $[0,\pi]$. You can see that area is something that is always positive, but an integral can be negative, for example
$$\int_{\pi}^{2\pi} sin(x) dx = -2$$
But if you pay attention to the graph, this curve is below the $x$ axis, so it is negative. Although you have
$$\int_{0}^{2\pi} sin(x) dx = 0$$
the area you can see is actually $4$, but the integral gives you zero because
$$\int_{0}^{2\pi} sin(x) dx = \int_{0}^{\pi} sin(x) dx + \int_{\pi}^{2\pi} sin(x) dx  = 2 -2 = 0$$
Finally, this algebraic area takes into account negative area and positive area, so you can have weird things like an integral giving zero, or even negative. If you want a more classical area, you might want to work with the absolute value.
$$\int_{0}^{2\pi} |sin(x)| dx = 4$$
A: Consider an example from Physics:

A body moves along the $x$ axis with a velocity that varies with time as $v=\sin t$. Find its displacement from
(a) $t = 0$ to $t=\frac{\pi}2$
(b) $t = 0$ to $t=2\pi$

We know that $$s=\int v \ dt$$
For part (a), $$s=\int_{0}^{\frac\pi 2} \sin t \ dt=[-\cos t]_0^{\frac\pi 2}=-1$$
Here, the negative sign represents that the body moves backwards (along negative $x$ axis). It may appear that we do not really require the negative sign, as the displacement is 1 unit anyway.
But for part (b), $$s=\int_{0}^{2\pi} \sin t \ dt=[-\cos t]_0^{2\pi}=0$$
Here, the displacement is zero. If we had taken the absolute area bounded by the curve $y=\sin x$ with the x axis, we will not get the displacement as zero. So it becomes necessary to use the "signed area".
Finally, to answer your question, people have defined definite integrals in a way that is convenient. We can't really ask why; it's a convention. In this problem, if we had been asked for distance instead of displacement, we would have to use the absolute area. So it really depends on where we apply the concept of definite integrals.
A: It is actually $2$. You've made an error in placing the sign.
$-(\cos\pi - \cos 0) = -(-1-1) = +2$
Now if you do the algebraic sum, it is also positive and by direct integration the value is positive.
