Integration by parts

By Martin McBride, 2024-07-10
Tags: integration by parts product rule
Categories: integration calculus


Finding integrals can be challenging because, unlike differentiation, we can't usually integrate a function from first principles. Instead, we usually find integrals by identifying a related differential equation and reversing it. For example, if we happen to know that the first derivative of the function f(x) is g(x), then (subject to a few conditions) we know that the integral of g(x) will be f(x).

This gives us a repertoire of standard integrals that we can use to solve problems. However, it is always useful to expand our repertoire. One way to do that is to investigate some of the rules we use for differentiating more complex expressions. These can sometimes be "reversed" to provide a new weapon in our integration armoury.

One well-known rule we use in differentiation is the product rule. The equivalent rule for integration is integration by parts. We will introduce that method in this article, with examples and a proof using calculus.

Integration by parts

Let's start by stating the rule as an indefinite integral (we will prove it later):

Integration by parts

How is this useful? Well, suppose we have an expression to integrate but there is no known way to do it. But we notice that the expression is a factor of two other functions, like this:

Integration by parts

Now suppose we happen to know that the integral of h is some other function g. In other words, h is equal to g'. So now we have this:

Integration by parts

According to the formula above, we can rewrite this as:

Integration by parts

This gives us a second chance at solving the integral. It might be that f' g is easier to integrate than f g'. This sometimes happens if f' is simpler than f. And since finding f(x) times g(x) is easy (it isn't under the integral sign) we have found a solution. This doesn't always work, but it sometimes does, so it is worth a try.

Let's look at a simple example:

Integration by parts example 1

We can't integrate this directly, so we will try integration by parts. We need to split the function into two factors, one that will represent f, and the other that will represent the derivative of some other function g:

Integration by parts example 1

Our function can be split into two factors fairly easily, it is x times sin x. Let's try defining f and g' like this:

Integration by parts example 1

We can now find f' by differentiating f:

Integration by parts example 1

We can find g by integrating g':

Integration by parts example 1

Looking back to the original rule:

Integration by parts

We can substitute f, g and their derivatives:

Integration by parts example 1

Simplifying gives:

Integration by parts example 1

Evaluating the integral gives us the final result:

Integration by parts example 1

Here is a graph showing the original function on the left, and the integral on the right. As you would expect, the places where the left-hand graph is zero correspond to the turning points in the right-hand graph. Also, the regions where the left-hand graph is positive correspond to the regions where the right-hand graph has a positive slope, and vice versa. This gives us a small measure of confidence that the integral is correct:

Integration by parts example 1

Integration by parts doesn't always work

This technique is great when it works, but in many cases (in fact most cases) it won't work. As an example, consider what might happen if we had allocated f and g' differently. In this equation:

Integration by parts example 2

We could have chosen to swap the definitions of f and g':

Integration by parts example 2

We are allowed to do this, of course, because the order of multiplication makes no difference. This would have created different f' and g functions:

Integration by parts example 2

This in turn would have created a different equation for the integration by parts:

Integration by parts example 2

This equation is perfectly valid, but it isn't very useful because the integral on the RHS is still not solvable. If anything, it is more difficult than the original.

Standard form of integration by parts

You will often see the rule for integration by parts written in a standard, almost idiomatic, form. We will derive that form here. Taking the formula above:

Integration by parts

By definition, we have:

Integration by parts

This can be rearranged to give:

Integration by parts

We can derive a similar result for g:

Integration by parts

This allows us to replace dx in the original to obtain the standard formulation of the integration by parts rule:

Integration by parts

This is often written using u and v rather than f and g.

Proof

The proof of the method can be derived from the product rule of differentiation. We will assume that our functions f and g are continuously differentiable. When we say that a function is continuously differentiable, we mean that the function is differentiable everywhere and that the first derivative itself is a continuous function.

This proof assumes the product rule is already proven, see the proof from first principles here. In summary, the product rule states that, if we have a function p that is the product of two other functions:

Integration by parts

Then, using the product rule, the derivative of p will be:

Integration by parts

We can now integrate both sides with respect to x:

Integration by parts

The integral of p' is just p:

Integration by parts

And p is the product of f and g:

Integration by parts

Rearranging this formula gives us the integration by parts rule:

Integration by parts

Finding the definite integral

To find the definite integral, we need to evaluate the integral term over the required range (let's call it a to b). But we also need to evaluate the product term between a and b. So:

Integration by parts

This is equivalent to:

Integration by parts

Example

As a second example, we will evaluate this definite integral:

Integration by parts example 3

We will choose f and g' as follows:

Integration by parts example 3

This means that f' will be 1, as in the previous example. To find g, we rely on the special property of the exponential function, that it is its own derivative. So g is the same as g':

Integration by parts example 3

So, using the equation for the definite integral by parts we saw in the previous section, we have:

Integration by parts example 3

Evaluating the second integral between 0 and 2 gives:

Integration by parts example 3

We can gather both terms on the RHS and evaluate them both between 0 and 2:

Integration by parts example 3

Substituting the values gives:

Integration by parts example 3

These graphs show the original function of the left, with the calculated integral on the right. The integral graph has been adjusted by adding a constant 1 to ensure that the integral starts at zero when x is zero (because the definite integral range starts at zero):

Integration by parts example 3

The value of the graph on the right, when x is 2, is about 8.3891 as calculated above. For the curve on the left, we would therefore expect the area under the curve between 0 and 2 to also be 0.83891.

As a quick check, the yellow triangle also has an area of 0.83891. Visually, it is certainly plausible that the area of the triangle is equal to the area under the curve, which gives an informal validation of the result.

See also



Join the GraphicMaths Newletter

Sign up using this form to receive an email when new content is added:

Popular tags

adder adjacency matrix alu and gate angle area argand diagram binary maths cartesian equation chain rule chord circle cofactor combinations complex modulus complex polygon complex power complex root cosh cosine cosine rule cpu cube decagon demorgans law derivative determinant diagonal directrix dodecagon eigenvalue eigenvector ellipse equilateral triangle euler eulers formula exponent exponential exterior angle first principles flip-flop focus gabriels horn gradient graph hendecagon heptagon hexagon horizontal hyperbola hyperbolic function hyperbolic functions infinity integration by parts integration by substitution interior angle inverse hyperbolic function inverse matrix irrational irregular polygon isosceles trapezium isosceles triangle kite koch curve l system line integral locus maclaurin series major axis matrix matrix algebra mean minor axis nand gate newton raphson method nonagon nor gate normal normal distribution not gate octagon or gate parabola parallelogram parametric equation pentagon perimeter permutations polar coordinates polynomial power probability probability distribution product rule proof pythagoras proof quadrilateral radians radius rectangle regular polygon rhombus root sech set set-reset flip-flop sine sine rule sinh sloping lines solving equations solving triangles square standard curves standard deviation star polygon statistics straight line graphs surface of revolution symmetry tangent tanh transformation transformations trapezium triangle turtle graphics variance vertical volume of revolution xnor gate xor gate