How to integrate $\int{\frac{1}{\cos(x)}}dx$ using the substitution $u=\tan\left(\frac{x}2\right)$?

6.8k Views Asked by At

So far, I've tried out to reformulate: $$\int{\frac{1}{\cos(x)}}dx$$ to: $$\int{\frac{\sin(x)}{\cos(x)\sin(x)}}dx$$

which is basically: $$\int{\frac{\tan(x)}{\sin(x)}}dx$$ But I'm not sure if this is the right way to go, or if I try something else.

Any tips or methods would be very helpful.

8

There are 8 best solutions below

1
On BEST ANSWER

This substitution is to be used as a last resort? Bioche's rules say in this case the correct substitution is $u=\sin x$, $\mathrm d\mkern1mu u=\cos x\,\mathrm d\mkern1mu x$. Indeed $$\int\frac{\mathrm d\mkern1mu x}{\cos x}=\int\frac{\cos x\,\mathrm d\mkern1mu x}{\cos^2 x}=\int\frac{\mathrm d\mkern1mu u}{1-u^2}=\frac12\ln\Bigl(\frac{1+u}{1-u}\Bigr)=\frac12\ln\Bigl(\frac{1+\sin x}{1-\sin x}\Bigr).$$

Note:

Using some trigonometry formulae, this may be rewritten as $$\ln\Bigl(\tan\Bigl(\frac x2+\frac\pi 4\Bigr)\Bigr).$$

2
On

Hint:

If $u=\tan\left(x\over2\right)$, then $\cos x={1-u^2\over1+u^2}$ and $dx={2\ du\over1+u^2}$. Hence

\begin{equation} \int {1\over\cos x}\ dx=\int{2\over1-u^2}\ du=\int\left[\frac{1}{1+u}+\frac{1}{1-u}\right]\ du \end{equation}

0
On

$$\int { \frac { 1 }{\cos(x) } } dx=\int { \frac { \cos { x }\, dx }{ \cos ^{ 2 }{ x } } } =\int { \frac { d\left( \sin { x } \right) }{ 1-\sin^{ 2 }{ x } } } =\frac { 1 }{ 2 } \int { \left( \frac { 1 }{ 1-\sin { x } } +\frac { 1 }{ 1+\sin { x } } \right) d\left( \sin { x } \right) } =\frac { 1 }{ 2 } \ln { C\left| \frac { 1+\sin { x } }{ 1-\sin { x } } \right| } $$

0
On

These are the things I would try. I would find $\cos(x)$ in terms of $x/2$ because I would have to do that eventually anyway, here $\cos(x) = 2\cos^2(x/2) - 1$.

Then I would replace the $dx$ with an expression in $du$ as that also must be done eventually. \begin{align*} du = & 0.5 \sec^2(x/2)\, dx\\ dx = & 2 \cos^2(x/2)\, du \end{align*} Thus the integral becomes $$\int \frac{2 \cos^2(x/2)}{1 - 2 \cos^2(x/2)} du$$ This reminds me of the rule $\sec^2(x/2) = 1 + \tan^2(x/2)$, thus I divide the top and the bottom by $\cos^2(x/2)$, I rewrite it in terms of $\sec^2(x/2)$ and then in terms of $\tan^2(x/2)$ and then in terms of $u$ and I solve it.

0
On

You can certainly do it with the substitution $t=\tan(x/2)$: you have $$ \int\frac{1}{\cos x}\,dx= \int\frac{1+t^2}{1-t^2}\frac{2}{1+t^2}\,dt= \int\left(\frac{1}{1+t}+\frac{1}{1-t}\right)\,dt= \log\left|\frac{1+t}{1-t}\right|+c $$ The back substitution gives $$ \log\left| \frac{\cos\frac{x}{2}+\sin\frac{x}{2}} {\cos\frac{x}{2}-\sin\frac{x}{2}} \right|+c=\log\left|\frac{1+\sin x}{\cos x}\right|+c $$

1
On

When I learned how to do this, I used a much different substitution method. Sure, I'm subbing something, but not $tan(\frac x2)$.

$$\int\frac{1}{\cos(x)}\ dx=\int \sec(x)\ dx = \int \sec(x)\ \frac{\sec(x)+\tan(x)}{\sec(x)+\tan(x)}\ dx$$

Let $u = \sec(x)+\tan(x)$, and so $du = \sec(x)\ \tan(x) + {\sec}^2(x)\ dx$.

Substituting this back into the equation yields

$$\int \frac{{\sec}^2(x) + \sec (x)\ \tan (x)\ dx}{\sec(x) + \tan (x)} = \int \frac{du}u = \ln\ |\ u\ | + C$$

Substituting back for u yields $ln\ |\ \sec (x) + \tan (x)\ | + C$.

0
On

$\displaystyle\int\frac{1}{\cos x}dx=\int\frac{1}{\sin(x+\frac{\pi}{2})}dx=\int\frac{1}{\sin t}dt\;\;$ with $t=x+\frac{\pi}{2}.\;\;$ Now let $u=\tan\frac{t}{2}$ to get

$\displaystyle\int\frac{1}{\frac{2u}{1+u^2}}\cdot\frac{2}{1+u^2}du=\int\frac{1}{u}du=\ln|u|+C=\ln\big|\tan\left(\frac{x}{2}+\frac{\pi}{4}\right)\big|+C$,

which can be rewritten as $\displaystyle\ln\left\vert\frac{1+\tan\frac{x}{2}}{1-\tan\frac{x}{2}}\right\vert+C=\ln\left\vert\frac{\cos\frac{x}{2}+\sin\frac{x}{2}}{\cos\frac{x}{2}-\sin\frac{x}{2}}\right\vert+C=\ln\left\vert\sec x+\tan x\right\vert+C$

1
On

\begin{align} I&=\int\frac{dx}{\cos x}=\int\frac{1-\sin x}{\cos x}\frac{dx}{1-\sin x}=\int\frac{1-\sin x}{\cos x}d\left(\frac{\cos x}{1-\sin x}\right)=\ln\left|\frac{\cos x}{1-\sin x}\right|+C \end{align}