Why must the area under a curve require a non-negative function? For context, this is the first math class in Bachelor's electrical engineering.
Our teacher has just given us a definition for the area under a curve as the following:

If $f(x)$ is an integrable and non-negative function on a closed interval $[a, b]$, then the area under the curve $y = f(x)$ in that range is the integral of $f(x)$ evaluated from $a$ to $b$.

I asked him why the non-negative condition is given, and we're a little stuck trying to find an answer.
In a real-life context, I understand that areas are negative. But when applied to stuff like physics, we'll have to account for the sign as it often denotes ideas like direction. Moreover, imo pure mathematics should allow for negative areas.
Does anyone have any answers?

Usually, a geometrical area is always between two curves or more. Let us  consider the example of two curves  $y=f(x)$ and $y=g(x)$. Further, if $f(x)> g(x)$ or $f(x) < g(x)$ in $(a,c)$; at $x=a,c$ the two may be equal. Then the geometrical area is
$$A=\int_{a}^{c} |f(x)-g(x)|~ dx.$$
But if these two curves cross each other at a single point $x=b$, then the geometrical area is
$$A=\int_{a}^{b} |f(x)-g(x)|~dx+\int_{b}^{c} |f(x)-g(x)|~dx,$$
without  even knowing which one is more or less in $(a,b)$ or $(b,c)$.
In case there are more crossing points $b_1,b_2,b_3,...b_n$, the integral will be broken into $n+1$ integrals.
Most often it is asked to find area area projected on the $x$-axis  by a curve $y=(x)$ from $x=a$ to $x=c$. and the curve does not cross $x$-axis in the interval $(a,c).$ Then the geometrical area is
$$A=\int_{a}^{c} |f(x)-0|~dx.$$
If the curve crosses x-axis at $x=b$, the the geometrical area will be
$$A=\int_{a}^{b} |f(x)| dx+\int_{b}^{c} |f(x)| dx$$
There could also be a concept of vector area which could be positive or negative. So the integrals $\int_{a}^{c}f(x) dx$ and $\int_{a}^{c} (f(x)-g(x))~dx$ represent the vector area, which may not be the same as the geometrical area. For instance $$\int_{0}^{2\pi} \sin x dx=0$$  is the vector but the geometrical area made by $\sin x$ on $x-$axis  from $x=0$ to $x=2\pi$ is $$\int_{0}^{2\pi} |\sin x|~dx=2 ~\text{sq. units}$$
I hope that this discussion may be helpful.
