3.3. Integration in 1D#

3.3.1. Learning goals:#

After working through these notes, you will be able to:

  1. Describe the difference between definite and indefinite integration

  2. Determine the indefinite integrals of common functions of one variable

  3. Determine definite integrals of common functions of one variable

3.3.2. Coding concepts:#

No coding concepts are used in this notebook.

3.3.3. Integration#

Integration is the inverse operation of differentiation. When asked “what is \(\int f(x) dx\)?” you can think of it like asking “what function has the derivative \(f(x)\)?”. Much like in differentiation, we need to learn the integral, or antiderivative, of various functions for ease of use later in Thermodynamics and Kinetics. We will start by differentiating between indefinite and definite integration.

3.3.4. Indefinite integration#

Indefinite integration is equivalent to the question above. What is the antiderivative of a function? For example, we might write

(3.34)#\[\begin{equation} \int x^2dx = \frac{x^3}{3} + C, \end{equation}\]

where this can be read as “the integral of \(x^2\) is \(\frac{x^3}{3}\) plus an arbitrary constant, \(C\).” This is an example of indefinite integration for which we determine the function(s) that represent the antiderivative of the integrand (\(x^2\)). Note that you can substitute any real number for \(C\) and have a correct answer.

If we look at the indefinite integration above in reverse, we see that the derivative of \(\frac{x^3}{3}\) with respect to \(x\) is \(x^2\). The derivative of any constant is \(0\) so we actually have an infinite number of functions that satisfy the indefinite integration above and we represent these by including \(C\), the arbitrary constant.

3.3.4.1. Some Common Indefinite Integrals#

Here are the indefinite integrals of some common 1D functions:

Polynomials (with constant \(A\) and integer \(n\neq-1\))

(3.35)#\[\begin{equation} \int Ax^n dx = \frac{Ax^{n+1}}{n+1} + C \end{equation}\]

Polynomial \(n=-1\) (with constant \(A\))

(3.36)#\[\begin{equation} \int \frac{A}{x}dx = A\ln|x| + C \end{equation}\]

Exponentials (with constants \(A\) and \(m\)):

(3.37)#\[\begin{equation} \int Ae^{m\cdot x}dx = \frac{A}{m}e^{m\cdot x} + C \end{equation}\]

Trig functions (constant \(A\)):

(3.38)#\[\begin{equation} \int A\sin(x) dx = -A\cos(x) + C \end{equation}\]
(3.39)#\[\begin{equation} \int A\cos(x) dx = A\sin(x) + C \end{equation}\]

For a more exhaustive list of indefinite integrals, see http://integral-table.com/, https://en.wikipedia.org/wiki/Lists_of_integrals, or use Wolgram alpha.

3.3.4.2. \(u\) substitution#

Composite functions are more difficult to differentiate. There are a few tricks to help with this. One example is \(u\) substitution. This is basically the integral version of the chain rule and does come in handy in Thermodynamics and Kinetics.

Rather than spell out the theory of \(u\) substitution, here is an example of using it. Determine a closed for expression for \(f(x)\) where

(3.40)#\[\begin{equation} f(x) = \int 2x\cos(x^2)dx \end{equation}\]

Note that we clearly have composite functions here. We have \(2x\), \(\cos(x)\), and \(x^2\). This integral is also clearly not one of the ones listed above. We are going to use \(u\) substitution to solve it.

A clue that \(u\) substitution will work is when you have to parts of the function that are related by a derivative

We see that the \(x^2\) and \(2x\) are related by a derivative. Namely \(\frac{d}{dx}x^2 = 2x\). This means \(u\) substitution will likely work in this case.

We start by picking one of the functions and substitute it with a new variable \(u\). We will choose

(3.41)#\[\begin{equation} u = x^2 \end{equation}\]

because the derivative of \(x^2\) is \(dx\). When we substitue \(u\) into the integral above we are going to want to do the integration over \(u\), not \(x\). Thus, we need to also substitute the differential of \(u\). To determine that, we take the differential of both sides of the equation for \(u\) above to yield

(3.42)#\[\begin{equation} du = 2xdx \end{equation}\]

We now substitute both of these into the integral above to get

(3.43)#\[\begin{align} f(x) &= \int 2x\cos(x^2)dx \\ &= \int \cos(x^2)2xdx \\ &= \int \cos(u)du\\ &= \sin(u) + C\\ &= \sin(x^2) + C \end{align}\]

where I first rearrange the integral to make clear that there is a \(du=2xdx\) in the integral. I then substitute in \(u\) and \(du\) to get \(\int \cos(u)du\). This integral is given above as \(\sin(u) + C\). Finally, we substitute back in for \(u\) to make the dependence on \(x\) explicit once again.

If we take the derivative of \(\sin(x^2) + C\) we need to use the chain rule but should see that we will get \(2x\cos(x^2)\).

3.3.4.3. Integration by Parts#

The integral version of the product rule is integration by parts (sort of). It is annoying and we won’t encounter it that much in this class so I will not go over it.

3.3.5. Definite Integration#

Definite integration is comparable to indefinite integration except that there are limits placed on the integral in definite integration. The result is typically a number and represents the area under the curve between the lower and upper limits.

Definite integrals are often evaluated by determining the indefinite integral and then determining the difference of the values of this function at the limits. The arbitrary constant, \(C\), no longer matters because it is the same at both limits and so get substracted out.

Here is an example

(3.44)#\[\begin{equation} \int_{-2}^2x^2dx = ? \end{equation}\]

To dermine this definite integral, we start be determining the indefinite integral. We determined this above to be

(3.45)#\[\begin{equation} \int x^2dx = \frac{x^3}{3} + C, \end{equation}\]

We can now solve the definite integral

(3.46)#\[\begin{align} \int_{-2}^2x^2dx &= \left[ \frac{x^3}{3} \right]_{-2}^2 \\ &= \frac{2^3}{3} - \frac{(-2)^3}{3} \\ &= \frac{16}{3} \end{align}\]

The notation \(\left[ \frac{x^3}{3} \right]_{-2}^2\) means to take the difference of the function \(\frac{x^3}{3}\) evaluated at the upper (\(2\)) and lower (\(-2\)) limits.

3.3.5.1. Tables of Definite Integrals#

There are some functions that do not have a nice indefinite integral but for which the definite integral over certain domains can be determined. A common example is a Guassian integral over either \(0<x<\infty\) or \(-\infty<x<\infty\). It can be shown that

(3.47)#\[\begin{equation} \int_{-\infty}^{\infty}e^{-\alpha x^2} dx= \sqrt{\frac{\pi}{\alpha}} \end{equation}\]

We may encounter integrals like this. It is not expected that you be able to determine these but rather you will be given a general result like those tabulated at the bottom of the wikipedia page of integrals (https://en.wikipedia.org/wiki/Lists_of_integrals).

3.3.5.2. Numeric integration#

Definite integrals can also be approximated by numeric integration. We will not dicuss this technique but the basics are give in a different noteboook.