Why are the areas non-positive? I learnt that the integral of a function $f(\cdot)$ is the measure of an area, i.e. $\int\limits_{a}^{b}f(x)\,\mathrm{d}x$ is the area of the intersection of $x=a$, $x=b$, and $y=f(x)$.
How come some areas are non-positive.
Example: $\int\limits_{0}^{\pi}\cos x\,\mathrm{d}x=0\leq 0$.
 A: What you can do to compute the area between the curve and the $x$ axis (y = 0) is split the integral. At $\pi/2$, the graph of $\cos x$ intersects the $x$ axis (the line $y = 0$). For values $0 \lt x \lt \pi/2$, $\cos x$ is above the $x$ axis.  For values $\pi/2 \lt x \lt \pi$, $\cos x$ is below the line $y = 0$.
To compute the area bound by the line $y = 0$ and $\cos x$, we split the integral into two integrals, subtracting the lower curve from the upper curve.
$$\begin{align} \int_0^{\pi/2} (\cos x - 0)\,dx + \int_{\pi/2}^\pi (0 - \cos x)\,dx & = \int_0^{\pi/2} \cos x \,dx - \int_{\pi/2}^\pi \cos x \,dx \\ \\ &= 2 \int_0^{\pi/2} \cos x\,dx\end{align}$$
A: It's simply not true, in general, that $\int_a^b f(x) \,dx$ is equal to the area between $f(x)$ and the $x$-Axis in the interval $[a,b]$. For precisely the reason you stated - areas obviously cannot be negative. 
What is true is that for non-negative functions $f(x)$, the area between $f(x)$ and the $x$-Axis in the interval $[a,b]$ is $\int_a^b f(x) \,dx$. Though note that this is more a definition of that area then anything else - how would you compute that area without resorting to integration? The only thing you can really prove is that this notion of area coincides with other definitions of area for simple shapes like rectangles.
For general functions $fx$, $\int_a^b f(x) \,dx$ is the difference between the area above the $x$-Axis and below $f(x)$, and the area below the $x$-Axis and above $f(x)$. We chose to define the integral that way because it then has a lot of convenient properties. For example, we then get $$
  \int_a^b - f(x) = -\int_a^b f(x) \text{.}
$$
For similar reasons, we also define $$
  \int_a^b f = - \int_b^a f \text{.}
$$
