Definition
The integral is the continuous analog of summation. The process of computing/evaluating an integral is called integration. We can view it as the accumulation/summation of the product of the integrand by the differential being integrated over. The integrand is the function to be integrated over and the differential is the infinitesimal of our dependent variable.
It is denoted by the symbol (think of it as a elongated S for ‘summation’).
It is an important tool in calculating areas, volumes (and higher dimension generalisations). This has a wide application of uses, as these the evaluation of integrals can be used to calculate all sorts of values of interest.
The ‘areas’ can represent a myriad of different values. One way to look at it is as a “Accumulated Change” or Accumulation function. In general, if the curve of a function represents a rate of change of some quantity with respect to another variable, the area under the curve represents the total accumulated change of that quantity over the interval.
As we did with differentiation, we will examine a physical quantity - velocity as a function of time. We know that velocity is distance over time, so we can express it as the rate of change of position i.e the time Derivative of position.
By integrating we are calculating an indefinite integral, and can use it to measure accumulated change of the position quantity by evaluating a definite integral, i.e. distance travelled. We can check from a dimensional analysis POV that we get a quantity in the length dimension with the product of the integrand () and the differential ():
Cases where we can just obtain the area by simple geometry laws
Constant velocity
Let’s start from the simplest case, where velocity is constant. Set
\begin{document}
\begin{tikzpicture}[domain=0:5]
% Draw grid
\draw[very thin, color=gray] (-1,-1) grid (5,5);
% Draw axes
\draw[->] (-1,0) -- (5,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[left, yshift=-10] {$v(t)$};
\fill[blue!20,opacity=0.5] (0,0) -- (0,3) -- (4,3) -- (4,0) -- cycle;
% Draw the graph
\draw[color=black!10, thick, smooth] plot (\x, {3}) node[above] {$v(t) = 3$};
\end{tikzpicture}
\end{document}
We know that:
Since is constant, in this case multiplying by will give us the exact displacement .
Example
for Notice that this is equivalent to the area under the curve.
Using integration
Remark
We can see that this can be generalised for the integral of any constant - it will always be the dependant variable (multiplied by the constant) - we can take the constant out of the integral and integrate over 1
Constant acceleration
In the case where is a straight line, i.e. , i.e. the rate of change of velocity a.k.a acceleration is constant.
\begin{document}
\begin{tikzpicture}[domain=0:2.2]
% Draw grid
\draw[very thin, color=gray] (-1,-1) grid (4,5);
% Draw axes
\draw[->] (-1,0) -- (4,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[above] {$v(t)$};
\fill[blue!20, opacity=0.5] plot[smooth, domain=0:2] (\x, {2*\x}) -- (2,0) -- (0,0) -- cycle;
\fill[red!20, opacity=0.5] plot[smooth, domain=0:2] (\x, {2*\x}) -- (0,4) -- (0,0) -- cycle;
% Draw the graph
\draw[color=black!10, thick, smooth] plot (\x, {2*\x}) node[left] {$v(t) = 2t$} ;
\end{tikzpicture}
\end{document}We can use the equations of motion for constant acceleration to calculate the displacement.
Example
for
\begin{align} s&=ut+\frac{1}{2}at^2 \ &= ut + \frac{1}{2} \dot{v}(t)\cdot t^2\ &=(0,ms^{-1}\cdot4,s) + \frac{1}{2}(2,ms^{-2}\cdot2^2,s^2) \ &=0,m + \frac{1}{2} (8,m) \ &=4,m \end{align}
We can see that again, the [[Area#triangle|area]] under the curve is equivalent to the displacement we calculated using the equations of motion.
A = \frac{bh}{2} = \frac{2\cdot4}{2} = 4
Using integration
Variable acceleration
Now let’s look at a case where the acceleration is not 0 or constant but varies, i.e. the graph of velocity is not a straight line.
\begin{document}
\begin{tikzpicture}[domain=-1:8]
% Draw grid
\draw[very thin, color=gray] (-1,-1) grid (5,5);
% Draw axes
\draw[->] (-1,0) -- (5,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[above] {$v(t)$};
% Label t0 and t1 on the x-axis
\draw (0,0) node[below] {$t_i$};
\draw (4,0) node[below] {$t_n$};
% Draw the graph of f(x) = -x² + 4
\begin{scope}
\clip (-1,0) rectangle (5,5);
\draw[color=black!10, thick, smooth] plot (\x, {4*\x - \x*\x}) node[midway, yshift=130, xshift=60] {$v(t) = 4t - t^2$};
\fill[color=blue!20, opacity=0.5] plot (\x, {4*\x - \x*\x});
\end{scope}
\end{tikzpicture}
\end{document}Example
for and
\require{physics} \begin{align} F(x) &= \int^{4}{0} v(t), dt \ &= \eval{\left[, 2t^2 - \frac{t^3}{3} \right]}^4{0} \ \ F(4) &= 2 \cdot 16 - \frac{64}{3} \ &= 32 - \frac{64}{3} \ &= \frac{96}{3} - \frac{64}{3} \ &= \frac{32}{3} \ &= 10 \frac{2}{3} = 10.\dot{6} \end{align}
F(4) - F(0) = 10.\dot{6} - 0 = 10.\dot{6}
Even here, we can see that again, the area under the curve is equivalent to what we calculated using the definite integral.
What about when the area under our function is not some shape with a well known area equation? Let’s introduce the concept of approximating definite integrals using Riemann sums.
Riemann sums (Integration as summation with a limit)
We need a way to calculate the area under the curve of any arbitrary function.
\begin{document}
\begin{tikzpicture}[xscale=2, yscale=1.2]
\coordinate (a) at (1,0);
\coordinate (b) at (2*pi - 1,0);
\draw[->] (-1,0) -- (2*pi,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth, domain=-.3:2*pi] plot (\x, {-sin(1.2*\x r) + 3});
\draw (a) node[below] {a};
\draw (b) node[below] {b};
\fill[color=blue!20, opacity=0.5, domain=1:2*pi - 1]
(a) --
plot (\x, {-sin(1.2*\x r) + 3}) --
(b) --
cycle;
\end{tikzpicture}
\end{document}A way we could do this is to estimate the area under the curve using polygons. Let’s try and approximate the area using one rectangle. It is a crude approximation and we can clearly see regions where we overestimate and underestimate the true area.
\begin{document}
\begin{tikzpicture}[xscale=2, yscale=1.2]
\coordinate (a) at (1,0);
\coordinate (b) at (2*pi - 1,0);
\draw[->] (-1,0) -- (2*pi,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth, domain=-.3:2*pi] plot (\x, {-sin(1.2*\x r) + 3});
\draw (a) node[below] {a};
\draw (b) node[below] {b};
\draw[color=blue!70, thick, domain=1:2*pi - 1]
(a) rectangle (2*pi - 1, 2.9);
\fill[color=blue!20, opacity=0.5, domain=1:2*pi - 1]
(a) rectangle (2*pi - 1, 2.9);
\end{tikzpicture}
\end{document}Two rectangles might make a better approximation:
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[xscale=2, yscale=1.2]
\coordinate (a) at (1,0);
\coordinate (b) at (2*pi - 1,0);
\coordinate (m) at ($(a)!0.5!(b)$);
\draw[->] (-1,0) -- (2*pi,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth, domain=-.3:2*pi] plot (\x, {-sin(1.2*\x r) + 3});
\draw (a) node[below] {a};
\draw (b) node[below] {b};
\fill[color=blue!20, opacity=0.5, domain=1:2*pi - 1]
(a) rectangle ($(m)+(0, 2.1)$);
\draw[color=blue!70, thick]
(a) rectangle ($(m)+(0, 2.1)$);
\fill[color=blue!20, opacity=0.5, domain=1:2*pi - 1]
(m) rectangle (2*pi - 1, 3.6);
\draw[color=blue!70, thick]
(m) rectangle (2*pi - 1, 3.6);
\end{tikzpicture}
\end{document}As we keep adding more and more rectangles, our approximation of the area gets closer and closer.
\usetikzlibrary{calc, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[xscale=2, yscale=1.2]
\coordinate (a) at (1,0);
\coordinate (b) at (2*pi - 1,0);
\draw[->] (-1,0) -- (2*pi,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth, domain=-.3:2*pi] plot (\x, {3 -sin(1.2*\x r)});
\draw (a) node[below] {a};
\draw (b) node[below] {b};
\foreach \x in {1,...,5} {
\fill[blue!20, opacity=0.5]
(0.86*\x + 1, 0)
rectangle (0.86*\x - 0.86 + 1, {3 - sin(1.2*(0.86*\x + 1) r)});
\draw[blue!70, thick]
(0.86*\x + 1, 0)
rectangle (0.86*\x - 0.86 + 1, {3 - sin(1.2*(0.86*\x + 1) r)});
\draw[decorate, decoration={brace,amplitude=4pt,mirror,raise=1.4em}]
(0.86*\x + 0.20, 0) -- (0.86*\x + 0.98, 0) node[midway,yshift=-3em]{$\Delta x$};
}
\end{tikzpicture}
\end{document}This type of approximation is known as a Riemann sum. Riemann sums are best approached with subintervals of equal size, so each of our rectangle samples taken for our approximation of the integral has width:
Riemann sum
Let be a partition of the interval . In particular let be a tagged partition - ‘tags’ () are the position within a subinterval at which we choose as our ‘sample’ value for the independent variable in order to determine what height (from ) to use for our current sample rectangle.
\begin{align} x_i^* \in [x_{i−1}, x_i] &\implies x_{i-1} \le x_i^* \le x_{i + 1}\ \ a = x_{0} \le x_{1}^* \le x_{1} &\le x_{2}^* \le x_{2} \le \dots \le x_{n} = b \end{align}
The Riemann sum for a function $f$ over a tagged partition $P$ as defined above is:
\begin{align} S &= \sum_{i=1}^n f(x^{i}), \Delta x \ &= \Delta x \cdot \sum{i=1}^n f(x^_{i}) \end{align}
The choice of where to position $x^*_{i}$ within the subinterval of the $i^{th}$ rectangle affects the height of the rectangle $f(x^*_{i})$. As such different choices of $x^*_{i}$ may produce different Riemann sums but in practice this is of no consequence if the different sums converge as we limit $\Delta x \to 0$ - (in the nomenclature this means the function is **Riemann-integrable**).
The following choices of result in the following Riemann sums:
The left rule has the height approximated by the value at the left most endpoint of the subinterval. So the first term/rectangle of the summation would use the height at and the last term would use .
\usetikzlibrary{calc, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[domain=0:2, xscale=2, yscale=0.5]
\draw[->] (0,0) -- (2,0) node[right] {$t$};
\draw[->] (0,0) -- (0,8) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth] plot (\x, {\x^3});
\foreach \x in {0,...,3} {
\fill[blue!20, opacity=0.5]
(0.5*\x, 0)
rectangle (0.5*\x + .5, {(0.5*\x)^3});
\draw[blue!70, thick]
(0.5*\x, 0)
rectangle (0.5*\x + .5, {(0.5*\x)^3});
}
\end{tikzpicture}
\end{document}The left Riemann sum amounts to an underestimation if the function is monotonically increasing on the interval (and vice versa).
The right rule has the height approximated by the value at the right most endpoint of the subinterval. So the first term/rectangle of the summation would use the height at and the last term would use .
\usetikzlibrary{calc, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[domain=0:2, xscale=2, yscale=0.5]
\draw[->] (0,0) -- (2,0) node[right] {$t$};
\draw[->] (0,0) -- (0,8) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth] plot (\x, {\x^3});
\foreach \x in {0,...,3} {
\fill[blue!20, opacity=0.5]
(0.5*\x, 0)
rectangle (0.5*\x + .5, {(0.5*\x + .5)^3});
\draw[blue!70, thick]
(0.5*\x, 0)
rectangle (0.5*\x + .5, {(0.5*\x + .5)^3});
}
\end{tikzpicture}
\end{document}The right Riemann sum amounts to an overestimation if the function is monotonically increasing on the interval (and vice versa).
\usetikzlibrary{calc, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[domain=0:2, xscale=2, yscale=0.5]
\draw[->] (0,0) -- (2,0) node[right] {$t$};
\draw[->] (0,0) -- (0,8) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth] plot (\x, {\x^3});
\foreach \x in {0,...,3} {
\fill[blue!20, opacity=0.5]
(0.5*\x, 0)
rectangle (0.5*\x + .5, {(0.5*\x + .25)^3});
\draw[blue!70, thick]
(0.5*\x, 0)
rectangle (0.5*\x + .5, {(0.5*\x + .25)^3});
}
\end{tikzpicture}
\end{document}The midpoint Riemann sum has error that is half that of the trapezoidal sum; as such the middle Riemann sum is the most accurate approach to the Riemann sum.
As we limit the width of our samples (and of samples ) we converge on the exact value of the area (or higher dimensional generalisation for multiple integrals).
Area and the Limit of Riemann Sums
Let be a continuous function on the closed interval and let , and be the sums of equally spaced rectangles formed using the left rule, right rule, and midpoint rule, respectively. Then:
- The net area under on the interval is equal to
\usetikzlibrary{calc, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[xscale=2, yscale=1.2]
\coordinate (a) at (1,0);
\coordinate (b) at (2*pi - 1,0);
\draw[->] (-1,0) -- (2*pi,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth, domain=-.3:2*pi] plot (\x, {3 -sin(1.2*\x r)});
\draw (a) node[below] {a};
\draw (b) node[below] {b};
\foreach \x in {1,...,30} {
\fill[blue!20, opacity=0.5]
(0.14*\x + 1, 0)
rectangle (0.14*\x - 0.14 + 1, {3 - sin(1.2*(0.14*\x + 1) r)});
\draw[blue!70, thick]
(0.14*\x + 1, 0)
rectangle (0.14*\x - 0.14 + 1, {3 - sin(1.2*(0.14*\x + 1) r)});
}
\end{tikzpicture}
\end{document}\usetikzlibrary{calc, decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[xscale=2, yscale=1.2]
\coordinate (a) at (1,0);
\coordinate (b) at (2*pi - 1,0);
\draw[->] (-1,0) -- (2*pi,0) node[right] {$t$};
\draw[->] (0,-1) -- (0,5) node[left, yshift=-10] {$v(t)$};
% Draw the graph
\draw[color=black!10, thick, smooth, domain=-.3:2*pi] plot (\x, {3 -sin(1.2*\x r)});
\draw (a) node[below] {a};
\draw (b) node[below] {b};
\foreach \x in {1,...,50} {
\fill[blue!20, opacity=0.5]
(0.086*\x + 1, 0)
rectangle (0.086*\x - 0.086 + 1, {3 - sin(1.2*(0.086*\x + 1) r)});
\draw[blue!70, thick]
(0.086*\x + 1, 0)
rectangle (0.086*\x - 0.086 + 1, {3 - sin(1.2*(0.086*\x + 1) r)});
}
\end{tikzpicture}
\end{document}Integral of 1 (and of any constant):
The indefinite integral is just the dependent variable (the variable which the differential is an infinitesimal of) plus a constant (as with all indefinite integrals):
This is since the antiderivative of 1 (w.r.t ) is just . We saw this from differentiating a variable w.r.t itself. We can also conclude this from the definition of exponentiating to the power of 0 and the power rule - we can view 1 as and thus the antiderivative must be .
From the second fundamental theorem of calculus we can see that the definite integral when the integrand is 1 will just be the difference between the upper and lower bound.
We can apply the same logic when the integrand is any constant. We can decompose a constant as the constant multiplied by 1. Then we just use the evaluate the integral of 1 and multiply the result by the constant
\begin{align} \int^b_{a} q\ dx &= q \int^b_{a} 1\ dx\\ &= q \Big{[} x\big{|} ^b_{a} \Big{]} \\ &= q\ (b - a) \end{align}