# 13.3 Tricks of Integration

The techniques of integration are basically those of differentiation looked at backwards.

The rule for differentiating a sum: **It is the sum of the derivatives of the summands**, gives
rise to the same fact for integrals: **the integral of a sum of integrands is the sum of their
integrals.**

**13.3.1 The Product Rule Backwards**

The product rule, says that the **derivative of a product is the sum gotten by differentiating each factor
as if the other were constant and adding up the results.**

We can read this backwards as a way to handle an integrand of the form \(fg'\), when we know how to handle the integrand \(f'g\). For, we can write the product rule as

\[fg' = (fg)'-f'g\]

and integrating both sides tells us

\[ \begin{aligned} \int_a^b f(x)g'(x)dx &= \int_a^b \frac{d(f(x)g(x))}{dx}dx \\ \thinspace &= \int_{x=a}^{x=b} (d(f(x)g(x)) - \int_a^b f'(x)g(x)dx \\ \thinspace &= f(b)g(b) - \int_a^b f'(x)g(x)dx \end{aligned} \]

This statement is called **"integrating by parts"** and is useful for integrands like
\(x^k\exp(x)\) or \(\ln(x)\) or \(x\ln(x)\).

For example, to integrate \(\ln(x)\), set \(f(x) = \ln(x)\) and \(g'(x)= 1\). Then we have \(f'(x) = \frac{1}{x}\) and \(g(x) = x\). Thus \(f(x)g(x)\) is \(x\ln(x)\) and \(f'g\) is \(1\).

We can conclude that the integral of \(\ln(x)\) from \(a\) to \(b\) is \(b\ln(b) - a\ln(a) - (b-a)\). This answer is often written as

\[(x(\ln x)-x)\vert_a^b\]

**Exercise 13.7 Do the other integrals mentioned just above: with integrands \(x^k \exp(x)\) for \(k = 1\)
and \(k = 2\), and also \(x\ln(x)\).**

**13.3.2 The Chain Rule Backwards**

The chain rule tells us how to differentiate \(f(g(x))\) and the answer is \(\frac{df}{dg}\frac{dg}{dx}\).

This tells us that we if we can recognize an integrand as having the form \(\frac{df}{dg}g'\), we can integrate it over \(dx\) to get \(f(g(x))\) evaluated at \(b\) less its evaluation at \(a\).

What can we recognize this way?

Here are examples you should mull over: \((\sin x)^6cos x\), and \(\frac{\ln(x)}{x}\). Try guessing what to choose for \(g(x)\) in each case and see if you can get it to work. If you fail, try again.

Using the chain rule backwards is sometimes called **the method of substitution**.

We will not dwell on this topic. To actually learn to use any of these methods you must practice them perhaps a dozen times each. This is very valuable experience for the substitution rule, something like solving puzzles. It can be fun but at first it seems like drudgery.

We do note that, by an appropriate magical substitution, you can turn any rational function of sines and cosines into a rational function, which you can actually integrate, with enough effort. In the old days tables of integrable functions with their integrals were very useful. Such things are now readily available on the web.

**Is there anything we cannot integrate?**

Yes definitely. The integrands \(\frac{e^{-x}}{x}\) and \(\exp(-x^2)\) are examples, for which there is no solution that can be expressed in terms of combinations obtained from the identity function., the sine and the exponent. Actually modern spreadsheets often include their integrals as non-standard but spreadsheet available functions.

(The Error Function, or erf for example,

\[erf(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2}dt\]

is a function available in Excel 7 among its Engineering Formulae, and it can be entered as part of the content of any location in the spreadsheet.)

Nowadays, you can consult any of a number of available programs, such as Maple, Mathematica, and Matlab and they will give you formal solutions to any doable integrals, and solutions to arbitrary accuracy for those that cannot be integrated exactly in terms of the functions we have defined.

We now turn to the question: how feasible is it to integrate, that is, to determine areas under curves, numerically? There was a tiny discussion of this in Chapter 2.