Integration By Parts, Definite Integrals

Integration By Parts: Definite Integrals

Integration by Parts is a powerful technique for evaluating integrals of products. For definite integrals, the formula becomes:

$ \displaystyle \int_{a}^{b} u\,dv \;=\; \bigl[u\,v\bigr]_{a}^{b} \;-\; \int_{a}^{b} v\,du $

This means we first find an antiderivative via integration by parts ($u\,v - \int v\,du$), then evaluate at the limits $(a,b)$. Below are five examples showing how to apply this method step by step.


Example 1

Evaluate: $ \displaystyle \int_{0}^{1} x e^x \, dx $

Choose $u = x$, hence $du = dx$.

Then $dv = e^x\,dx$ and so $v = e^x$.

Using the formula: $ \int_{0}^{1} x e^x \, dx = \Bigl[x e^x\Bigr]_{0}^{1} - \int_{0}^{1} e^x \, dx $.

Compute separately: $ [x e^x]_{0}^{1} = (1 \cdot e^1) - (0 \cdot e^0) = e $ and $ \int_{0}^{1} e^x\,dx = e - 1$.

So the definite integral is $ e \;-\; (e - 1) = 1$.

$ \displaystyle \int_{0}^{1} x e^x \, dx = 1 $

Example 2

Evaluate: $ \displaystyle \int_{1}^{2} x^2 \sin(x) \, dx $

Take $u = x^2$, so $du = 2x\,dx$.

$dv = \sin(x)\,dx$, thus $v = -\cos(x)$.

$ \int_{1}^{2} x^2 \sin(x)\,dx = \Bigl[ -x^2 \cos(x) \Bigr]_{1}^{2} - \int_{1}^{2} -\cos(x) \cdot 2x \, dx $.

This becomes $ [-x^2 \cos(x)]_{1}^{2} + 2 \int_{1}^{2} x \cos(x)\,dx $.

Evaluate the boundary term: $[-x^2 \cos(x)]_{1}^{2} = \bigl[-(2^2)\cos(2)\bigr] - \bigl[-(1^2)\cos(1)\bigr] = -4\cos(2) + \cos(1)$.

Next, for $ \int x \cos(x)\, dx$, do another integration by parts quickly or recall that $ \int x \cos(x)\, dx = x \sin(x) + \cos(x)$. So $ \int_{1}^{2} x \cos(x)\,dx = \bigl[x \sin(x) + \cos(x)\bigr]_{1}^{2} = \bigl(2\sin(2) + \cos(2)\bigr) - \bigl(1 \cdot \sin(1) + \cos(1)\bigr)$.

Thus the whole integral is: $ -4\cos(2) + \cos(1) \;+\; 2 \bigl[2\sin(2) + \cos(2) - \sin(1) - \cos(1)\bigr] $.

Simplify if desired, but it's perfectly fine in this form.

$ \displaystyle \int_{1}^{2} x^2 \sin(x) \, dx \;=\; -4\cos(2) + \cos(1) \;+\; 2\bigl(2\sin(2) + \cos(2) - \sin(1) - \cos(1)\bigr). $

Example 3

Evaluate: $ \displaystyle \int_{0}^{\pi} x \cos(2x)\, dx $

Let $u = x$ so $du = dx$. Let $dv = \cos(2x)\, dx$. Then $v = \frac{\sin(2x)}{2}$.

Apply integration by parts: $ \int_{0}^{\pi} x \cos(2x)\, dx = \Bigl[x \cdot \tfrac{\sin(2x)}{2}\Bigr]_{0}^{\pi} - \int_{0}^{\pi} \tfrac{\sin(2x)}{2} \, dx $.

Evaluate boundary term: $ \Bigl[x \cdot \tfrac{\sin(2x)}{2}\Bigr]_{0}^{\pi} = \frac{\pi}{2} \sin(2\pi) - 0 \cdot \sin(0) = 0 $.

Remaining integral: $ - \int_{0}^{\pi} \tfrac{\sin(2x)}{2}\, dx = - \tfrac{1}{2} \int_{0}^{\pi} \sin(2x)\, dx. $

Now, $ \int \sin(2x)\, dx = -\tfrac{1}{2}\cos(2x)$. So $ \int_{0}^{\pi} \sin(2x)\, dx = \Bigl[-\tfrac{1}{2}\cos(2x)\Bigr]_{0}^{\pi} = -\tfrac{1}{2}\cos(2\pi) + \tfrac{1}{2}\cos(0) = -\tfrac{1}{2}(1) + \tfrac{1}{2}(1) = 0. $

Therefore the entire integral is $0$.

$ \displaystyle \int_{0}^{\pi} x \cos(2x)\, dx = 0 $

Example 4

Evaluate: $ \displaystyle \int_{2}^{3} x^3 e^x \, dx $

We can do repeated integration by parts or recall a known formula. Let's outline it quickly:

$u = x^3, \quad dv = e^x \, dx$$du = 3x^2 \, dx, \quad v = e^x$.

$ \int x^3 e^x\, dx = x^3 e^x - \int 3x^2 e^x\, dx = x^3 e^x - 3 \bigl(\int x^2 e^x\, dx\bigr). $

Similarly, $ \int x^2 e^x\, dx = x^2 e^x - 2 \int x e^x \, dx = x^2 e^x - 2 [ x e^x - e^x ] = x^2 e^x - 2x e^x + 2 e^x. $

Putting it all together yields $ \int x^3 e^x\, dx = x^3 e^x - 3[x^2 e^x - 2x e^x + 2 e^x] = x^3 e^x - 3x^2 e^x + 6x e^x - 6 e^x = (x^3 - 3x^2 + 6x - 6)e^x. $

Therefore, $ \int_{2}^{3} x^3 e^x \, dx = \Bigl[(x^3 - 3x^2 + 6x - 6) e^x\Bigr]_{2}^{3}. $

At $x=3$: $(3^3 - 3 \cdot 3^2 + 6 \cdot 3 - 6) e^3 = (27 - 27 + 18 - 6)e^3 = 12 e^3$.

At $x=2$: $(2^3 - 3 \cdot 2^2 + 6 \cdot 2 - 6) e^2 = (8 - 12 + 12 - 6)e^2 = 2 e^2$.

Subtract: $12 e^3 - 2 e^2$.

$ \displaystyle \int_{2}^{3} x^3 e^x \, dx = 12 e^3 - 2 e^2 $

Example 5

Evaluate: $ \displaystyle \int_{0}^{1} x^2 e^{3x} \, dx $

Let $u = x^2$, so $du = 2x\,dx$. Let $dv = e^{3x}\, dx$. Then $v = \frac{1}{3} e^{3x}$ (because $ \int e^{3x}\, dx = \tfrac{1}{3} e^{3x}$).

Thus $ \int_{0}^{1} x^2 e^{3x}\, dx = \Bigl[ x^2 \cdot \tfrac{1}{3} e^{3x} \Bigr]_{0}^{1} - \int_{0}^{1} \tfrac{1}{3} e^{3x} \cdot 2x \, dx. $

This is $ \Bigl[\tfrac{x^2}{3} e^{3x}\Bigr]_{0}^{1} - \tfrac{2}{3} \int_{0}^{1} x e^{3x}\, dx $.

Evaluate boundary: $ \bigl(\tfrac{1^2}{3} e^{3 \cdot 1}\bigr) - \bigl(\tfrac{0^2}{3} e^{0}\bigr) = \tfrac{1}{3} e^3 $.

Next, $ \int x e^{3x}\, dx$ by parts: let $u = x, \; du = dx$, $dv = e^{3x}dx, \; v = \tfrac{1}{3} e^{3x}$. So $ \int x e^{3x}\, dx = x \cdot \tfrac{1}{3} e^{3x} - \int \tfrac{1}{3} e^{3x}\, dx = \tfrac{x}{3} e^{3x} - \tfrac{1}{3} \cdot \tfrac{1}{3} e^{3x} = \bigl(\tfrac{x}{3} - \tfrac{1}{9}\bigr) e^{3x}. $

Hence $ \int_{0}^{1} x e^{3x} \, dx = \Bigl[\bigl(\tfrac{x}{3} - \tfrac{1}{9}\bigr) e^{3x}\Bigr]_{0}^{1}. $

At $x=1$: $(\tfrac{1}{3} - \tfrac{1}{9}) e^{3} = \tfrac{2}{9} e^3$. At $x=0$: $(0 - 0)\, e^0 = 0$.

So $ \int_{0}^{1} x e^{3x}\, dx = \tfrac{2}{9} e^3$.

Putting it back: $ \int_{0}^{1} x^2 e^{3x}\, dx = \tfrac{1}{3} e^3 - \tfrac{2}{3} \Bigl(\tfrac{2}{9} e^3\Bigr) = \tfrac{1}{3} e^3 - \tfrac{4}{27} e^3 = \Bigl(\tfrac{9}{27} - \tfrac{4}{27}\Bigr) e^3 = \tfrac{5}{27} e^3. $

$ \displaystyle \int_{0}^{1} x^2 e^{3x}\, dx = \frac{5}{27} e^3 $

Example 6

Evaluate: $ \displaystyle \int_{0}^{\frac{\pi}{2}} x \cos(3x)\, dx $

Let $u = x$, thus $du = dx$.

Then $dv = \cos(3x)\, dx$. Integrating, $v = \frac{\sin(3x)}{3}$ because $ \int \cos(3x)\, dx = \tfrac{1}{3}\sin(3x)$.

Using integration by parts: $ \int_{0}^{\frac{\pi}{2}} x \cos(3x)\, dx = \Bigl[x \cdot \frac{\sin(3x)}{3}\Bigr]_{0}^{\frac{\pi}{2}} - \int_{0}^{\frac{\pi}{2}} \frac{\sin(3x)}{3} \, dx. $

Evaluate the boundary term: $ \Bigl[x \cdot \frac{\sin(3x)}{3}\Bigr]_{0}^{\tfrac{\pi}{2}} = \frac{\pi}{2} \cdot \frac{\sin\bigl(3 \cdot \frac{\pi}{2}\bigr)}{3} - 0 $. Note that $3 \cdot \frac{\pi}{2} = \frac{3\pi}{2}$, and $\sin\bigl(\frac{3\pi}{2}\bigr) = -1$. So this becomes $\frac{\pi}{2} \cdot \frac{-1}{3} = -\frac{\pi}{6}$.

Next, the remaining integral: $ - \int_{0}^{\frac{\pi}{2}} \frac{\sin(3x)}{3}\, dx = -\frac{1}{3} \int_{0}^{\frac{\pi}{2}} \sin(3x)\, dx. $ We have $ \int \sin(3x)\,dx = -\frac{1}{3}\cos(3x)$.

Thus $ \int_{0}^{\frac{\pi}{2}} \sin(3x)\, dx = \Bigl[-\frac{1}{3}\cos(3x)\Bigr]_{0}^{\frac{\pi}{2}} = -\frac{1}{3}\cos\bigl(\tfrac{3\pi}{2}\bigr) - \Bigl(-\frac{1}{3}\cos(0)\Bigr). $ Since $\cos\bigl(\frac{3\pi}{2}\bigr) = 0$, and $\cos(0) = 1$, this becomes $0 + \frac{1}{3} = \frac{1}{3}$.

Hence $ -\frac{1}{3} \int_{0}^{\frac{\pi}{2}} \sin(3x)\, dx = -\frac{1}{3} \cdot \frac{1}{3} = -\frac{1}{9}. $

Combine both parts: $ \Bigl[x \frac{\sin(3x)}{3}\Bigr]_{0}^{\frac{\pi}{2}} + \bigl(-\frac{1}{9}\bigr) = -\frac{\pi}{6} - \frac{1}{9}. $

$ \displaystyle \int_{0}^{\frac{\pi}{2}} x \cos(3x)\, dx = -\frac{\pi}{6} \;-\; \frac{1}{9}. $

Example 7

Evaluate: $ \displaystyle \int_{1}^{3} x^2 e^{2x} \, dx $

Let $u = x^2$, so $du = 2x\,dx$. Let $dv = e^{2x}\, dx$; then $v = \frac{1}{2} e^{2x}$ (since $ \int e^{2x} \, dx = \tfrac{1}{2} e^{2x}$).

By parts, $ \int_{1}^{3} x^2 e^{2x}\, dx = \Bigl[ x^2 \cdot \tfrac{1}{2} e^{2x} \Bigr]_{1}^{3} - \int_{1}^{3} \tfrac{1}{2} e^{2x} \cdot 2x \, dx. $

Simplify: $= \Bigl[\tfrac{x^2}{2} e^{2x}\Bigr]_{1}^{3} - \int_{1}^{3} x e^{2x}\, dx $.

Evaluate boundary term: $ \Bigl[\tfrac{x^2}{2} e^{2x}\Bigr]_{1}^{3} = \Bigl(\tfrac{3^2}{2} e^{6}\Bigr) - \Bigl(\tfrac{1^2}{2} e^{2}\Bigr) = \frac{9}{2} e^{6} - \frac{1}{2} e^{2}. $

Now we handle $ \int x e^{2x}\, dx$ by another integration by parts or known formula: let $u = x$, $du = dx$, $dv = e^{2x}\, dx$, $v = \tfrac{1}{2} e^{2x}$.

So $ \int x e^{2x}\, dx = x \cdot \tfrac{1}{2} e^{2x} - \int \tfrac{1}{2} e^{2x}\, dx = \tfrac{x}{2} e^{2x} - \tfrac{1}{2} \cdot \tfrac{1}{2} e^{2x} = \Bigl(\tfrac{x}{2} - \tfrac{1}{4}\Bigr) e^{2x}. $

Evaluate from 1 to 3: $ \int_{1}^{3} x e^{2x} \, dx = \Bigl[\bigl(\tfrac{x}{2} - \tfrac{1}{4}\bigr) e^{2x}\Bigr]_{1}^{3}. $ At $x=3$: $(\tfrac{3}{2} - \tfrac{1}{4}) e^{6} = \tfrac{5}{4} e^{6}$. At $x=1$: $(\tfrac{1}{2} - \tfrac{1}{4}) e^{2} = \tfrac{1}{4} e^{2}$. So the difference is $\tfrac{5}{4} e^{6} - \tfrac{1}{4} e^{2}$.

Therefore $ \int_{1}^{3} x^2 e^{2x}\, dx = \Bigl(\frac{9}{2} e^{6} - \frac{1}{2} e^{2}\Bigr) - \Bigl(\tfrac{5}{4} e^{6} - \tfrac{1}{4} e^{2}\Bigr). $

Combine like terms: $ \frac{9}{2} e^{6} - \frac{5}{4} e^{6} = \Bigl(\frac{18}{4} - \frac{5}{4}\Bigr)e^{6} = \frac{13}{4} e^{6}. $ and $ -\frac{1}{2} e^{2} + \frac{1}{4} e^{2} = -\frac{2}{4} e^{2} + \frac{1}{4} e^{2} = -\frac{1}{4} e^{2}. $

Thus $ \frac{13}{4} e^{6} \;-\; \frac{1}{4} e^{2} $.

$ \displaystyle \int_{1}^{3} x^2 e^{2x}\, dx = \frac{13}{4} e^{6} \;-\; \frac{1}{4} e^{2}.$

Example 8

Evaluate: $ \displaystyle \int_{-1}^{1} x^3 \sin(2x) \, dx $

Let $u = x^3$, so $du = 3x^2\, dx$. Let $dv = \sin(2x)\, dx$, so $v = -\frac{1}{2}\cos(2x)$ (since $ \int \sin(2x)\,dx = -\frac{1}{2}\cos(2x)$).

Then $ \int_{-1}^{1} x^3 \sin(2x)\, dx = \Bigl[x^3 \bigl(-\tfrac{1}{2}\cos(2x)\bigr)\Bigr]_{-1}^{1} - \int_{-1}^{1} -\tfrac{1}{2} \cos(2x) \cdot 3x^2 \, dx. $

This becomes $ -\tfrac{1}{2} \Bigl[x^3 \cos(2x)\Bigr]_{-1}^{1} + \tfrac{3}{2} \int_{-1}^{1} x^2 \cos(2x)\, dx. $

Evaluate the boundary term: $ \bigl[x^3 \cos(2x)\bigr]_{-1}^{1} = (1^3 \cos(2\cdot1)) - \bigl((-1)^3 \cos(-2)\bigr) = \cos(2) - \bigl(-1 \cdot \cos(-2)\bigr) = \cos(2) + \cos(-2). $ But $\cos(-2) = \cos(2)$, so this is $\cos(2) + \cos(2) = 2\cos(2)$.

Thus $ -\tfrac{1}{2}\cdot 2\cos(2) = -\cos(2). $

Next, $ \int_{-1}^{1} x^2 \cos(2x)\, dx$ is an even function integrand ($x^2$ is even, $\cos(2x)$ is even), so we can integrate from 0 to 1 and double it, or do by parts again. Let's do direct by parts once more for completeness:

Let $u = x^2 \Rightarrow du = 2x\, dx$, $dv = \cos(2x)\, dx \Rightarrow v = \frac{\sin(2x)}{2}$. Then $ \int x^2 \cos(2x)\, dx = x^2 \cdot \frac{\sin(2x)}{2} - \int \frac{\sin(2x)}{2} \cdot 2x \, dx. $

$ = \frac{x^2}{2} \sin(2x) - \int x \sin(2x)\, dx. $ We can do one more parts or recall $ \int x \sin(2x)\, dx$. Let's do it quickly: $ u = x,\; dv = \sin(2x)\,dx \;\Rightarrow\; v = -\tfrac{1}{2}\cos(2x). $ So $ \int x \sin(2x)\,dx = x\bigl(-\tfrac{1}{2}\cos(2x)\bigr) - \int -\tfrac{1}{2} \cos(2x) \, dx = -\tfrac{x}{2}\cos(2x) + \tfrac{1}{2} \int \cos(2x)\,dx = -\tfrac{x}{2}\cos(2x) + \tfrac{1}{2} \cdot \tfrac{1}{2}\sin(2x) = -\tfrac{x}{2}\cos(2x) + \tfrac{1}{4}\sin(2x). $

Therefore, $ \int x^2 \cos(2x)\, dx = \frac{x^2}{2}\sin(2x) - \Bigl[-\tfrac{x}{2}\cos(2x) + \tfrac{1}{4}\sin(2x)\Bigr]. $ $ = \frac{x^2}{2}\sin(2x) + \tfrac{x}{2}\cos(2x) - \tfrac{1}{4}\sin(2x) = \Bigl(\frac{x^2}{2} - \tfrac{1}{4}\Bigr)\sin(2x) + \tfrac{x}{2}\cos(2x). $

We evaluate from -1 to 1: $ F(x) = \Bigl(\frac{x^2}{2} - \tfrac{1}{4}\Bigr)\sin(2x) + \tfrac{x}{2}\cos(2x).$ Notice $x^2/2 - 1/4$ is an even expression, but $\sin(2x)$ is odd, so that product is an odd function. Meanwhile, $(x/2)\cos(2x)$ is an odd times even => odd function. So $F(x)$ is odd, meaning $F(1) = -F(-1)$ but let's just compute directly:

At $x=1$: $\Bigl(\tfrac{1}{2}-\tfrac{1}{4}\Bigr)\sin(2) + \tfrac{1}{2}\cos(2) = \tfrac{1}{4}\sin(2) + \tfrac{1}{2}\cos(2).$

At $x=-1$: $ \Bigl(\tfrac{(-1)^2}{2}-\tfrac{1}{4}\Bigr)\sin(-2) + \tfrac{-1}{2}\cos(-2) = \Bigl(\tfrac{1}{2} - \tfrac{1}{4}\Bigr)(-\sin(2)) + \bigl(-\tfrac{1}{2}\bigr)\cos(2) = \tfrac{1}{4}\cdot(-\sin(2)) - \tfrac{1}{2}\cos(2) = -\tfrac{1}{4}\sin(2) - \tfrac{1}{2}\cos(2). $

Subtracting: $ F(1) - F(-1) = \bigl(\tfrac{1}{4}\sin(2) + \tfrac{1}{2}\cos(2)\bigr) - \bigl(-\tfrac{1}{4}\sin(2) - \tfrac{1}{2}\cos(2)\bigr) = \tfrac{1}{4}\sin(2) + \tfrac{1}{2}\cos(2) + \tfrac{1}{4}\sin(2) + \tfrac{1}{2}\cos(2) = \tfrac{1}{2}\sin(2) + \cos(2). $

Hence $ \int_{-1}^{1} x^2 \cos(2x)\, dx = \tfrac{1}{2}\sin(2) + \cos(2).$

Going back, $ \int_{-1}^{1} x^3 \sin(2x)\, dx = -\cos(2) + \tfrac{3}{2}\bigl(\tfrac{1}{2}\sin(2) + \cos(2)\bigr). $ $ = -\cos(2) + \tfrac{3}{2}\cdot \tfrac{1}{2}\sin(2) + \tfrac{3}{2}\cdot \cos(2) = -\cos(2) + \tfrac{3}{4}\sin(2) + \tfrac{3}{2}\cos(2). $

Combine like terms: $-\cos(2) + \tfrac{3}{2}\cos(2) = \tfrac{1}{2}\cos(2)$.

Final result: $ \tfrac{1}{2}\cos(2) + \tfrac{3}{4}\sin(2). $

$ \displaystyle \int_{-1}^{1} x^3 \sin(2x)\, dx = \frac{1}{2}\cos(2) \;+\; \frac{3}{4}\sin(2).$

Example 9

Evaluate: $ \displaystyle \int_{0}^{2} \bigl(3x - 1\bigr) e^{x} \, dx $

We can distribute or apply integration by parts. Distribution is often simpler: $ \int_{0}^{2} (3x - 1) e^{x}\, dx = 3 \int_{0}^{2} x e^{x}\, dx - \int_{0}^{2} e^{x}\, dx.$

We know $ \int x e^{x}\,dx = (x-1)e^{x}$ (from prior examples). Also $ \int e^{x}\, dx = e^{x}$.

So $ 3 \int_{0}^{2} x e^{x}\, dx = 3 \Bigl[(x-1)e^{x}\Bigr]_{0}^{2} = 3 \Bigl[(2-1)e^{2} - (0-1)e^{0}\Bigr] = 3 \bigl[e^{2} + 1\bigr] = 3e^{2} + 3. $

And $ \int_{0}^{2} e^{x}\, dx = [\,e^{x}\,]_{0}^{2} = e^{2} - 1.$

Hence $ \int_{0}^{2} (3x - 1) e^{x}\, dx = \bigl(3e^{2} + 3\bigr) - (e^{2} - 1) = 3e^{2} + 3 - e^{2} + 1 = 2e^{2} + 4. $

$ \displaystyle \int_{0}^{2} (3x - 1) e^{x} \, dx = 2 e^{2} + 4.$

Example 10

Evaluate: $ \displaystyle \int_{2}^{4} x^{4} e^{x} \, dx $

Similar to earlier repeated integration by parts. We can use the known formula $ \int x^n e^{x}\, dx = e^{x} \cdot P_n(x)$, where $P_n(x)$ is a polynomial of degree $n$. Specifically, we can do it step by step:

$ \int x^4 e^{x}\, dx = x^4 e^{x} - 4 \int x^3 e^{x}\, dx $. Then for $ \int x^3 e^{x}\, dx$, we similarly get $(x^3 - 3x^2 + 6x - 6)e^{x}$ (see Example 4 logic).

Therefore $ \int x^4 e^{x}\, dx = x^4 e^{x} - 4 \bigl[ (x^3 - 3x^2 + 6x - 6)e^{x} \bigr] = x^4 e^{x} - 4x^3 e^{x} + 12x^2 e^{x} - 24x e^{x} + 24 e^{x} $ $ = \bigl(x^4 - 4x^3 + 12x^2 - 24x + 24\bigr)\, e^{x}. $

Hence $ \int_{2}^{4} x^4 e^{x}\, dx = \Bigl[\bigl(x^4 - 4x^3 + 12x^2 - 24x + 24\bigr)\, e^{x}\Bigr]_{2}^{4}. $

At $x=4$: $ (4^4 - 4\cdot4^3 + 12\cdot4^2 - 24\cdot4 + 24) e^{4} = (256 - 256 + 192 - 96 + 24) e^{4} = (120) e^{4}. $

At $x=2$: $ (2^4 - 4\cdot2^3 + 12\cdot2^2 - 24\cdot2 + 24) e^{2} = (16 - 32 + 48 - 48 + 24) e^{2} = 8 e^{2}. $

Subtracting: $120 e^{4} - 8 e^{2}$.

$ \displaystyle \int_{2}^{4} x^4 e^{x}\, dx = 120 e^{4} \;-\; 8 e^{2}.$

Example 11

Evaluate: $ \displaystyle \int_{0}^{\pi} x^3 \cos(2x)\, dx $

Let $u = x^3$$du = 3x^2 \, dx$.

Let $dv = \cos(2x)\, dx$$v = \tfrac{\sin(2x)}{2}$ (since $ \int \cos(2x)\,dx = \tfrac{1}{2}\sin(2x)$).

Then by parts: $ \int_{0}^{\pi} x^3 \cos(2x)\, dx = \Bigl[x^3 \cdot \tfrac{\sin(2x)}{2}\Bigr]_{0}^{\pi} - \int_{0}^{\pi} \tfrac{\sin(2x)}{2} \cdot 3x^2 \, dx. $

Evaluate boundary term: $ [\, x^3 \cdot \tfrac{\sin(2x)}{2}\, ]_{0}^{\pi} = \tfrac{\pi^3}{2}\sin(2\pi) - 0 = 0 $. (since $ \sin(2\pi) = 0$).

The integral becomes $ - \tfrac{3}{2} \int_{0}^{\pi} x^2 \sin(2x)\, dx. $

Next, we do $ \int x^2 \sin(2x)\, dx$ by parts again or recall a known result. Let $u = x^2$$du = 2x\, dx$. $dv = \sin(2x)\, dx$$v = -\tfrac{1}{2}\cos(2x)$.

So $ \int x^2 \sin(2x)\, dx = x^2\bigl(-\tfrac{1}{2}\cos(2x)\bigr) - \int -\tfrac{1}{2}\cos(2x)\cdot 2x \, dx = -\tfrac{x^2}{2}\cos(2x) + \int x \cos(2x)\, dx. $

Again, $ \int x \cos(2x)\, dx$ can be done by parts or a known formula. Let $u=x, dv=\cos(2x)\,dx$. Then $du=dx, v=\tfrac{\sin(2x)}{2}$. So $ \int x \cos(2x)\, dx = x \tfrac{\sin(2x)}{2} - \int \tfrac{\sin(2x)}{2}\, dx = \tfrac{x}{2}\sin(2x) - \tfrac{1}{2} \cdot \bigl(-\tfrac{1}{2}\cos(2x)\bigr) = \tfrac{x}{2}\sin(2x) + \tfrac{1}{4}\cos(2x). $

Therefore $ \int x^2 \sin(2x)\, dx = -\tfrac{x^2}{2}\cos(2x) + \bigl(\tfrac{x}{2}\sin(2x) + \tfrac{1}{4}\cos(2x)\bigr) = -\tfrac{x^2}{2}\cos(2x) + \tfrac{x}{2}\sin(2x) + \tfrac{1}{4}\cos(2x). $ $ = \tfrac{x}{2}\sin(2x) + \bigl(-\tfrac{x^2}{2} + \tfrac{1}{4}\bigr)\cos(2x). $

Evaluate from 0 to $\pi$: $F(x) = \tfrac{x}{2}\sin(2x) + \Bigl(-\tfrac{x^2}{2} + \tfrac{1}{4}\Bigr)\cos(2x).$

At $x=\pi$: $ F(\pi) = \tfrac{\pi}{2}\sin(2\pi) + \Bigl(-\tfrac{\pi^2}{2} + \tfrac{1}{4}\Bigr)\cos(2\pi) = 0 + \Bigl(-\tfrac{\pi^2}{2} + \tfrac{1}{4}\Bigr)\cdot 1 = -\tfrac{\pi^2}{2} + \tfrac{1}{4}. $

At $x=0$: $ F(0) = \tfrac{0}{2}\sin(0) + \Bigl(-\tfrac{0^2}{2} + \tfrac{1}{4}\Bigr)\cos(0) = \tfrac{1}{4}\cdot 1 = \tfrac{1}{4}. $

So $ \int_{0}^{\pi} x^2 \sin(2x)\, dx = F(\pi) - F(0) = \bigl(-\tfrac{\pi^2}{2} + \tfrac{1}{4}\bigr) - \tfrac{1}{4} = -\tfrac{\pi^2}{2}. $

Therefore $ \int_{0}^{\pi} x^3 \cos(2x)\, dx = -\tfrac{3}{2} \Bigl(-\tfrac{\pi^2}{2}\Bigr) = \tfrac{3\pi^2}{4}. $

$ \displaystyle \int_{0}^{\pi} x^3 \cos(2x)\, dx = \frac{3\pi^2}{4}. $

Example 12

Evaluate: $ \displaystyle \int_{1}^{2} \bigl(x^2 + 3x\bigr) e^{2x} \, dx $

Distribute: $ \int_{1}^{2} (x^2 + 3x) e^{2x} \, dx = \int_{1}^{2} x^2 e^{2x}\, dx + 3 \int_{1}^{2} x e^{2x}\, dx. $

We can handle each term via known integration by parts. Recall from earlier style: $ \int x e^{ax}\, dx = \frac{x}{a} e^{ax} - \frac{1}{a^2} e^{ax} $ or we do a quick by parts. For $a=2$: $ \int x e^{2x}\, dx = \frac{x}{2} e^{2x} - \int \frac{1}{2} e^{2x}\,dx = \frac{x}{2} e^{2x} - \frac{1}{2}\cdot \frac{1}{2} e^{2x} = \Bigl(\frac{x}{2} - \frac{1}{4}\Bigr)e^{2x}. $

Similarly, $ \int x^2 e^{2x}\, dx $ can be done by parts or recalled: $ \int x^2 e^{2x}\, dx = \frac{x^2}{2} e^{2x} - \int \frac{1}{2} 2x\, e^{2x}\, dx = \frac{x^2}{2} e^{2x} - \int x e^{2x}\, dx. $ Then you plug in the $\int x e^{2x}\, dx$ result above, etc. We only need the definite integral from 1 to 2, so let's do it systematically.

Part (i): $ \int_{1}^{2} x^2 e^{2x}\, dx $. By parts: $ u = x^2,\; dv=e^{2x}dx \;\Rightarrow\; du=2x\,dx,\; v=\tfrac{1}{2} e^{2x}. $ So $ \int x^2 e^{2x}\, dx = x^2 \cdot \tfrac{1}{2} e^{2x} - \int \tfrac{1}{2} e^{2x} \cdot 2x\, dx = \tfrac{x^2}{2} e^{2x} - \int x e^{2x}\, dx. $ Evaluate from 1 to 2, we get $ \Bigl[\tfrac{x^2}{2} e^{2x}\Bigr]_{1}^{2} - \int_{1}^{2} x e^{2x}\, dx. $ The boundary: $ \Bigl[\tfrac{x^2}{2} e^{2x}\Bigr]_{1}^{2} = \Bigl(\tfrac{2^2}{2} e^{4}\Bigr) - \Bigl(\tfrac{1^2}{2} e^{2}\Bigr) = (2 e^{4}) - \tfrac{1}{2} e^{2}. $

Part (ii): $ \int_{1}^{2} x e^{2x}\, dx $. We know $ \int x e^{2x}\, dx = \Bigl(\tfrac{x}{2} - \tfrac{1}{4}\Bigr) e^{2x}. $ So $ \int_{1}^{2} x e^{2x}\, dx = \Bigl[\bigl(\tfrac{x}{2} - \tfrac{1}{4}\bigr) e^{2x}\Bigr]_{1}^{2} = \Bigl(\bigl(\tfrac{2}{2} - \tfrac{1}{4}\bigr) e^{4}\Bigr) - \Bigl(\bigl(\tfrac{1}{2} - \tfrac{1}{4}\bigr) e^{2}\Bigr). $ $ = \Bigl(\tfrac{3}{4} e^{4}\Bigr) - \Bigl(\tfrac{1}{4} e^{2}\Bigr) = \tfrac{3}{4} e^{4} - \tfrac{1}{4} e^{2}. $

Return to part (i): $ \int_{1}^{2} x^2 e^{2x}\, dx = \Bigl(2 e^{4} - \tfrac{1}{2} e^{2}\Bigr) - \Bigl(\tfrac{3}{4} e^{4} - \tfrac{1}{4} e^{2}\Bigr) = 2 e^{4} - \tfrac{1}{2} e^{2} - \tfrac{3}{4} e^{4} + \tfrac{1}{4} e^{2}. $ Combine like terms: $ 2 e^{4} - \tfrac{3}{4} e^{4} = \tfrac{8}{4} e^{4} - \tfrac{3}{4} e^{4} = \tfrac{5}{4} e^{4}. $ $ -\tfrac{1}{2} e^{2} + \tfrac{1}{4} e^{2} = -\tfrac{2}{4} e^{2} + \tfrac{1}{4} e^{2} = -\tfrac{1}{4} e^{2}. $ So $ \int_{1}^{2} x^2 e^{2x}\, dx = \tfrac{5}{4} e^{4} - \tfrac{1}{4} e^{2}. $

Finally, $ \int_{1}^{2} (x^2 + 3x) e^{2x}\, dx = \bigl(\tfrac{5}{4} e^{4} - \tfrac{1}{4} e^{2}\bigr) + 3 \bigl(\tfrac{3}{4} e^{4} - \tfrac{1}{4} e^{2}\bigr) = \tfrac{5}{4} e^{4} - \tfrac{1}{4} e^{2} + \tfrac{9}{4} e^{4} - \tfrac{3}{4} e^{2}. $ $ = \bigl(\tfrac{5}{4} + \tfrac{9}{4}\bigr) e^{4} + \bigl(-\tfrac{1}{4} - \tfrac{3}{4}\bigr) e^{2} = \tfrac{14}{4} e^{4} - \tfrac{4}{4} e^{2} = \tfrac{14}{4} e^{4} - e^{2}. $ $ = \frac{14}{4} e^{4} - e^{2} = \frac{7}{2} e^{4} - e^{2}. $

$ \displaystyle \int_{1}^{2} (x^2 + 3x) e^{2x} \, dx = \frac{7}{2} e^{4} \;-\; e^{2}. $

Example 13

Evaluate: $ \displaystyle \int_{0}^{1} x^2 \ln(1 + x)\, dx $

For integrals with a logarithm, we often choose $u = \ln(1+x)$ so that $du = \frac{1}{1+x} \, dx$, and $dv = x^2 \, dx$. Then $v = \frac{x^3}{3}$.

By parts: $ \int_{0}^{1} x^2 \ln(1+x)\, dx = \Bigl[\ln(1+x)\cdot \tfrac{x^3}{3}\Bigr]_{0}^{1} - \int_{0}^{1} \tfrac{x^3}{3} \cdot \frac{1}{1+x}\, dx. $

Evaluate boundary term: at $x=1$, $\ln(2)\cdot \tfrac{1^3}{3} = \tfrac{\ln(2)}{3}$. at $x=0$, $\ln(1)\cdot \tfrac{0^3}{3}=0$. So that part is $\tfrac{\ln(2)}{3}$.

Now the remaining integral: $ -\int_{0}^{1} \frac{x^3}{3(1+x)}\, dx$, i.e. $ -\tfrac{1}{3} \int_{0}^{1} \frac{x^3}{1+x}\, dx. $

We can simplify $ \frac{x^3}{1+x} = x^2 - x + 1 - \frac{1}{1+x}$ by polynomial division? Let's do it carefully: $ \frac{x^3}{1+x} = x^2 - x + 1 - \frac{1}{1+x}. $ (Because $x^3 = (x^2 - x + 1)(1+x) - 1$.)

So $ \int_{0}^{1} \frac{x^3}{1+x}\, dx = \int_{0}^{1} \Bigl(x^2 - x + 1 - \frac{1}{1+x}\Bigr)\, dx. $

Integrate term by term: $ \int_{0}^{1} x^2\, dx = \Bigl[\tfrac{x^3}{3}\Bigr]_{0}^{1} = \tfrac{1}{3}, $ $ \int_{0}^{1} (-x)\, dx = \Bigl[-\tfrac{x^2}{2}\Bigr]_{0}^{1} = -\tfrac{1}{2}, $ $ \int_{0}^{1} 1\, dx = [\,x\,]_{0}^{1} = 1, $ $ \int_{0}^{1} -\frac{1}{1+x}\, dx = -\Bigl[\ln(1+x)\Bigr]_{0}^{1} = -[\ln(2) - \ln(1)] = -\ln(2). $

Summation: $ \int_{0}^{1} \frac{x^3}{1+x}\, dx = \tfrac{1}{3} - \tfrac{1}{2} + 1 - \ln(2). $ $ = \tfrac{1}{3} + \tfrac{1}{2} + 1 - \tfrac{1}{2} - \ldots $ actually let's be neat: $ \tfrac{1}{3} - \tfrac{1}{2} + 1 - \ln(2) = \Bigl(\tfrac{1}{3} - \tfrac{1}{2}\Bigr) + 1 - \ln(2) = -\tfrac{1}{6} + 1 - \ln(2) = \tfrac{5}{6} - \ln(2). $

Hence $ -\tfrac{1}{3} \int_{0}^{1} \frac{x^3}{1+x}\, dx = -\tfrac{1}{3} \bigl(\tfrac{5}{6} - \ln(2)\bigr) = -\tfrac{5}{18} + \tfrac{1}{3}\ln(2). $

Combine with the boundary term from earlier: $ \int_{0}^{1} x^2 \ln(1+x)\, dx = \tfrac{\ln(2)}{3} + \Bigl(-\tfrac{5}{18} + \tfrac{1}{3}\ln(2)\Bigr) = \tfrac{\ln(2)}{3} + \tfrac{1}{3}\ln(2) - \tfrac{5}{18} = \tfrac{2}{3}\ln(2) - \tfrac{5}{18}. $ $ = \frac{2\ln(2)}{3} - \frac{5}{18}. $

$ \displaystyle \int_{0}^{1} x^2 \ln(1 + x)\, dx = \frac{2}{3}\ln(2) \;-\; \frac{5}{18}. $

Example 14

Evaluate: $ \displaystyle \int_{1}^{2} x^2 \ln(x)\, dx $

Again we use the standard approach with logs: let $u = \ln(x)$, $du = \frac{1}{x}\, dx$. Let $dv = x^2\, dx$, so $v = \tfrac{x^3}{3}$.

By parts: $ \int_{1}^{2} x^2 \ln(x)\, dx = \Bigl[\ln(x)\cdot \tfrac{x^3}{3}\Bigr]_{1}^{2} - \int_{1}^{2} \tfrac{x^3}{3} \cdot \tfrac{1}{x}\, dx. $

Boundary term: $ \Bigl[\tfrac{x^3}{3}\ln(x)\Bigr]_{1}^{2} = \Bigl(\tfrac{2^3}{3}\ln(2)\Bigr) - \Bigl(\tfrac{1^3}{3}\ln(1)\Bigr) = \tfrac{8}{3}\ln(2) - 0. $

Remaining integral: $ - \int_{1}^{2} \tfrac{x^3}{3} \cdot \tfrac{1}{x}\, dx = -\tfrac{1}{3} \int_{1}^{2} x^2 \, dx. $ $ \int_{1}^{2} x^2\, dx = \Bigl[\tfrac{x^3}{3}\Bigr]_{1}^{2} = \tfrac{2^3}{3} - \tfrac{1^3}{3} = \tfrac{8}{3} - \tfrac{1}{3} = \tfrac{7}{3}. $

So $ -\tfrac{1}{3} \cdot \tfrac{7}{3} = -\tfrac{7}{9}. $

Combine: $ \int_{1}^{2} x^2 \ln(x)\, dx = \tfrac{8}{3}\ln(2) - \tfrac{7}{9}. $

$ \displaystyle \int_{1}^{2} x^2 \ln(x)\, dx = \frac{8}{3}\ln(2) \;-\; \frac{7}{9}. $

Example 15

Evaluate: $ \displaystyle \int_{0}^{\frac{\pi}{2}} x^2 \cos^2(x)\, dx $

A common approach for powers of $\cos(x)$ is to use $ \cos^2(x) = \frac{1 + \cos(2x)}{2} $. Then we can handle $ \int x^2 \cos(2x)\, dx$ by parts.

Rewrite: $ \int_{0}^{\frac{\pi}{2}} x^2 \cos^2(x)\, dx = \int_{0}^{\frac{\pi}{2}} x^2 \cdot \frac{1 + \cos(2x)}{2}\, dx = \frac{1}{2} \int_{0}^{\frac{\pi}{2}} x^2\, dx + \frac{1}{2} \int_{0}^{\frac{\pi}{2}} x^2 \cos(2x)\, dx. $

The first part is straightforward: $ \frac{1}{2} \int_{0}^{\frac{\pi}{2}} x^2\, dx = \frac{1}{2} \Bigl[\tfrac{x^3}{3}\Bigr]_{0}^{\frac{\pi}{2}} = \frac{1}{2} \cdot \frac{\bigl(\frac{\pi}{2}\bigr)^3}{3} = \frac{1}{2} \cdot \frac{\frac{\pi^3}{8}}{3} = \frac{\pi^3}{48}. $

Next, $ \frac{1}{2} \int_{0}^{\frac{\pi}{2}} x^2 \cos(2x)\, dx. $ Use integration by parts on $ \int x^2 \cos(2x)\, dx$: let $u = x^2$, $dv = \cos(2x)\,dx$. Then $du = 2x\,dx$, $v = \tfrac{\sin(2x)}{2}$.

So $ \int x^2 \cos(2x)\, dx = x^2 \cdot \tfrac{\sin(2x)}{2} - \int \tfrac{\sin(2x)}{2} \cdot 2x\, dx = \tfrac{x^2}{2}\sin(2x) - \int x \sin(2x)\, dx. $

Again, $\int x \sin(2x)\, dx$ by parts or recall known result: let $u = x, dv=\sin(2x)\,dx$, so $du=dx, v=-\tfrac{1}{2}\cos(2x)$. $ \int x \sin(2x)\, dx = x\bigl(-\tfrac{1}{2}\cos(2x)\bigr) - \int -\tfrac{1}{2}\cos(2x)\, dx = -\tfrac{x}{2}\cos(2x) + \tfrac{1}{2}\int \cos(2x)\, dx = -\tfrac{x}{2}\cos(2x) + \tfrac{1}{2}\cdot \tfrac{\sin(2x)}{2} = -\tfrac{x}{2}\cos(2x) + \tfrac{1}{4}\sin(2x). $

Thus $ \int x^2 \cos(2x)\, dx = \tfrac{x^2}{2}\sin(2x) - \Bigl[-\tfrac{x}{2}\cos(2x) + \tfrac{1}{4}\sin(2x)\Bigr] = \tfrac{x^2}{2}\sin(2x) + \tfrac{x}{2}\cos(2x) - \tfrac{1}{4}\sin(2x). $ $ = \bigl(\tfrac{x^2}{2} - \tfrac{1}{4}\bigr)\sin(2x) + \tfrac{x}{2}\cos(2x). $

Evaluate from 0 to $\frac{\pi}{2}$: $F(x) = \bigl(\tfrac{x^2}{2} - \tfrac{1}{4}\bigr)\sin(2x) + \tfrac{x}{2}\cos(2x).$

At $x=\frac{\pi}{2}$: $ F\bigl(\tfrac{\pi}{2}\bigr) = \Bigl(\tfrac{(\pi/2)^2}{2} - \tfrac{1}{4}\Bigr)\sin(\pi) + \tfrac{\pi/2}{2}\cos(\pi). $ Notice $\sin(\pi) = 0$, and $\cos(\pi) = -1$. So that is $ 0 + \Bigl(\tfrac{\pi}{2} \cdot \tfrac{1}{2}\Bigr)\cdot (-1) = \frac{\pi}{4}\cdot(-1) = -\frac{\pi}{4}. $

At $x=0$: $ F(0) = \Bigl(\tfrac{0}{2} - \tfrac{1}{4}\Bigr)\sin(0) + \tfrac{0}{2}\cos(0) = 0. $

Thus $ \int_{0}^{\frac{\pi}{2}} x^2 \cos(2x)\, dx = F\bigl(\tfrac{\pi}{2}\bigr) - F(0) = -\frac{\pi}{4}. $

Finally, $ \int_{0}^{\frac{\pi}{2}} x^2 \cos^2(x)\, dx = \frac{1}{2}\int_{0}^{\frac{\pi}{2}} x^2\, dx + \frac{1}{2}\int_{0}^{\frac{\pi}{2}} x^2 \cos(2x)\, dx $ = $ \frac{\pi^3}{48} + \frac{1}{2}\Bigl(-\frac{\pi}{4}\Bigr) = \frac{\pi^3}{48} - \frac{\pi}{8}. $

$ \displaystyle \int_{0}^{\frac{\pi}{2}} x^2 \cos^2(x)\, dx = \frac{\pi^3}{48} \;-\; \frac{\pi}{8}. $

Example 16

Integral: $ \displaystyle \int_{0}^{1} 2x\, e^{3x}\, dx $

Rewrite as $ 2 \int_{0}^{1} x e^{3x}\, dx$.

Let $u = x,\, dv = e^{3x}dx.$ Then $du=dx,\, v=\tfrac{1}{3}e^{3x}.$

So $ \int x e^{3x}\, dx = x \cdot \tfrac{1}{3} e^{3x} - \int \tfrac{1}{3} e^{3x}\, dx$.

The leftover integral is $\tfrac{1}{3} e^{3x}$, so $ \int x e^{3x}\, dx = \Bigl(\tfrac{x}{3} - \tfrac{1}{9}\Bigr)e^{3x}.$

Evaluate from 0 to 1: $\Bigl(\tfrac{1}{3} - \tfrac{1}{9}\Bigr)e^{3} - \bigl(0 - \tfrac{1}{9}\bigr) = \tfrac{2}{9}e^{3} + \tfrac{1}{9} = \tfrac{2 e^{3} + 1}{9}.$

Multiply by 2: $2 \cdot \tfrac{2 e^{3} + 1}{9} = \tfrac{4 e^{3} + 2}{9}.$

$ \displaystyle \int_{0}^{1} 2x\, e^{3x}\, dx = \frac{4 e^{3} + 2}{9}. $

Example 17

Integral: $ \displaystyle \int_{0}^{\frac{\pi}{2}} x \sin(2x)\, dx $

Let $u = x,\, dv = \sin(2x)\, dx.$ Then $du=dx,\, v= -\tfrac{1}{2}\cos(2x).$

So $ \int x \sin(2x)\, dx = x\bigl(-\tfrac{1}{2}\cos(2x)\bigr) - \int -\tfrac{1}{2}\cos(2x)\, dx.$

Evaluate from 0 to $\tfrac{\pi}{2}$: boundary term at $x=\tfrac{\pi}{2}$ is $(\tfrac{\pi}{2})(-\tfrac{1}{2}\cos(\pi)) = \tfrac{\pi}{4}.$ The leftover integral in cos becomes zero on [0,\tfrac{\pi}{2}].

$ \displaystyle \int_{0}^{\frac{\pi}{2}} x \sin(2x)\, dx = \frac{\pi}{4}. $

Example 18

Integral: $ \displaystyle \int_{1}^{3} x^3 \ln(x)\, dx $

Let $u=\ln(x),\, dv=x^3 dx.$ Then $du=\tfrac{1}{x}dx,\, v=\tfrac{x^4}{4}.$

$ \int x^3 \ln(x)\, dx = \ln(x)\cdot \tfrac{x^4}{4} - \int \tfrac{x^4}{4}\cdot \tfrac{1}{x}\, dx = \tfrac{x^4}{4}\ln(x) - \tfrac{1}{4} \int x^3\, dx.$

$\int x^3\, dx = \tfrac{x^4}{4}.$ So $ \int x^3 \ln(x)\, dx = \tfrac{x^4}{4}\ln(x) - \tfrac{x^4}{16}.$

Evaluate 1 to 3: $ \Bigl[\tfrac{x^4}{4}\ln(x) - \tfrac{x^4}{16}\Bigr]_{1}^{3} = \Bigl(\tfrac{81}{4}\ln(3) - \tfrac{81}{16}\Bigr) - \Bigl(0 - \tfrac{1}{16}\Bigr) = \tfrac{81}{4}\ln(3) - 5.$

$ \displaystyle \int_{1}^{3} x^3 \ln(x)\, dx = \frac{81}{4}\ln(3) \;-\; 5. $

Example 19

Integral: $ \displaystyle \int_{0}^{2} x e^{2x} \, dx $

Let $u=x,\, dv=e^{2x}dx.$ Then $du=dx,\, v=\tfrac{1}{2} e^{2x}.$

$ \int x e^{2x}\, dx = x\bigl(\tfrac{1}{2}e^{2x}\bigr) - \int \tfrac{1}{2} e^{2x}\, dx = \tfrac{x}{2} e^{2x} - \tfrac{1}{4} e^{2x} = \Bigl(\tfrac{x}{2} - \tfrac{1}{4}\Bigr) e^{2x}.$

Evaluate 0 to 2: $ \Bigl(\tfrac{2}{2}-\tfrac{1}{4}\Bigr) e^{4} - \bigl(0-\tfrac{1}{4}\bigr) = \tfrac{3}{4} e^{4} + \tfrac{1}{4}.$

$ \displaystyle \int_{0}^{2} x e^{2x}\, dx = \frac{3}{4} e^{4} + \frac{1}{4}. $

Example 20

Integral: $ \displaystyle \int_{0}^{\frac{\pi}{4}} x^2 \tan(x)\, dx $

Recall $ \int \tan(x)\, dx = -\ln|\cos(x)|.$

Let $u = x^2,\, dv=\tan(x)\,dx.$ Then $du=2x\,dx,\, v=-\ln(\cos x).$

$ \int_{0}^{\tfrac{\pi}{4}} x^2 \tan(x)\, dx = \Bigl[x^2\cdot(-\ln(\cos x))\Bigr]_{0}^{\tfrac{\pi}{4}} - \int_{0}^{\tfrac{\pi}{4}} -\ln(\cos x)\cdot 2x\, dx. $

Boundary at $x=\tfrac{\pi}{4}$ gives $ (\tfrac{\pi}{4})^2 \cdot\bigl(-\ln(\cos(\tfrac{\pi}{4}))\bigr) = -\tfrac{\pi^2}{16}\ln(\tfrac{\sqrt{2}}{2}).$ At $x=0$ is 0.

The rest is $ + 2\int_{0}^{\tfrac{\pi}{4}} x\ln(\cos x)\, dx.$ That integral typically has no simpler closed form, so we leave it there.

$ \displaystyle \int_{0}^{\frac{\pi}{4}} x^2 \tan(x)\, dx = - \frac{\pi^2}{16}\,\ln\!\Bigl(\frac{\sqrt{2}}{2}\Bigr) \;+\; 2 \int_{0}^{\frac{\pi}{4}} x \ln\!\bigl(\cos(x)\bigr)\, dx. $


Summary

We have seen five examples applying the definite integral version of the Integration by Parts formula:

$ \displaystyle \int_{a}^{b} u\,dv \;=\; \bigl[u\,v\bigr]_{a}^{b} \;-\; \int_{a}^{b} v\,du $

Each time, we identify parts of the integrand as $u$ and $dv$, then evaluate carefully at the upper and lower limits. This approach allows us to handle integrals of products like $x^n e^x$ or $x^n \sin(x)$ quite systematically.