Areas under Curves

In this lecture, we devise a way to calculate the area under a curve. How do we do this? Have you seen the Spaceship Earth at Epcot? If you look at the Spaceship Earth from afar, it looks like a smooth sphere but if you come close, you will find out that it is made of a whole bunch of triangles (actually tetrahedra).

Spaceship Earth

Spaceship Earth

This may give us a clue as to how to tackle our problem. Perhaps we can too to approximate the given curved region with some simple geometric figures of which we know how to calculate areas. Considering that our region is a part of a rectangle except for the curved top, the best candidate would be rectangles. By the way this is in no way a new idea. Ancient Greeks already knew that they could approximate complex curved regions or solids by simple geometric objects such as triangles, rectangles, disks, etc. There are three convenient ways to approximate the area under a curve by rectangles. They are called the left-end point method, midpoint method, and right-end point method, respectively. Let us first discuss the left-end point method. We want to approximate the area under a curve given by $y=f(x)$ on the interval $[a,b]$. Partition $[a,b]$ by $n$ equal subintervals
$$a=x_0<x_1<\cdots<x_n=b,$$
where $\Delta x_k:=\ell([x_{k-1},x_k])=\frac{b-a}{n}$ and $x_k=x_0+k\frac{b-a}{n}$, $k=1,2,\cdots,n$. On each subinterval $[x_{k-1},x_k]$ we consider the rectangle with base $\Delta x_k=\frac{b-a}{n}$ and height $f(x_{k-1})$ (i.e. the left-end point of $[x_{k-1},x_k]$). The area $A$ of the region is then approximated by adding areas of these rectangles:
\begin{align*}
A&\approx f(x_0)\Delta x_1+f(x_1)\Delta x_2+\cdots+f(x_{n-1})\Delta x_n\\
&=\sum_{k=0}^{n-1}f(x_k)\Delta x\\
&=\sum_{k=0}^{n-1}f\left(x_0+k\frac{(b-a)}{n}\right)\frac{b-a}{n}.
\end{align*}
But we are not just satisfied with an approximation. Can we find the exact area $A$? The following figures would give us a clue. The figures show the area under the curve $y=x^2$ on the unit interval $[0,1]$ being approximated by the left-end point method with $n=4$, $n=10$, $n=20$, $n=50$, and $n=100$, respectively.

Approximation by the Left-end point method with n=4

Approximation by the Left-end point method with n=10

Approximation by the Left-end point method with n=20

Approximation by the Left-end point method with n=50

Approximation by the Left-end point method with n=100

It is clear from the above figures that the more rectangles we use the better approximation we get (or equivalently the smaller the error becomes). So if we imagine that we somehow can increase the number of rectangles to infinity, the error will be gone and we will obtain the exact area $A$. How do we then achieve this? Simple, by taking the limit
\begin{equation}\label{eq:left-endpt}
A=\lim_{n\to\infty}\sum_{k=0}^{n-1}f\left(x_0+k\frac{(b-a)}{n}\right)\frac{b-a}{n}.
\end{equation}
Before we discuss an example, let me list three useful sums.
\begin{align}
\label{eq:sum1}
1+2+3+\cdots+n&=\sum_{k=1}^nk=\frac{n(n+1)}{2},\\
\label{eq:sum2}
1^2+2^2+3^3+\cdots+n^2&=\sum_{k=1}^nk^2=\frac{n(n+1)(2n+1)}{6},\\
\label{eq:sum3}
1^3+2^3+3^3+\cdots+n^3&=\sum_{k=1}^nk^3=\left[\frac{n(n+1)}{2}\right]^2.
\end{align}

Example. Let $f(x)=x^2$ and $a=1$, $b=2$. Find the area under the curve $y=f(x)$.

Solution.
\begin{align*}
A&=\lim_{n\to\infty}\sum_{k=0}^{n-1}f\left(1+\frac{k}{n}\right)\frac{1}{n}\\
&=\lim_{n\to\infty}\sum_{k=0}^{n-1}\left(1+\frac{k}{n}\right)^2\frac{1}{n}\\
&=\lim_{n\to\infty}\left\{\frac{1}{n}\sum_{k=0}^{n-1} 1+\frac{2}{n^2}\sum_{k=0}^{n-1}k+\frac{1}{n^3}\sum_{k=0}^{n-1}k^2\right\}\\
&=\lim_{n\to\infty}\left\{\frac{n}{n}+\frac{2}{n^2}\frac{(n-1)n}{2}+\frac{1}{n^3}\frac{(n-1)n(2n-1)}{6}\right\}\\
&=\frac{7}{3}.
\end{align*}

In a similar manner, we can also calculate the area $A$ under curve $y=f(x)$ on the closed interval $[a,b]$ by the midpoint method
\begin{equation}
\label{eq:midpt}
\begin{aligned}
A&=\lim_{n\to\infty}\sum_{k=1}^{n}f\left(\frac{x_{k-1}+x_k}{2}\right)\frac{b-a}{n}\\
&=\lim_{n\to\infty}\sum_{k=1}^{n}f\left(x_0+\frac{(2k-1)}{2}\frac{(b-a)}{n}\right)\frac{b-a}{n},
\end{aligned}
\end{equation}
and by the right-end point method
\begin{equation}\label{eq:right-endpt}
A=\lim_{n\to\infty}\sum_{k=1}^{n}f\left(x_0+k\frac{(b-a)}{n}\right)\frac{b-a}{n}.
\end{equation}

For calculating the exact area under a curve, you can use any of the left-end point, midpoint, and right-end point methods. But what is you are only interested in approximating the area under a curve? Assuming that you are using the same number of rectangles to approximate the area, is there a difference between the methods. If fact, there is. In the above example, we found the exact area $\frac{7}{3}$ of the region under $y=x^2$ on the interval $[1,2].$ The approximation by the left-end point method with $n=100$ is 2.31835. The approximation by the midpoint method with $n=100$ is 2.333325. The approximation by the right-end point method with $n=100$ is 2.34835. Let us now compare the errors from the left-end point, midpoint, and right-end point methods, respectively.
\begin{align*}
E_{\mathrm{left}}&=\left|\frac{7}{3}-2.31835\right|\approx 0.014983333,\\
E_{\mathrm{mid}}&=\left|\frac{7}{3}-2.333325\right|\approx 0.0000083333333,\\
E_{\mathrm{right}}&=\left|\frac{7}{3}-2.34835\right|\approx 0.015016667.
\end{align*}
Clearly, the midpoint method gives rise to the best approximation among the three approximation methods when the same number of rectangles are used. This is indeed true in general. If the function is increasing on the closed interval, the left-end point method underestimates while the right-end point method overestimates. If the functions is decreasing on the closed interval, the left-end point method overestimates while the right-end point method underestimates. The midpoint method averages these two estimates.

Antiderivatives

A function $F(x)$ is called an antiderivative of a function $f(x)$ if it is a solution of the differential equation $\frac{d}{dx}F(x)=f(x)$. For instance, $F(x)=\frac{1}{2}x^2$ is an antiderivative of $f(x)=x$. There can be more than one (actually infinitely many) antiderivative of a function $f(x)$ but they all differ by a constant. In other words, if $F(x)$ and $G(x)$ are antiderivatives of $f(x)$, then $G(x)=F(x)+C$, where $C$ is a constant. In fact, one can easily check that for any constant $C$, $\frac{1}{2}x^2+C$ is an antiderivative of $x$ since the derivative of any constant is zero. On the other hand, if $F(x)$ and $G(x)$ are both antiderivatives of $f(x)$, they differ only by a constant. This can be easily seen: Since $F(x)$ and $G(x)$ are both antiderivatives of $f(x)$,
$$\frac{d}{dx}F(x)=\frac{d}{dx}G(x)=f(x),$$
ans so
$$\frac{d}{dx}(F(x)-G(x))=0.$$
Hence, $F(x)=G(x)+C$, where $C$ is a constant.

If $F(x)$ is an antiderivative of a function $f(x)$,
$$F(x)+C,$$
where $C$ is an arbitrary constant is called the indefinite integral of $f(x)$ and is denoted by $\int f(x)dx$, i.e.
$$\int f(x)dx=F(x)+C.$$
Example. Find the indefinite integral of each of the following functions.

1. $f(x)=\sin x$.

Solution. Let $F(x)$ be an antiderivative of $f(x)$. Then $F'(x)=f(x)$. If we let $y=F(x)$, then
$$\frac{dy}{dx}=\sin x.$$
We know one such function $y$ which satisfies the equaion $\frac{dy}{dx}=\sin x$. It is $y=-\cos x$. So, the indefinite integral of $\sin x$ is
$$\int \sin xdx=-\cos x+C,$$
where $C$ is an arbitrary constant.

2. $f(x)=\frac{1}{x}$.

Solution. An antidetivative of $\frac{1}{x}$ is $\ln x$. Note that $f(x)=\frac{1}{x}$ is defined for $x<0$ while $\ln x$ is not, so in fact the antiderivative should be written as $\ln|x|$ instead of $\ln x$. Hence, the indefinte integral is
$$\int\frac{1}{x}dx=\ln |x|+C,$$
where $C$ is an arbitrary constant.

3. $f(x)=x^n$, where $n\ne -1$.

Solution. $F(x)=\frac{1}{n+1}x^{n+1}$ is an antiderivative of $f(x)=x^n$. Hence, the indefinite integral of $x^n$ is
$$\int x^n dx=\frac{1}{n+1}x^{n+1}+C,$$
where $C$ is an arbitrary constant.

The most general solution of the differential equation
$$\frac{dy}{dx}=f(x)$$
is the indefinite integral
$$y=\int f(x)dx=F(x)+C,$$
where $C$ is an arbitrary constant. With an additional condition, the arbitrary constant $C$ may be determined. Such a condition is called an initial condition.

Example. Solve the differential equation $\frac{dy}{dx}=\sin x$ with the condition $y(0)=1$.

Solution. In the previous example, we find that the general solution is given by
$$y(x)=-\cos x+C,$$
where $C$ is an arbitrary constant. The condition $y(0)=1$ implies that $-\cos 0+C=1$ i.e. $-1+C=1$. So, we obtain $C=2$. Therefore, the solution we seek is
$$y(x)=-\cos x+2.$$

Indefinite integrals satisfy the following properties:
\begin{align*}
\int (f(x)+g(x))dx&=\int f(x)dx+\int g(x)dx,\\
\int c f(x)dx&=c\int f(x)dx,
\end{align*}
where $c$ is a constant. For this we say indefinite integrals are linear. If you have studied linear algebra, you know that a linear map is a map from a vector space to another vector space which preserves vector space operations (vector addition and scalar multiplication). It turns out that functions may be treated as vectors and the indefinite integral $\int f(x)dx$ may be considered as a linear map. This sort of abstract treatment is important in advanced mathematics, physics and engineering. The linearity of indefinite integrals can be used to find the indefinite integral of a complicated function. For example,

Example. Find the indefinite integral of
$$f(x)=1-x^3+12x^5.$$

Solution.
\begin{align*}
\int (1-x^3+12x^5)dx&=\int dx-\int x^3dx+12\int x^5dx\\
&=x-\frac{x^4}{4}+\frac{12}{6}x^6+C\\
&=x-\frac{x^4}{4}+2x^6+C,
\end{align*}
where $C$ is an arbitrary constant.

Some Important Formulas

\begin{align}
\int x^ndx&=\frac{x^n}{n+1}+C\ (n\ne -1\ \mbox{is a rational number})\\
\int \sin kxdx&=-\frac{\cos kx}{k}+C\ (k\ne 0\ \mbox{is a constant})\\
\int \cos kx dx&=\frac{\sin kx}{k}+C\ (k\ne 0\ \mbox{is a constant})\\
\int \sec^2 xdx&=\tan x+C\\
\int \csc^2 xdx&=-\cot x+C\\
\int \sec x\tan xdx&=\sec x+C\\
\int \csc x\cot xdx&=-\csc x+C
\end{align}

Example. [Initial Value Problem] A balloon is ascending at the constant speed of 12 ft/sec is at a height 80 ft above the ground when a package is dropped. How long does it take for the package to reach the ground?

Solution. In order to answer the question we need to have $h(t)$, the motion i.e. the position (height) function of the falling package. We don’t have it yet. If we know the velocity $v(t)$ of the falling package, we would be abel to find $h(t)$ by solving the differential equation
\begin{equation}
\label{eq:height}
\frac{dh(t)}{dt}=v(t).
\end{equation}
However, we don’t have it either. Instead, what is known is the acceleration $a(t)$ of the freely falling package which is constant
$$a(t)=-9.8\mathrm{m/sec^2}=-32\mathrm{ft/sec^2}.$$
The velocity $v(t)$ can be found by solving the differential equation
\begin{equation}
\label{eq:velocity}
\frac{dv(t)}{dt}=a(t)
\end{equation}
with $a(t)=-32\mathrm{ft/sec^2}$. The solution of \eqref{eq:velocity} is the indefinite integral
\begin{align*}
v(t)&=\int -32dt\\
&=-32t+C_1,
\end{align*}
where $C_1$ is a constant. At the time the package was dropped from the balloon, the balloon was ascending at the rate $12\mathrm{ft/sec}$. So the package’s initial velocity is $v(0)=12\mathrm{ft/sec}$. Using this we find $C_1=12$ and so
$$v(t)=-32t+12.$$
Now, we are ready to find $h(t)$. The solution of the differential equation \eqref{eq:height} with $v(t)=-32t+12$ is the indefinite integral
\begin{align*}
h(t)&=\int (-32t+12)dt\\
&=-16t^2+12t+C_2,
\end{align*}
where $C_2$ is a constant. At the time the package was dropped from the balloon the height was 80ft, i.e. $h(0)=80\mathrm{ft}$. Using this we find $C_2=80$. Hence, we have
$$h(t)=-16t^2+12t+80.$$
Setting $h(t)=0$, we obtain the quadratic equation
$$-16t^2+12t+80=0$$
whose solutions are $t_1\approx -1.89$ or $t_2\approx 2.64$. Therefore, it takes 2.64 seconds for the package to reach the ground.

Applications of Residues: Evaluaton of Improper Integrals 3 (Indented Paths)

Suppose that a function $f(z)$ has a simple pole at a point $z=x_0$ on the real axis, with a Laurent series representation in a punctured disk $0<|z-x_0|<R_2$ and with residue $B_0$. Let $C_\rho$ denote the upper half of a circle $|z-x_0|=\rho$, where $\rho<R_2$ and with the clockwise direction.

indentedpath$f(z)$ can be written as
$$f(z)=g(z)+\frac{B_0}{z-x_0}\ (0<|z-x_0|<R_2),$$
where $g(z)=\sum_{n=0}^\infty a_n(z-x_0)^n$. So, we have
$$\int_{C_\rho}f(z)dz=\int_{C_\rho}g(z)dz+B_0\int_{C_\rho}\frac{dz}{z-x_0}.$$
Let $\rho<\rho_0<R_2$. Then $g(z)$ is bounded on $|z-x_0|\leq\rho_0$ i.e. there exists $M>0$ such that $|g(z)|\leq M$ whenever $|z-x_0|\leq\rho_0$. Thus, we get the estimate
$$\left|\int_{C_\rho}g(z)dz\right|\leq M\pi\rho.$$
Consequently, we have
$$\lim_{\rho\to 0}\int_{C_\rho} g(z)dz=0.$$
The semi-circle $-C_\rho$ has parametric representation
$$z=x_0+\rho e^{i\theta}\ (0\leq\theta\leq\pi).$$
Using this parametric representation, we calculate
\begin{align*}
\int_{C_\rho}\frac{dz}{z-x_0}&=-\int_{-C_{\rho}}\frac{dz}{z-x_0}\\
&=-\int_0^{\pi}\frac{1}{\rho e^{i\theta}}\rho i e^{i\theta}d\theta\\
&=-\pi i.
\end{align*}
Therefore, we obtain
\begin{equation}
\label{eq:indentpath}
\lim_{\rho\to 0}\int_{C_\rho}f(z)dz=-B_0\pi i.
\end{equation}

Example. [Singularity on Contour of Integration] Evaluate the improper Integral
$$I=\int_0^\infty\frac{\sin x}{x}dx.$$

Solution. The function $f(z)=\frac{e^{iz}}{z}$ has a simple pole at $z=0$.

indentedpath2Since $f(z)$ is analytic within and on the simple closed contour, we have
$$\int_{C_R} \frac{e^{iz}}{z}dz+\int_{-R}^{-\rho}\frac{e^{ix}}{x}dx+\int_{C_\rho}\frac{e^{iz}}{z}dz+\int_{\rho}^R\frac{e^{ix}}{x}dx=0.$$
Note that $\frac{1}{z}$ is analytic at all points $z$ in the upper half plane that are exterior to the circle $C_\rho$ and that for any $z$ on $C_R$, $\left|\frac{1}{z}\right|=\frac{1}{R}$
and $\lim_{R\to\infty}\frac{1}{R}=0$. Thus, by Jordan’s Lemma
$$\lim_{R\to\infty}\int_{C_R}f(z)dz=\lim_{R\to\infty}\int_{C_R}\frac{e^{iz}}{z}dz=0.$$
As $R\to\infty$ and $\rho\to 0$, we obtain
$$\int_{-\infty}^\infty\frac{e^{ix}}{x}dx=-\lim_{\rho\to 0}\int_{C_\rho}\frac{e^{iz}}{z}dz=\pi i.$$
Therefore,
$$\int_0^\infty\frac{\sin x}{x}dx=\frac{\pi}{2}.$$

Fresnel Integrals

In this lecture, we derive Fresnel integrals
$$\int_0^\infty\cos(x^2)dx=\int_0^\infty\sin(x^2)dx=\frac{1}{2}\sqrt{\frac{\pi}{2}},$$
which appear in optics and diffraction theory.

Let us consider a contour shown in the following figure.

fresnel

As seen in the figure, $C_R$ is a part of the circle $z=Re^{i\theta}$, where $0\leq\theta\leq\frac{\pi}{4}$. Let $f(z)=e^{iz^2}$. Then $f(z)$ is analytic on and within the positively oriented simple closed contour $C$ shown in the figure. So, we have $\int_Cf(z)dz=0$ which amounts to the following expression:
$$\int_0^Re^{ix^2}dx+\int_{C_R}e^{iz^2}dz-\int_0^Re^{-r^2}\left(\frac{1}{\sqrt{2}}+i\frac{1}{\sqrt{2}}\right)dr=0.$$
Separating this expression into the real and the imaginary parts, we obtain
\begin{align}
\label{eq:cos}
\int_0^R\cos(x^2)dx&=\frac{1}{\sqrt{2}}\int_0^Re^{-r^2}dr-\mathrm{Re}\int_{C_R}e^{iz^2}dz,\\
\label{eq:sin}
\int_0^R\sin(x^2)dx&=\frac{1}{\sqrt{2}}\int_0^Re^{-r^2}dr-\mathrm{Im}\int_{C_R}e^{iz^2}dz.
\end{align}
\begin{align*}
\left|\int_{C_R}e^{iz^2}dz\right|&=\left|\int_0^{\frac{\pi}{4}}e^{iR^2e^{2i\theta}}Rie^{i\theta}d\theta\right|\\
&\leq R\int_0^{\frac{\pi}{4}}|e^{iR^2e^{2i\theta}}|d\theta\\
&=R\int_0^{\frac{\pi}{4}}e^{-R^2\sin 2\theta}d\theta\\
&=\frac{R}{2}\int_0^{\frac{\pi}{2}}e^{-R^2\sin\phi}d\phi\ (\mbox{by subsitution}\ \phi=2\theta)\\
&=\frac{R}{4}\int_0^\pi e^{-R^2\sin\phi}d\phi\\
&<\frac{R}{4}\frac{\pi}{R^2}\\
&=\frac{\pi}{4R}\to 0
\end{align*}
as $R\to\infty$. The inequality in the second line to the last was obtained by Jordan’s Inequality. Hence, as $R\to\infty$ \eqref{eq:cos} and \eqref{eq:sin} become
\begin{align*}
\int_0^\infty\cos(x^2)dx&=\int_0^\infty\sin(x^2)dx\\
&=\frac{1}{\sqrt{2}}\int_0^\infty e^{-r^2}dr\\
&=\frac{1}{2}\sqrt{\frac{\pi}{2}}.
\end{align*}

Jordan’s Lemma

Suppose that

  1. a function $f(z)$ is analytic at all points $z$ in the upper half plane $y\geq 0$ that are exterior to a circle $|z|=R_0$.
  2. For any $z$ on $C_R: |z|=R>R_0$, there exists a positive real number $M_R>0$ such that $|f(z)|\leq M_R$ and $\lim_{R\to\infty}M_R=0$.

Then for any positive real number $a$,
$$\lim_{R\to\infty}\int_{C_R}f(z)e^{iaz}dz=0.$$

Proof. We first show Jordan’s Inequality
\begin{equation}\label{eq:jordan}\int_0^\pi e^{-R\sin\theta}d\theta<\frac{\pi}{R}\ (R>0).\end{equation}

The graphs of y=sin(theta) (in red) and y=(2/pi)theta (in blue)

The graphs of y=sin(theta) (in red) and y=(2/pi)theta (in blue)

As shown in the figure, $\frac{2}{\pi}\theta\leq\sin\theta$ for $0\leq\theta\leq\frac{\pi}{2}$. If $R>0$, then $$e^{-R\sin\theta}\leq e^{-2R\theta/\pi},\ 0\leq\theta\leq\frac{\pi}{2}.$$So, we have
\begin{align*}
\int_0^{\frac{\pi}{2}}e^{-R\sin\theta}d\theta&\leq\int_0^{\frac{\pi}{2}}e^{-2R\theta/\pi}d\theta\\
&=\frac{\pi}{2R}(1-e^{-R})\\
&<\frac{\pi}{2R}.
\end{align*}Since the graph of $y=\sin\theta$ is symmetric about $\theta=\frac{\pi}{2}$ on the interval $0\leq\theta\leq\pi$,
$$\int_0^\pi e^{-R\sin\theta}d\theta=2\int_0^{\frac{\pi}{2}}e^{-R\sin\theta}d\theta<\frac{\pi}{R}.$$

Let $C_R$ denote the positively oriented circle $z=Re^{i\theta}$ where $0\leq\theta\leq\pi$. Then
$$\int_{C_R}f(z)e^{iaz}dz=\int_0^\pi f(Re^{i\theta})\exp(iaRe^{i\theta})iRe^{i\theta}d\theta$$
and so
\begin{align*}
\left|\int_{C_R}f(z)e^{iaz}dz\right|&\leq M_RR\int_0^\pi e^{-aR\sin\theta}d\theta\\
&<\frac{M_R\pi}{a}\ (\mbox{by Jordan Inequality \eqref{eq:jordan}})\\
&\to 0
\end{align*}
as $R\to\infty$ since by assumption $\lim_{R\to\infty}M_R=0$.