We’ve seen that the definite integral

$\int_a^c f(x)dx$

can be regarded as the area under the graph of $$y = f(x)$$ over the interval [a, c]. If you have a point $$b$$ such that $$a < b < c$$, the above integral can be expressed as the sum of the integral from $$a$$ to $$b$$, and the integral from $$b$$ to $$c$$. This is the additive property of definite integrals.

$\int_a^b f(x)dx = \int_a^b f(x)dx + \int_b^c f(x)dx$

To review a complete list of properties of integrals, check out this article.

## The Area of a Region Bounded by Two Graphs

If you have a couple of functions $$f$$ and $$g$$ such that $$f(x) \geq g(x)$$ over an interval [a, b], then the area of the region between the two curves is the difference of their definite integrals.

$\int_a^b [f(x) - g(x)]dx$

As an example, let’s find the area bounded in the following region.

import matplotlib.pyplot as plt
import sympy as sp
from sympy.abc import x
import numpy as np

f = sp.lambdify(x, 2*x + 1, "numpy")
g = sp.lambdify(x, x**2 + 1, "numpy")

xs = np.arange(-1, 5, 1)

plt.plot(xs, f(xs), color = "red", label="$f(x) = 2x + 1$")
plt.plot(xs, g(xs), label="$g(x) = x^2 + 1$")

plt.fill_between(xs, f(xs), g(xs), where=f(xs) >= g(xs), color = "yellow")
plt.legend(frameon=False)

sp.integrate(f(x), (x, 0, 2)) - sp.integrate(g(x), (x, 0, 2))
## 4/3

## Life Science Example

A clever college student develops an engine that is believed to meet all state standards for emission control. The new engine’s rate of emission is given by

$E(t) = 2t^2$ where $$E(t)$$ is the emissions, in billions of pollution particulates per year, at time $$t$$, in years. The emission rate of a conventional engine is given by

$C(t) = 9 + t^2$

• At what point in time (how many years) will the emission rates be the same?
• What reduction in emissions results from using the student’s engine?
from sympy.abc import t

E = 2*t**2
C = 9 + t**2

sp.solve(sp.Eq(E - C, 0), t)[1]
## 3
C = sp.lambdify(x, C, "numpy")
E = sp.lambdify(x, E, "numpy")

sp.integrate(C(t), (t, 0, 3)) - sp.integrate(E(t), (t, 0, 3))
## 18

## Average Value of a Continuous Function

Another important use of the area under a curve is finding the average value of a continuous function over a closed interval.

Formally, let $$f$$ be a continuous function over a closed interval [a, b]. It’s average value, $$y_{av}$$, over the interval is given by

$y_{av} = \frac{1}{b - a} \int_a^b f(x)dx$

Let’s look an example. Let’s find the average of $$f(x) = x^2$$ over the interval [0, 2].

xs = np.linspace(0, 2)

f = sp.lambdify(x, x**2, "numpy")

def avg(f, a, b):
integral = sp.integrate(f(x), (x, a, b))
return float(integral * (1 / b - a))

average = avg(f, 0, 2)
average
## 1.3333333333333333
plt.plot(xs, f(xs))
plt.fill_between(xs, f(xs), color="green", alpha=0.3)
plt.axhline(average, ls="--", color="gray")
plt.fill_between(xs, average, color="gray", alpha=0.3)