30

Solve the indefinite integral

$$ I=\int\frac{1}{\sin x+\cos x+\tan x+\cot x+\csc x+\sec x}\;dx $$

My Attempt:

$$ \begin{align} I&=\int\frac{1}{\sin x+\cos x+\frac{1}{\sin x \cos x}+\frac{\sin x +\cos x}{\sin x\cos x}}\;dx\\ \\ &=\int\frac{\sin x\cos x}{\left(\sin x+\cos x\right)\left(\sin x\cos x \right)+1+\left(\sin x+\cos x\right)}\;dx \end{align} $$

How can I complete the solution from here?

hululu
  • 4,913
juantheron
  • 56,203

6 Answers6

14

You want

$\begin{align} \int\frac{dx}{\sin x+\cos x+\tan x+\cot x+\csc x+\sec x} &= \int\frac{dx}{\sin x+\cos x+\frac{\sin x}{\cos x} +\frac{\cos x}{\sin x}+\frac1{\sin x}+\frac1{\cos x}}\\ &= \int\frac{\sin x \cos x\ dx}{\sin^2 x \cos x+\cos^2 x \sin x+\sin^2 x +\cos^2 x+\cos x+\sin x}\\ &= \int\frac{\sin x \cos x\ dx}{\sin x \cos x(\sin x+ \cos x)+1+\cos x+\sin x}\\ &= \int\frac{\sin x \cos x\ dx}{(\sin x \cos x+1)(\sin x+ \cos x)+1}\\ \end{align} $.

Applying substitutions $\sin x = \frac{2t}{1+t^2}, \cos x = \frac{1-t^2}{1+t^2}, dx = \frac{2 dt}{1+t^2}$, this becomes

$\begin{align} \int\frac{\sin x \cos x\ dx}{(\sin x \cos x+1)(\sin x+ \cos x)+1} &=\int\frac{\frac{(2t)(1-t^2)(2dt)}{(1+t^2)^3}} {(\frac{(2t)(1-t^2)}{(1+t^2)^2}+1)(\frac{2t}{1+t^2}+ \frac{1-t^2}{1+t^2})+1}\\ &=\int\frac{(2t)(1-t^2)(2dt)} {((2t)(1-t^2)+(1+t^2)^2)(1+2t-t^2)+(1+t^2)^3}\\ &=\int\frac{4t(1-t^2)dt} {((2t-2t^3)+1+2t^2+t^4)(1+2t-t^2)+1+3t^2+3t^4+t^6}\\ &=\int\frac{4t(1-t^2)dt} {(1+2t+2t^2-2t^3+t^4)(1+2t-t^2)+1+3t^2+3t^4+t^6}\\ &=\int\frac{4t(1-t^2)dt} {2 (t+1) (2 t^4-3 t^3+3 t^2+t+1)} \quad \text{ (according to Wolfram Alpha)}\\ &=\int\frac{2t(1-t)dt} {2 t^4-3 t^3+3 t^2+t+1}\\ \end{align} $.

According to Wolfram Alpha, that quartic can be factored as the product of two quadratics, but the coefficients look irrational.

I'll leave it at this.

marty cohen
  • 110,450
8

If you can't see anything simpler: when you have a rational function of sin and cos, you can always use the tangent half-angle substitution $t = \tan (x/2)$. Then $$\sin x = \frac{2t}{1+t^2}, \cos x = \frac{1-t^2}{1+t^2}, dx = \frac{2 dt}{1+t^2}.$$ Substituting these converts your integral into the integral of a rational function of $t$, which can then be integrated by partial fractions.

Ted
  • 35,732
7

You can use Euler's identities and expand it in terms of complex exponents like (after some simplifications): $$\frac{1}{\sin x+\cos x+\tan x+\cot x+\csc x+\sec x}=\frac{e^{\mathrm i x} \left((1+\mathrm i) e^{2 \mathrm i x}-2 \mathrm i e^{\mathrm i x}+(\mathrm i-1)\right)}{e^{4 \mathrm i x}-(1+\mathrm i) e^{3 \mathrm i x}+6 \mathrm i e^{2 \mathrm i x}+(1-\mathrm i) e^{\mathrm i x}-1}$$ So $$ \begin{eqnarray} \int\!\!\frac{1}{\sin x\!+\!\cos x\!+\!\tan x\!+\!\cot x\!+\!\csc x\!+\!\sec x}\!\mathrm dx&=&\frac{1}{\mathrm i}\!\!\int \!\! \frac{(1+\mathrm i) e^{2 \mathrm i x}-2 \mathrm i e^{\mathrm i x}+(\mathrm i-1)}{e^{4 \mathrm i x}-(1+\mathrm i) e^{3 \mathrm i x}+6 \mathrm i e^{2 \mathrm i x}+(1-\mathrm i) e^{\mathrm i x}-1}\!\!\mathrm de^{\mathrm i x}\!\!=\\ &=&\frac{1}{\mathrm i}\!\!\int \!\! \frac{(1+\mathrm i) t^{2}-2 \mathrm i t+(\mathrm i-1)}{t^{4}-(1+\mathrm i) t^{3}+6 \mathrm i t^{2}+(1-\mathrm i) t^{}-1} \!\!\mathrm dt&=&\\ &=&\frac{1}{\mathrm i}\!\!\int \!\! \frac{(t-t_{11})(t-t_{12})}{(t-t_{21})(t-t_{22})(t-t_{32})(t-t_{42})} \!\!\mathrm dt \end{eqnarray} $$ After that you can use partial fraction expansion to simplify the answer (Mathematica gives 4 distinct roots for denominator).

Caran-d'Ache
  • 3,612
2

Substitute $x=y+\dfrac\pi4$ :

$$\begin{align*} I &= \int \frac{dx}{\sin x+\cos x+\csc x+\sec x+\tan x+\cot x} \\ &= \int \frac{dy}{\frac{\cos y+\sin y}{\sqrt2} + \frac{\cos y-\sin y}{\sqrt2} + \frac{\sqrt2}{\cos y+\sin y} + \frac{\sqrt2}{\cos y-\sin y} + \frac{\cos y+\sin y}{\cos y-\sin y} + \frac{\cos y-\sin y}{\sin y-\cos y}} \\ &= \int \frac{2\cos^2y-1}{2\sqrt2\,\cos^3y+\sqrt2\,\cos y+2} \, dy \\ \end{align*}$$

By inspection, $\sqrt2 \, c \left(2c^2 + 1\right) + 2 = 0$ at $c=-\dfrac1{\sqrt2}$, and thus we may simplify

$$I = \int \frac{\sqrt2\,\cos y+1}{2\cos^2y - \sqrt2 \, \cos y + 2} \, dy$$

Now substituting $y=2\arctan z \implies \cos y = \dfrac{1-z^2}{1+z^2}$ makes for an easier partial fraction expansion,

$$I = \frac{3\sqrt2-2}7 \int \frac{1-(3+2\sqrt2)z^2}{1+\frac{9+4\sqrt2}7 z^4} \, dz$$

The right side expands to

$$\int \frac{1-az^2}{1+b^2z^4}\,dz = \frac1{2ib} \int \left(\frac{a+ib}{1+ibz^2} - \frac{a-ib}{1-ibz^2}\right) \, dz$$

and this produces a combination of the $\arctan$ and $\operatorname{artanh}$ of a complex argument.

user170231
  • 25,320
2

Try $U$ substitution $x = 2 \arctan U$

Kemono Chen
  • 8,849
1

Consider,

$$I=\int\frac{dx}{\sin x+\cos x+\tan x+\cot x+\csc x+\sec x}$$

Substitute $x-\frac{\pi}{4}=t$


\[ \sin\left(t + \frac{\pi}{4}\right) = \frac{\sin t + \cos t}{\sqrt{2}}, \quad \cos\left(t + \frac{\pi}{4}\right) = \frac{\cos t - \sin t}{\sqrt{2}} \]

\[ \tan\left(t + \frac{\pi}{4}\right) = \frac{\tan t + 1}{1 - \tan t}, \quad \cot\left(t + \frac{\pi}{4}\right) = \frac{\cot t + 1}{1 - \cot t} \] \[ \sec\left(t + \frac{\pi}{4}\right) = \frac{1}{\cos\left(t + \frac{\pi}{4}\right)} = \frac{\sqrt{2}}{\cos t - \sin t} \] \[ \csc\left(t + \frac{\pi}{4}\right) = \frac{1}{\sin\left(t + \frac{\pi}{4}\right)} = \frac{\sqrt{2}}{\sin t + \cos t} \]

After a lot of simplification,


$$=\int \frac{\sqrt2 \cos t -1}{2\cos^2 t-\sqrt2 \cos t+2}\,dt$$

Substitute $tan \frac{t}2=u\implies \cos t = \frac{1-t^2}{1+t^2}, \frac{2}{1+t^2}\,dt=\,du$

$$=-\frac{2+3\sqrt2}{7}\int \frac{u^2-(3-2\sqrt2)}{u^2+\left(\frac{10-4\sqrt2}{7}\right)}\,du$$

For ease of notations, $a=3-2\sqrt2$ and $b=\frac{10-4\sqrt2}{7}$

$$=-\frac{2+3\sqrt2}{7}\int \frac{u^2-a}{u^2+b}\,du$$

$$=-\frac{2+3\sqrt2}{7}\color{red}{\int \frac{u^2}{u^2+b}\,du}+a\cdot\frac{2+3\sqrt2}{7}\color{red}{\int \frac{1}{u^2+b}\,du}$$

These are two standard integrals,

The first integral evaluates to,

$=\frac{1}{4\sqrt{b}\sqrt{2\sqrt{b}}}\ln\left|\frac{\tan^2\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}-\sqrt{2\sqrt{b}}\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)}{\tan^2\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}+\sqrt{2\sqrt{b}}\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)}\right|+\frac{1}{2\sqrt{b}\sqrt{2\sqrt{b}}}\tan^{-1}\left(\frac{\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}-\sqrt{2\sqrt{b}}\cot\left(\frac{x}{2}-\frac{\pi}{8}\right)}{\sqrt{2\sqrt{b}}}\right)$

The second integral evaluates to,

$=-\frac{1}{4\sqrt{b}\sqrt{2\sqrt{b}}}\ln\left|\frac{\tan^2\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}-\sqrt{2\sqrt{b}}\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)}{\tan^2\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}+\sqrt{2\sqrt{b}}\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)}\right|+\frac{1}{2\sqrt{b}\sqrt{2\sqrt{b}}}\tan^{-1}\left(\frac{\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)-\sqrt{b}\cot\left(\frac{x}{2}-\frac{\pi}{8}\right)}{\sqrt{2\sqrt{b}}}\right)$

So combining these results,

$I=-\frac{\sqrt{2}+1}{7\sqrt{b}\sqrt{2\sqrt{b}}}\ln\sqrt{\left|\frac{\tan^2\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}-\sqrt{2\sqrt{b}}\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)}{\tan^2\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}+\sqrt{2\sqrt{b}}\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)}\right|}+\frac{2-\sqrt{2}}{7\sqrt{b}\sqrt{2\sqrt{b}}}\tan^{-1}\left(\frac{\tan\left(\frac{x}{2}-\frac{\pi}{8}\right)+\sqrt{b}-\sqrt{2\sqrt{b}}\cot\left(\frac{x}{2}-\frac{\pi}{8}\right)}{\sqrt{2\sqrt{b}}}\right)$

Amrut Ayan
  • 8,887