# Area under a Graph

## Distance and speed

When moving at a constant speed during a time interval $$\Delta t$$, following relations are true for the distance travelled $$\Delta s$$ and the speed $$v$$:

$v=\frac{\Delta s}{\Delta t} \hspace{0.5 cm} \text{and} \hspace{0.5 cm} \Delta s = v\cdot \Delta t$

Graphically, you get the speed by taking the slope of the segment in the s-t-diagram, and you get the distance travelled by taking the area under the constant function in the v-t-diagram.

If you divide the time into intervals, where you have a constant speed within each interval; then you get the speed within an interval by taking the slope of the segment belonging to that interval in the s-t-diagram, and you get the total distance travelled by adding up the areas in the v-t-diagram.

If you let the number of intervals tend to infinity, then $$\Delta t \rightarrow 0$$. You can now find the speed at a given point by differentiating at that point.

$v=\frac{ds}{dt}$

The v-t-diagram will turn into the graph of the derivative function $$v$$. If the function $$v$$ is given, you can find the distance travelled between time $$a$$ and $$b$$ by integrating.

$\int_a^b \! v \, dt=s(b)-s(a)$

Graphically, you find the distance travelled by finding the area under the graph of $$v$$ between $$a$$ and $$b$$.

## Approximating the area

To approximate the area under the graph of a function between $$x=a$$ and $$x=b$$, you divide the interval into several smaller intervals. Within each such smaller interval, you can approximate the area with the area of a rectangle. Since the value of the function can vary within an interval, you usually make two kind of step functions; one where you pick the maximum function value, and one where you pick the minimum. Then you add the areas of the rectangles in a so called upper sum, and a lower sum. If the limit of the upper sum is the same as the limit of the lower sum as the number of intervals tends to infinity, then this limit is the area under the graph. If this is the case, the function is said to be Riemann-integrable.

Note that the function must be defined on the interval $$[a,b]$$.

A function does not have to be continuous to be Riemann-integrable. As an example, consider a step function on an interval.

## Correspondence with the antiderivative

The area of the step function in the picture above is

$A=f(x_0)\cdot \Delta x + f(x_1)\cdot \Delta x + f(x_2)\cdot \Delta x + f(x_3)\cdot \Delta x + f(x_4)\cdot \Delta x$

Let $$F(x)$$ be an antiderivative to $$f(x)$$, i.e. a function such that $$F'(x)=f(x)$$. If $$\Delta x$$ is "small", we can make following approximation

$f(x_i)\approx \frac{F(x_{i+1})-F(x_i)}{\Delta x} \text{ for } i=0,1,2,3,4$

This gives us following approximation for the area

$A\approx \frac{F(x_1)-F(x_0)}{\Delta x}\cdot \Delta x + \frac{F(x_2)-F(x_1)}{\Delta x}\cdot \Delta x + \frac{F(x_3)-F(x_2)}{\Delta x}\cdot \Delta x + \frac{F(x_4)-F(x_3)}{\Delta x}\cdot \Delta x + \frac{F(x_5)-F(x_4)}{\Delta x}\cdot \Delta x$

Cancel out all $$\Delta x$$

$A\approx F(x_1)-F(x_0) + F(x_2)-F(x_1) + F(x_3)-F(x_2) + F(x_4)-F(x_3) + F(x_5)-F(x_4)=F(x_5)-F(x_0)$

Let the number of intervals tend to infinity, then $$\Delta x \rightarrow 0$$. If the endpoints are called $$a$$ and $$b$$, we get that

$A=F(b)-F(a)$

Another explanation about the correspondence between the area under a function and the antiderivative is shown on the next page.

## Exercise

Let $$f(x)$$ and $$g(x)$$ be defined on the interval $$[0,1]$$. Let

f(x) = \left \{ \begin{align*} 1&\text{ when } x=0.6 \\ 0&\text{ otherwise} \end{align*} \right.

and let

g(x) = \left \{ \begin{align*} 1&\text{ when } x \text{ is a rational number} \\ 0&\text{ otherwise} \end{align*} \right.

Explain why $$f(x)$$ is Riemann-integrable and find the area under the graph of $$f(x)$$ in the interval $$[0,1]$$.

Explain why $$g(x)$$ is not Riemann integrable.

## Fundamental Theorem of Calculus

An antiderivative $$F(x)$$ of the function $$f(x)$$, has the property that $$F'(x)=f(x)$$. If a function $$f(x)$$ has an antiderivative $$F(x)$$ and if $$C$$ is a constant, then the function $$F(x)+ C$$ is also an antiderivative. Since the constant $$C$$ can be infinitely many numbers, we can conclude that if there is one antiderivative function, then there are infinitely many antiderivatives. In the picture below, the graphs of some antiderivatives to the function $$f(x)=2x$$ are shown.

Let $$f(x)$$ be a function and $$a$$ be a number. We can define a function $$A(x)$$ as the area under the graph of $$f(x)$$ on the interval $$[a,x]$$. In order to show that $$A(x)$$ is an antiderivative to $$f(x)$$, we must show that the derivative $$A'(x)=f(x)$$. In other words, we must show that

$\lim_{h\rightarrow 0}\frac{A(x+h)-A(x)}{h}=f(x)$

Since all antiderivate functions to a given function just differ by a constant, you can use any such function when calculating the area under $$f(x)$$ in the interval $$[a,b]$$. Let $$F(x)$$ be an antiderivative to $$f(x)$$, then $$F(x)=A(x)+C$$ for some constant C. Then

$\int_a^b \! f(x) \, dx = F(b)-F(a)=A(b)+C-(A(a)+C)=A(b)-A(a)=A(b)-0=A(b)$

The relation above is one version of the Fundamental Theorem of Calculus. For a formal treatment, see Wikipedia - Fundamental Theorem of Calculus.