Skip to main content
Mathematics LibreTexts

8.2: Integration by Parts

  • Page ID
    212072
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Integration by parts is an integration method that enables us to find antiderivatives of certain functions for which our previous antidifferentiation methods fail, such as \(\ln(x)\) and \(\arctan(x)\), as well as antiderivatives of certain products of functions, such as \(x^2 \ln(x)\) and \(e^x \sin(x)\). It leads to many of the general integral formulas in Appendix I and (next to \(u\)-substitution) it is one of the most powerful and frequently used of antidifferentiation techniques.

    The Integration by Parts formula for integrals arises from the Product Rule for derivatives. Recall that for functions \(u = u(x)\) and \(v = v(x)\), the Product Rule says:\[\frac{d}{dx}\left[u\cdot v\right] = u\cdot \frac{dv}{dx} + v \cdot \frac{du}{dx}\nonumber\]If we integrate both sides of this equation with respect to \(x\) we get:\[u\cdot v = \int u\cdot \frac{dv}{dx} \, dx + \int v \cdot \frac{du}{dx}\, dx\nonumber\]Solving for the first of the two integrals on the right side, yields:\[\int u\cdot \frac{dv}{dx} \, dx = u\cdot v - \int v \cdot \frac{du}{dx}\, dx\nonumber\]At first, this formula may not appear very promising, as it merely exchanges one integration problem for another. But in certain situations, if we choose \(u(x)\) and \(v(x)\) carefully, this formula exchanges a difficult integral for an easier one. We can restate the formula in slightly more compact form using differentials.

    Integration by Parts Formula

    If: \(u\), \(v\), \(u'\) and \(v'\) are continuous functions,

    then: \(\displaystyle \int{u \, dv} = u\cdot v - \int{v \, du}\)

    For definite integrals, the Integration By Parts Formula says:

    Integration by Parts Formula (Definite Integrals)

    If: \(u\), \(v\), \(u'\) and \(v'\) are continuous functions,

    then: \(\displaystyle \int_a^b{u \, dv} = \bigg[u\cdot v\bigg]_a^b - \int_a^b{v \, du}\)

    Example \(\PageIndex{1}\)

    Use integration by parts to evaluate \(\displaystyle \int{x \cos(x) \, dx}\) and \(\displaystyle \int_0^{\pi}{x \cos(x) \, dx}\) (see figure below for a graphical interpretation).

    Graph of the red curve x times cosine of x for x between 0 and pi, with the region below the curve and above the x-axis shaded yellow and the region below the x-axis and above the curve shaded light purple.

    Solution

    Our first step is to write this integral in the form required by the Integration by Parts formula, \(\int{u \, dv}\). If we let \(u = x\), then we must have \(dv = \cos(x) \, dx\) so that \(u \, dv\) completely represents the integrand \(x \cos(x)\). We also need to calculate \(du\) and \(v\):\[u = x \ \Rightarrow \ du = dx \qquad \mbox{ and } \qquad dv = \cos(x) \, dx \ \Rightarrow \ v = \sin(x)\nonumber\]Putting these pieces into the Integration by Parts formula, we have:\[\int{x \cdot \cos(x) \, dx} \ = \ x \cdot \sin(x) - \int{\sin(x) \, dx} \ = \ x \cdot \sin(x) + \cos(x) + C\nonumber\]Now use this result to evaluate the definite integral:
    \begin{align*}\int_0^{\pi} x \cdot \cos(x) \, dx &= \bigg[x \cdot \sin(x) + \cos(x)\bigg]_0^{\pi} \\
    &= \left[\pi \sin(\pi) + \cos(\pi)\right] - \left[0\cdot \sin(0) + \cos(0)\right] = -1 - 1\end{align*}
    or \(-2\), which appears reasonable based on the area interpretation of this integral in the graph above.

    To check this result, differentiate the answer to verify that:\[\left[x \sin(x) + \cos(x)\right]' = x \cos(x)\nonumber\]

    Integration by parts allowed us to exchange the problem of evaluating \(\displaystyle \int{x \cos(x) \, dx}\) for the much easier problem of evaluating \(\displaystyle \int{\sin(x) \, dx}\).

    Practice \(\PageIndex{1}\)

    Use the Integration by Parts formula on \(\displaystyle \int{x \cos(x) \, dx}\) with \(u = \cos(x)\) and \(dv = x \, dx\). Why does this lead to a poor exchange?

    Answer

    \(u = \cos(x) \Rightarrow du = -\sin(x)\, dx\) and \(dv = x\, dx \Rightarrow v = \frac12 x^2\), so:
    \begin{align*}\int{x \cos(x)\, dx} &= \int{\cos(x) \cdot x\, dx} = \int{u\, dv} = u\cdot v - \int{v\, du} \\
    &= \cos(x)\cdot \frac12 x^2 - \int{\frac12 x^2 \left[-\sin(x)\right] \, dx} \\
    &= \frac12 x^2\cos(x) + \int{\frac12 x^2 \sin(x) \, dx}\end{align*}
    resulting in a new integral worse than the original integral.

    Example \(\PageIndex{2}\)

    Evaluate \(\displaystyle \int{x e^{3x} \, dx}\) and \(\displaystyle \int_0^1{x e^{3x} \, dx}\).

    Solution

    The integrand is a product of two functions, so it is reasonable to use integration by parts to search for an antiderivative. If \(u = x \ \Rightarrow du = dx\), then \(dv = e^{3x}\, dx \ \Rightarrow \ v = \frac13 e^{3x}\). Inserting these expressions into the Integration by Parts formula, we get:
    \begin{align*}\int{x e^{3x}\, dx} &= x\cdot \frac13 e^{3x} - \int{\frac13 e^{3x}\, dx} = \frac{x}{3}e^{3x} - \frac19 e^{3x} + C\\
    \Rightarrow \int_0^1{x e^{3x}\, dx} &= \left[\frac{x}{3} e^{3x} - \frac19 e^{3x}\right]_0^1 = \left[\frac13 e^3 - \frac19 e^3\right] - \left[0 - \frac19\right] = \frac29 e^3 + \frac19
    \end{align*}
    or about \(4.57\).

    Note

    In practice, when you need to use integration by parts to evaluate a definite integral, it is often safest to first evaluate the corresponding indefinite integral and then use that antiderivative pattern to evaluate the definite integral, as we have done here.

    In the previous Example another valid choice would have been \(u = e^{3x}\) and \(dv = x\, dx\), but that choice results in an integral that is more difficult than the original one: \(du = 3e^{3x}\, dx\) and \(v = \frac12 x^2\), so the Integration by Parts formula yields:\[\int{x e^{3x}\, dx} = e^{3x}\cdot \frac12 x^2 - \int{\frac12 x^2 \cdot 3 e^{3x}\, dx}\nonumber\]which exchanges \(\int{x e^{3x}\, dx}\) for the more difficult integral \(\int{\frac32 x^2 e^{3x}\, dx}\).

    Practice \(\PageIndex{2}\)

    Evaluate \(\displaystyle \int{x \sin(x)\, dx}\) and \(\displaystyle \int{x e^{5x}\, dx}\).

    Answer

    With \(u = x\), \(dv = \sin(x)\, dx\) so \(du = dx\) and \(v = -\cos(x)\):
    \begin{align*}\int{x \sin(x)\, dx} &= \int{u\, dv} = u\cdot v - \int{v\, du} \\
    &= x\cdot\left(-\cos(x)\right) - \int{\left[-\cos(x)\right] \, dx} \\
    &= -x\cos(x) + \int{\cos(x) \, dx} = -x\cos(x) + \sin(x) + C\end{align*}
    <li> With \(u = x\), \(dv = e^{5x}\, dx\) so \(du = dx\) and \(v = \frac15 e^{5x}\):
    \begin{align*}\int{x e^{5x}\, dx} &= \int{u\, dv} = u\cdot v - \int{v\, du} \\
    &= x\cdot \frac15 e^{5x} - \int{\frac15 e^{5x} \, dx} = \frac15 x e^{5x} - \frac{1}{25} e^{5x} + C\end{align*}

    Once you have chosen \(u\) and \(dv\) to represent the integrand as \(u\, dv\), you need to calculate \(du\) and \(v\). The \(du\) calculation is usually easy, but finding \(v\) from \(dv\) can be difficult for some choices of \(dv\). In practice, you need to select \(u\) so that the remaining \(dv\) is simple enough that you can find \(v\), the antiderivative of \(dv\).

    Example \(\PageIndex{3}\)

    Evaluate \(\displaystyle \int{2x \ln(x)\, dx}\).

    Solution

    The choice \(u = 2x\) seems fine until we get a little further into the process. If \(u = 2x\), then \(dv = \ln(x)\, dx\). We now need to find \(du\) and \(v\). Computing \(du = 2\, dx\) is simple, but then we face the difficult problem of finding an antiderivative \(v\) for our choice \(dv = \ln(x)\, dx\).

    The choice \(u = \ln(x)\) results in easier calculations. Let \(u = \ln(x)\). Then \(dv = 2x\, dx\), so \(du = \frac{1}{x}\, dx\) and \(v = x^2\). Then the Integration by Parts formula gives:\[\int{2x \ln(x)\, dx} = \ln(x) \cdot x^2 - \int{x^2 \cdot \frac{1}{x}\, dx} = x^2 \ln(x) - \int{x\, dx}\nonumber\]so the final result is \(\displaystyle x^2 \ln(x) - \frac12 x^2 + C\).

    If you cannot find a \(v\) for your original choice of \(dv\), try a different \(u\) and \(dv\).

    Antiderivatives of Inverse Functions

    So far we have applied the Integration by Parts method to products of simple functions, but it also enables us — perhaps surprisingly — to find antiderivatives of the inverse trigonometric functions and of the logarithm (the inverse exponential function).

    Example \(\PageIndex{4}\)

    Evaluate \(\displaystyle \int{\arctan(x)\, dx}\).

    Solution

    Let \(u = \arctan(x)\). Then \(dv = dx\), so \(\displaystyle du = \frac{1}{1 + x^2}\, dx\) and \(v = x\). Putting these expressions into the Integration by Parts formula:\[\int{\arctan(x)\, dx} = x \arctan(x) - \int{x \cdot \frac{1}{1 + x^2}\, dx}\nonumber\]We can evaluate the new integral using the substitution \(w = 1 + x^2 \Rightarrow dw = 2x\, dx \Rightarrow \frac12 \, dw = x\, dx\):\[\int{x \cdot \frac{1}{1 + x^2}\, dx} = \int{\frac12 \cdot\frac{1}{w}\, dw} = \frac12 \ln\left(\left|w\right|\right) + K \ = \ \frac12 \ln\left(1 + x^2\right) + K\nonumber\]Combining these results:\[\int{\arctan(x)\, dx} = x \arctan(x) - \frac12\ln\left(1 + x^2\right) + C\nonumber\](why are absolute value signs not needed in the last term?) or\[ x \arctan(x) - \ln\left(\sqrt{1 + x^2}\right) + C \]

    We can now include the antiderivative of \(\arctan(x)\) in our list of antiderivatives in Appendix I.

    Practice \(\PageIndex{3}\)

    Evaluate \(\displaystyle \int{\ln(x)\, dx}\) and \(\displaystyle \int_1^e{\ln(x)\, dx}\).

    Answer

    Let \(u = \ln(x)\) and \(dv = dx\) so that \(du = \frac{1}{x}\, dx\) and \(v = x\):
    \begin{align*}\int{\ln{x}\, dx} &= \int{u\, dv} = u\cdot v - \int{v\, du} \\
    &= \ln(x)\cdot x - \int{x\cdot \frac{1}{x} \, dx} = x\ln(x) - \int{1 \, dx} = x\ln(x) - x + C\end{align*}
    Using this result:\[\int_1^e{\ln{x}\, dx} = \left[x\ln(x) - x\right]_1^e = \left[e\ln(e) - e\right]-\left[1\ln(1) - 1\right] = 1\nonumber\]

    Note the following about the Integration by Parts formula:

    • Once you choose \(u\), then \(dv\) is completely determined: \(dv\) = rest of the integrand
    • Because you need to find an antiderivative of \(dv\) to get \(v\), pick \(u\) and \(dv\) with this in mind.
    • Integration by parts allows you to trade one integral for another. If the new integral is more difficult than the original integral, then you have made a poor choice of \(u\) and \(dv\). Try a different choice for \(u\) and \(dv\) (or try a different technique).
    • To evaluate the new integral \(\int{v\, du}\) you may need to use substitution, integration by parts again, or some other technique (such as the ones discussed later in this chapter).

    General Patterns

    Sometimes a single application of integration by parts yields a formula that allows us to integrate an entire family of functions.

    Example \(\PageIndex{5}\)

    Evaluate \(\displaystyle \int{x^p \ln(x)\, dx}\) for any number \(p \ne -1\).

    Solution

    Set \(u = \ln(x)\) so \(dv = x^p\, dx\), \(du = \frac{1}{x}\, dx\) and \(v = \frac{1}{p+1} x^{p+1}\). Putting all of this into the Integration by Parts formula:\[\int{x^p \ln(x)\, dx} = \frac{1}{p+1} x^{p+1} \cdot \ln(x) - \int{\frac{1}{p+1} x^{p+1} \cdot \frac{1}{x}\, dx}\nonumber\]This new integral becomes:\[\frac{1}{p+1} \int{x^p \, dx} = \frac{1}{p+1} \cdot \frac{1}{p+1} x^{p+1} + K = \frac{x^{p+1}}{(p+1)^2} + K\nonumber\]Combining these results yields:\[\frac{x^{p+1}}{p+1} \ln(x) - \frac{x^{p+1}}{(p+1)^2} + C = \frac{x^{p+1}}{p+1} \left[\ln(x) - \frac{1}{p+1}\right] + C\nonumber\]for any number \(p\) as long as \(p \neq -1\).

    What happens when \(p=-1\)? Can you evaluate that integral?

    Practice \(\PageIndex{4}\)

    Use Example 5 to evaluate \(\displaystyle \int{x^2 \ln(x)\, dx}\) and \(\displaystyle \int{\ln(x)\, dx}\).

    Answer

    With \(n=2\): \(\displaystyle \int x^2 \ln(x)\, dx = \frac{x^3}{3}\left[ \ln(x) - \frac13\right] +C\)

    With \(n=0\): \(\displaystyle \int \ln(x)\, dx = \frac{x^1}{1}\left[ \ln(x) - \frac11\right] +C = x\ln(x) - x + C\)

    Reduction Formulas

    Sometimes the result of an integration-by-parts procedure still contains an integral, but a simpler one with a smaller exponent. In these situations we can reuse the resulting reduction formula until the remaining integral is simple enough to integrate completely.

    Example \(\PageIndex{6}\)

    Evaluate \(\displaystyle \int{x^n e^x\, dx}\) and use the result to evaluate \(\displaystyle \int{x^2 e^x\, dx}\).

    Solution

    Set \(u = x^n\) so \(dv = e^x\, dx\), \(du = n x^{n-1}\, dx\) and \(v = e^x\). The Integration by Parts formula gives:\[\int{x^n e^x \, dx} \ = \ x^n e^x - n \int{ x^{n-1} e^x\, dx}\nonumber\]which is a reduction formula because we have reduced the power of \(x\) by \(1\), trading \(\displaystyle \int{x^n e^x\, dx}\) for the ``reduced'' integral \(\displaystyle \int{x^{n-1} e^x\, dx}\).

    Because \(\displaystyle \int{x^2 e^x\, dx}\) matches the general pattern of \(\displaystyle \int{x^n e^x\, dx}\) with \(n = 2\), we know that:\[\int{x^2 e^x\, dx} = x^2 e^x - 2\int{x^1 e^x\, dx}\nonumber\]The new integral also matches the pattern in the reduction formula (with \(n=1\) this time) so we know that:\[\int{x^1 e^x\, dx}= x^1 e^x - 1\cdot \int{x^0 e^x\, dx}\nonumber\]This last integral is just \(\displaystyle \int{e^x\, dx} = e^x + K\), so combining our results:
    \begin{align*}\int{x^2 e^x\, dx} &= x^2 e^x - 2\int{x^1 e^x\, dx} = x^2 e^x - 2\left[x e^x - \int{e^x\, dx}\right] \\
    &= x^2 e^x - 2x e^x + 2e^x + C\end{align*}
    We can also write the answer as \(e^x\left[x^2-2x+2\right]+C\).

    Practice \(\PageIndex{5}\)

    Develop the reduction formula:\[\int{x^n \sin(x)\, dx} \ = \ -x^n \cos(x) + n \int{x^{n-1}\cos(x)\, dx}\nonumber\]using integration by parts.

    Answer

    Set \(u = x^n\) and \(dv = \sin(x)\, dx\) so \(du = n x^{n-1}\, dx\) and \(v = -\cos(x)\):
    \begin{align*}\int{x^n \sin(x)\, dx} &= \int{u\, dv} = uv - \int{v\, du} \\
    &= -x^n \cos(x) - \int{\left[-\cos(x)\right]\cdot n x^{n-1}\, dx} \\
    &= -x^n \cos(x) + n \int{x^{n-1}\cos(x)\, dx}\end{align*}

    The Reappearing Integral

    Sometimes the integral we are trying to evaluate shows up on both sides of the equation during our calculations in such a way that we can solve for the desired integral algebraically.

    Example \(\PageIndex{7}\)

    Evaluate \(\displaystyle \int{e^x \cos(x)\, dx}\).

    Solution

    Let \(u = e^x\), so \(dv = \cos(x)\, dx\), \(du = e^x\, dx\) and \(v = \sin(x)\):\[\int{e^x \cos(x)\, dx} \ = \ e^x \sin(x) - \int{e^x \sin(x)\, dx}\nonumber\]The new integral does not look any easier than the original one, but it doesnt look any worse, so lets try to evaluate the new integral using integration by parts again. To evaluate \(\int{e^x \sin(x)\, dx}\), let \(u = e^x\) and \(dv = \sin(x)\, dx\) so that \(du = e^x\, dx\) and \(v = -\cos(x)\), giving us:\[\int{e^x \sin(x)\, dx} \ = \ -e^x \cos(x) + \int{e^x \cos(x)\, dx}\nonumber\]Putting this result back into the original problem, we get:
    \begin{align*}\int{e^x \cos(x)\, dx} \ &= \ e^x \sin(x) - \int{e^x \sin(x)\, dx} \\
    &= \ e^x \sin(x) - \left[-e^x \cos(x) + \int{e^x \cos(x)\, dx}\right] \\
    &= \ e^x \sin(x) + e^x \cos(x) - \int{e^x \cos(x)\, dx}
    \end{align*}
    Note that \(\displaystyle \int{e^x \cos(x)\, dx}\) appears on both sides of this last equation, so we can solve for that expression algebraically:\[2 \int{e^x \cos(x)\, dx} \ = \ e^x \sin(x) + e^x \cos(x) + K\nonumber\](we need an arbitrary constant on the right side of this equation because the left side is an indefinite integral) and, finally, divide both sides by \(2\) to get:\[\int{e^x \cos(x)\, dx} \ = \ \frac12 \left[e^x \sin(x) + e^x \cos(x)\right] + C\nonumber\]\(\displaystyle C = \frac{K}{2}\) which we can also write as \(\frac12 e^x \left[\sin(x) + \cos(x)\right] + C\).

    Practice \(\PageIndex{6}\)

    Evaluate \(\displaystyle \int{e^x \sin(x)\, dx}\).

    Answer

    Proceeding as in Example 7, set \(u = e^x\) so that \(dv = \sin(x)\, dx\). Then \(du = e^x \, dx\) and \(v = -\cos(x)\, dx\), yielding:
    \begin{align*}\int{e^x \sin(x)\, dx} &= \int{u\, dv} = uv - \int{v \, du} \\
    &= e^x\cdot \left(-\cos(x)\right) -\int{\left(-\cos(x)\right)\cdot e^x \,dx} \\
    &= -e^x \cos(x) + \int{e^x \cos(x)\, dx}\end{align*}
    For this new integral, set \(u = e^x\) so that \(dv = \cos(x)\, dx\). Then \(du = e^x \, dx\) and \(v = \sin(x)\, dx\), yielding:\[\int{e^x \cos(x)\, dx} = \int{u\, dv} = uv - \int{v \, du} = e^x \sin(x) - \int{e^x \sin(x)\, dx}\nonumber\]Combining these results we get:
    \begin{align*}\int{e^x \sin(x)\, dx} &= -e^x \cos(x) + \int{e^x \cos(x)\, dx} \\
    &= -e^x \cos(x) + e^x \sin(x) - \int{e^x \sin(x)\, dx}\end{align*}
    and solving for the integral we started with yields:\[2\int{e^x \sin(x)\, dx} = -e^x \cos(x) + e^x \sin(x) + K\nonumber\]so that:\[\int{e^x \sin(x)\, dx} = \frac12\left[-e^x \cos(x) + e^x \sin(x)\right] + C\nonumber\]

    A Useful Shortcut

    Repeated application of integration by parts, as in Example 6, can quickly become tedious, even with the aid of a reduction formula. For integrals of the form \(\displaystyle \int x^n \cdot f(x)\, dx\) where \(n\) is an integer, it is often possible to arrange the integration-by-parts ingredients in a table to allow much speedier computation.

    Example \(\PageIndex{8}\)

    Evaluate \(\displaystyle \int{x^2 e^{3x}\, dx}\).

    Solution

    Make a table with two columns (see below). In the second entry of the left column, start with \(u = x^2\) and below it list the successive derivatives of \(x^2\): \(2x\), \(2\) and \(0\) (you can stop when you get to \(0\)). In the right column start with \(v' = e^{3x}\) and below it list successive antiderivatives of \(e^{3x}\): \(\frac13 e^{3x}\), \(\frac19 e^{3x}\) and \(\frac{1}{27}e^{3x}\).

        \(e^{3x}\) \(= \ v'\)
    \(u \ =\) \(x^2\) \(\frac13e^{3x}\) \((+)\)
      \(2x\) \(\frac19e^{3x}\) \((-)\)
      \(2\) \(\frac{1}{27}e^{3x}\) \((+)\)
      \(0\) \(\frac{1}{81}e^{3x}\) \((-)\)

    Now multiply the functions in each row and add the results, alternating signs:\[x^2\cdot \frac13 e^{3x} - 2x\cdot \frac19 e^{3x} + 2 \cdot \frac{1}{27}e^{3x} - 0 \cdot \frac{1}{81}e^{3x}\nonumber\]We can stop here, because all of the remaining terms will be \(0\). Now add a constant and you have the result: \(\frac13 x^2 e^{3x} - \frac29 x e^{3x} + \frac{2}{27}e^{3x} + C\).

    This shortcut method only works when the chosen \(u\) in the initial integration-by-parts setup is \(x^n\) (so that taking several derivatives results in \(0\)) and when the chosen \(dv\) is a function like \(e^{ax}\) or \(\sin(bx)\) so that repeated antidifferentiation is fairly easy. But when this shortcut does apply, it can save you a great deal of time. (Apply this new technique to the second integral in Example 6 to verify that you get the same result with the new method. Which method is faster?)

    Practice \(\PageIndex{7}\)

    Evaluate \(\displaystyle \int{x^5 \cos(x)\, dx}\) and \(\displaystyle \int{x^3 e^{-2x}\, dx}\).

    Answer

    For the first integral, let \(u = x^5\) and take derivatives until you get \(0\):\[x^5 \longrightarrow 5x^4 \longrightarrow 20x^3 \longrightarrow 60x^2 \longrightarrow 120x \longrightarrow 120 \longrightarrow 0\nonumber\]Put these in the left column of the table below Then set \(v' = \cos(x)\) and start taking antiderivatives:\[\cos(x) \longrightarrow \sin(x) \longrightarrow -\cos(x) \longrightarrow -\sin(x) \longrightarrow \cos(x)\nonumber\]and put these in the right column of the table below:

        \(\cos(x)\) \(= \ v'\)
    \(u \ =\) \(x^5\) \(\sin(x)\) \((+)\)
      \(5x^4\) \(-\cos(x)\) \((-)\)
      \(20x^3\) \(-\sin(x)\) \((+)\)
      \(60x^2\) \(\cos(x)\) \((-)\)
      \(120x\) \(\sin(x)\) \((+)\)
      \(120\) \(-\cos(x)\) \((-)\)
      \(0\) \(-\sin(x)\) \((+)\)

    Now multiply the entries in each and add, using alternating signs:
    \begin{align*}\int x^5 \cos(x)\, dx = &x^5\sin(x) - 5x^4\left[-\cos(x)\right] + 20x^3\left[-\sin(x)\right]\\
    &-60x^2\cos(x)+120x\sin(x)-120\left[-\cos(x)\right]+C\end{align*}
    which we can rewrite as:\[\left[x^5-20x^3+120x\right]\sin(x) + \left[5x^4-60x^2+120\right]\cos(x) + C\nonumber\]Using the same method with the second integral yields:\[x^3 \left[-\frac12 e^{-2x}\right] - 3x^2 \left[\frac14 e^{-2x}\right] + 6x\left[-\frac18 e^{-2x}\right] - 6\left[\frac{1}{16}e^{-2x}\right] + C\nonumber\]so \(\displaystyle \int x^3e^{-2x} \, dx = -e^{-2x}\left[\frac12 x^3 + \frac34 x^2 + \frac34 x +\frac38\right] + C\).

    Problems

    Problems 1–6 list one part (\(u\) or \(dv\)) needed for integration by parts. Find the other part (\(dv\) or \(u\)), calculate \(du\) and \(v\), and apply the Integration by Parts formula to evaluate the integral.

    1. \(\displaystyle \int{12x \ln(x)\, dx}, \quad u = \ln(x)\)
    2. \(\displaystyle \int{x e^{-x}\, dx}, \quad u = x\)
    3. \(\displaystyle \int{x^4 \ln(x)\, dx}, \quad dv = x^4\, dx\)
    4. \(\displaystyle \int{x \sec^2(3x)\, dx}, \quad u = x\)
    5. \(\displaystyle \int{x \arctan(x)\, dx}, \quad dv = x\, dx\)
    6. \(\displaystyle \int{x (5x+1)^{19}\, dx}, \quad u = x\)

    In Problems 7–24, evaluate the integral.

    1. \(\displaystyle \int_0^1{\frac{x}{e^{3x}}\, dx}\)
    2. \(\displaystyle \int_0^1{10x e^{3x}\, dx}\)
    3. \(\displaystyle \int{x \sec(x) \tan(x)\, dx}\)
    4. \(\displaystyle \int_0^{\pi}{5x \sin(2x)\, dx}\)
    5. \(\displaystyle \int_{\frac{\pi}{3}}^{\frac{\pi}{2}}{7x \cos(3x)\, dx}\)
    6. \(\displaystyle \int{6x \sin(x^2+1)\, dx}\)
    7. \(\displaystyle \int{12x \cos(3x^2)\, dx}\)
    8. \(\displaystyle \int{x^2 \cos(x)\, dx}\)
    9. \(\displaystyle \int_1^3{\ln(2x+5)\, dx}\)
    10. \(\displaystyle \int{x^3 \ln(5x)\, dx}\)
    11. \(\displaystyle \int_1^e{\left(\ln(x)\right)^2\, dx}\)
    12. \(\displaystyle \int_1^e{\sqrt{x} \ln(x)\, dx}\)
    13. \(\displaystyle \int{\arcsin(x)\, dx}\)
    14. \(\displaystyle \int{x^2 e^{5x}\, dx}\)
    15. \(\displaystyle \int{x \arctan(3x)\, dx}\)
    16. \(\displaystyle \int{x \ln(x+1)\, dx}\)
    17. \(\displaystyle \int_1^2{\frac{\ln(x)}{x}\, dx}\)
    18. \(\displaystyle \int_1^2{\frac{\ln(x)}{x^2}\, dx}\)
    19. Write \(\sin^n(x) = \sin^{n-1}(x)\cdot\sin(x)\) and use integration by parts to obtain the following reduction formula for \(\displaystyle \int \sin^n(x)\, dx\):\[\frac{1}{n}\left[ -\sin^{n-1}(x) \cos(x) + (n-1) \int{\sin^{n-2}(x)\, dx} \right]\nonumber\]
    20. Write \(\cos^n(x) = \cos^{n-1}(x)\cdot\cos(x)\) and use integration by parts to obtain the following reduction formula for \(\displaystyle \int \cos^n(x)\, dx\):\[\frac{1}{n}\left[ \cos^{n-1}(x) \sin(x) + (n-1) \int{\cos^{n-2}(x)\, dx} \right]\nonumber\]
    21. Use integration by parts to obtain a reduction formula for \(\displaystyle \int \sec^n(x)\, dx\).
    22. Use integration by parts to obtain a reduction formula for \(\displaystyle \int \tan^n(x)\, dx\).

    In Problems 29–40, use a result from Problems 25–28 to evaluate the integral.

    1. \(\displaystyle \int{\sin^3(x)\, dx}\)
    2. \(\displaystyle \int{\sin^4(x)\, dx}\)
    3. \(\displaystyle \int{\sin^5(x)\, dx}\)
    4. \(\displaystyle \int{\cos^3(x)\, dx}\)
    5. \(\displaystyle \int{\cos^4(x)\, dx}\)
    6. \(\displaystyle \int{\cos^5(x)\, dx}\)
    7. \(\displaystyle \int{\sec^3(x)\, dx}\)
    8. \(\displaystyle \int{\sec^4(x)\, dx}\)
    9. \(\displaystyle \int{\sec^5(x)\, dx}\)
    10. \(\displaystyle \int{\sin^3(5x-2)\, dx}\)
    11. \(\displaystyle \int{\cos^3(2x+3)\, dx}\)
    12. \(\displaystyle \int{\sec^3(7x-1)\, dx}\)

    In Problems 41–44, obtain a reduction formula using integration by parts.

    1. \(\displaystyle \int{x^n e^{ax} \, dx}\)
    2. \(\displaystyle \int{x^n \sin(ax) \, dx}\)
    3. \(\displaystyle \int{x \left(\ln(x) \right)^n \, dx}\)
    4. \(\displaystyle \int{x^n \cos(ax) \, dx}\)
    5. The integral \(\displaystyle \int{x (2x + 5)^{19}\, dx}\) can be evaluated with integration by parts or by substitution.
      1. Evaluate the integral using integration by parts with \(u = x\) and \(dv = (2x + 5)^{19}\, dx\).
      2. Evaluate the integral using a change of variable with \(w = 2x + 5\).
      3. Which method is easier?
    6. The integral \(\displaystyle \int{\frac{x}{\sqrt{1+x}}\, dx}\) can be evaluated with integration by parts or by substitution.
      1. Evaluate the integral using integration by parts with \(u = x\) and \(dv = \frac{1}{\sqrt{1+x}}\, dx\).
      2. Evaluate the integral using a change of variable with \(w = 1+x\).
      3. Which method is easier?

    In Problems 47–68, evaluate the integral using any appropriate method.

    1. \(\displaystyle \int{x \left(\ln(x)\right)^2\, dx}\)
    2. \(\displaystyle \int{x^2 \arctan(x)\, dx}\)
    3. \(\displaystyle \int_0^1{e^{-x} \sin(x)\, dx}\)
    4. \(\displaystyle \int_0^1{\frac{\cos(x)}{e^x}\, dx}\)
    5. \(\displaystyle \int{\sin\left(\ln(x)\right)\, dx}\)
    6. \(\displaystyle \int{\cos\left(\ln(x)\right)\, dx}\)
    7. \(\displaystyle \int{\cos\left(\sqrt{x}\right)\, dx}\)
    8. \(\displaystyle \int{\sin\left(\sqrt{x}\right)\, dx}\)
    9. \(\displaystyle \int{e^{3x} \sin(x)\, dx}\)
    10. \(\displaystyle \int{e^x \cos(3x)\, dx}\)
    11. \(\displaystyle\int_0^{\infty}{x e^{-x}\, dx}\)
    12. \(\displaystyle\int_0^{\infty}{x^2 e^{-3x}\, dx}\)
    13. \(\displaystyle\int_0^{\infty}{e^{-x}\sin(x)\, dx}\)
    14. \(\displaystyle\int_0^{\infty}{e^{-2x}\cos(3x)\, dx}\)
    15. \(\displaystyle\int {x\sqrt{x+1}\, dx}\)
    16. \(\displaystyle\int {x\sqrt{x^2+1}\, dx}\)
    17. \(\displaystyle\int {x\cos(x^2)\, dx}\)
    18. \(\displaystyle\int {x^2\sqrt{x^3+1}\, dx}\)
    19. \(\displaystyle\int {x^2\cos(x)\, dx}\)
    20. \(\displaystyle\int {x^3\sqrt{x^2+1}\, dx}\)
    21. \(\displaystyle\int {x^3\sqrt[3]{x^2+1}\, dx}\)
    22. \(\displaystyle\int {x^2\sin(x)\, dx}\)

    In Problems 69–72, solve the initial value problem.

    1. \(\displaystyle y' = x\sin(x)\), \(y(0) = 0\)
    2. \(\displaystyle y' = xe^{7x}\), \(y(0) = 1\)
    3. \(\displaystyle y' = \frac{x}{e^{x+y}}\), \(y(0) = 1\)
    4. \(\displaystyle y' = x\sin(x)\cos^2(y)\), \(y(0) = \frac{\pi}{4}\)
    5. Consider \(\displaystyle \int_0^1{x \sin(x)\, dx}\) and \(\displaystyle \int_0^1{\sin(x)\, dx}\).
      1. Before evaluating the integrals, which do you think is larger? Why?
      2. Evaluate both integrals. Was your prediction in part (a) correct?
    6. Consider \(\displaystyle \int_0^{\pi}{x \sin(x)\, dx}\) and \(\displaystyle \int_0^{\pi}{\sin(x)\, dx}\).
      1. Before evaluating the integrals, which do you think is larger? Why?
      2. Evaluate both integrals. Was your prediction in part (a) correct?
    7. The figure below shows two regions, \(A\) and \(B\):
      Blue graph of y = ln(x) or x = e^y for x between 1 and e, and y between 0 and 1. The region A to the right of the curve is shaded yellow and the region B to the left is shaded pink. Circles indicate the curve and the regions are being roated about the x-axis.
      The volume swept out when region \(A\) is revolved about the \(x\)-axis is (using the disk method):\[\int_{x=1}^{x=e}{\pi \left(\ln(x)\right)^2\, dx}\nonumber\]and the volume swept out when region \(B\) is revolved about the \(x\)-xis is (using the tube method):\[\int_{y=0}^{y=1}{2\pi y e^y\, dy}\nonumber\]
      1. Before evaluating the integrals, which do you think is larger? Why?
      2. Evaluate both integrals. Was your prediction in part (a) correct?
    8. Refer to regions \(A\) and \(B\) from Problem 75.
      1. Compute the volume of the solid generated when \(A\) is revolved around the \(y\)-axis.
      2. Compute the volume of the solid generated when \(B\) is revolved around the \(y\)-axis.
    9. Calculate the volume swept out when the region between the \(x\)-axis and the graph of \(y = \sin(x)\) for \(0 \leq x \leq \pi\) is rotated about the \(y\)-axis.
    10. Calculate the volume swept out when the region between the \(x\)-axis and the graph of \(y = \cos(x)\) for \(0 \leq x \leq \frac{\pi}{2}\) is rotated about the \(y\)-axis.
    11. Calculate the volume swept out when the region between the \(x\)-axis and the graph of \(y = x\sin(x)\) for \(0 \leq x \leq \pi\) is rotated about the \(y\)-axis.
    12. Calculate the volume swept out when the region between the \(x\)-axis and the graph of \(y = x\cos(x)\) for \(0 \leq x \leq \frac{\pi}{2}\) is rotated about the \(y\)-axis.
    13. Determine if the area of the region between the graph of \(y = xe^{-x}\) and the positive \(x\)-axis is finite. (If so, compute the area.)
    14. Determine if the area of the region between the graph of \(y = x^2e^{-x}\) and the positive \(x\)-axis is finite. (If so, compute the area.)
    15. Determine if the volume of the solid obtained by revolving the region between the graph of \(y = xe^{-x}\) and the positive \(x\)-axis about the \(x\)-axis is finite. (If so, compute the volume.)
    16. Determine if the volume of the solid obtained by revolving the region between the graph of \(y = x^2e^{-x}\) and the positive \(x\)-axis about the \(x\)-axis is finite. (If so, compute the volume.)
    17. Determine if the volume of the solid obtained by revolving the region between the graph of \(y = xe^{-x}\) and the positive \(x\)-axis about the \(y\)-axis is finite. (If so, compute the volume.)
    18. Determine if the volume of the solid obtained by revolving the region between the graph of \(y = x^2e^{-x}\) and the positive \(x\)-axis about the \(y\)-axis is finite. (If so, compute the volume.)
    19. We obtained the Integration by Parts formula analytically, starting with the Product Rule, but the formula also has a geometric interpretation. In the figure below, let \(D\) be the large rectangle formed by the regions \(A\), \(B\) and \(C\):
      Two rectangles in the first quadrant of the uv-plane, one (labeled A) with upper-right corner at (u_1,v_1), the other with upper-right corner at (u_2,v_2), with a red curve passing through these points. The region B above A and to the left of the curve is shaded yellow, the region C to the right of A and below the red curve is shaded light purple.
      so that:\[(\mbox{area of }C) = (\mbox{area of }D) -(\mbox{area of }A) - (\mbox{area of }B)\nonumber\]
      1. Represent the area of the large rectangle \(D\) as a function of \(u_2\) and \(v_2\).
      2. Represent the area of the small rectangle \(A\) as a function of \(u_1\) and \(v_1\).
      3. Represent the area of region \(C\) as an integral with respect to the variable \(u\).
      4. Represent the area of region \(B\) as an integral with respect to the variable \(v\).
      5. Rewrite the area equation using the results of parts (a)–(d). This should look familiar.
    20. Suppose \(f\) and \(f'\) are continuous and bounded on the interval \([0, 2\pi]\), meaning that \(\left|f(x)\right| < M\) and \(\left|f'(x)\right| < M\) when \(0 \leq x \leq 2\pi\). The \(n\)-th Fourier Sine Coefficient of \(f\) is defined as:\[S_n = \int_0^{2\pi}{f(x) \sin(nx)\, dx}\nonumber\]
      1. Use the Integration By Parts Formula with \(u = f(x)\) and \(dv = \sin(nx)\, dx\) to represent the formula for \(S_n\) in a different way.
      2. Use the new representation of \(S_n\) from part (a) to determine what happens to the values of \(S_n\) when \(n\) is very large (\(n \rightarrow \infty\)). (Hint: \(\left| f'(x) \cos(nx) \right| = \left| f'(x)\right|\cdot\left|\cos(nx)\right| < M\cdot 1\).)
      3. What happens to the \(n\)-th Fourier Cosine Coefficients \(\displaystyle C_n = \int_0^{2\pi}{f(x) \cos(nx)\, dx}\) as \(n \rightarrow \infty\)?

    This page titled 8.2: Integration by Parts is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Dale Hoffman, edited & updated by Jeff Eldridge .

    • Was this article helpful?