Topic 8 Techniques of Integration

8.1 Integration by Parts

Exercise 8.1 Evaluate the integral.

\[ \int x \cos 5 x \mathrm{d} x \]

Solution.

\[ \begin{aligned} &\int x \cos 5 x \mathrm{d} x\\ =&\frac15\int x \mathrm{d}(\sin 5 x)\\ =&\frac15\left(x\sin5x-\int \sin 5x\mathrm{ }d x\right)\\ =&\frac15\left(x\sin5x+\frac15\cos5x\right)+C\\ =&\frac15x\sin5x+\frac1{25}\cos5x+C. \end{aligned} \]

Exercise 8.2 Evaluate the integral.

\[ \int t e^{-3 t} \mathrm{d} t \]

Solution.

\[ \begin{aligned} &\int te^{-3t} \mathrm{d} t\\ =&-\frac13 \int t \mathrm{d}(e^{-3t})\\ =&-\frac13 \left(te^{-3t}-\int e^{-3t} \mathrm{d}t\right)\\ =&-\frac13 \left(te^{-3t}+\frac13e^{-3t}\right)+C\\ =&-\frac13 te^{-3t}-\frac19e^{-3t}+C\\ \end{aligned} \]

Exercise 8.3 Evaluate the integral.

\[ \int \sin ^{-1} x \mathrm{d} x \]

Solution.

\[ \begin{aligned} &\int \sin^{-1} x \mathrm{d} x\\ =&x\sin^{-1}x -\int x\mathrm{d}(\sin^{-1} x)\\ =&x\sin^{-1}x -\int \frac{x}{\sqrt{1-x^2}}\mathrm{d}x \\ =&x\sin^{-1}x+\frac12\int u^{-1/2} \mathrm{d}u \qquad\qquad u=1-x^2\\ =&x\sin^{-1}x+\sqrt{u}+C\\ =&x\sin^{-1}x+\sqrt{1-x^2}+C. \end{aligned} \]

Exercise 8.4 Evaluate the integral.

\[ \int \arctan4t \mathrm{d} t \]

Solution.

\[ \begin{aligned} &\int \arctan4t \mathrm{d} t\\ =&t\arctan4t -\int t\mathrm{d}(\arctan4t)\\ =&t\arctan4t -\int \frac{4t}{1+(4t)^2}\mathrm{d}t\\ =&t\arctan4t - \frac18\int \frac{1}{u}\mathrm{d}u \qquad\qquad u=1+(4t)^2\\ =&t\arctan4t - \frac18\ln|u|+C\\ =&t\arctan4t - \frac18\ln(1+16t^2)+C\\ \end{aligned} \]

Exercise 8.5 Evaluate the integral.

\[ \int e^{-\theta} \cos 2 \theta \mathrm{d} \theta \]

Solution.

Let \(I=\int e^{-\theta} \cos 2 \theta \mathrm{d} \theta\).

\[ \begin{aligned} I=&-\int \cos 2 \theta \mathrm{d}(e^{-\theta})\\ =&-\left(e^{-\theta}\cos 2 \theta - \int e^{-\theta} \mathrm{d}(\cos 2 \theta)\right)\\ =&-e^{-\theta}\cos 2 \theta - 2\int e^{-\theta} \sin 2 \theta \mathrm{d}\theta\\ =&-e^{-\theta}\cos 2 \theta + 2\left(\int \sin 2 \theta \mathrm{d} (e^{-\theta})\right)\\ =&-e^{-\theta}\cos 2 \theta + 2\left(e^{-\theta}\sin 2 \theta - \int e^{-\theta} \mathrm{d}(\sin 2 \theta)\right)\\ =&-e^{-\theta}\cos 2 \theta + 2\left(e^{-\theta}\sin 2 \theta - 2\int e^{-\theta} \cos 2 \theta \mathrm{d}\theta\right)\\ =& -e^{-\theta}\cos 2 \theta + 2e^{-\theta}\sin 2 \theta -4I. \end{aligned} \]

Solve for \(I\), we get \[ I=\int e^{-\theta} \cos 2 \theta \mathrm{d} \theta=\frac15e^{-\theta}(2\sin 2 \theta-\cos 2 \theta)+C. \]

Exercise 8.6 Evaluate the integral.

\[ \int_{0}^{1}\left(x^{2}+1\right) e^{-x} \mathrm{d} x \]

Solution.

We first find an antiderivative. \[ \begin{aligned} &\int \left(x^{2}+1\right) e^{-x} \mathrm{d} x\\ =& -\int \left(x^{2}+1\right) \mathrm{d} (e^{-x})\\ =&-\left((x^{2}+1)e^{-x}- \int e^{-x} \mathrm{d} (x^{2}+1) \right)\\ =&-(x^{2}+1)e^{-x}+ \int 2xe^{-x} \mathrm{d}x\\ =&-(x^{2}+1)e^{-x}-\int 2x \mathrm{d}(e^{-x})\\ =&-(x^{2}+1)e^{-x}-\left(2xe^{-x}-\int e^{-x} \mathrm{d}(2x)\right)\\ =&-(x^{2}+1)e^{-x}- 2xe^{-x}+2\int e^{-x} \mathrm{d}x\\ =&-(x^{2}+1)e^{-x}- 2xe^{-x}-2 e^{-x}+C\\ =&-e^{-x}(x^{2}+2x+3)+C. \end{aligned} \]

By FTC, \[ \begin{aligned} &\int_{0}^{1}\left(x^{2}+1\right) e^{-x} \mathrm{d} x \\ =& -\left(e^{-1}(1^{2}+2\cdot 1+3)-3e^{0}\right)\\ =&3-\frac{6}{e} \end{aligned} \]

Exercise 8.7 Evaluate the integral.

\[ \int_{0}^{1 / 2} \cos^{-1} x \mathrm{d} x \]

Solution.

Find the indefinite integral first.

\[ \begin{aligned} &\int \cos ^{-1} x \mathrm{d} x\\ =& x\cos^{-1}x-\int x\mathrm{d}(\cos^{-1}x)\\ =& x\cos^{-1}x+\int \frac{x}{\sqrt{1-x^2}}\mathrm{d}x\\ =& x\cos^{-1}x-\int \frac{1}{2\sqrt{u}}\mathrm{d}u \qquad\qquad u=1-x^2\\ =& x\cos^{-1}x-\sqrt{u}+C\\ =& x\cos^{-1}x-\sqrt{1-x^2}+C\\ \end{aligned} \]

By FTC, \[ \begin{aligned} &\int_{0}^{1 / 2} \cos^{-1} x \mathrm{d} x\\ =& ((1/2)\cos^{-1}(1/2)-\sqrt{1-(1/2)^2})-(0\cdot\cos^{-1}0-\sqrt{1-0^2})\\ =&\frac{\pi}{6}-\frac{\sqrt{3}}{2}+1 \end{aligned} \]

Exercise 8.8 Evaluate the integral.

\[ \int \cos \sqrt{x} \mathrm{d} x \]

Solution.

Apply the substitution method first and then the integration by parts.

\[ \begin{aligned} &\int \cos\sqrt{x} \mathrm{d} x\\ =& 2\int u\cos u \mathrm{d}u \qquad\qquad u=\sqrt{x}\\ =& 2\int u \mathrm{d}(\sin u)\\ =& 2\left(u\sin u-\int\sin u\mathrm{d} u\right)\\ =& 2\left(u\sin u+\cos u\right )+C\\ =& 2\left(\sqrt{x}\sin\sqrt{x}+\cos\sqrt{x}\right)+C\\ \end{aligned} \]

Exercise 8.9 Evaluate the integral.

\[ \int x \ln (1+x) \mathrm{d} x \]

Solution.

Apply the substitution method first and then the integration by parts.

\[ \begin{aligned} &\int x \ln (1+x) \mathrm{d} x\\ =&\int (u-1)\ln u\mathrm{d}u \qquad\qquad u=x+1\\ =&\int u \ln u\mathrm{d}u - \int \ln u\mathrm{d}u\\ =&\frac12\int\ln u\mathrm{d}u^2 - \left(u\ln u-\int u\mathrm{d}(\ln u)\right)\\ =&\frac12\left(u^2\ln u-\int u^2\mathrm{d}(\ln u)\right) - \left(u\ln u-\int \mathrm{d}u\right)\\ =&\frac12\left(u^2\ln u-\int u \mathrm{d} u\right) - \left(u\ln u-u\right)+C\\ =&\frac12\left(u^2\ln u-\frac12u^2\right) - \left(u\ln u-u\right)+C\\ =&\frac12\left(u^2-2u\right)\ln u+u-\frac14u^2+C\\ =&\frac12\left(x^2-1\right)\ln(x+1)-\frac14(x^2-2x-3)+C. \end{aligned} \]

Exercise 8.10 Prove the reduction formula

\[ \int \cos^{n} x \mathrm{d} x=\frac{1}{n} \cos^{n-1} x \sin x+\frac{n-1}{n} \int \cos^{n-2} x \mathrm{d} x \]

Solution.

Let \(f(x)=\cos^{n-1} x\) and \(g(x)=\sin x\). Then \(\cos^nx=f(x)g'(x)\mathrm{d}x\). We apply the integration by parts to the left-hand side. \[ \begin{aligned} I=&\int \cos^{n} x \mathrm{d} x \\ =&\int \cos^{n-1}x\mathrm{d}(\sin x)\\ =&\cos^{n-1}x\sin x - \int \sin x \mathrm{d} (\cos^{n-1}x)\\ =&\cos^{n-1}x\sin x + (n-1)\int \sin^2 x\cos^{n-2}x\mathrm{d} x\\ =&\cos^{n-1}x\sin x + (n-1)\int (1-\cos^2 x)\cos^{n-2}x\mathrm{d} x\\ =&\cos^{n-1}x\sin x + (n-1)\int \cos^{n-2}x\mathrm{d} x-(n-1)\int \cos^{n}x\mathrm{d} x\\ =&\cos^{n-1}x\sin x + (n-1)\int \cos^{n-2}x\mathrm{d} x-(n-1)I\\ \end{aligned} \]

Solve for \(I\), we get \[ I=\frac{1}{n}\cos^{n-1}x\sin x+\frac{n-1}{n} \int \cos^{n-2}x\mathrm{d} x. \]

Therefor, \[ \int \cos^{n} x \mathrm{d} x =\frac{1}{n}\cos^{n-1}x\sin x+\frac{n-1}{n} \int \cos^{n-2}x\mathrm{d} x. \]

Exercise 8.11 Evaluate the integral.

\[ \int \sin^{2} x \cos^{3} x \mathrm{d} x \]

Solution.

Since not both \(\cos x\) has an odd power, we may use the substitution \(t=\sin x\) and the Pythagorean identity \(\sin^2x+\cos^2=1\) to change the integrand into a polynomial of \(t\). \[ \begin{aligned} &\int \sin^{2} x \cos^{3} x \mathrm{d} x \\ =&\int \sin^2x\cos^2x\mathrm{d}(\sin x)\\ =&\int t^2(1-t^2)\mathrm{d}t\qquad\qquad t=\sin x\\ =&\int t^2-t^4\mathrm{d}t\\ =&\frac{t^3}{3}-\frac{t^5}{5}+C\\ =&\frac{\sin^3x}{3}-\frac{\sin^5x}{5}+C \end{aligned} \]

Exercise 8.12 Evaluate the integral.

\[ \int_{0}^{2 \pi} \sin^{2}\left(\frac{1}{3} x\right) \mathrm{d} x \]

Solution.

Again, we first find the indefinite integral.

We use the double angle formula to reduce the power of the trigonometric function in the integrand.

\[ \begin{aligned} &\int \sin^{2}\left(\frac{1}{3} x\right) \mathrm{d} x\\ =&\frac12\int \left(1-\cos\left(\frac23x\right)\right) \mathrm{d}x\\ =&\frac x2-\frac12\int\cos\left(\frac23x\right)\mathrm{d}x\\ =&\frac x2-\frac34\int\cos\left(t\right)\mathrm{d}t \qquad\qquad t=\frac23x\\ =&\frac x2-\frac34\sin t + C\\ =&\frac x2-\frac34\sin\left(\frac23x\right) +C \end{aligned} \]

By FTC, \[ \int_{0}^{2 \pi} \sin^{2}\left(\frac{1}{3} x\right) \mathrm{d} x=\pi-\frac34\sin\left(\frac{4\pi}{3}\right)=\pi+\frac{3\sqrt{3}}{8} \]

```

Exercise 8.13 Evaluate the integral.

\[ \int \sin^{2} x \cos^{4} x \mathrm{d} x \]

Solution.

We use trigonometric identities to reduce the power in the integrand. \[ \begin{aligned} &\sin^{2} x \cos^{4} x\\ =&(\sin x\cos x)^2\cos^2 x\\ =&\frac14 (\sin(2x)\cos x)^2\\ =&\frac1{16}(\sin(3x)+\sin x)^2\\ =&\frac1{16}(\sin^2(3x)+2\sin3x\sin x+\sin^2x)\\ =&\frac1{16}\left(\frac12(1-\cos6x)+\cos(2x)-\cos(4x)+\frac12(1-\cos2x)\right)\\ =&\frac1{16}-\frac1{32}\cos6x+\frac1{32}\cos(2x)-\frac1{16}\cos(4x)\\ \end{aligned} \]

Then the integral is \[ \begin{aligned} &\int \sin^{2} x \cos^{4} x \mathrm{d} x\\ =& \int\left(\frac1{16}-\frac1{32}\cos6x+\frac1{32}\cos(2x)-\frac1{16}\cos(4x)\right) \mathrm{d}x\\ =&\frac{x}{16}+\frac1{64}\sin 2x-\frac{1}{64}\sin 4x-\frac{1}{192}\sin 6x + C \end{aligned} \]

Remark: Note that \(\sin^2x\cos^4x=(1-\cos^2x)\cos^4x=\cos^4x-\cos^6x\). So we may evaluate the integral using the formula (\(n>0\)) \[ \int\cos^nx\mathrm{d} x =\frac1n\sin x\cos^{n-1}x-\frac{n-1}{n}\int\cos^{n-2}x\mathrm{d}x \] which is obtain via integration by parts.

Exercise 8.14 Evaluate the integral.

\[ \int \tan x \sec^{3} x \mathrm{d} x \]

Solution.

Note that \(\mathrm{d}(\sec x)=(\tan x\sec x)\mathrm{d} x\). Let \(t=\sec x\). Then \[ \begin{aligned} \int \tan x \sec^{3} x \mathrm{d} x =&\int t^2\mathrm{d} t \qquad\qquad t=\sec x\\ =&\frac{t^3}{3} + C\\ =&\frac{\sec^3x}{3} + C \end{aligned} \]

Exercise 8.15 Evaluate the integral.

\[ \int_{0}^{\pi / 4} \sec^{4} x \tan^{4} x \mathrm{d} x \]

Solution.

Let \(t=\tan x\). Then \(\mathrm{d} t=\sec^2x\mathrm{d} x\). Using the Pythagorean identity \(1+\tan^2x=\sec^2x\), we get \[ \begin{aligned} & \int \sec^{4} x \tan^{4} x \mathrm{d} x\\ =& \int (1+t^2)t^2 \mathrm{d} t\\ =& \int (t^2+t^4) \mathrm{d} t\\ =& \frac{t^3}{3}+\frac{t^4}{4} + C\\ =& \frac{\tan^3 x}{3}+\frac{\tan^4x}{4} + C \end{aligned} \]

By FTC, \[ \int_{0}^{\pi / 4} \sec^{4} x \tan^{4} x \mathrm{d} x =\frac{\tan^3(\pi/4)}{3}+\frac{\tan^4(\pi/4)}{4}=\frac13+\frac14=\frac7{12}. \]

Exercise 8.16 Evaluate the integral.

\[ \int \tan^{5} x \mathrm{d} x \]

Solution.

One way to evaluate the integral is to rewrite \(\tan^5x=\frac{\sin^5x}{\cos^5 x}\) and then substitute \(t=\cos x\).

Another way is to use the identity \(\tan^2x=1-\sec^2x\) and \(\frac{\mathrm{d}}{\mathrm{d} x}\tan x=\sec^2\) to deduce a reduction formula. \[ \begin{aligned} & \int \tan^{5} x \mathrm{d} x\\ =& \int \tan^{3} x(\sec^2x-1) \mathrm{d} x\\ =& \int (\tan^{3}x\sec^2x-\tan^3x)\mathrm{d} x\\ =& \int \tan^{3}x\sec^2x \mathrm{d} x - \int \tan^3x \mathrm{d} x\\ =& \int t^3\mathrm{d} t-\int\tan^3x\mathrm{d} x \qquad\qquad t=\tan x\\ =& \frac{t^4}{4}-\int\tan x(\sec^2x-1)\mathrm{d} x\\ =& \frac{\tan^4x}{4}-\int\tan x\sec^2x \mathrm{d} x + \int \tan x\mathrm{d} x\\ =& \frac{\tan^4x}{4}-\frac{\tan^2 x}{2} - \ln|\cos x| + C. \end{aligned} \]

Remark: In general (\(n\neq 1\)), we have \[ \int \tan^{n} x \mathrm{d} x=\frac{1}{n-1} \tan^{n-1} x-\int \tan^{n-2} x \mathrm{d} x \]

Exercise 8.17 Evaluate the integral.

\[ \int x \sec x \tan x \mathrm{d} x \]

Solution.

Let \(f(x)=x\) and \(g'(x)=\sec x\tan x\). Then \(g(x)=\sec x\). By integration by parts, we have \[ \begin{aligned} &\int x \sec x \tan x \mathrm{d} x\\ =&x\sec x-\int \sec x\mathrm{d} x\\ =&x\sec x - \ln|\sec x+\tan x| + C. \end{aligned} \]

Exercise 8.18 Evaluate the integral.

\[ \int \sin 5 x \sin x \mathrm{d} x \]

Solution.

Using the sum of angles formula for cosine, we have \[ \begin{aligned} &\int \sin 5 x \sin x \mathrm{d} x\\ =&\frac12\int(\cos4x-\cos 6x)\mathrm{d} x\\ =&\frac18\sin4x-\frac1{12}\sin6x + C. \end{aligned} \]

8.2 Trigonometric Substitution

When having \(\sqrt{a^2-b^2x^2}\), \(\sqrt{a^2+b^2x^2}\) or \(\sqrt{b^2x^2-a^2}\), we consider trigonometric substitution.

Assume that \(a\) and \(b\) are both positive. Then we have the following table of substitutions and transformations.

Expression Substitution Transformation
\(\sqrt{a^2-b^2x^2}\) \(x=\frac ab \sin \theta, \quad-\frac{\pi}{2} \le \theta \le \frac{\pi}{2}\) \(\sqrt{a^2-b^2x^2}=a \cos(\theta)\)
\(\sqrt{a^2+b^2x^2}\) \(x=\frac ab \tan \theta, \quad-\frac{\pi}{2}<\theta<\frac{\pi}{2}\) \(\sqrt{a^2+b^2x^2}=a \sec(\theta)\)
\(\sqrt{b^2x^2-a^2}\) \(x=\frac ab \sec \theta, \quad0 \le \theta<\frac{\pi}{2} \text { or } \pi \le \theta<\frac{3 \pi}{2}\) \(\sqrt{b^2x^2-a^2}=a \tan(\theta)\)

Exercise 8.19 Evaluate the integral.

\[ \int \frac{x^{2}}{\sqrt{9-x^{2}}} \mathrm{d} x \]

Solution.

Let \(x=3\sin t\) with \(-\pi/2<t <\pi/2\).

Then \[ \begin{aligned} &\int \frac{x^{2}}{\sqrt{9-x^{2}}} \mathrm{d} x\\ =&\int \frac{9\sin^{2}t}{3\cos t} 3\cos t\mathrm{d} t \\ =&\int 9\sin^{2}t \mathrm{d} t \\ =&\frac92\int(1-\cos2t)\mathrm{d} t\\ =&\frac92t-\frac94\sin2t + C\\ =&\frac92\arcsin\left(\frac x3\right) - \frac12 x \sqrt{9-x^2} + C \end{aligned} \]

Exercise 8.20 Evaluate the integral.

\[ \int_{0}^{a} \frac{\mathrm{d} x}{\left(a^{2}+x^{2}\right)^{3/2}}, \quad a>0 \]

Solution.

Let \(x=a\tan t\) with \(-\pi/2<t <\pi/2\). Then \(\mathrm{d} x=a\sec^2 t \mathrm{d} t\) and \((a^2+x^2)^{3/2}=(a\sec t)^3\).

Then \[ \begin{aligned} &\int \frac{\mathrm{d} x}{\left(a^{2}+x^{2}\right)^{3/2}}\\ =&\int \frac{a\sec^2 t\mathrm{d} t}{a^3\sec^3 t}\\ =&\int \frac{\cos t\mathrm{d} t}{a^2}\\ =&\frac{\sin t}{a^2} + C\\ =&\frac{1}{a^2}\sqrt{\frac{x^2}{a^2+x^2}} + C \end{aligned} \]

Remark: Since \(\tan t=\frac xa\), then \(\sec^2 t=1+\frac{x^2}{a^2}\) and \(\cos^2 t=\frac{a^2}{a^2+x^2}\). So \(\sin t=\sqrt{1-\cos^2 t}=\sqrt{\frac{x^2}{a^2+x^2}}\).

By FTC, \[ \int_{0}^{a} \frac{\mathrm{d} x}{\left(a^{2}+x^{2}\right)^{3/2}} =\frac{1}{a^2}\sqrt{\frac{a^2}{a^2+a^2}}=\frac{\sqrt2}{2a^2}. \]

Exercise 8.21 Evaluate the integral.

\[ \int_{2}^{3} \frac{\mathrm{d} x}{\left(x^{2}-1\right)^{3/2}} \]

Solution.

Let \(x=\sec t\) with \(0<t <\pi/2\) or \(\pi<t<3\pi/2\). Then \(\mathrm{d} x=\sec t\tan t \mathrm{d} t\) and \((x^2-1)^{3/2}=\tan^3 t\).

Then \[ \begin{aligned} &\int \frac{\mathrm{d} x}{\left(x^{2}-1\right)^{3/2}}\\ =&\int \frac{\sec t\tan t\mathrm{d} t}{\tan^3 t}\\ =&\int \frac{\cos t\mathrm{d} t}{\sin^2 t}\\ =&-\frac{1}{\sin t} + C\\ =&\frac{x}{\sqrt{x^2-1}} + C \end{aligned} \]

Remark: Here we used the identities \(\sin t=\sqrt{1-\cos^2 t}=\sqrt{1-\frac1{\sec^2 t}}=\sqrt{1-\frac{1}{x^2}}\).

By FTC, \[ \int_{2}^{3} \frac{\mathrm{d} x}{\left(x^{2}-1\right)^{3/2}} =\frac{3}{\sqrt{9^2-1}}-\frac{2}{\sqrt{2^2-1}}=\frac{8\sqrt3-9\sqrt2}{12}. \]

Exercise 8.22 Evaluate the integral.

\[ \int \frac{\mathrm{d} x}{\sqrt{x^{2}+2 x+5}} \]

Solution.

By completing the square, we may rewrite \(x^{2}+2 x+5=1+(x+1)^2\). Let \(x+1=\sec t\). Then \(\mathrm{d} x=\sec t\tan t\mathrm{d} t\) and \(\sqrt{x^{2}+2 x+5}=\tan t\). Therefore, \[ \begin{aligned} &\int \frac{\mathrm{d} x}{\sqrt{x^{2}+2 x+5}}\\ =& \int \frac{\sec t\tan t\mathrm{d} t}{\tan t}\\ =&\int \sec t\mathrm{d} t\\ =&\ln|\sec t+\tan t| + C\\ =&\ln|x+1+\sqrt{1-(x+1)^2}| +C \end{aligned} \]

Exercise 8.23 Evaluate the integral.

\[ \int x \sqrt{1-x^{4}} \mathrm{d} x \]

Solution.

Let \(x^2=\sin t\), then \(2x\mathrm{d} x=\cos t\mathrm{d} t\) and \(\sqrt{1-x^{4}}=\cos t\). Then \[ \begin{aligned} &\int x \sqrt{1-x^{4}} \mathrm{d} x\\ =&\frac12\int \cos^2 t\mathrm{d} t\\ =&\frac14\int(1+\cos 2t)\mathrm{d} t\\ =&\frac14t+\frac18\sin2t + C\\ =&\frac14\arcsin(x^2)+\frac12x^2\sqrt{1-x^4} + C\\ \end{aligned} \]

Remark: Instead of substitute \(x^2\) by \(\sin t\), you may use substitution twice, \(u=x^2\), \(u=\sin t\).

Exercise 8.24 Evaluate the integral.

\[ \int_{0}^{\pi / 2} \frac{\cos x}{\sqrt{1+\sin^{2} x}} \mathrm{d} x \]

Solution.

Let \(\sin x=\tan t\). Then \(\cos x\mathrm{d}x=\sec^2t\mathrm{d} t\) and \(\sqrt{1+\sin^2x}=\sqrt{1+\tan^2t}=\sec t\). Therefore, \[ \begin{aligned} &\int \frac{\cos x}{\sqrt{1+\sin^{2} x}} \mathrm{d} x\\ =&\int \frac{\sec^2 t \mathrm{d} t}{\sec t}\\ =&\int \sec t \mathrm{d} t\\ =&\ln|\sec t+\tan t| + C =&\ln|\sin x+\sqrt{1+\sin^2 x}| + C \end{aligned} \]

By FTC, \[ \int_{0}^{\pi / 2} \frac{\cos x}{\sqrt{1+\sin^{2} x}} \mathrm{d} x= \ln|1+\sqrt{1+1}|-0=\ln(1+\sqrt2) \]

Remark: Instead of the substitution \(\sin x=\tan t\), you may first set \(u=\sin x\) and then set \(u=\tan t\).

8.3 Integrations of Rational Functions by Partial Fractions

In Algebra, there is a theorem called the Fundamental Theorem of Algebra which implies that for rational function \(P(x)/Q(x)\) can be written as a sum of partial fractions of the form \[ \frac{A}{(a x+b)^{i}} \quad \text { or } \quad \frac{A x+B}{\left(a x^{2}+b x+c\right)^{j}}, \] where \(ax^2+bx+c\) is a irreducible quadratic form, that is the equation \(ax^2+bx+c=0\) has no real roots.

After rewriting the rational function into a sum of partial fractions, we may use substitution methods to find the integral.

Exercise 8.25 Write out the form of the partial fraction decomposition of the function. Do not determine the numerical values of the coefficients.

\[ \frac{x^2-2}{x^{3}+2x^2+x} \]

Solution.

The denominator can be factor into \(x(x+1)^2\). Then the sum of partial fractions for the rational function can be written in the following form \[ \frac{x^2-2}{x^{3}+2x^2+x}=\frac{A}{x}+\frac{B}{x+1}+\frac{C}{(x+1)^2}. \]

Remark: To determine the values of coefficients, we clear the denominator first. From here, there are two ways you may try.

Method one: substitute \(x\) by the roots of the GCD and/or special numbers and then solve for the undetermined coefficients.

Method two: simplify both sides and get system of equations of the undetermined coefficients by comparing coefficients of polynomials in both sides.

Exercise 8.26 Write out the form of the partial fraction decomposition of the function. Do not determine the numerical values of the coefficients.

\[ \frac{x^{4}}{\left(x^{2}-x+1\right)\left(x^{2}+2\right)^{2}} \]

Solution.

Since the denominators has irreducible quadratic functions, the partial fraction form for the rational function can be written as

\[ \frac{x^{4}}{\left(x^{2}-x+1\right)\left(x^{2}+2\right)^{2}}=\frac{A_1x+B_1}{x^2-x+1}+\frac{A_2x+B_2}{x^2+2}+\frac{A_3x+C_3}{(x^2+2)^2}. \]

Remark: Although an irreducible quadratic form has no real roots, it has complex roots. One may also substitute \(x\) by a complex root to solve of the undetermined coefficients.

Exercise 8.27 Evaluate the integral \[ \int \frac{5 x+1}{(2x+1)(x-1)} \mathrm{d} x \]

Solution.

We first write the rational function in the partial fraction form \[ \frac{5 x+1}{(2x+1)(x-1)}=\frac{A}{2x+1}+\frac{B}{x-1}. \]

Clear the denominators, we have \[ 5x+1=A(x-1)+B(2x+1). \]

Let \(x=1\), we get \(6=3B\). So \(B=2\).

Let \(x=-\frac12\), we get \(-\frac52+1=A(-\frac12-1)\). So \(A=1\).

Then the integral is \[ \begin{aligned} &\int \frac{5 x+1}{(2x+1)(x-1)} \mathrm{d} x\\ =&\int\frac{1}{2x+1}\mathrm{d} x+\int\frac{2}{x-1}\mathrm{d} x\\ =&\frac12\ln|2x+1|+2\ln|x-1| + C. \end{aligned} \]

Exercise 8.28 Evaluate the integral

\[ \int_{0}^{1} \frac{2}{2 x^{2}+3 x+1} \mathrm{d} x \]

Solution.

The denominator can be factored into \((2x+1)(x+1)\).

Write the rational function in the partial fraction form \[ \frac{2}{2 x^{2}+3 x+1}=\frac{A}{2x+1}+\frac{B}{x+1}. \]

Clear the denominators, we have \[ 2=A(x+1)+B(2x+1). \]

Let \(x=-1\), we get \(2=-B\). So \(B=-2\).

Let \(x=-\frac12\), we get \(2=A(-\frac12+1)\). So \(A=4\).

Then the indefinite integral is \[ \begin{aligned} &\int \frac{2}{(2x+1)(x+1)} \mathrm{d} x\\ =&\int\frac{4}{2x+1}\mathrm{d} x+\int\frac{-2}{x-1}\mathrm{d} x\\ =&2\ln|2x+1|-2\ln|x+1| + C. \end{aligned} \]

By FTC, \[ \int_{0}^{1} \frac{2}{2 x^{2}+3 x+1} \mathrm{d} x=2\ln3-2\ln2=\ln\left(\frac94\right). \]

Exercise 8.29 Evaluate the integral

\[ \int_{0}^{1} \frac{x^{2}+x+1}{(x+1)^{2}(x+2)} \mathrm{d} x \]

Solution.

Write the rational function in the partial fraction form \[ \frac{x^{2}+x+1}{(x+1)^{2}(x+2)}=\frac{A}{x+2}+\frac{B}{x+1}+\frac{C}{(x+1)^2}. \]

Clear the denominators, we have \[ x^2+x+1=A(x+1)^2+B(x+1)(x+2)+C(x+2). \]

Let \(x=-1\), we get \(1=C\).

Let \(x=-2\), we get \(3=A\).

Comparing coefficients of degree two terms in both sides, we get \(1=A+B\). So \(B=-2\).

Then the indefinite integral is \[ \begin{aligned} &\int \frac{x^{2}+x+1}{(x+1)^{2}(x+2)} \mathrm{d} x\\ =&\int\frac{3}{x+2}\mathrm{d} x+\int\frac{-2}{x+1}\mathrm{d} x+\int\frac{1}{(x+1)^2}\mathrm{d} x\\ =&3\ln|x+2|-2\ln|x+1| -\frac{1}{x+1}+ C. \end{aligned} \]

By FTC, \[ \begin{aligned} \int_{0}^{1} \frac{2}{2 x^{2}+3 x+1} \mathrm{d} x=&\left(3\ln3-2\ln2-\frac12\right)-(3\ln2-2\ln1-1)\\ =&\frac12+\ln\left(\frac{27}{32}\right). \end{aligned} \]

Exercise 8.30 Evaluate the integral

\[ \int \frac{x^{2}-x+6}{x^{3}+3 x} \mathrm{d} x \]

Solution.

The denominator can be factored into \(x(x^2+3)\).

We may write the rational function in the partial fraction form \[ \frac{x^{2}-x+6}{x^{3}+3 x}=\frac{A}{x}+\frac{Bx+C}{x^2+3}. \]

Clear the denominators, we have \[ x^{2}-x+6=A(x^2+3)+Bx^2+Cx. \]

Let \(x=0\). We find \(A=2\). Let \(x=i\sqrt{3}\), we get \(x^2=-3\) and \[ -3-i\sqrt{3}+6=-3B+i\sqrt{3}C. \] Since \(B\) and \(C\) are real numbers, \(3=-3B\) and \(-i\sqrt{3}=i\sqrt{3}C\). So \(B=-1\) and \(C=-1\).

Then the indefinite integral is \[ \begin{aligned} &\int \frac{x^{2}-x+6}{x^{3}+3 x} \mathrm{d} x\\ =&\int\frac{2}{x}\mathrm{d} x-\int\frac{x}{x^2+3}\mathrm{d} x-\int\frac{1}{x^2+3}\mathrm{d} x\\ =&2\ln|x|-\frac12\ln(x^2+3) -\frac{\sqrt{3}}{3}\arctan\left(\frac{x}{\sqrt{3}}\right)+ C\\ =&\ln\left(\frac{x^2}{\sqrt{x^3+3}}\right) -\frac{\sqrt{3}}{3}\arctan\left(\frac{x}{\sqrt{3}}\right)+ C. \end{aligned} \]

Exercise 8.31 Evaluate the integral

\[ \int \frac{x^{2}+x+1}{\left(x^{2}+1\right)^{2}} \mathrm{d} x \]

Solution.

The rational function can be written in the partial fraction form \[ \begin{aligned} \frac{x^{2}+x+1}{\left(x^{2}+1\right)^{2}}&=\frac{x^{2}+1}{\left(x^{2}+1\right)^{2}}+\frac{x}{\left(x^{2}+1\right)^{2}}\\ &=\frac{1}{x^2+1}+\frac{x}{(x^2+1)^2}. \end{aligned} \]

Clear the denominators, we have \[ x^{2}+x+1=(Ax+B)(x^2+1)+Cx+D. \]

By comparing the top degree terms, we find that \(A=0\). So the equality become \[ x^{2}+x+1=B(x^2+1)+Cx+D. \] Comparing the same degree terms, we find \(B=1\), \(C=1\) and \(1=B+D\) which implies \(D=0\). –>

Therefore, \[ \begin{aligned} &\int\frac{x^{2}+x+1}{\left(x^{2}+1\right)^{2}} \mathrm{d} x\\ =&\int\frac{1}{x^2+1}\mathrm{d} x+\int\frac{x}{(x^2+1)^2}\mathrm{d} x\\ =&\arctan x-\frac{1}{2(x^2+1)}+C. \end{aligned} \]

Exercise 8.32 Evaluate the integral

\[ \int \frac{x^{3}+6 x-2}{x^{4}+6 x^{2}} \mathrm{d} x \]

Solution.

The rational function can be written in the partial fraction form \[ \begin{aligned} \frac{x^{3}+6 x-2}{x^{4}+6 x^{2}}&=\frac{A}{x}+\frac{B}{x^2}+\frac{Cx+D}{x^{2}+6}. \end{aligned} \]

Clear the denominators, we have \[ x^{3}+6 x-2=Ax(x^2+6)+B(x^2+6)+Cx^3+Dx^2. \]

Let \(x=0\). We find \(B=-\frac13\).

Let \(x=i\sqrt{6}\). Then \(x^2=-6\), \(x^3=-6\sqrt{6}~i\) and \[ -2=-6\sqrt{6}C~i-6D. \] As \(C\) and \(D\) are real numbers, we must have \(C=0\) and \(D=\frac13\).

Comparing degree 3 terms, we find \(A=1\).

Therefore, \[ \begin{aligned} &\int \frac{x^{3}+6 x-2}{x^{4}+6 x^{2}}\mathrm{d} x\\ =&\int\frac{1}{x}\mathrm{d} x+\int\frac{-\frac13}{x^2}\mathrm{d} x+\int\frac{\frac13}{x^2+6}\mathrm{d} x\\ =&\ln|x|+\frac{1}{3x}+\frac{\sqrt{6}}{18}\arctan\left(\frac{x}{\sqrt{6}}\right)+C. \end{aligned} \]

Exercise 8.33 Evaluate the integral

\[ \int \frac{\mathrm{d} x}{x \sqrt{x-1}} \]

Solution.

Although the integrand is note a rational function, we may apply a linear substitution \(u=\sqrt{x-1}\) to rewrite the integral as \[ \int \frac{\mathrm{d} x}{x \sqrt{x-1}}=\int \frac{2u\mathrm{d} u}{u(u^2+1)} \]

Simplify and evaluate the resulting integral, we get \[ \int \frac{\mathrm{d} x}{x \sqrt{x-1}}=2\arctan(\sqrt{x-1})+C. \]

Exercise 8.34 Evaluate the integral

\[ \int \frac{\sin x}{\cos ^{2} x-3 \cos x} \mathrm{d} x \]

Solution.

Let \(u=\cos x\). Then \[ \begin{aligned} & \int \frac{\sin x}{\cos ^{2} x-3 \cos x} \mathrm{d} x\\ =&\int\frac{-\mathrm{d} x}{x^2-3x}\\ =&\frac13\int\left(\frac{1}{x}-\frac{1}{x-3}\right)\mathrm{d} x\\ =&\frac13\left(\ln|x|-\ln|x-3|\right)+C\\ =&\frac13\left(\ln|\cos x|-\ln|\cos x-3|\right)+C. \end{aligned} \]

8.4 Improper Integrals

8.4.1 Infinite Intervals

Definition 8.1 Suppose the integral \(\int_a^t f(x)\mathrm{d} x\) exists for any \(t\).

Then \[ \int_a^\infty f(x)\mathrm{d} x=\lim_{t\to \infty}\int_a^tf(x)\mathrm{d} x, \] and \[ \int^a_{-\infty} f(x)\mathrm{d} x=\lim_{t\to -\infty}\int^a_tf(x)\mathrm{d} x. \]

An improper integral is called convergent if the corresponding limit exists and divergent if the limit does not exist.

If both \(\int_a^\infty f(x)\mathrm{d} x\) and \(\int^a_{-\infty} f(x)\mathrm{d} x\) are convergent, then \[ \int_{-\infty}^\infty f(x)\mathrm{d} x=\int_a^\infty f(x)\mathrm{d} x+\int^a_{-\infty} f(x)\mathrm{d} x. \]

Exercise 8.35 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent. \[ \int_{0}^{\infty} \frac{1}{\sqrt[4]{1+x}} \mathrm{d} x \]

Solution.

We first find the indefinite integral. \[ \begin{aligned} &\int \frac{1}{\sqrt[4]{1+x}} \mathrm{d} x\\ =&\int u^{-\frac14} \mathrm{d} u \qquad\qquad u=x+1\\ =&\frac43 u^{\frac34} + C\\ =&\frac{4}{3}(1+x)^{\frac34} + C. \end{aligned} \]

Then \[ \begin{aligned} &\lim_{t\to \infty}\int_0^t \frac{1}{\sqrt[4]{1+x}} \mathrm{d} x\\ =& \lim_{t\to \infty}\left(\frac{4}{3}(1+t)^{\frac34}-\frac{4}{3}\right)\\ =&\infty. \end{aligned} \]

By definition, \[ \int_{0}^{\infty} \frac{1}{\sqrt[4]{1+x}} \mathrm{d} x= \lim_{t\to \infty}\int_0^t \frac{1}{\sqrt[4]{1+x}} \mathrm{d} x =\infty \] is divergent.

Exercise 8.36 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent. \[ \int_{-\infty}^{0} 2^{x} \mathrm{d} x \]

Solution.

We first find the indefinite integral. \[ \begin{aligned} &\int 2^{x} \mathrm{d} x\\ =&\frac{2^x}{\ln 2}+C\\ \end{aligned} \]

Then \[ \begin{aligned} &\lim_{t\to -\infty}\int_t^0 2^{x} \mathrm{d} x\\ =& \lim_{t\to \infty}\left(\frac{1}{\ln 2}-\frac{2^x}{\ln 2}\right)\\ =&\frac{1}{\ln2}. \end{aligned} \]

By definition, \[ \int_{0}^{\infty} \frac{1}{\sqrt[4]{1+x}} \mathrm{d} x= \lim_{t\to \infty}\int_0^t \frac{1}{\sqrt[4]{1+x}} \mathrm{d} x =\frac{1}{\ln2}. \]

Exercise 8.37 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent. \[ \int_{-\infty}^{\infty} \frac{x^{2}}{9+x^{6}} \mathrm{d} x \]

Solution.

We first find the indefinite integral. \[ \begin{aligned} &\int \frac{x^{2}}{9+x^{6}} \mathrm{d} x\\ =&\frac19\int \frac{1}{1+u^2} \mathrm{d} u\qquad\qquad 3u=x^3\\ =&\frac19\arctan u + C\\ =&\frac19\arctan\left(\frac{x^3}{3}\right) + C\\ \end{aligned} \]

Then \[ \begin{aligned} &\lim_{t\to -\infty}\int_t^0 \frac19\arctan\left(\frac{x^3}{3}\right)\\ =&\lim_{t\to -\infty} -\frac19\arctan\left(\frac{t^3}{3}\right)\\ =&\frac{\pi}{18} \end{aligned} \] and \[ \begin{aligned} &\lim_{t\to \infty}\int^t_0 \frac19\arctan\left(\frac{x^3}{3}\right)\\ =&\lim_{t\to \infty} \frac19\arctan\left(\frac{t^3}{3}\right)\\ =&\frac{\pi}{18}. \end{aligned} \]

By definition, \[ \int_{-\infty}^{\infty} \frac{x^{2}}{9+x^{6}} \mathrm{d} x = \frac{\pi}{18}+\frac{\pi}{18}=\frac{\pi}{9}. \]

Exercise 8.38 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent. \[ \int_{2}^{\infty} x e^{-3 x} \mathrm{d} x \]

Solution.

We first find the indefinite integral. \[ \begin{aligned} &\int x e^{-3 x} \mathrm{d} x\\ =&\int x \left(\frac{e^{-3 x}}{-3}\right)^\prime\mathrm{d} x\\ =&-\frac13\left(xe^{-3x}-\int e^{-3 x}\mathrm{d} x\right)\\ =&-\frac13\left(xe^{-3x}+\frac13 e^{-3 x}\right) + C\\ =&-\frac13xe^{-3x}-\frac19 e^{-3 x} + C \end{aligned} \]

Then \[ \begin{aligned} &\int_{2}^{\infty}x e^{-3 x} \mathrm{d} x\\ =&\lim_{t\to -\infty}\left[\left(-\frac13te^{-3t}-\frac19 e^{-3t}\right) - \left(-\frac132e^{-6}-\frac19 e^{-6}\right)\right]\\ =&\frac79 e^{-6}-\frac13\lim_{t\to -\infty}te^{-3t}\\ =&\frac79 e^{-6} \qquad\qquad \text{by L'Hospital's rule} \end{aligned} \]

8.4.2 Discountinuous Integrands

Definition 8.2 Suppose the function \(f\) is continuous on \([a, b)\) but discontinuous at \(b\). Then \[ \int_a^b f(x)\mathrm{d} x=\lim_{t\to b^-}\int_a^tf(x)\mathrm{d} x. \]

Suppose the function \(f\) is continuous on \((a, b]\) but discontinuous at \(a\). Then \[ \int_a^b f(x)\mathrm{d} x=\lim_{t\to a^+}\int^b_tf(x)\mathrm{d} x. \]

An improper integral is called convergent if the corresponding limit exists and divergent if the limit does not exist.

If \(f\) has a discontinuity \(c\) within the interval \((a, b)\) and both \(\int_a^c f(x)\mathrm{d} x\) and \(\int_c^b f(x)\mathrm{d} x\) are convergent, then \[ \int_a^b f(x)\mathrm{d} x=\int_a^c f(x)\mathrm{d} x+\int^b_c f(x)\mathrm{d} x \]

Exercise 8.39 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent.

\[ \int_{2}^{3} \frac{1}{\sqrt{3-x}} \mathrm{d} x \]

Solution.

We first find the indefinite integral. \[ \begin{aligned} &\int \frac{1}{\sqrt{3-x}} \mathrm{d} x\\ =&-\int u^{-\frac12} \mathrm{d} u\qquad\qquad u=3-x\\ =&-2\sqrt{u} + C\\ =&-2\sqrt{3-x}+C \end{aligned} \]

Then \[ \begin{aligned} &\int_2^3 \frac{1}{\sqrt{3-x}} \mathrm{d} x\\ =&\lim_{t\to 3^-} \int_2^{t} \frac{1}{\sqrt{3-x}}\\ =&\lim_{t\to 3^-}(-2\sqrt{3-t}+2)\\ =&2 \end{aligned} \]

Exercise 8.40 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent.

\[ \int_{0}^{1} \frac{\ln x}{\sqrt{x}} \mathrm{d} x \]

Solution.

We first find the indefinite integral. \[ \begin{aligned} &\int \frac{\ln x}{\sqrt{x}} \mathrm{d} x\\ =&2\int \ln(u^2) \mathrm{d} u\qquad\qquad u=\sqrt{x}\\ =&4\int \ln u \mathrm{d} u\\ =&4(u\ln u-u) +C\\ =&2\sqrt{x}\ln x-4\sqrt{x} + C. \end{aligned} \]

Then \[ \begin{aligned} &\int_{0}^{1} \frac{\ln x}{\sqrt{x}} \mathrm{d} x\\ =&\lim_{t\to 0^+}\int_t^1 \frac{\ln x}{\sqrt{x}} \mathrm{d} x\\ =& -4-\lim_{t\to 0^+}(2\sqrt{t}\ln t-4\sqrt{t})\\ =&-4-\lim_{t\to 0^+}(2\sqrt{t}\ln t)\\ =&-4-2\lim_{t\to 0^+}\frac{(\ln t)'}{\left(\frac{1}{\sqrt{t}}\right)'} \qquad\text{L'Hospitcal's rule}\\ =&-4-2\cdot 0\\ =&-4.\\ \end{aligned} \]

Exercise 8.41 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent.

\[ \int_{0}^{5} \frac{x}{x-2} \mathrm{d} x \]

Solution.

We first find the indefinite integral. \[ \begin{aligned} &\int \frac{x}{x-2} \mathrm{d} x\\ =&\int \left(1+\frac{2}{x-2}\right) \mathrm{d} x\\ =&x+2 \ln|x-2|. \end{aligned} \]

Since \(\lim\limits_{t\to 2^+}\ln(t-2)=-\infty\), \[ \begin{aligned} &\lim_{t\to 2^+}\int_t^5 \frac{x}{x-2} \mathrm{d} x\\ =& 5+2\ln 3 - \lim_{t\to 2^+}(t+2\ln(t-2))\\ =&-\infty. \end{aligned} \]

Therefore, the given improper integral is divergent.

Exercise 8.42 Determine whether the integral is convergent or divergent. Evaluate the integral if it is convergent.

\[ \int_{0}^{3} \frac{\mathrm{d} x}{x^{2}-6 x+5} \]

Solution.

We first find the indefinite integral by partial fractions. \[ \begin{aligned} &\int \frac{\mathrm{d} x}{x^{2}-6 x+5}\\ =&\int \frac{-\frac14}{x-1}+\frac{\frac14}{x-5} \mathrm{d} x\\ =&-\frac14\int \frac{1}{x-1}-\frac{1}{x-5} \mathrm{d} x\\ =&-\frac14(\ln|x-1|-\ln|x-5|) + C. \end{aligned} \]

Since \(\lim\limits_{t\to 1^+}\ln(t-1)=-\infty\), similar to the previous question, the given improper integral is divergent.

8.4.3 Comparison Test

Theorem 8.1 Suppose \(f\) and \(g\) are continuos functions and \(f(x)\ge g(x)\ge 0\) for all \(x\ge a\).

  1. If \(\int_a^{\infty} f(x)\mathrm{d} x\) is convergent, then \(\int_a^{\infty} g(x)\mathrm{d} x\) is convergent.

  2. If \(\int_a^{\infty} g(x)\mathrm{d} x\) is divergent, then \(\int_a^{\infty} f(x)\mathrm{d} x\) is divergent.

The same conclusion holds true for improper integrals of functions with discontinuities.

We have the following results. \[ \int_{1}^{\infty} \frac{1}{x^{p}} \mathrm{d} x \quad \text{ is convergent if }\quad p>1 \quad \text { and divergent if } \quad p \leq 1 \]

\[ \int_{1}^{\infty} \frac{1}{e^{kx}} \mathrm{d} x \quad \text{ is convergent if }\quad k>0 \quad \text { and divergent if } \quad k < 0. \]

Exercise 8.43 Determine whether the integral is convergent or divergent.

\[ \int_{0}^{\infty} \frac{\sin^2 x}{1+x^{2}} \mathrm{d} x \]

Solution.

We know that \[ \int_0^\infty\frac1{1+x^2}\mathrm{d} x=\lim_{t\to \infty} \int_0^t\frac1{1+x^2}\mathrm{d} x = \lim_{t\to \infty} \arctan t=\frac{\pi}{2}. \]

Since \(0\leq \sin^2 x\le 1\), by comparison theorem, the integral is convergent.

Exercise 8.44 Determine whether the integral is convergent or divergent.

\[ \int_{0}^{\infty} \frac{\arctan x}{2+e^{x}} \mathrm{d} x \]

Solution.

We know that \[ \int_0^\infty\frac1{e^x}\mathrm{d} x=\lim_{t\to \infty} \int_0^t e^{-x}\mathrm{d} x = \lim_{t\to \infty} -e^t+1=1. \]

Since \[ 0\leq \frac{\arctan x}{2+e^x}\le \frac{\pi}{2}\frac1{e^x}, \] by comparison theorem, the integral is convergent.