# Calculus/Integration/Solutions
## Integration of Polynomials

Evaluate the following:
$\int (x^{2}-2)^{2}\,dx$
${\begin{aligned}\int (x^{2}-2)^{2}dx&=\int (x^{4}-4x^{2}+4)dx\\&=\mathbf {{\frac {x^{5}}{5}}-{\frac {4x^{3}}{3}}+4x+C} \end{aligned}}$
${\begin{aligned}\int (x^{2}-2)^{2}dx&=\int (x^{4}-4x^{2}+4)dx\\&=\mathbf {{\frac {x^{5}}{5}}-{\frac {4x^{3}}{3}}+4x+C} \end{aligned}}$
$\int 8x^{3}\,dx$
${\begin{aligned}\int 8x^{3}dx&={\frac {8x^{4}}{4}}+C\\&=\mathbf {2x^{4}+C} \end{aligned}}$
${\begin{aligned}\int 8x^{3}dx&={\frac {8x^{4}}{4}}+C\\&=\mathbf {2x^{4}+C} \end{aligned}}$
$\int (4x^{2}+11x^{3})\,dx$
$\int (4x^{2}+11x^{3})dx=\mathbf {{\frac {4x^{3}}{3}}+{\frac {11x^{4}}{4}}+C}$
$\int (4x^{2}+11x^{3})dx=\mathbf {{\frac {4x^{3}}{3}}+{\frac {11x^{4}}{4}}+C}$
$\int (31x^{32}+4x^{3}-9x^{4})\,dx$
${\begin{aligned}\int (31x^{32}+4x^{3}-9x^{4})dx&={\frac {31x^{33}}{33}}+{\frac {4x^{4}}{4}}-{\frac {9x^{5}}{5}}+C\\&=\mathbf {{\frac {31x^{33}}{33}}+x^{4}-{\frac {9x^{5}}{5}}+C} \end{aligned}}$
${\begin{aligned}\int (31x^{32}+4x^{3}-9x^{4})dx&={\frac {31x^{33}}{33}}+{\frac {4x^{4}}{4}}-{\frac {9x^{5}}{5}}+C\\&=\mathbf {{\frac {31x^{33}}{33}}+x^{4}-{\frac {9x^{5}}{5}}+C} \end{aligned}}$
$\int 5x^{-2}\,dx$
${\begin{aligned}\int 5x^{-2}dx&={\frac {5x^{-1}}{-1}}+C\\&=\mathbf {-{\frac {5}{x}}+C} \end{aligned}}$
${\begin{aligned}\int 5x^{-2}dx&={\frac {5x^{-1}}{-1}}+C\\&=\mathbf {-{\frac {5}{x}}+C} \end{aligned}}$

## Indefinite Integration

Find the general antiderivative of the following:
$\int (\cos x+\sin x)\,dx$
$\int (\cos x+\sin x)\,dx=\mathbf {\sin x-\cos x+C}$
$\int (\cos x+\sin x)\,dx=\mathbf {\sin x-\cos x+C}$
$\int 3\sin x\,dx$
$\int 3\sin x\,dx=\mathbf {-3\cos(x)+C}$
$\int 3\sin x\,dx=\mathbf {-3\cos(x)+C}$
$\int (1+\tan ^{2}x)\,dx$
${\begin{aligned}\int (1+\tan ^{2}x)dx&=\int \sec ^{2}xdx\\&=\mathbf {\tan x+C} \end{aligned}}$
${\begin{aligned}\int (1+\tan ^{2}x)dx&=\int \sec ^{2}xdx\\&=\mathbf {\tan x+C} \end{aligned}}$
$\int (3x-\sec ^{2}x)\,dx$
$\int (3x-\sec ^{2}x)\,dx=\mathbf {{\frac {3x^{2}}{2}}-\tan x+C}$
$\int (3x-\sec ^{2}x)\,dx=\mathbf {{\frac {3x^{2}}{2}}-\tan x+C}$
$\int -e^{x}\,dx$
$\int -e^{x}\,dx=\mathbf {-e^{x}+C}$
$\int -e^{x}\,dx=\mathbf {-e^{x}+C}$
$\int 8e^{x}\,dx$
$\int 8e^{x}\,dx=\mathbf {8e^{x}+C}$
$\int 8e^{x}\,dx=\mathbf {8e^{x}+C}$
$\int {\frac {1}{7x}}\,dx$
$\int {\frac {1}{7x}}\,dx=\mathbf {{\frac {1}{7}}\ln |x|+C}$
$\int {\frac {1}{7x}}\,dx=\mathbf {{\frac {1}{7}}\ln |x|+C}$

## Integration by Substitution

Find the anti-derivative or compute the integral depending on whether the integral is indefinite or definite.
$\int _{0}^{\pi /2}\sin(x)\cos(x)\,dx$
    ${\begin{aligned}\sin(2x)&=2\sin(x)\cos(x)\\{\frac {1}{2}}\sin(2x)&=\sin(x)\cos(x)\end{aligned}}$
By this,
    $\int _{0}^{\pi /2}\sin(x)\cos(x)\,dx=\int _{0}^{\pi /2}{\frac {1}{2}}\sin(2x)\,dx$.
Let
    $u=2x,\qquad du=2\,dx\implies {\frac {1}{2}}du=dx$.
    $u(0)=0,\qquad u(\pi /2)=\pi$
Then,
    ${\begin{aligned}\int _{0}^{\pi /2}{\frac {1}{2}}\sin(2x)\,dx&={\frac {1}{2}}\int _{0}^{\pi }{\frac {1}{2}}\sin(u)\,du\\&=-{\frac {1}{4}}\left(\cos(\pi )-\cos(0)\right)\\&=\mathbf {\frac {1}{2}} \end{aligned}}$
    ${\begin{aligned}\sin(2x)&=2\sin(x)\cos(x)\\{\frac {1}{2}}\sin(2x)&=\sin(x)\cos(x)\end{aligned}}$
By this,
    $\int _{0}^{\pi /2}\sin(x)\cos(x)\,dx=\int _{0}^{\pi /2}{\frac {1}{2}}\sin(2x)\,dx$.
Let
    $u=2x,\qquad du=2\,dx\implies {\frac {1}{2}}du=dx$.
    $u(0)=0,\qquad u(\pi /2)=\pi$
Then,
    ${\begin{aligned}\int _{0}^{\pi /2}{\frac {1}{2}}\sin(2x)\,dx&={\frac {1}{2}}\int _{0}^{\pi }{\frac {1}{2}}\sin(u)\,du\\&=-{\frac {1}{4}}\left(\cos(\pi )-\cos(0)\right)\\&=\mathbf {\frac {1}{2}} \end{aligned}}$
$\int _{0}^{\pi /4}\tan(x)\,dx$
    $\int _{0}^{\pi /4}\tan(x)\,dx=\int _{0}^{\pi /4}{\frac {\sin(x)}{\cos(x)}}\,dx$
Let
    $u=\cos(x),\qquad -du=\sin(x)\,dx$.
    $u(0)=1,\qquad u(\pi /4)={\frac {1}{\sqrt {2}}}$.
Apply all this information to find the original integral:
    ${\begin{aligned}\int _{0}^{\pi /4}{\frac {\sin(x)}{\cos(x)}}\,dx&=-\int _{1}^{1/{\sqrt {2}}}{\frac {1}{u}}\,du\\&=\int _{1/{\sqrt {2}}}^{1}{\frac {1}{u}}\,du\\&=\ln(1)-\ln \left({\frac {1}{\sqrt {2}}}\right)\\&=0+\ln \left({\sqrt {2}}\right)\\&=\mathbf {\frac {\ln(2)}{2}} \end{aligned}}$
    $\int _{0}^{\pi /4}\tan(x)\,dx=\int _{0}^{\pi /4}{\frac {\sin(x)}{\cos(x)}}\,dx$
Let
    $u=\cos(x),\qquad -du=\sin(x)\,dx$.
    $u(0)=1,\qquad u(\pi /4)={\frac {1}{\sqrt {2}}}$.
Apply all this information to find the original integral:
    ${\begin{aligned}\int _{0}^{\pi /4}{\frac {\sin(x)}{\cos(x)}}\,dx&=-\int _{1}^{1/{\sqrt {2}}}{\frac {1}{u}}\,du\\&=\int _{1/{\sqrt {2}}}^{1}{\frac {1}{u}}\,du\\&=\ln(1)-\ln \left({\frac {1}{\sqrt {2}}}\right)\\&=0+\ln \left({\sqrt {2}}\right)\\&=\mathbf {\frac {\ln(2)}{2}} \end{aligned}}$
$\int _{1/2}^{1}{\frac {e^{\sqrt {2x-1}}}{\sqrt {2x-1}}}\,dx$
    $u={\sqrt {2x-1}},\qquad du={\frac {1}{\sqrt {2x-1}}}\,dx$.
    $u(1/2)=0,\qquad u(1)=1$.
Then,
    ${\begin{aligned}\int _{1/2}^{1}{\frac {e^{\sqrt {2x-1}}}{\sqrt {2x-1}}}\,dx&=\int _{0}^{1}e^{u}\,du\\&=e^{1}-e^{0}\\&=\mathbf {e-1} \end{aligned}}$
    $u={\sqrt {2x-1}},\qquad du={\frac {1}{\sqrt {2x-1}}}\,dx$.
    $u(1/2)=0,\qquad u(1)=1$.
Then,
    ${\begin{aligned}\int _{1/2}^{1}{\frac {e^{\sqrt {2x-1}}}{\sqrt {2x-1}}}\,dx&=\int _{0}^{1}e^{u}\,du\\&=e^{1}-e^{0}\\&=\mathbf {e-1} \end{aligned}}$
$\int _{-3}^{-{\sqrt {6}}}{\frac {8x}{\sqrt {x^{2}-5}}}\,dx$
    $u=x^{2}-5,\qquad du=2x\,dx$.
    $u\left(-3\right)=4,\qquad u(-{\sqrt {6}})=1$.
Then,
    ${\begin{aligned}\int _{-3}^{-{\sqrt {6}}}{\frac {8x}{\sqrt {x^{2}-5}}}\,dx&=4\int _{-3}^{-{\sqrt {6}}}{\frac {2x}{\sqrt {x^{2}-5}}}\,dx\\&=4\int _{4}^{1}{\frac {1}{\sqrt {u}}}\,du\\&=-4\int _{1}^{4}u^{-1/2}\,du\\&=-8\left({\sqrt {4}}-{\sqrt {1}}\right)\,du\\&=-8\left(2-1\right)\\&=\mathbf {-8} \end{aligned}}$
    $u=x^{2}-5,\qquad du=2x\,dx$.
    $u\left(-3\right)=4,\qquad u(-{\sqrt {6}})=1$.
Then,
    ${\begin{aligned}\int _{-3}^{-{\sqrt {6}}}{\frac {8x}{\sqrt {x^{2}-5}}}\,dx&=4\int _{-3}^{-{\sqrt {6}}}{\frac {2x}{\sqrt {x^{2}-5}}}\,dx\\&=4\int _{4}^{1}{\frac {1}{\sqrt {u}}}\,du\\&=-4\int _{1}^{4}u^{-1/2}\,du\\&=-8\left({\sqrt {4}}-{\sqrt {1}}\right)\,du\\&=-8\left(2-1\right)\\&=\mathbf {-8} \end{aligned}}$
$\int -{\frac {3}{2}}{\sqrt {\frac {2}{e^{3x-2}}}}\,dx$
    $\int -{\frac {3}{2}}{\sqrt {\frac {2}{e^{3x-2}}}}\,dx=\int -{\frac {3{\sqrt {2}}}{2}}e^{-{\frac {1}{2}}(3x-2)}\,dx$
From there, it becomes obvious to let
    $u=-{\frac {1}{2}}(3x-2),\qquad du=-{\frac {3}{2}}\,dx$.
Then,
    ${\begin{aligned}\int -{\frac {3{\sqrt {2}}}{2}}e^{-{\frac {1}{2}}(3x-2)}\,dx&=\int {\sqrt {2}}e^{u}\,du\\&={\sqrt {2}}e^{u}+C\\&={\sqrt {2}}e^{-{\frac {1}{2}}(3x-2)}+C\\&=\mathbf {{\sqrt {\frac {2}{e^{3x-2}}}}+C} \end{aligned}}$
    $\int -{\frac {3}{2}}{\sqrt {\frac {2}{e^{3x-2}}}}\,dx=\int -{\frac {3{\sqrt {2}}}{2}}e^{-{\frac {1}{2}}(3x-2)}\,dx$
From there, it becomes obvious to let
    $u=-{\frac {1}{2}}(3x-2),\qquad du=-{\frac {3}{2}}\,dx$.
Then,
    ${\begin{aligned}\int -{\frac {3{\sqrt {2}}}{2}}e^{-{\frac {1}{2}}(3x-2)}\,dx&=\int {\sqrt {2}}e^{u}\,du\\&={\sqrt {2}}e^{u}+C\\&={\sqrt {2}}e^{-{\frac {1}{2}}(3x-2)}+C\\&=\mathbf {{\sqrt {\frac {2}{e^{3x-2}}}}+C} \end{aligned}}$
$\int {\frac {x\sec \left({\sqrt {x^{2}-5}}\right)\tan \left({\sqrt {x^{2}-5}}\right)}{50{\sqrt {x^{2}-5}}}}\,dx$
    $u={\sqrt {x^{2}-5}},\qquad du={\frac {x}{\sqrt {x^{2}-5}}}\,dx$.
Then,
    ${\begin{aligned}\int {\frac {x\sec \left({\sqrt {x^{2}-5}}\right)\tan \left({\sqrt {x^{2}-5}}\right)}{50{\sqrt {x^{2}-5}}}}\,dx&=\int {\frac {1}{50}}\sec(u)\tan(u)\,du\\&={\frac {1}{50}}\sec(u)+C\\&=\mathbf {{\frac {\sec \left({\sqrt {x^{2}-5}}\right)}{50}}+C} \end{aligned}}$
    $u={\sqrt {x^{2}-5}},\qquad du={\frac {x}{\sqrt {x^{2}-5}}}\,dx$.
Then,
    ${\begin{aligned}\int {\frac {x\sec \left({\sqrt {x^{2}-5}}\right)\tan \left({\sqrt {x^{2}-5}}\right)}{50{\sqrt {x^{2}-5}}}}\,dx&=\int {\frac {1}{50}}\sec(u)\tan(u)\,du\\&={\frac {1}{50}}\sec(u)+C\\&=\mathbf {{\frac {\sec \left({\sqrt {x^{2}-5}}\right)}{50}}+C} \end{aligned}}$
$\int {\frac {2\sec ^{2}\left(\ln(x)\right)\tan \left(\ln(x)\right)}{x}}\,dx$
    $u=\ln(x),\qquad du={\frac {1}{x}}\,dx$.
Then,
    $\int {\frac {2\sec ^{2}\left(\ln(x)\right)\tan \left(\ln(x)\right)}{x}}\,dx=\int 2\sec ^{2}(u)\tan(u)\,du$.
Let
    $v=\tan(u),\qquad dv=\sec ^{2}(u)\,du$.
Therefore,
    ${\begin{aligned}\int 2\sec ^{2}(u)\tan(u)\,du&=\int 2v\,dv\\&=v^{2}+C\\&=\tan ^{2}(u)+C\\&=\mathbf {\tan ^{2}\left(\ln(x)\right)+C} \end{aligned}}$
Alternatively, this could all be done with one substitution if one realized that
    ${\frac {d}{dx}}\left(\tan \left[\ln(x)\right]\right)={\frac {\sec ^{2}\left(\ln(x)\right)}{x}}$.
    $u=\ln(x),\qquad du={\frac {1}{x}}\,dx$.
Then,
    $\int {\frac {2\sec ^{2}\left(\ln(x)\right)\tan \left(\ln(x)\right)}{x}}\,dx=\int 2\sec ^{2}(u)\tan(u)\,du$.
Let
    $v=\tan(u),\qquad dv=\sec ^{2}(u)\,du$.
Therefore,
    ${\begin{aligned}\int 2\sec ^{2}(u)\tan(u)\,du&=\int 2v\,dv\\&=v^{2}+C\\&=\tan ^{2}(u)+C\\&=\mathbf {\tan ^{2}\left(\ln(x)\right)+C} \end{aligned}}$
Alternatively, this could all be done with one substitution if one realized that
    ${\frac {d}{dx}}\left(\tan \left[\ln(x)\right]\right)={\frac {\sec ^{2}\left(\ln(x)\right)}{x}}$.
$\int \left(e^{x}-1\right)x^{e^{x}-2}+x^{e^{x}-1}e^{x}\ln(x)\,dx$
    ${\begin{aligned}\int \left(e^{x}-1\right)x^{e^{x}-2}+x^{e^{x}-1}e^{x}\ln(x)\,dx&=\int x^{e^{x}-1}\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx\\&=\int e^{\left(e^{x}-1\right)\ln(x)}\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx\end{aligned}}$
From there, let
    $u=\left(e^{x}-1\right)\ln(x),\qquad du=\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx$.
Then,
    ${\begin{aligned}\int e^{\left(e^{x}-1\right)\ln(x)}\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx&=\int e^{u}\,du\\&=e^{u}+C\\&=e^{\left(e^{x}-1\right)\ln(x)}+C\\&=\mathbf {x^{e^{x}-1}+C} \end{aligned}}$
    ${\begin{aligned}\int \left(e^{x}-1\right)x^{e^{x}-2}+x^{e^{x}-1}e^{x}\ln(x)\,dx&=\int x^{e^{x}-1}\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx\\&=\int e^{\left(e^{x}-1\right)\ln(x)}\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx\end{aligned}}$
From there, let
    $u=\left(e^{x}-1\right)\ln(x),\qquad du=\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx$.
Then,
    ${\begin{aligned}\int e^{\left(e^{x}-1\right)\ln(x)}\left({\frac {e^{x}-1}{x}}+e^{x}\ln(x)\right)\,dx&=\int e^{u}\,du\\&=e^{u}+C\\&=e^{\left(e^{x}-1\right)\ln(x)}+C\\&=\mathbf {x^{e^{x}-1}+C} \end{aligned}}$
$\int 2\sec ^{2}\left(\ln \left(x^{2}+{\frac {2}{x}}\right)\right){\frac {x^{3}-1}{x^{4}+2x}}\,dx$
    $u=\ln \left(x^{2}+{\frac {2}{x}}\right),\qquad du=2{\frac {x^{3}-1}{x^{4}+2x}}\,dx\,dx$.
Then,
    ${\begin{aligned}\int 2\sec ^{2}\left(\ln \left(x^{2}+{\frac {2}{x}}\right)\right){\frac {x^{3}-1}{x^{4}+2x}}\,dx&=\int \sec ^{2}(u)\,du\\&=\tan(u)+C\\&=\mathbf {\tan \left(\ln \left(x^{2}+{\frac {2}{x}}\right)\right)+C} \end{aligned}}$
    $u=\ln \left(x^{2}+{\frac {2}{x}}\right),\qquad du=2{\frac {x^{3}-1}{x^{4}+2x}}\,dx\,dx$.
Then,
    ${\begin{aligned}\int 2\sec ^{2}\left(\ln \left(x^{2}+{\frac {2}{x}}\right)\right){\frac {x^{3}-1}{x^{4}+2x}}\,dx&=\int \sec ^{2}(u)\,du\\&=\tan(u)+C\\&=\mathbf {\tan \left(\ln \left(x^{2}+{\frac {2}{x}}\right)\right)+C} \end{aligned}}$

## Integration by parts

$\int \sin(x)\cos(x)\,dx$
$u=\sin(x)$
$v'=\cos(x)$
$u=\cos(x)$
$v'=\sin(x)$
    $u=\sin x;\qquad du=\cos xdx$
    $v=\sin x;\qquad dv=\cos xdx$
    ${\begin{array}{ccc}\int \sin x\cos xdx=\sin ^{2}x-\int \sin x\cos xdx&\implies &2\int \sin x\cos xdx=\sin ^{2}x\\&\implies &\int \sin x\cos xdx=\mathbf {\frac {\sin ^{2}x}{2}} \end{array}}$
(b)
    $u=\cos x;\qquad du=-\sin xdx$
    $v=-\cos x\qquad dv=\sin xdx$
    ${\begin{array}{ccc}\int \sin x\cos xdx=-\cos ^{2}x-\int \sin x\cos xdx&\implies &2\int \sin x\cos xdx=-\cos ^{2}x\\&\implies &\int \sin x\cos xdx=\mathbf {-{\frac {\cos ^{2}x}{2}}} \end{array}}$
Notice that the answers in parts (a) and (b) are not equal. However, since indefinite integrals include a constant term, we expect that the answers we found will differ by a constant. Indeed
    ${\frac {\sin ^{2}x}{2}}-(-{\frac {\cos ^{2}x}{2}})={\frac {\sin ^{2}x+\cos ^{2}x}{2}}={\frac {1}{2}}$
    $u=\sin x;\qquad du=\cos xdx$
    $v=\sin x;\qquad dv=\cos xdx$
    ${\begin{array}{ccc}\int \sin x\cos xdx=\sin ^{2}x-\int \sin x\cos xdx&\implies &2\int \sin x\cos xdx=\sin ^{2}x\\&\implies &\int \sin x\cos xdx=\mathbf {\frac {\sin ^{2}x}{2}} \end{array}}$
(b)
    $u=\cos x;\qquad du=-\sin xdx$
    $v=-\cos x\qquad dv=\sin xdx$
    ${\begin{array}{ccc}\int \sin x\cos xdx=-\cos ^{2}x-\int \sin x\cos xdx&\implies &2\int \sin x\cos xdx=-\cos ^{2}x\\&\implies &\int \sin x\cos xdx=\mathbf {-{\frac {\cos ^{2}x}{2}}} \end{array}}$
Notice that the answers in parts (a) and (b) are not equal. However, since indefinite integrals include a constant term, we expect that the answers we found will differ by a constant. Indeed
    ${\frac {\sin ^{2}x}{2}}-(-{\frac {\cos ^{2}x}{2}})={\frac {\sin ^{2}x+\cos ^{2}x}{2}}={\frac {1}{2}}$

## Integration by Trigonometric Substitution

$\int {\frac {1}{x^{2}+a^{2}}}\,dx$
    $x=a\tan \theta ;\qquad dx=a\sec ^{2}\theta d\theta$
Then
    ${\begin{aligned}\int {\frac {1}{x^{2}+a^{2}}}dx&=\int {\frac {a\sec ^{2}\theta d\theta }{a^{2}(\tan ^{2}\theta +1)}}\\&=\int {\frac {\sec ^{2}\theta d\theta }{a\sec ^{2}\theta }}\\&={\frac {1}{a}}\int d\theta \\&={\frac {\theta }{a}}+C\\&=\mathbf {{\frac {1}{a}}\arctan {\frac {x}{a}}+C} \end{aligned}}$
    $x=a\tan \theta ;\qquad dx=a\sec ^{2}\theta d\theta$
Then
    ${\begin{aligned}\int {\frac {1}{x^{2}+a^{2}}}dx&=\int {\frac {a\sec ^{2}\theta d\theta }{a^{2}(\tan ^{2}\theta +1)}}\\&=\int {\frac {\sec ^{2}\theta d\theta }{a\sec ^{2}\theta }}\\&={\frac {1}{a}}\int d\theta \\&={\frac {\theta }{a}}+C\\&=\mathbf {{\frac {1}{a}}\arctan {\frac {x}{a}}+C} \end{aligned}}$
Navigation:
Main Page · Precalculus · Limits · Differentiation · Integration · Parametric and Polar Equations · Sequences and Series · Multivariable Calculus · Extensions · References