Processing math: 100%

Integration by Parts

Integration by parts is another technique for simplifying integrands. As we saw in previous posts, each differentiation rule has a corresponding integration rule. In the case of integration by parts, the corresponding differentiation rule is the Product Rule. The technique of integration by parts allows us to simplify integrands of the form: f(x)g(x)dx

Examples of this form include: xcosx dx,excosx dx,x2ex dx

As integration by parts is the product rule applied to integrals, it helps to state the Product Rule again. The Product Rule is defined as: ddx[f(x)g(x)]=f(x)g(x)+f(x)g(x)

When we apply the product rule to indefinite integrals, we can restate the rule as:

ddx[f(x)g(x)] dx=[fg(x)+f(x)g(x)] dx

Then, rearranging so we get f(x)g(x) dx on the left side of the equation:

f(x)g(x) dx=ddx[f(x)g(x)] dxf(x)g(x) dx

Which gives us the integration by parts formula! The formula is typically written in differential form:

u dv=uvv du

Examples

The following examples walkthrough several problems that can be solved using integration by parts. We also employ the wonderful SymPy package for symbolic computation to confirm our answers. To use SymPy later to verify our answers, we load the modules we will require and initialize several variables for use with the SymPy library.

In [1]:
from sympy import symbols, limit, diff, sin, cos, log, tan, sqrt, init_printing, plot, integrate
from mpmath import ln, e, pi, cosh, sinh

init_printing()
x = symbols('x')
y = symbols('y')

Example 1: Evaluate the integrand xsinx2 dx

Recalling the differential form of the integration by parts formula, u dv=uvv du, we set u=x and dv=sinx2

Solving for the derivative of u, we arrive at du=1 dx=dx. Next, we find the antiderivative of dv. To find this antiderivative, we employ the Substitution Rule.

u=12x,du=12 dx,dudx=2y=sinu,dy=cosu du,dydu=cosu

Therefore, v=2cosx2

Entering these into the integration by parts formula:

2xcosx2(2)cosx2

Then, solving for the integrand cosx2, we employ the Substitution Rule again as before to arrive at 2sinx2 (the steps in solving this integrand are the same as before when we solved for sinx2). Thus, the integral is evaluated as:

2xcosx2+4sinx2+C

Using SymPy's integrate, we can verify our answer is correct (SymPy does not include the constant of integration C).

In [2]:
integrate(x * sin(x / 2), x)
Out[2]:
2xcos(x2)+4sin(x2)

Example 2: Evaluate t2cost dt

We start by setting u=t2 and dv=cost. The derivative of t2 is 2t, thus du=2t dt, or dudt=2t. Integrating dv=cost gives us v=sint du. Entering these into the integration by parts formula:

t2sint2tsint

Therefore, we must do another round of integration by parts to solve tsint.

u=t,du=dt

dv=sint,v=cost du

Putting these together into the integration by parts formula with the above:

t2sint2(tcost+cost dt)

Which gives us the solution:

t2sint+2tcost2sint+C

As before, we can verify that our answer is correct by leveraging SymPy.

In [6]:
t = symbols('t')
integrate(t ** 2 * cos(t), t)
Out[6]:
t2sin(t)+2tcos(t)2sin(t)

Example 3: xex dx

Here, we set u=x and dv=ex. Therefore, du=dx and v=ex dx. Putting these together in the integration by parts formula:

xexex

As the integral of ex is just ex, our answer is:

xexex+C

We can again verify our answer is accurate using SymPy.

In [7]:
integrate(x * e ** x, x)
Out[7]:
2.71828182845905x(1.0x1.0)

References

Related Posts