# 8. Integration

## 8. Integration

### From sum to integral

#### Definite integral

Geometric interpretation: Let \(f\colon[a,b]\to\mathbb{R}\) be such that \(f(x)\ge 0\) for all \(x\in[a,b]\). How can we find the area of the region bounded by the function graph \(y=f(x)\), the x-axis and the two lines \(x=a\) and \(x=b\)?

The answer to this question is given by the *definite integral*
\[\int_{a}^{b}f(x)\,dx\]
**Remark.** The general definition of the integral does not necessitate the condition \(f(x)\ge 0\).

#### Integration of continuous functions

##### Definition: Partition

Let \(f\colon[a,b]\to\mathbb{R}\) be continuous. A finite sequence \(D=(x_{0},x_{1},x_{2},\dots,x_{n})\)
of real numbers such that
\[a=x_{0} < x_{1} < x_{2} < \dots < x_{n} = b\]
is called a *partition* of the interval \([a,b]\).

##### Definition: Upper and lower sum

For each partition \(D\) we define the related *upper sum* of the function \(f\) as
\[U_{D}(f) = \sum_{k=1}^{n}M_{k}(x_{k}-x_{k-1}),~M_{k} = \max\{f(x)\mid x_{k-1}\le x\le x_{k}\}\]
and the *lower sum* as
\[L_{D}(f) = \sum_{k=1}^{n}m_{k}(x_{k}-x_{k-1}),~m_{k}=\min\{f(x)\mid x_{k-1}\le x\le x_{k}\}.\]

If \(f\) is a positive function then the upper sum represents the total area of the rectangles circumscribing the function graph and similarly the lower sum is the total area of the inscribed rectangles.

##### Properties of partitions

- Suppose that \(D_{1}\) and \(D_{2}\) are two partitions of a given interval such that \(D_{1}\) is a subsequence of
\(D_{2}\) (i.e. \(D_{2}\) is
*finer*than \(D_{1}\)). Then the inequalities\(U_{D_1}(f) \ge U_{D_{2}}(f)~\) and \(~L_{D_{1}}(f) \le L_{D_{2}}(f)\)

always hold. - For
*any*two partitions \(D_{1}\) and \(D_{2}\) of a given interval the inequality \[ L_{D_{2}}(f) \le U_{D_{1}}(f)\] always holds.

**Interactive.**

\(f(x)=~\)

Upper Darboux sum | Lower Darboux sum |

##### Definition: Integrability

We say that a function \(f\colon[a,b]\to\mathbb{R}\) is *integrable* if for every \(\epsilon>0\)
there exists a corresponding partition \(D\) of \([a,b]\) such that
\[ U_{D}(f) - L_{D}(f) < \epsilon.\]

##### Definition: Integral

Integrability implies that there exists a unique real number \(I\) such that \(L_{D}(f)\le I\le U_{D}(f)\) for every
partition \(D\). This is called the *integral* of \(f\) over the interval \([a,b]\) and denoted by
\[ I = \int_{a}^{b}f(x)\,dx. \]

**Remark.** This definition of the integral is sometimes referred to as the *Darboux integral*.

For non-negative functions \(f\) this definition of the integral coincides with the idea of making the difference between the the areas of the circumscribed and the inscribed rectangles arbitrarily small by using ever finer partitions.

##### Theorem.

A continuous function on a closed interval is integrable.

Here we will only provide the proof for continuous functions with bounded derivatives.

Suppose that \(f\colon[a,b]\to\mathbb{R}\) is a continuous function and that there exists a constant \(L>0\) such that \(|f'(x)|\le L\) for all \(x\in]a,b[\). Let \(\epsilon>0\) and define \(D\) to be an equally spaced partition of \([a,b]\) such that \[\underbrace{|x_{k}-x_{k-1}|}_{=\Delta x} < \frac{\epsilon}{L(b-a)},~\text{for all} k=1,2,\dots,n.\] Let \(f(y_{k})=m_{k}\) and \(f(z_{k})=M_{k}\) for some suitable points \(y_{k},z_{k}\in[x_{k-1},x_{k}]\). The mean value theorem then states that \[M_{k}-m_{k}=f'(c_{k})|z_{k}-y_{k}|\le L\Delta x<\frac{\epsilon}{b-a}.\] and thus \[U_{D}(f)-L_{D}(f) = \sum_{k=1}^{n}(M_{k}-m_{k})\Delta x < \frac{\epsilon}{b-a}\sum_{k=1}^{n}\Delta x = \epsilon.\]

\(\square\)

##### Definition: Riemann integral

Suppose that \(f\colon[a,b]\to\mathbb{R}\) is a continuous function and let
\((x_{0},x_{1},\dots,x_{n})\) be a partition of \(\left[a,b\right]\) and
\((z_{1},z_{2},\dots,z_{n})\) be a sequence of real numbers such that
\(z_{k}\in[x_{k-1},x_{k}]\) for all \(1\le k\le n\). The partial sums
\[ S_{n} = \sum_{k=1}^{n}f(z_{k})\Delta x_{k},~\text{where}
~\Delta x_{k}=x_{k}-x_{k-1} \]
are called the *Riemann sums* of \(f\). Suppose further that the partitions are
such that \(\displaystyle\max_{1\le k\le n}\Delta x_{k}\to 0\) as \(n\to\infty\).
The integral of \(f\) can then be defined as the limit
\[ \int_{a}^{b}f(x)\,\mathrm{d}x = \lim_{n\to\infty} S_{n}. \]
This definition of the integral is called the *Riemann integral*.

**Remark.** This definition of the integral turns out to be equivalent to that of the Darboux integral i.e. a function is
Riemann-integrable if and only if it is Darboux-integrable and the values of the
two integrals are always equal.

##### Example

Find the integral of \(f(x)=x\) over the interval \([0,1]\) using Riemann sums.

Let \(x_{k}=k/n\). Then \(x_{0}=0\), \(x_{n}=1\) and \(x_{k} < x_{k+1}\) for all \(0\le k\le n\). Thus the sequence \((x_{0},x_{1},x_{2},\dots,x_{n})\) is a proper partition of \(\left[0,1\right]\). This partition has the pleasant property hat \(\Delta x=1/n\) is a constant. Estimating the Riemann sums we now find that \[\sum_{k=1}^{n}f(x_{k})\Delta x = \sum_{k=1}^{n}x_{k}\Delta x= \sum_{k=1}^{n}\frac{k}{n}\left(\frac{1}{n}\right)\] \[= \frac{1}{n^2}\sum_{k=1}^{n}k = \frac{1}{n^2}\frac{n(n+1)}{2} = \frac{n+1}{2n}\to \frac{1}{2},\] as \(n\to\infty\) and hence \[\int_{0}^{1}f(x)\,\mathrm{d}x = \frac{1}{2}.\]

This is of course the area of the triangular region bounded by the line \(y=x\), the \(x\)-axis and the lines \(x=0\) and \(x=1\).

**Remark.** Any interval \([a,b]\) can be partitioned into equally spaced subintervals by setting
\(\Delta x = (b-a)/n\) and \(x_{k} = a + k\Delta x\).

##### Conventions

- If the upper and lower limits of integration are the same then the integral is zero: \[ \int_{a}^{a}f(x)\,dx = 0.\]
- Reversing the limits of integration changes the sign of the integral: \[ \int_{b}^{a}f(x)\,dx = -\int_{a}^{b}f(x)\,dx.\]
- It also follows that \[ \int_{a}^{b}f(x)\,dx = \int_{a}^{c}f(x)\,dx + \int_{c}^{b}f(x)\,dx \] holds for all \(a,b,c\in\mathbb{R}\).

#### Piecewise-defined functions

##### Definition: Piecewise continuity

A function \(f\colon\left[a,b\right]\to\mathbb{R}\) is called piecewise continuous if it is continuous except at a finite number of points \[a\le c_{1} < c_{2} < \dots < c_{m} \le b\] and the one-sided limits of the function are defined and bounded on each of these points. It follows that the restriction of \(f\) on each subinterval \(\left[c_{k-1},c_{k}\right]\) is continuous if the one-sided limits are taken to be the values of the function at the end points of the subinterval.

##### Definition: Piecewise integration

Let \(f\colon\left[a,b\right]\) be a piecewise continuous function. Then \[\int_{a}^{b}f(x)\,dx = \sum_{k=1}^{m+1}\int_{c_{k-1}}^{c_{k}}f(x)\,dx,\] where \(a=c_{0}< c_{1} < \dots < c_{m+1} = b\) and \(f\) is thought as a continuous function on each subinterval \(\left[c_{k-1},c_{k}\right]\). Usually functions which are continuous yet piecewise defined are also integrated using the same idea.

##### Example

Consider the function \(f\colon\left[-1,1\right]\) defined as \[ f(x) = \begin{cases} -1 &\text{ for }-1\le x<0 \\ 1 &\text{ for }0\le x\le 1. \end{cases} \] We can now integrate \(f\) as follows: \[ \int_{-1}^{1}f(x)\,dx = \int_{-1}^{0}f(x)\,dx + \int_{0}^{1}f(x)\,dx \] \[ =\int_{-1}^{0}(-1)\,dx + \int_{0}^{1}1\,dx = -1\cdot(-1-0) + 1\cdot(1-0) = 2. \]

### Important properties

##### Properties

Suppose that \(f,g\colon\left[a,b\right]\to\mathbb{R}\) are piecewise continuous functions. The integral has the following properties

- Linearity: If \(c_{1},c_{2}\in\mathbb{R}\) then \[\int_{a}^{b}\big(c_{1}f(x)+c_{2}g(x)\big)\,\mathrm{d}x = c_{1}\int_{a}^{b}f(x)\,\mathrm{d}x+c_{2}\int_{a}^{b}g(x)\,\mathrm{d}x.\]
- If \(h(x)\ge 0\) for all \(x\in[a,b]\) then \[\int_{a}^{b}h(x)\,\mathrm{d}x \ge 0.\]
- If \(f(x)\le g(x)\) then \[\int_{a}^{b}f(x)\,\mathrm{d}x \le \int_{a}^{b}g(x)\,\mathrm{d}x.\]
- As \(f(x)\le|f(x)|\) it follows that \[\int_{a}^{b}f(x)\,\mathrm{d}x \le \int_{a}^{b}|f(x)|\,\mathrm{d}x\] and taking the absolute value of both sides of the equation gives \[\left|\int_{a}^{b}f(x)\,\mathrm{d}x\right|\le \int_{a}^{b}|f(x)|\,\mathrm{d}x.\]
- Suppose that \(p=\inf_{x\in\left[a,b\right]}f(x)\) and \(s=\sup_{x\in\left[a,b\right]}f(x)\). Then \[p(b-a)\le \int_{a}^{b}f(x)\,dx \le s(b-a).\]

### Fundamental theorem of calculus

##### Theorem: Mean value theorem

Let \(f\colon[a,b]\to\mathbb{R}\) be a continuous function. Then there exists \(c\in(a,b)\) such that \[ f(c)=\frac{1}{b-a}\int_{a}^{b}f(x)\,\mathrm{d}x.\] This is the mean value of \(f\) on the interval \([a,b]\) and we denote it with \(\overline{f}\).

Suppose that \(m\) and \(M\) are the minimum and maximum of \(f\) on the interval \([a,b]\), respectively. It follows that \[ m(b-a)\le \int_{a}^{b}f(x)\,\mathrm{d}x\le M(b-a)\] or \[m\le \frac{1}{b-a}\int_{a}^{b}f(x)\,\mathrm{d}x\le M\quad \Leftrightarrow\quad m\le \overline{f}\le M.\] Thus \(\overline{f}\) is between the minimum and maximum of a continuous function \(f\) and by the intermediate value theorem it must be that \(f(c)=\overline{f}\) for some \(c\in\,]a,b[\).

\(\square\)

##### (First) Fundamental theorem of calculus.

Let \(f\colon[a,b]\to\mathbb{R}\) be a continuous function. Then \[ \frac{\mathrm{d}}{\mathrm{d}x}\int_{a}^{x}f(t)\,\mathrm{d}t = f(x)\] for all \(x\in\,]a,b[\).

Let \[ F(x) = \int_{a}^{x}f(t)\,\mathrm{d}t. \] The mean value theorem implies that there exists \(c\in\,[x,x+h]\) such that \[ \frac{F(x+h)-F(x)}{h} = \frac{1}{h}\left(\int_{a}^{x+h}f(t)\, \mathrm{d}t-\int_{a}^{x}f(t)\,\mathrm{d}t\right)\] \[ =\frac{1}{h}\int_{x}^{x+h}f(t)\,\mathrm{d}t = \frac{1}{h}f(c)(x+h-x) = f(c). \] As \(h\to0\) we see that \(c\to x\) and from the continuity of \(f\) it follows that \(f(c)\to f(x)\). Thus \(F'(x)=f(x)\).

\(\square\)

#### Antiderivative

If \(F'(x)=f(x)\) on some open interval then \(F\) is the *antiderivative*
(or the *primitive function*) of \(f\). The fundamental theorem of calculus
guarantees that for every continuous function \(f\) there exists an antiderivative
\[ F(x) = \int_{a}^{x}f(t)\,dt. \]
The antiderivative is not necessarily expressible as a combination of elementary
functions even if \(f\) were an elementary function, e.g. \(f(x) = e^{-x^{2}}\).
Such primitives are called *nonelementary antiderivatives*.

##### Theorem.

Antiderivatives are only unique up to a constant; \[\int f(x)\,dx = F(x) + C, C\in\mathbb{R} \text{ constant }\] if \(F'(x)=f(x)\).

Suppose that \(F'_{1}(x)=F'_{2}(x)=f(x)\) for all \(x\). Then the derivative of \(F_{1}(x)-F_{2}(x)\) is identically zero and thus the difference is a constant.

\(\square\)

##### (Second) Fundamental theorem of calculus

Let \(f\colon\left[a,b\right]\to\mathbb{R}\) be a continuous function and \(G\) an antiderivative of \(f\), then \[\int_{a}^{b}f(x)\,dx = G(x)\Big|_{x=a}^{x=b} = G(b)-G(a). \]

Because \(F(x)=\int_{a}^{x}f(t)\,dt\) is an antiderivative of \(f\) then due to continuity \(F(x)-G(x)=C=\text{constant}\) for all \(x\in\left[a,b\right]\). Substituting \(x=a\) we find that \(C=-G(x)\). Thus \[\int_{a}^{x}f(t)\,dt = F(x) = G(x)-G(a)\] and substituting \(x=b\) the result follows.

\(\square\)

Suppose that \(f\) is a continuous function and that \(a\) and \(b\) are differentiable functions. Then \[\frac{d}{dx}\int_{a(x)}^{b(x)}f(t)\,dt = f(b(x))b'(x)-f(a(x))a'(x).\]

Suppose that \(F\) is an antiderivative of \(f\). Then from the fundamental theorem of calculus and the chain rule it follows that \[\frac{d}{dx}\int_{a(x)}^{b(x)}f(t)\,dt = \frac{d}{dx}\big(F(b(x)) - F(a(x))\big)\] \[=\frac{d}{dx}F(b(x)) - \frac{d}{dx}F(a(x)) = F'(b(x))b'(x) - F'(a(x))a'(x) \] \[ = f(b(x))b'(x) - f(a(x))a'(x). \]

\(\square\)

### Integrals of elementary functions

#### Constant Functions

Given the constant function \(f(x) = c,\,c\in\mathbb{R}\). The integral \(\int\limits_a^b f(x)\,\mathrm{d} x = \int\limits_a^b c \, \mathrm{d}x\) has to be determined now.

##### Solution by finding a antiderivative

From the previous chapter it is known that \(g(x) = c\cdot x\) gives \(g'(x) = c\). This means that \(c \cdot x\) is an antiderivative for \(c\). So the following applies \[\int\limits_a^b c \, \mathrm{d}x = [c \cdot x]_{x=a}^{x=b} = c\cdot b - c \cdot a = c \cdot (b-a).\]

**Remark:** Of course, a function \(h(x) = c \cdot x + d\) would also be an antiderivative of \(f\), since the constant \(d\) is omitted in the derivation. For sake of simplicity \(c \cdot x\) can be used, since \(d\) can be chosen as \(d=0\) for definite integrals.

##### Solution by geometry

The area under the constant function forms a rectangle with height \(c\) and length \(b-a\). Thus the area is \(c \cdot (b-a)\) and this corresponds to the solution of the integral. Illustrate this remark by a sketch.

#### Linear functions

Given is the linear function \( f(x) = mx\). We are looking for the integral \(\int\limits_a^b f(x)\, \mathrm dx=\int\limits_a^b mx\, \mathrm dx\).

##### Solve by finding a antiderivative

The antiderivative of a linear function is in any case a quadratic function, since \(\frac{\mathrm d x^2}{\mathrm dx} = 2x \). The derivative of a quadratic function results in a linear function. Here, it is important to consider the leading factor as in \[\frac{\mathrm d (m \cdot \frac{1}{2} \cdot x^2)}{\mathrm dx} = mx.\] Thus the result is \[\int\limits_a^b mx \mathrm{d}x = \left[\frac{m}{2}x^2 \right]_{x=a}^{x=b}= \frac{m}{2}b^2 - \frac{m}{2}a^2. \]

##### Solving by geometry

The integral \(\int\limits_a^b mx\, \mathrm dx\) can be seen geometrically, as subtracting the triangle with the edges \((0|0)\), \((a|0)\) and \((a| ma)\) from the triangle with the edges \((0|0)\), \((b|0)\) and \((b| mb)\). Since the area of a triangle ist given by \(\frac{1}{2} \cdot \mbox{baseline} \cdot \mbox{height}\), the area of the first triangle \(\frac{1}{2}\cdot b \cdot mb = \frac{1}{2}mb^2\) and that of the second triangle is analogous \(\frac{1}{2}ma^2\). For the integral the result is \(\frac{m}{2}b^2 - \frac{m}{2}a^2\). This is consistent with the integral calculated using the antiderivative. Illustrate this remark by a sketch.

#### Power functions

In constant and linear functions we have already seen that the exponent of a function decreases by one when it is derived. So it has to get bigger when integrating. The following applies: \[\frac{\mathrm d x^n}{\mathrm dx} = n \cdot x^{n-1}. \] It follows that the antiderivative for \(x^n\) must have the exponent \(n+1\), \[\frac{\mathrm d x^{n+1}}{\mathrm dx} = (n+1) \cdot x^n.\] By multiplying the last equation with \(\frac{1}{n+1}\) we get \[\frac{\mathrm d}{\mathrm dx}\frac{1}{n+1} x^{n+1} = \frac{n+1}{n+1} \cdot x^n = x^n.\] Finally the antiderivative is \(\int x^n\, \mathrm dx = \frac{1}{n+1} x ^{n+1}+c,\,c\in\mathbb{R}\).

**Examples**

- \(\int x^2\, \mathrm dx = \frac{1}{3} x^3 +c,\,c\in\mathbb{R}\)
- \(\int x^3\, \mathrm dx = \frac{1}{4} x^4 +c,\,c\in\mathbb{R}\)
- \(\int x^{20}\, \mathrm dx = \frac{1}{21} x^{21} +c,\,c\in\mathbb{R}\)

The formula \(\int x^n\, \mathrm dx = [\frac{1}{n+1} x^{n+1}] \) is also valid, if the exponent of the function is a real number and not equal \(-1\).

**Examples **

- \(\int x^{2,7}\, \mathrm dx = \frac{1}{3,7} x^{3,7}+c,\,c\in\mathbb{R}\)
- \(\int \sqrt{x}\, \mathrm dx = \int x^\frac{1}{2} = \frac{2}{3} x^{\frac{3}{2}}+c,\,c\in\mathbb{R}\)
- But: For \(x\gt0\) applies\(\int x^{-1}\,\mathrm d x=\ln(x)+c,\,c\in\mathbb{R}.\)

#### Natural Exponential function

The natural exponential function \(f(x) = e^x\) is one of the easiest function to differentiate and integrate. Since the derivation of \(e^x\) results in \(e^x\), it follows \[\int e^x\, \mathrm dx = e^x +c, \, c\in \mathbb{R}.\]

##### Example 1

Determine the value of the integral \(\int_0^1 e^z \,\mathrm{d} z\).

\[\int\limits_0^1e^z\,\mathrm{d}z= e^z\big|_{z=0}^{z=1}=e^1-e^0=e-1.\]

##### Example 2

Determine the value of the integral \(\int_0^b e^{\alpha t} \,\mathrm{d} t\). Using the same considerations as above we get \[\int\limits_0^b e^{\alpha t}\,\mathrm{d}t= \frac{1}{\alpha}e^{\alpha t}\big|_{t=0}^{t=b} =\frac{1}{\alpha}\left(e^{\alpha b}-e^0\right)=\frac{1}{\alpha}\left(e^{\alpha b}-1\right).\] Important is here, that we have to use the factor \(\frac1{\alpha}\).

#### Natural Logarithm

The derivative of the natural logarithmic function is \(\ln'(x) =\frac{1}{x}\) for \(x\gt0\). It even applies \(\ln'(x) =\frac{1}{x}\) to \(x<0\). These results together result in for the antiderivative of \(\frac{1}{x}\)

\[\int \frac{1}{x}\,\mathrm{d}x = \ln\left(|x|\right) +c , c\in\mathbb{R}.\]

An antiderivative can be specified for the natural logarithm: \[\int \ln(x)\,\mathrm{d}x = x\ln(x) - x + c ,\, c\in\mathbb{R}.\]

#### Trigonometric function

The antiderivatives of \(\sin(x)\) and \(\cos(x)\) also result logically if you derive "backwards". We have \[\int \sin(x)\, \mathrm dx = -\cos(x)+c,\,c\in\mathbb{R},\] since \( (-\cos(x))' =-(-\sin(x))=\sin(x).\) Furthermore we know \[\int \cos(x)\, \mathrm dx = \sin(x)+c,\,c\in\mathbb{R},\] since \((\sin(x))' = \cos(x) \) applies.

##### Example 1

Which area is covered by the sine on the interval \([0,\pi]\) and the \(x\)-axis? To determination the area we simply have to evaluate the integral \[\int_0^{\pi} \sin(\tau) \, \mathrm{\tau}.\] That means \[\int_0^{\pi} \sin(\tau) \, \mathrm{d}\tau = \left[-\cos(\tau)\right]_{\tau=0}^{\tau=\pi} = -\cos(\pi) - (-\cos(0)) = -(-1) - (-1) = 2.\] Again make a sketch for this example.

##### Example 2

How can the integral \(\int \cos(\omega t +\phi)\,\mathrm{d}t\) be expressed analytically?

To determine the integral we use the antiderivative of the cosine: \(\sin'(x) = \cos(x)\). However, the inner derivativ has to be considered in the given function and thus we get \[\int \ \cos(\omega t +\phi)\,\mathrm{d}t =\frac{1}{\omega}\sin(\omega t+\phi)+c,\,c\in\mathbb{R}.\]

##### Summary:

The most common antiderivatives follow from the rules of differentiation: \[\int x^{r}\,dx = \frac{1}{r+1}x^{r+1} + C, ~r\neq-1\] \[\int x^{-1}\,dx = \ln|x| + C\] \[\int e^{x}\,dx = e^{x} + C\] \[\int \sin x\,dx = -\cos x + C\] \[\int \cos x\,dx = \sin x + C\] \[\int \frac{dx}{1+x^{2}} = \arctan x + C\]

##### Example 1

Evaluate the integrals \(\displaystyle \int_{-1}^{1}e^{-x}\,dx\) and \(\displaystyle\int_{0}^{1}\sin(\pi x)\,dx\).

*Solution.* The antiderivative of \(e^{-x}\) is \(-e^{-x}\) so we have that
\[\int_{-1}^{1}e^{-x}\,dx = -e^{-1}+e^{1} = 2\sinh1.\]
The antiderivative of \(\sin(\pi x)\) is \(-\frac{1}{\pi}\cos(\pi x)\) and thus
\[\int_{0}^{1}\sin(\pi x)\,dx = -\frac{1}{\pi}(\cos\pi-\cos0) = \frac{2}{\pi}.\]

##### Example 2

Evaluate the integral \(\displaystyle\int_{0}^{1}\frac{x}{\sqrt{25-9x^{2}}}\,dx\).

*Solution.* The antiderivative might look something like \(F(x)=a(25-9x^{2})^{1/2}\), where we can find the factor \(a\) through differentiation:
\[D\big(a(25-9^{2})^{1/2}\big) = a\cdot\frac{1}{2}\cdot(-18x)(25-9x^{2})^{-1/2} = \frac{-9ax}{\sqrt{25-9x^{2}}}\]
hence if \(a=-1/9\) we get the correct antiderivative. Thus
\[\int_{0}^{1}\frac{x}{\sqrt{25-9x^{2}}}\,dx = -\frac{1}{9}\cdot(25-9x^{2})^{1/2}\Big|_{x=0}^{x=1} = -\frac{1}{9}(\sqrt{16}-\sqrt{25}) = \frac{1}{9}.\]
This integral can also be solved using *integration by substitution*; more on this method later.

### Geometric applications

#### Area of a plane region

Suppose that \(f\) and \(g\) are piecewise continuous functions. The area of a region bounded by the graphs \(y=f(x)\), \(y=g(x)\) and the vertical lines \(x=a\) and \(x=b\) is given by the integral \[A=\int_{a}^{b}|f(x)-g(x)|\,dx.\]

Especially if \(f\) is a non-negative function on the interval \([a,b]\) and \(g(x)=0\) for all \(x\) then the integral \[A=\int_{a}^{b}f(x)\,dx\] is the area of the region bounded by the graph \(y=f(x)\), the \(x\)-axis and the vertical lines \(x=a\) and \(x=b\).

#### Arc length

The arc length \(\ell\) of a planar curve \(y=f(x)\) between points \(x=a\) and \(x=b\) is given by the integral \[\ell = \int_{a}^{b}\sqrt{1+f'(x)^{2}}\,dx.\]

*Heuristic reasoning:* On a small interval \(\left[x,x+\Delta x\right]\) the arc length of the curve between \(y=f(x)\) and \(y=f(x+\Delta x)\) is approximately
\[\Delta s \approx \sqrt{\Delta x^{2} + \Delta y^{2}} = \Delta x\sqrt{1+\left(\frac{\Delta y}{\Delta x}\right)^{2}} \approx \Delta x\sqrt{1+f'(x)^{2}}.\]

#### Surface of revolution

The area of a surface generated by rotating the graph \(y=f(x)\) around the \(x\)-axis on the interval \(\left[a,b\right]\) is given by \[A = 2\pi\int_{a}^{b}|f(x)|\sqrt{1+f'(x)^{2}}\,dx.\] Heuristic reasoning: An area element of the surface is approximately \[\Delta A \approx \text{perimeter}\cdot\text{length} = 2\pi|f(x)|\cdot\Delta s.\]

#### Solid of revolution

Suppose that the cross-sectional area of a solid is given by the function \(A(x)\) when \(x\in\left[a,b\right]\). Then the volume of the solid is given by the integral
\[V = \int_{a}^{b}A(x)\,dx.\]
If the graph \(y=f(x)\) is rotated around the \(x\)-axis between the lines \(x=a\) and \(x=b\) the volume of the generated figure (the *solid of revolution*) is
\[V = \pi\int_{a}^{b}f(x)^{2}\,dx.\]
This follows from the fact that the cross-sectional area of the figure at \(x\) is a circle with radius \(f(x)\) i.e. \(A(x)=\pi f(x)^{2}\).

More generally: Let \(0\le g(x)\le f(x)\) and suppose that the region bounded by \(y=f(x)\) and \(y=g(x)\) and the lines \(x=a\) and \(x=b\) is rotated around the \(x\)-axis. The volume of this solid of revolution is \[V = \pi\int_{a}^{b}\big(f(x)^{2}-g(x)^{2}\big)\,dx.\]

### Improper integral

##### Definition: Improper integral

- 1st kind: The integral is defined on an unbounded domain, \(\left[a,\infty\right[,\left]-\infty,b\right]\) or the entire \(\mathbb{R}\).
- 2nd kind: The integrand function is unbounded in the domain of integration or a two-sided limit doesn't exist on one or both of the endpoints of the integral

One limitation of the improper integration is that the limit must be taken with respect to one endpoint at a time.

##### Example

\[\int_{0}^{\infty}\frac{dx}{\sqrt{x}(1+x)} = \int_{0}^{1}\frac{dx}{\sqrt{x}(1+x)} + \int_{1}^{\infty}\frac{dx}{\sqrt{x}(1+x)}\] Provided that both of the integrals on the right-hand side converge. If either of the two is divergent then so is the integral.

##### Definition

Let \(f\colon\left[a,\infty\right[\to\mathbb{R}\) be a piecewise continuous function. Then
\[\int_{a}^{\infty}f(x)\,dx = \lim_{R\to\infty}\int_{a}^{R}f(x)\,dx\]
provided that the limit exists and is finite. We say that **the improper integral of \(f\) converges** over \(\left[a,\infty\right[\).

Likewise for \(f\colon\left]-\infty,b\right]\to\mathbb{R}\) we define \[\int_{-\infty}^{b}f(x)\,dx = \lim_{R\to\infty}\int_{-R}^{b}f(x)\,dx\] provided that the limit exists and is finite.

##### Example

Find the value of \(\displaystyle\int_{0}^{\infty}e^{-x}\,dx\).

*Solution.* Notice that
\[\int_{0}^{R}e^{-x}\,dx = \left(-e^{-x}\right)\Bigg|_{x=0}^{R}=1-e^{-R}\to 1\]
as \(R\to\infty\). Thus the improper integral converges and
\[\int_{0}^{\infty}e^{-x}\,dx = 1.\]

##### Definition

Let \(f\colon\mathbb{R}\to\mathbb{R}\) be a piecewise continuous function. Then
\[\int_{-\infty}^{\infty}f(x)\,dx = \int_{-\infty}^{0}f(x)\,dx + \int_{0}^{\infty}f(x)\,dx\]
if **both** of the two integrals on the right-hand side converge.

In the case \(f(x)\ge0\) for all \(x\in\mathbb{R}\) the following holds \[\int_{-\infty}^{\infty}f(x)\,dx = \lim_{R\to\infty}\int_{-R}^{R}f(x)\,dx.\]

However, this doesn't apply in general. For example, let \(f(x)=x\). Note that even though \[ \int_{-R}^{R}f(x)\,dx = \int_{-R}^{R}x\,dx = \frac{R^2}{2} - \frac{(-R)^2}{2} = 0 \] for all \(R\in\mathbb{R}\) the improper integral \[ \int_{-\infty}^{\infty}x\,dx = \lim_{R\to\infty}\int_{-R}^{0}x\,dx + \lim_{R\to\infty}\int_{0}^{R}x\,dx = \lim_{R\to\infty}-\frac{(-R)^2}{2} + \lim_{R\to\infty}\frac{R^2}{2} = \infty - \infty \] does not converge.

Improper integrals of the 2nd kind are handled in a similar way using limits. As there are many different (but essentially rather similar) cases, we leave the matter to one example only.

##### Example

Find the value of the improper integral \(\displaystyle\int_{0}^{1}\frac{dx}{\sqrt{x}}\).

*Solution.* We get
\[\int_{\epsilon}^{1}\frac{dx}{\sqrt{x}} = \left(2\sqrt{x}\right)\Bigg|_{x=\epsilon}^{x=1} = 2-2\sqrt{\epsilon} \to 2,\]
as \(\epsilon\to0+\). Thus the integral converges and its value is \(2\).

### Comparison test

*comparison test*.

##### Theorem.

Suppose that \(f\) and \(g\) are integrable functions such that \(|f(x)|\le g(x)\) for \(a < x < b\).- If the improper integral \[I=\int_{a}^{b}g(x)\,dx\] converges then so does \(\displaystyle\int_{a}^{b}f(x)\,dx\) and its value is less than or equal to \(I\).
- If the improper integral \[\int_{a}^{b}f(x)\,dx\] diverges then so does \(\displaystyle\int_{a}^{b}g(x)\,dx\).

##### Example 2

Notice that \[0\le\frac{1}{\sqrt{x}(1+x)}\le\frac{1}{\sqrt{x}}, \text{ for }0 < x < 1\] and that the integral \[\int_{0}^{1}\frac{dx}{\sqrt{x}} = 2\] converges. Thus by the comparison test the integral \[\int_{0}^{1}\frac{dx}{\sqrt{x}(1+x)}\] also converges and its value is less than or equal to \(2\).

##### Example 3

Likewise \[0\le\frac{1}{\sqrt{x}(1+x)} < \frac{1}{\sqrt{x}(0+x)}=\frac{1}{x^{3/2}}, \text{ for }x\ge1\] and because \(\displaystyle\int_{1}^{\infty}x^{3/2}\,dx=2\) converges so does \[\int_{1}^{\infty}\frac{dx}{\sqrt{x}(1+x)}\] and its value is less than or equal to \(2\).

**Note.** The choice of the dominating function depends on both the original function and the interval of integration.

##### Example 4

Determine whether the integral \[\int_{0}^{\infty}\frac{x^2+1}{x^3(\cos^2{x}+1)}\,dx\] converges or diverges.

*Solution.* Notice that \(x^2+1\ge x^2\) for all \(x\in\mathbb{R}\) and therefore
\[\frac{x^2+1}{x^3(\cos^2{x}+1)} \ge \frac{1}{x\underbrace{(\cos^2{x}+1)}_{\le 2}} \ge \frac{1}{2x}.\]
Now, because the integral \(\displaystyle\int_{0}^{\infty}\frac{dx}{2x}\) diverges then by the comparison test so does the original integral.

### Integration techniques

#### Logarithmic integration

Given a quotient of differentiable functions, we know to apply the quotient rule. However, this is not so easy with integration. Here only for a few **special cases** we will state rules in this chapter.

**Logarithmic integration** As we already know the derivative of \(\ln(x)\), i.e. the natural logarithm to the base \(e\), equal to \(\frac{1}{x}\). According to the chain rule the derivative of differentiable function with positive function values is \(f\,:\,\frac{\mathrm d}{\mathrm dx} \ln (f(x)) = \frac{f'(x)}{f(x)}\). This means that for a quotient of functions where the numerator is the derivative of the denominator yields the rule: \begin{equation} \int \frac{f'(x)}{f(x)}\, \mathrm{d} x= \ln \left(|f(x)|\right) +c,\,c\in\mathbb{R}.\end{equation} Using the absolute value of the function is important, since the logarithm is defined on \(\mathbb{R}^+\).

##### Examples

- \(\int \frac{1}{x}\, \mathrm dx = \int \frac{x'}{x} \mathrm\, dx = \ln(|x|) +c,\,c\in\mathbb{R} \).
- \(\int \frac{3x^2 + 17}{x^3 +17x - 15}\, \mathrm dx = \ln(|x^3 + 17x - 15|)+c,\,c\in\mathbb{R}\).
- \(\int \frac{\cos(x)}{\sin(x)}\,\mathrm dx = \ln(|\sin(x)|)+c,\,c\in\mathbb{R}\).

#### Integration of rational functions - partial fraction decomposition

The logarithmic integration works well in special cases of broken rational functions where the counter is a multiple of the derivation of the denominator. However, other cases can sometimes be traced back to this. This method is called ** partial fractional decomposition, ** which represents rational functions as the sum of proper rational functions.

##### Example 1

The function \(\frac{1}{1-x^2}\) cannot be integrated at first glance. However, the denominator \(1-x^2\) can be written as \((1-x)(1+x)\) and the function can finally reads as \(\dfrac{1}{1-x^2} = \dfrac{\frac{1}{2}}{1+x} + \dfrac{\frac{1}{2}}{1-x}\) by partial fraction decomposition. This expression can be integrated, as demonstrated now: \begin{eqnarray} \int \dfrac{1}{1-x^2} \,\mathrm dx &= & \int \dfrac{\frac{1}{2}}{1+x} + \dfrac{\frac{1}{2}}{1-x}\, \mathrm dx \\ & =& \frac{1}{2} \int \dfrac{1}{1+x}\, \mathrm dx - \frac{1}{2} \int \dfrac{-1}{1-x}\, \mathrm dx\\ & = &\frac{1}{2} \ln|1+x| +c_1 - \frac{1}{2} \ln|1-x| +c_2\\ &= &\frac{1}{2} \ln \left|\dfrac{1+x}{1-x}\right|+c,\,c\in\mathbb{R}. \end{eqnarray} This procedure is now described in more detail for some special cases.

**Case 1**: \(Q(x)=(x-\lambda_1)(x-\lambda_2)\) with \(\lambda_1\ne\lambda_2\). In this case, \(R\) has the representation \(R(x) = \frac{ax+b}{(x-\lambda_1)(x-\lambda_2)}\) and can be transformed to \[\frac{ax+b}{(x-\lambda_1)(x-\lambda_2)} = \frac{A}{(x-\lambda_1)}+\frac{B}{(x-\lambda_2)}.\] By multiplying with \((x-\lambda_1)(x-\lambda_2)\) it yields ot \[ax+b = A(x-\lambda_1) + B(x-\lambda_2) = \underbrace{(A+B)}_{\stackrel{!}{=}a}x + \underbrace{(-A\lambda_1-B\lambda_2)}_{\stackrel{!}{=}b}.\]

\(A\) and \(B\) are now obtained by the method of equating the coefficients.

##### Example 2

Determe the partial fraction decomposition of \(\frac{2x+3}{(x-4)(x+5)}\).

Start with the equation \[\frac{2x+3}{(x-4)(x+5)} = \frac{A}{(x-4)}+\frac{B}{(x+5)}\] to get the parameters \(A\) and \(B\). Multiplication by \({(x-4)(x+5)}\) leads to \[2x+3 = A(x+5)+B(x-4) = (A+B)x +5A -4B.\] Now we get the system of linear equations

\begin{eqnarray}A+B & = & 2 \\ 5A - 4 B &=& 3\end{eqnarray} with the solution \(A = \frac{11}{9}\) and \(B= \frac{7}{9}\). The representation with proper rational functions is \[\frac{2x+3}{(x-4)(x+5)}=\frac{11}{9}\frac{1}{(x-4)}+\frac{7}{9}\frac{1}{(x+5)} \] The integral of the type \(\int \frac{ax+b}{(x-\lambda_1)(x-\lambda_2)}\,\mathrm{d} x.\) is no longer mystic.

With the help of partial fraction decomposition, this integral can now be calculated in the following manner \begin{eqnarray}\int \frac{ax+b}{(x-\lambda_1)(x-\lambda_2)}\mathrm{d} x &=& \int\frac{A}{(x-\lambda_1)}+\frac{B}{(x-\lambda_2)}\mathrm{d} x \\ &=&A\int\frac{1}{(x-\lambda_1)}\mathrm{d} x +B\int\frac{1}{(x-\lambda_2)}\mathrm{d} x \\ & = & A\ln(|x-\lambda_1|) + B\ln(|x-\lambda_2|).\end{eqnarray}

##### Example 3

Determine the antiderivative for \(\frac{2x+3}{(x-4)(x+5)}\), i.e. \(\int\frac{2x+3}{(x-4)(x+5)}\,\mathrm{d} x.\)

From the above example we already know: \[\int\frac{2x+3}{(x-4)(x+5)}\,\mathrm{d} x = \int\frac{11}{9}\frac{1}{(x-4)}+\frac{7}{9}\frac{1}{(x+5)}\, \mathrm{d} x.\]

Using the idea explained above immediately follow: \[\int\frac{11}{9}\frac{1}{(x-4)}+\frac{7}{9}\frac{1}{(x+5)} \,\mathrm{d} x = \frac{11}{9}\int\frac{1}{(x-4)} \mathrm{d} x + \frac{7}{9}\int\frac{1}{(x+5)} \,\mathrm{d} x= \frac{11}{9}\ln(|(x-4)|)+\frac{7}{9}\ln(|(x+5)|).\] So is the result \[\int\frac{2x+3}{(x-4)(x+5)}\,\mathrm{d} x=\frac{11}{9}\ln(|(x-4)|)+\frac{7}{9}\ln(|(x+5)|).\]

**Case 2**: \(Q(x)=(x-\lambda)^2\).

In this case \(R\) has the representation \(R(x) = \frac{ax+b}{(x-\lambda)^2}\) and the ansatz \[\frac{ax+b}{(x-\lambda)^2} = \frac{A}{(x-\lambda)}+\frac{B}{(x-\lambda)^2}\] is used.

By multiplying the equation with \((x-\lambda)^2\) we get \[ax+b = A(x-\lambda) + B.\] Again equating the coefficients leads us to a system of linear equations in \(A=a\) and \(B=b+A\lambda=b+a\lambda.\)

So we have \[\int \frac{ax+b}{(x-\lambda)^2}\,\mathrm{d}x = \int \frac{a}{(x-\lambda)}+\frac{b+a\lambda}{(x-\lambda)^2} \mathrm{d}x =a\ln(|x-\lambda|)-\frac{b+a\lambda}{(x-\lambda)}+c,\,c\in\mathbb{R}. \]

**3. case** \(Q(x)=x^2+mx+n\) without real zeros.

In this case \(R\) has the representation \(R(x) = \frac{ax+b}{x^2+mx+n}\) and the representation can not be simplified.

Only the special case \(R(x) = \frac{2x+m}{x^2+mx+n}\) is now considered.

In this case we have \[\int \frac{2x+m}{x^2+mx+n}\,\mathrm{d}x = \ln(|x^2+mx+n|)+c, \quad c\in\mathbb{R}. \]

Another special case is \(R(x) = \frac{1}{x^2+1}\) with \[\int \frac{1}{x^2+1} \, \mathrm{d} x = \arctan(x) +c,\quad c\in \mathbb{R}.\]

#### Integration by Parts

The derivative of a product of two continuously differentiable functions \(f\) and \(g\) is \[(f(x)\cdot g(x))' = f'(x)\cdot g(x)+f(x)\cdot g'(x),\quad x\in(a,b).\]

This leads us to the following theorem:

##### Theorem: Integration by Parts

Let\(f\) and \(g\) be continuously differentiable functions on the interval \(\left[a,b\right]\). Then \[\int_{a}^{b}f'(x)g(x)\,dx = f(b)g(b)-f(a)g(a)-\int_{a}^{b}f(x)g'(x)\,dx\] Likewise for the indefinite integral it holds that \[\int f'(x)g(x)\,dx = f(x)g(x)-\int f(x)g'(x)\,dx.\]

It follows from the product rule that \[\frac{d}{dx}(f(x)g(x)) = f'(x)g(x) + f(x)g'(x)\] or rearranging the terms \[f'(x)g(x) = \frac{d}{dx}(f(x)g(x)) - f(x)g'(x). \] Integrating both sides of the equation with respect to \(x\) and ignoring the constant of integration now yields \[\int f'(x)g(x) = f(x)g(x) - \int f(x)g'(x)\,dx.\]

##### Example

Solve the integral \(\displaystyle\int_{0}^{\pi}x\sin x\,dx\).

*Solution.* Set \(f'(x)=\sin x\) and \(g(x) = x\). Then \(f(x)=-\cos x\) and \(g'(x) = 1\) and the integration by parts gives
\[\int_{0}^{\pi}x\sin x\,dx = -\pi\cos\pi - 0 - \int_{0}^{\pi}(-\cos x)\,dx\]
\[=\pi+\left(\sin x\right)\Bigg|_{x=0}^{\pi} = \pi.\]

Notice that had we chosen \(f\) and \(g\) the other way around this would have led to an even more complicated integral.

#### Integration by Substitution

##### Theorem: Integration by substitution

Let \(f\) and \(g\) be continuously differentiable functions on \(\left[a,b\right]\). Then \[\int_{a}^{b}f(g(x))g'(x)\,dx = \int_{g(a)}^{g(b)}f(u)\,du.\]

Let \(F'(x)=f(x)\). Then \[\int_{a}^{b}f(g(x))g'(x)\,dx = \int_{a}^{b}(F\circ g)'(x)\,dx\] \[= (F\circ g)(b) - (F\circ g)(a) = F(g(b)) - F(g(a))\] \[= \int_{g(a)}^{g(b)}f(u)\,du.\]

**In practise:** Substituting \(u=g(x)\) we have (heuristically)
\[\frac{du}{dx}=g'(x)\Rightarrow du=g'(x)\,dx\]
and the limits of integration \(x=a\Rightarrow u=g(a),x=b\Rightarrow u=g(b)\).

##### Example 1

Find the value of the integral \(\displaystyle\int_{0}^{\pi^2}\sin\sqrt{x}\,dx\).

*Solution.* Making the substitution \(x=t^{2}\) when \(t\ge0\) we have \(dx=2t\,dt\). Solving the limits from the inverse formula i.e. \(t=\sqrt{x}\) we find that \(t(0)=0\) and \(t(\pi^{2})=\pi\). Hence
\[\int_{0}^{\pi^{2}}\sin\sqrt{x}\,dx = \int_{0}^{\pi^{2}}2t\sin t\,dt = 2\int_{0}^{\pi}t\sin t\,dt = 2\pi.\]

Here the latter integral was solved applying integration by parts in the previous example.

##### Example 2

Find the antiderivative of \(\displaystyle\frac{1}{\sqrt{x}(1+x)}\).

*Solution.* Substituting \(x=t^{2}\), \(t>0\) or \(t=\sqrt{x}\) gives
\[\int\frac{dx}{\sqrt{x}(1+x)} = \int\frac{2t}{t(1+t^{2})}\,dt = 2\arctan t + C = 2\arctan\sqrt{x} + C.\]