Techniques of Integration - Examples

On this page we display several examples to illustrate the concepts and theorems discussed in the Techniques of Integration theme.

Computing an integral using integration by parts

Problem
Compute the indefinite integral \[ \int x^2\cos(x) \, dx.\]

Solution
We know how to integrate \(x^2\) and \(\cos(x)\), but not the product. Since polynomials 'disappear' upon successive differentiation, we choose \(x^2=u\) and \(\cos(x)=v'\). Using the formula for integration by parts, we then get

\[ \int x^2\cos(x) \, dx=x^2\sin(x)-2\int x\sin(x) \, dx.\]

Observe that if we use integration by parts on the last term with \(x=u\) and \(\sin(x)=v'\), we will get rid of the \(x\) term.

\[\int x\sin(x)\, dx=-x\cos(x)+\int \cos(x)\, dx=-x\cos(x)+\sin(x). \]

Inserting this in the calculation above, we find

\[ \int x^2\cos(x) \, dx=x^2\sin(x)+2x\cos(x)-2\sin(x)\].

This is an example of a typical situation that may occur: the integral does not let itself solve by a single application of substitution or integration by parts, but these methods have to be applied successively.

Computing an integral of a rational function

Problem
Compute the indefinite integral \[ \int \frac{3x+4}{x^2+x-6} \, dx.\]

Solution

We have that \(x^2+x-6 =(x-2)(x+3)\), so we guess that we can write \[ \frac{3x+4}{x^2+x-6} =\frac{A}{x-2}+\frac{B}{x+3} \] for some \(A, B\) to be determined. To find these numbers, we multiply by the common factor \(x^2+x-6 =(x-2)(x+3)\) on both sides and get

\[3x+4= A(x+3)+B(x-2) =(A+B)x+3A-2B.\]

Equation the terms with \(x\) and the constant terms, we get that \(A\) and \(B\) must satisfy

\(A+B=3\) and \(3A-2B=4.\) Solving this gives \(A=2 \) and \(B=1\), so that

\[ \int \frac{3x+4}{x^2+x-6} \, dx= \int \frac{2}{x-2} \, dx + \int \frac{1}{x+3} \, dx \] with solution \[ 2\ln|x-2|+1\ln|x+3|+C. \]

Inverse substitution

Problem

Find the area of the region bounded by the \(x\)-axis, the hyperbola \(x^2-y^2=1\), and the straight line from the origin to the point \(\left( \sqrt{1+Y^2},Y\right)\) on this hyperbola. Assume \(Y>0\).

Solution
Note that the hyperbola crosses the positive \(x\)-axis at the point \((1,0)\). Then it is easy to see that the area can be expressed as

\[A=\int_0^{\sqrt{1+Y^2}} \frac{xY}{\sqrt{1+Y^2}}\, dx-\int_1^{\sqrt{1+Y^2}} \sqrt{x^2-1} \, dx=\frac{1}{2}Y\sqrt{1+Y^2}-\int_1^{\sqrt{1+Y^2}} \sqrt{x^2-1} \, dx.\] To solve the last integral, we make the substitution \(x=\cosh(u)\). Then \(\sqrt{x^2-1}=\sinh(u)\) and \(dx=\sinh(u)du\). Thus

\[\int \sqrt{x^2-1} \, dx=\int \sinh^2(u)\, du.\]

Recalling the definition \(\sinh(u)=(1/2)(\mathrm{e}^x-\mathrm{e}^{-x})\), we find

\[\int \sinh^2(u)\, du=\int \frac{1}{2}\cosh(2u)-\frac{1}{2} \, du=\frac{1}{4}\sinh(2u)-\frac{u}{2}.\] Recall the identity \(\cosh^{-1}(x)=\ln\left(x+\sqrt{x^2-1}\right)\). In conclusion, we have

\[A=\frac{1}{2}Y\sqrt{1+Y^2}-\left[ \frac{1}{4}\sinh(2u)-\frac{u}{2}\right]_{\cosh^{-1}(1)}^{cosh^{-1}(\sqrt{1+Y^2})}=\frac{1}{2}Y\sqrt{1+Y^2}+\frac{\ln\left(Y+\sqrt{1+Y^2}\right)}{2}-\frac{\sinh\left(2\cosh^{-1}(\sqrt{1+Y^2})\right)}{4}.\]

An improper integral

Problem
Calculate the definite integral

\[\int_0^\infty \frac{\ln(x)}{(x+1)^2} \, dx.\]

Solution
We know that \(\ln(0)=-\infty\) and thus the integral is an improper integral of both type I and II, and we restate the problem as

\[\lim_{c\rightarrow 0^+}\left(\lim_{r\rightarrow \infty} \int_c^r \frac{\ln(x)}{(x+1)^2} \, dx\right).\]

To solve this we first find an antiderivative of the integrand. We use integration by parts, with \(1/(x+1)^2=u'\) and \(\ln(x)=v\). Then \(u=-1/(x+1)\). This gives

\[\int \frac{\ln(x)}{(x+1)^2} \, dx = -\frac{\ln(x)}{x+1}+\int \frac{1}{(x+1)x} \,dx.\] \(1/(x+1)x\) is a rational function which may be decomposed as

\[\frac{1}{(x+1)x}=\frac{1}{x}-\frac{1}{x+1}.\]

Therefore,

\[\int \frac{1}{(x+1)x} \,dx=\ln(x)-\ln(x+1).\]

To solve the original problem, we have to calculate

\[\lim_{c\rightarrow 0^+}\left(\lim_{r\rightarrow \infty} \left[ -\frac{\ln(x)}{x+1}+\ln(x)-\ln(x+1)\right]_c^r\right).\] This equals \[\lim_{c\rightarrow 0^+}\left(\lim_{r\rightarrow \infty} -\frac{\ln(r)}{r+1}+\ln(r)-\ln(r+1)+\frac{\ln(c)}{c+1}-\ln(c)+\ln(c+1)\right)=\lim_{c\rightarrow 0^+} \frac{\ln(c)}{c+1}-\ln(c)+\ln(c+1)=0.\]

Note that it would make no difference if we took the limits in the other order.

Numerical integration: Trapezoid rule

Problem
The integral

\[\int_{-1}^1 \mathrm{e}^{-x^2}\, dx\]

cannot be solved by using the Fundamental Theorem of calculus, since the integrand does not have an antiderivative. On the other hand, the integrand satisfies all the criteria for being integrable. Let \(T_n\) be the approximation to this integral using the trapezoid rule with \(n\) equally spaced nodes on the interval \([-1,1]\). Find the smallest \(n\) for which you guarantee

\[\left\vert\int_{-1}^1 \mathrm{e}^{-x^2}\, dx-T_n \right\vert\leq 10^{-3}.\]

Solution
Using theorem 4 in chapter 6 in Adams, we know that

\[\left\vert\int_{-1}^1 \mathrm{e}^{-x^2}\, dx-T_n \right\vert\leq \frac{K2^3}{12n^2}, \]

since the length of our interval is \(2\), where \(K\) is such that \(\frac{d^2}{dx^2}\mathrm{e}^{-x^2}\leq K\) on \([-1,1]\). We compute

\[\left\vert\frac{d^2}{dx^2}\mathrm{e}^{-x^2}\right\vert=\left\vert4x^2\mathrm{e}^{-x^2}-2\mathrm{e}^{-x^2}\right\vert\leq 2 \,\, \text{for} \,\, x\in [-1,1].\]

Thus \[\left\vert\int_{-1}^1 \mathrm{e}^{-x^2}\, dx-T_n \right\vert\leq \frac{4}{3n^2}\]

and we find, using a calculator, that \(n=37\).

2013-10-12, tokemeie