# Integrals

One of the most important things when describing geometry is having a consistent mechanism to define properties that do not appear to have an easily calculable value, such as the area of a curved surface or under a curved line, the surface area of an smooth but arbitrary surface or even the volume between two enclosed parabolas.

It turns out that calculus provides us with a tool called the Integral you can calculate all these properties in a fairly consistent way.

Unfortunately, the way that the integral is typically taught to students does not do very much to explain why it is useful to find these properties and also does not inspire students to think about what else it could be used for other than finding the area underneath curves. Part of the reason why this is the case is that the integral is taught in the context of calculus, where it is typically referred to as the "antiderivative".

While the fundamental theorem of calculus shows that this is technically true, it still does not give us a good intuition as to what integration actualy is and instead implants this abstract idea that is only good for to reverse differentiation as long as you throw an arbitrary constant, $C$ on the end.

Your math teachers did not get it all wrong, however. Usually in learning the integral you would have gotten some sort of hand-wavey explanation about how if you imagined drawing little rectangles underneath a function and adding them all up, then you could approximate the area under that function by making the rectangles thinner and thinnner.

Then you would have moved directly on to the notation and various antidifferentiation rules:

$\int 3x\phantom{\rule{thinmathspace}{0ex}}dx=\frac{3}{2}{x}^{2}+C$

What is worth paying attention to now is the $dx$ sitting at the end of the integral expression. What that actually translates to is, for every point $x$, spaced evenly by $dx$ evaluate the function at $x$ to get $y$ , then multiply by $dx$. Then, add up every result.

So it stands to reason that we can actually re-express any integral as the sum of the function evaluated at points ${x}_{min}$ to ${x}_{max}$ each separated by $dx$, times $dx$ itself.

${\int }_{0}^{4}-\frac{1}{2}{x}^{2}+3\phantom{\rule{thinmathspace}{0ex}}dx=\sum _{0}^{4/dx}-\frac{1}{2}{x}^{2}+3\phantom{\rule{thinmathspace}{0ex}}dx$

This notation is called a Riemann Sum.

So going back to the example of why the integral represents the area under a function, consider what happens when we apply the Riemann sum formula to it.

Take a very simple function like $y=x$. If we were to integrate by drawing lots of rectangles from the $x$ axis to the line defined by the function, we would essentially end up with a right angled triangle.

Now consider what happens when we take the Riemann sum from 0 to 3.

$\sum _{0}^{3/dx}x\phantom{\rule{thinmathspace}{0ex}}dx$

Lets say that for arguments sake, $dx$ is 0.5. So we evaluate the function at 0, 0.5, 1.0, 1.5, multiply by $dx$ and take the sum of all those evaluations.

$x=0,x×dx=0$$x=0.5,x×dx=0.25$$x=1.0,x×dx=0.5$$x=1.5,x×dx=0.75$$x=2.0,x×dx=1.0$$x=2.5,x×dx=1.25$$x=3.0,x×dx=1.5$

Now, adding up all those results, we get 5.25.

If we were to use the classic fomula, $a=\frac{1}{2}b×h$we would get$\frac{1}{2}3×3=4.5$. So we came pretty close! Its important to recognise that a Riemann sum is an approximation that gets better as $dx$ gets smaller, so by using more iterations we could get a more accurate result.

The nice thing about the Riemann sum is that it can easily be extended to additional dimensions. You just do a Riemann sum of Riemann sums! Say for instance we wanted to find the volume over a triangular prisim with base 3, height 3 and depth 1. You can do this by dividing it into two integrals. First, integrate over the the right-triangle as before.

Then, consider the $xz$ dimension. Our function there is always $z=1$. So we can just integrate over that.

Putting the two together, we get a 3D shape like a triangular prism that we integrate both ways by using some pillars.

Notationally, this is quite familiar. Remember? Its just a sum of sums.

$\sum _{0}^{1/dy}\sum _{0}^{3/dx}x\phantom{\rule{thinmathspace}{0ex}}dx\phantom{\rule{thinmathspace}{0ex}}dy$

If we wanted to express this as an integral, you can use a double-integral which is exactly what you would expect.

${\int }_{0}^{1}{\int }_{0}^{3}x\phantom{\rule{thinmathspace}{0ex}}dx\phantom{\rule{thinmathspace}{0ex}}dy$

Double integrals are evaluated by by integrating the first variable,$x$ on the left hand side, then integrating the second variable $y$, treating all each other variable like a constant.

So integrating $x$ first, we have:

${\int }_{0}^{1}\frac{1}{2}{3}^{2}\phantom{\rule{thinmathspace}{0ex}}dy$

Then, we integrate with respect to $y$, which is just:

$\frac{1}{2}{3}^{2}×1$

Now consider an even more complex function, a paraboloid in two dimensions.

$z=-{x}^{2}-{y}^{2}+2$

Describing the area of this shape in terms of a simple formula would be very difficult. But using the technique of integration we learned here, we can always find a solution that converges on the area.

${\int }_{-2}^{2}{\int }_{-2}^{2}-{x}^{2}-{y}^{2}+2\phantom{\rule{thinmathspace}{0ex}}dx\phantom{\rule{thinmathspace}{0ex}}dy$

Working through that integral we have:

${\int }_{-2}^{2}\left[\frac{-{x}^{3}}{2}-{y}^{2}x+2x{\right]}_{-2}^{2}\phantom{\rule{thinmathspace}{0ex}}dy$${\int }_{-2}^{2}\left(\left[\frac{-{2}^{3}}{3}-{y}^{2}\left(2\right)+2\left(2\right)\right]-\left[\frac{-\left(-2{\right)}^{3}}{3}-{y}^{2}\left(-2\right)+2\left(-2\right)\right]\right)\phantom{\rule{thinmathspace}{0ex}}dy$${\int }_{-2}^{2}\left(\left[\frac{-8}{3}-2{y}^{2}+4\right]-\left[\frac{8}{3}+2{y}^{2}-4\right]\right)\phantom{\rule{thinmathspace}{0ex}}dy$${\int }_{-2}^{2}\frac{-16}{3}-4{y}^{2}+8\phantom{\rule{thinmathspace}{0ex}}dy$$\left[\frac{-16y}{3}-\frac{4{y}^{3}}{3}+8y{\right]}_{-2}^{2}$$\left[\frac{-16\left(2\right)}{3}-\frac{4\left(2{\right)}^{3}}{3}+8\left(2\right)\right]-\left[\frac{-16\left(-2\right)}{3}-\frac{4\left(-2{\right)}^{3}}{3}+8\left(-2\right)\right]$$\left[\frac{-32}{3}-\frac{32}{3}+16\right]-\left[\frac{32}{3}-\frac{-32}{3}-16\right]$$\left[\frac{-64}{3}+\frac{48}{3}\right]-\left[\frac{64}{3}-\frac{48}{3}\right]$$\left[\frac{-16}{3}\right]-\left[\frac{16}{3}\right]$$\frac{-32}{3}$

Looking at the graph, the volume exists in the negative $z$ direction, hence, our final answer is negative.