# A calculus of the absurd

#### 11.2 Integration by parts

When differentiating a function $$f(x) = a(x) \cdot b(x)$$, the product rule (as in Section 10.4) tells us that

$$\frac {d}{dx} \left [ f(x) \right ] = \frac {d}{dx} \left [a(x)\right ] b(x) + a(x) \frac {d}{dx} \left [b(x)\right ]$$

We can also integrate this expression,

$$\int \frac {d}{dx} \left [ f(x) \right ] dx = \int \left ( \frac {d}{dx} \left [a(x)\right ] b(x) + a(x) \frac {d}{dx} \left [b(x)\right ] \right ) dx$$

As integration is linear8181 That is, the integral of a sum is the same as the sum of the integrals., this is equivalent to

$$\int \frac {d}{dx} \left [ f(x) \right ] dx = \int \frac {d}{dx} \left [a(x)\right ] b(x) dx + \int a(x) \frac {d}{dx} \left [b(x)\right ] dx$$

As (by definition) $$\int \frac {df}{dx} dx = f(x)$$, it is the case that

$$f(x) = a(x) \cdot b(x) = \int \frac {d}{dx} \left [a(x)\right ] b(x) dx + \int a(x) \frac {d}{dx} \left [b(x)\right ] dx$$

Why is this useful? First we can do a little addition/rearranging

Note that $$\iff$$ means “if and only if” - i.e. that the two equations are equivalent.

\begin{align} & a(x) \cdot b(x) = \int \frac {d}{dx} \left [a(x)\right ] b(x) dx + \int a(x) \frac {d}{dx} \left [b(x)\right ] dx \\ &\iff \int \frac {d}{dx} \left [a(x)\right ] b(x) dx = a(x) \cdot b(x) - \int a(x) \frac {d}{dx} \left [b(x)\right ] dx \label {int by parts formula} \end{align}

This gives us (a somewhat awkward) way to integrate products of expressions!

• Example 11.2.1 Find the value of

$$\int z \sin (z) dz$$

First, fear not the fact that this is an integral in $$z$$. As with sums, the variable itself does not matter (we could rename $$z$$ to anything else, and the integral would still be the same integral)! Note that we could solve this without using integration by parts; we could think about what would differentiate to give us $$z \sin (z)$$, but this is no fun (it’s much nicer to have a systematic way to solve a problem than to rely on lucky guessing)!

We start by trying to work out what should be what in the identity in Equation 11.6. We are starting with the left-hand side, and want to set $$\frac {d}{dz}\left [a(z)\right ] = \sin (z)$$ and $$b(z) = z$$. Why? Because in the integral on the right-hand side, we calculate the integral of the integral of $$a(z)$$ and the derivative of $$b(z)$$ and what makes the problem “hard” is not that we don’t know how to find the integral of either $$\sin (z)$$ or $$z$$, it’s that we don’t know how to find the integral of the two multiplied together! As the derivative of $$z$$ is just $$1$$, this gives us a way to rewrite the integral of the product of $$z$$ and $$\sin (z)$$ in terms of only the integral of $$\sin (z)$$.

Let us proceed by using the formula for integration by parts (let us agree to set $$x=z$$ if you’re not convinced that the variables can be renamed without changing the structure of the expressions), that is

$$\int z \sin (z) dz = \left (\int \sin (z) dz\right ) z - \int \left (\int \sin (z) dz\right ) dz$$

The $$\int \sin (z) dz$$ appears, because if $$\frac {d}{dz}\left [a(z)\right ] = \sin (z)$$, then $$a(z) = \int \sin (z) dz$$. We can proceed by simply evaluating the integrals on the right-hand side (all of which we know how to integrate)!

\begin{align} \int z \sin (z) dz &= -\cos (z) z - \int \left (-\cos (z)\right ) dz + C \\ &= -\cos (z) z + \int \cos (z) dz + C\\ &= -\cos (z) z + \sin (z) + C \end{align}

That this is the correct integral can be verified by differentiating the expression. You might also ask, why does the constant of integration $$C$$ remain unchanged after each step (doesn’t each integral add something to it). The answer is that it doesn’t - at each step we are effectively redefining $$C$$ to be $$C_{\text {new}} = C_{\text {old}} + k$$ (where $$k$$ is the constant of the new integral) - if we were to create a new constant each time it would get messy, so we can just “fold” all the constants into one new super-constant!