Integration by Parts

In this worksheet, you will…

  • Review the Integration by Parts formula and its derivation.

  • Practice using Integration by Parts to evaluate integrals, including deciding what to use as $u$ and $dv$.

  • Assess whether to use Integration by Substitution or Integration by Parts.

Integration by Parts: Formula and Derivation

The Integration by Parts Formula is as follows:

$$\int f(x) g’(x) dx = f(x) g(x) - \int f’(x) g(x) dx$$

Alternatively, you may prefer it in terms of variables $u$ and $v$ that are each functions of $x$. In this case, the formula is:

$$ \int u dv = uv - \int vdu$$

The two correspond in that $u=f(x)$ and $dv = g’(x) dx$— feel free to pick whichever notation works best for you! When using this formula, we have a choice to make: given an integral to evaluate, we must pick some part of it to be $f(x)$ and some other part to be $g’(x)$ such that $f(x)\cdot g’(x)$ corresponds to the original integrand. Though $f(x)$ can be just about anything, $g’(x)$ must be a function where we can find its antiderivative (i.e., $\int g’(x) dx$ can be calculated). This may require substitution or other integration methods. From there, we are essentially trading integrating $f(x)g’(x)$ for integrating $f’(x) g’(x)$ (the integral on the right hand side of the equation). In almost every case, we want this new integral $\int f’(x)g(x)dx$ to be an easier/simpler integral than the original one!


Derivation of the Formula:

Integration by Parts, at its heart, stems from the Product Rule for Derivatives. Recall the Product rule is given as follows:

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

By the Fundamental Theorem of Calculus,

$$\int \left[ f’(x)g(x) + f(x)g’(x) \right] dx = \int \frac{d}{dx}\left[ f(x)g(x) \right] dx = f(x)g(x) + C$$

From here, we split up the integral on the left as $\int f’(x)g(x) dx+ \int f(x)g’(x) dx$ and subtract the first term from both sides of the equation, giving us the final IBP formula:

$$\int f(x) g’(x) dx = f(x) g(x) - \int f’(x) g(x) dx \ \ \ (+ C)$$

 

Examples

Click on each example to see a worked out solution. If you have prior experience with IBP, I encourage you to try the examples on your own before reading the solutions!

  • Solution: Before jumping into IBP, let’s pause to see whether any other method would work. First, this certainly isn’t a function we have a known antiderivative for (it’s not the derivative of a more basic function). We could consider using substitution, but doing so requires some form of composition of functions. There’s no function “inside” of another function here, so we can rule out substitution. Since there is a product of functions, IBP does seem like a good candidate.

    We have here two obvious choices for $f(x)$ and $g’(x)$: one could be $x$ and the other could be $\ln(x)$, or vice versa. If we set $g’(x) = \ln (x)$, that would cause trouble as this is hard to evaluate its antiderivative directly! In fact, evaluating $\int \ln(x) dx$ requires IBP, as we will see later on. So, we’re stuck with $f(x) = \ln (x)$ and $g’(x) = x$. We then find $f’(x)$ and $g(x)$ as follows:

    $$\begin{aligned} &\ &g(x) = \frac{x^2}{2} \\ &f(x) = \ln(x), &g’(x) = x \\ &f’(x) = \frac{1}{x} &\ \end{aligned}$$

    This is written in this lopsided fashion to help remember which to differentiate and which to integrate. Starting with the line for $f(x)$ and $g(x)$, we get $f’(x)$ by differentiating, and $g(x)$ by integrating. Moving down a line corresponds to derivatives, while moving up a line corresponds to integrals! Note here that we don’t need the $+C$ for $g(x)$. Now that we have each of these terms, we can plug into the IBP formula:

    $$\int f(x) g’(x) dx = f(x) g(x) - \int f’(x) g(x) dx$$

    $$\int x \ln (x) dx = \ln (x) \frac{x^2}{2} - \int \frac{1}{x} \cdot \frac{x^2}{2} dx$$

    After we apply the IBP formula, we should always check: is this new integral on the right simpler than the original? (At the very least, it should not be more complicated.) In this case, definitely: this last term simplifies to a power of $x$, and so we use the Power Rule to finish up:

    $$= \ln (x) \frac{x^2}{2} - \int \frac{x}{2} dx$$

    $$\boxed {= \ln (x) \frac{x^2}{2} - \frac{x^2}{4} + C }$$

  • Solution: While there is a function within a function here ($3x$ inside $\cos (x)$), the derivative of the inner function ($3x$) does not account for the $x^2$ term. Thus we must proceed via Integration by Parts.

    Attempt 1: Let’s try out $f(x) = \cos (3x)$, $g’(x) = x^2$ to start (since $x^2$ seems easier to integrate). We compute $f’$ and $g$ below:

    $$\begin{aligned} &\ &g(x) = \frac{1}{3} x^3 \\ &f(x) = x^2, &g’(x) = x^2 \\ &f’(x) = -3 \sin(3x) &\ \end{aligned}$$

    Plugging into the IBP formula, we get:

    $$\int x^2 \cos(3x) dx = \frac{1}{3} x^3 \cos (3x) - \int \left( \frac{1}{3}x^3\right) \left( -3 \sin(3x) \right)dx$$

    $$= \frac{1}{3} x^3 \cos (3x) + \int x^3 \sin(3x)dx$$

    While this is technically correct, we’re now left with needing to integrate $\int x^3 \sin(3x)dx$. This seems worse than the original integral! We’d love for the power of $x$ to be decreasing, not increasing. Let’s try again.

    Attempt 2: $f(x) = x^2 $, $g’(x) = \cos (3x)$. Here, finding $g(x)$ will require a $u$-substitution with $u=3x$.

    $$\begin{aligned} &\ &g(x) = \frac{1}{3} \sin (3x) \\ &f(x) = x^2, &g’(x) = \cos (3x) \\ &f’(x) = 2x &\ \end{aligned}$$

    Plugging in and rearranging some constants:

    $$\int x^2 \cos(3x) dx = \frac{1}{3} x^2 \sin (3x) - \frac{2}{3} \int x \sin(3x) dx$$

    This looks more promising: At least the power of $x$ has gone down in the new integral to evaluate. We must perform Integration by Parts one more time, this time with $f(x) = x, g’(x) = \sin(3x)$. I encourage you to try this out on your own. You should obtain:

    $$\int x \sin(3x) dx = - \frac{1}{3}x \cos (3x) - \int \left( -\frac{1}{3} \cos (3x) \right) dx$$

    $$= - \frac{1}{3}x \cos (3x) + \frac{1}{9} \sin (3x) + C$$

    We then plug this result into the equation above to get our final answer (up to some simplification):

    $$\int x^2 \cos(3x) dx = \boxed{ \frac{1}{3} x^2 \sin (3x) - \frac{2}{3} \left( - \frac{1}{3}x \cos (3x) + \frac{1}{9} \sin (3x) \right) + C}$$

  • Solution: Again, we can rule out basic antiderivatives and the substitution rule as first choices due to a lack of functions within functions here. Instead, we can sneakily apply IBP if we say that $\arctan (x) = 1\cdot \arctan(x)$, giving us the product of functions that we need! Since $\arctan(x)$ is what we’re trying to figure out how to integrate, we cannot use it as $g’(x)$, so instead we set $f(x)=\arctan (x), g’(x) = 1$, and proceed as follows:

    $$\begin{aligned} &\ &g(x) = x \\ &f(x) = \arctan(x), &g’(x) = 1 \\ &f’(x) = \frac{1}{1+x^2} &\ \end{aligned}$$

    $$\Rightarrow \int \arctan (x) dx = x \arctan (x) - \int \frac{x}{1+x^2} dx$$

    The last term we can evaluate using the substitution $u = 1+x^2$, giving us the final answer of

    $$\boxed{ x \arctan (x) - \frac{1}{2} \ln |1+x^2| dx + C}$$

    (Since $1+x^2$ is always positive, it would also be perfectly fine to drop the absolute value inside the natural log.)

 

Choosing $f(x)$ and $g’(x)$

It takes practice recognizing what the best choice for $f$ and $g’$ should be— your first choice may not result in a new integral that is easier to evaluate! Here’s a few guidelines I keep in mind:

  • Your choice for $f(x)$ in IBP might be the part that is more difficult to integrate.

  • Likewise, $g’(x)$ should generally be the term that is easier to integrate.

  • $f(x)$ might be the term that becomes simpler after taking its derivative (or at least, doesn’t get more complicated).

These rules generally but don’t always agree. For instance, with $\int x e^x dx$, both $x$ and $e^x$ are straightforward enough to integrate. However, in terms of derivatives, $\frac{d}{dx} (x) = 1$ becomes “simpler” in its derivative, while $\frac{d}{dx} (e^x) = e^x$, does not become simpler at all!

In the problems below, if your first attempt at IBP results in a new integral that is much nastier, try another choice of $f(x)$ and $g’(x)$ to see what happens! If your first choice for IBP works out well, ask yourself: why was this a good choice? What would happen if I made a different choice for $f$ and $g’$?

 

Substitution vs. IBP

To choose between IBP and substitution, it is helpful to look closely at the terms in the general formulas to see the anatomy of each. Recall the Substitution Rule can be written as follows:

$$\int f’(g(x)) g’(x) dx = f(g(x)) + C$$

Let’s examine the terms on the left closely: the Substitution Rule requires a product of terms, where one of the terms is a composition of functions. Moreover, the inner function has to be something where its derivative appears in the integrand (as a product with the other terms, not inside of another function).

Integration by Parts, on the other hand, just requires a product of two functions, one of which can be integrated directly. I’ll admit I have a preference for Substitution, simply because it can be faster with a good choice for substitution. This gives me a general flowchart of questions to ask myself when approaching an integration problem:

  1. Basic Antiderivatives: Does this function have a known antiderivative?

    • If so, use that basic antiderivative!

  2. Do I see a function “within” another function? Does the derivative of the inner function appear elsewhere (possibly multiplied by a constant or missing a constant multiple)?

    • If so, try Integration by Substitution.

  3. Do I see a product of functions? Is one doable to integrate directly?

    • If so, try Integration by Parts.

    • Keep in mind that any function $f(x)$ can be written as $1 \cdot f(x)$, so you can create a product of functions if needed (see Example 3 above).

It’s useful to ask yourself all of these questions before starting on a problem. These will give you ideas on how to proceed if you’re stuck! Assuming there are no execution errors, we have three ways that we could find a new approach: Try substitution (or IBP) if the other didn’t work; try a new $u$ for substitution if your first choice didn’t work; or try a new choice of $f(x)$ and $g’(x)$ if your first choice didn’t work.

Final piece of advice: Be patient, and keep in mind that a failed attempt is a lesson in and of itself! Studies show that an expert problem solver doesn’t necessarily see the correct solution straight away; instead, they take time to canvas all their options before proceeding. If an attempt seems to be leading down a rabbit hole, pause to see what other paths you can try!

 

Practice Problems

  1. Evaluate the following integrals, using the Substitution Rule and/or Integration by Parts:

    • (a) $\int x e^{x^2} dx$

    • (b) $\int x e^x dx$

    • (c) $\int x^3 e^{x^2}dx$

  2. Evaluate the following integrals using Integration by Parts. What should you choose to be $u$ and $dv$ (alternatively, $f(x)$ and $g’(x)$)?

    • (a) $\int (5x+3) \sin(2x) dx$

    • (b) $\int x^2 e^x dx$

    • (c) $\int x^3 \ln x dx$

    • (d) $\int \ln (x) dx$

    • (e) $\int \arcsin (x) dx$

    • (f) $\int e^x \cos (2x) dx$ (Hint: use IBP twice and look very carefully at the resulting expressions.)

  3. Evaluate the following integrals, using Integration by Parts as needed.

    • (a) $\int \frac{\ln (2x) \sin [\ln (2x)] }{x} dx$

    • (b) $\int x^{10} \ln \left( \sqrt{x^3} \right) dx$

    • (c) $\int \sin (2 \ln x ) dx$

    • (d) $\int e^{2x} \sec^2 (e^x) dx$

 

Answers to Practice Problems

    • (a) $\frac{1}{2}e^{x^2} + C$

    • (b) $xe^x - e^x + C$

    • (c) $\frac{1}{2}\left( x^2e^{x^2} - e^{x^2}\right) + C$

    • (a) $\frac{5}{4} \sin (2x) - \frac{5x+3}{2} \cos (2x) + C$

    • (b) $(x^2 -2x+1)e^x + C$

    • (c) $\frac{1}{4}x^4 \ln x - \frac{1}{16} x^4 + C$

    • (d) $x \ln |x| - x + C$

    • (e) $x \arcsin (x) + \sqrt{1-x^2} + C$

    • (a) $-\ln (2x) \cos ( \ln (2x)) + \sin(\ln(2x)) + C$

    • (b) $\frac{3}{2} \left( \frac{1}{11} x^{11} \ln x - \frac{1}{11^2} x^11\right) + C$

    • (c) $\frac{1}{5}x \sin (2 \ln x) - \frac{2}{5} x \cos (2\ln x) + C$

    • (d) $e^x \tan (e^x) -\ln |\sec(e^x)| + C$

Next
Next

Practice: Integration by Substitution