7. Integration by Parts
≪ 6. Trigonometric Substitution | Table of ContentsWhen we learn how to take derivatives, we first learn the derivatives of basic functions (e.g. polynomials, trig functions) before learning how to take derivatives of products of functions (using the product rule) and compositions of functions (using the chain rule). The quotient rule is terrible. It’s a combination of the product and chain rules, and it doesn’t deserve a name.
Our path through integral calculus has been pretty similar so far. We started with the basic integrals (e.g. the power rule and trig functions), which arise from understanding integrals as antiderivatives. Then we learn about \(u\)-substitution, which is the chain rule in reverse. If we want to integrate a complicated looking function \(f(x)\), we look for a function \(u(x)\) such that \(f(x) = g\left( u(x) \right) u’(x)\) for some simpler function \(g\). That way, \[\int f(x) dx = \int g\left( u(x) \right) u’(x) dx = \int g(u) du.\] The trigonometric substitutions we discussed last week are a more sohpisticated way of determining \(u\) (we called it \(\theta \) then) when the substitution is not remotely obvious.
Can we expect a “reverse product rule” for integrals as well? Of course we can, but it’s slightly more involved than doing a \(u\)-substitution, and it’s called integration by parts. If \(u\) and \(v\) are two functions, the product rule tells us that \[\frac{d}{dx} \left( u(x) v(x) \right) = u(x) v’(x) + u’(x) v(x).\] Integrating this all with respect to \(x\), we get \(u(x) v(x)\) back on the left side, and on the right we have \[u(x) v(x) = \int u(x) v’(x) dx + \int v(x) u’(x) dx.\] Writing \(v’(x) = \frac{dv}{dx}\) and \(u’(x) = \frac{du}{dx}\), we get \[uv = \int u\ dv + \int v\ du \implies \int u\ dv = uv - \int v\ du.\] This is the formula for integration by parts.
When trying to integrate a product of two or more functions, we therefore need to decide what \(u\) and \(dv\) should be before applying the formula. Since the \(u\) becomes a \(du\) on the right side and the \(dv\) becomes a \(v\), i.e. we’re differentiating \(u\) and integrating \(v\), we should select \(u\) and \(v\) in a way that makes this as easy as possible.
Repeated Integration by Parts and the Tabular Method
There will invariably be problems where you’ll have to integrate by parts multiple times, and the work of setting up what \(u, v, du, \) and \(dv\) are can get very messy across every application of the formula. Consider, for instance, the example \[\int \left( x^3+4x \right)e^x dx.\] You can certainly get this done in a finite amount of time, but you’ll have to integrate by parts 3 or 4 times, and I’m not ready to lay out all that work. I can tell, however, that I should set \(u = x^3+4x\) and \(dv = e^x dx\), as polynomials only get easier to differentiatie as time goes on.
The tabular method condenses all the work of integration by parts. Create three columns, labeled as \(\frac{d}{dx}\), \(\int\), and \(\pm\) (for differentiation, integration, and sign). Load \(u\), \(v\), and \(+\) into the first row, then
- differentiate down the first column,
- integrate down the first column, and
- alternate signs down the last.
Note here that \(\frac{dv} = e^x dx\) so \(\frac{dv}{dx} = e^x\). We need to integrate this to get \(v =\int e^x dx = e^x\). In this example, our table works out to be:
\[\begin{array}{|c|c|c|} \hline \rule{0pt}{14pt} \frac{d}{dx} & \int & \pm \\[6pt] \hline \rule{0pt}{14pt} x^3 + 4x & e^x & + \\[6pt] 3x^2 + 4 & e^x & - \\[6pt] 6x & e^x & + \\[6pt] 6 & e^x & - \\[6pt] 0 & e^x & + \\[6pt] \hline \end{array} \] You can stop once you reach a zero. To finish the problem, multiply the first two columns together, then add or subtract the rows according to the sign in the third column, starting from the second row. In this case, \[\int \left( x^3 +4x \right)e^x dx = \left( x^3+4x \right)e^x - \left( 3x^2+4 \right)e^x + 6xe^x - 6e^x + C.\] (Don’t forget to tack on the constant of integration.) And wah lah, that’s our answer.
Integrating in Circles
There are some situations wherein you’ll integrate by parts a dozen times and end up in a spot worse than where you started. An example would be
\[\int \sin(2x) e^{3x} dx.\]
To set up our tabular integration by parts again, we may pick \(u = \sin(2x)\) and \(dv = e ^{3x} dx\). Integrating \(v = \int e ^{3x} dx\), we get \(v = \frac{1}{3} e ^{3x}\). So our table will look like:
\[\begin{array}{|c|c|c|}
\hline \rule{0pt}{14pt}
\frac{d}{dx} & \int & \pm \\[6pt]
\hline \rule{0pt}{14pt}
\sin(2x) & \frac{1}{3}e ^{3x} & + \\[6pt]
2\cos(2x) & \frac{1}{9}e ^{3x} & - \\[6pt]
-4\sin(2x) & \frac{1}{27} e ^{3x} & + \\[6pt]
-8\cos(2x) & \frac{1}{81} e ^{3x} & - \\[6pt]
16 \sin(2x) & \frac{1}{243} e ^{3x} & + \\[6pt]
\vdots & \vdots & \vdots \\[6pt]
\hline
\end{array}\]
This will go on, cycling through sines and cosines, while the coefficients just get worse and worse. We’ll never get to a zero and finish the problem.
Instead, we can cut off the integration by parts prematurely when things start to repeat, i.e. at the third row. We’ll still combine the first two rows as before (multiply and add/substract), but when we get to the third row, we’ll instead go diagonally up and to the right and insert an integral sign. Specifically, \[\int sin(2x) e ^{3x} dx = \underbrace{\frac{1}{3}\sin(2x) e ^{3x}}_{\textrm{row 1}} - \underbrace{\frac{2}{9}\cos(2x) e ^{3x}}_{\textrm{row 2}} - \underbrace{\frac 49\int\sin(2x) e ^{3x}dx}_{\textrm{diagonal}} + C.\] We’ve set up an equation involving the same integral on both sides, and we can use algebra to just isolate the integral! \[\begin{align*} \frac{13}{9}\int \sin(2x)e ^{3x}dx &= \frac{1}{3}\sin(2x) e ^{3x} - \frac{2}{9}\cos(2x) e ^{3x} +C \\ \int\sin(2x) e ^{3x} dx &= \frac{3}{13}\sin(2x)e ^{3x} - \frac{2}{13}\cos(2x) e ^{3x} + C. \end{align*}\]
You can always “kill” the tabular integration by parts process after however many rows you want, you just have to put down an integral sign before the last row. We just ignored this step in the first example because our last row was \(0\)!
Another example of when you would want to stop before reaching \(0\) is when integrating something involving natural logarithms. For instance, consider \[\int x^2\ln(x) dx.\] One may be tempted to select \(u = x^2\) and \(dv = \ln(x) dx\), but this is a very poor choice of \(dv\) since it’s hard to integrate. If you know its integral off the top of your head, great, but if you’re mortal like me, it might be better to try \(u = \ln(x)\) and \(dv = x^2 dx\). Now \(v = \frac{1}{3}x^3\), and our table becomes: \[\begin{array}{|c|c|c|} \hline \rule{0pt}{14pt} \frac{d}{dx} & \int & \pm \\[6pt] \hline \rule{0pt}{14pt} \ln(x) & \frac{1}{3}x^3 & + \\[6pt] \frac{1}{x} & \frac{1}{12}x^4 & - \\[6pt] -\frac{1}{x^2} & \frac{1}{60}x^5 & + \\[6pt] \vdots & \vdots & \vdots \\[6pt] \hline \end{array} \]
If we keep going without regard for our own lives, we’re going to get nowhere: neither of the two powers are getting closer to where they need to be. Instead, however, we should realise that terminating the process after one row leaves us with an integral of just a power of \(x\), something we know how to do: \[\begin{align*} \int x^2\ln(x) dx &= \frac{1}{3}x^3 \ln(x) - \int \frac{1}{x}\cdot 3x^3 dx \\ &= \frac{1}{3}x^3 \ln(x) - \frac{1}{3}\int x^2 dx \\ &= \frac{1}{3}x^3 \ln(x) -\frac{1}{9}x^3 +C. \end{align*}\]