# Trignometric integral : $\int \dfrac{dx}{\sin x + \sec x}$

The integral I am trying to compute is : $$\int \dfrac{dx}{\sin x + \sec x}$$

I have tried manipulating trignometric functions and it took me nowhere. Then finally I tried putting $\tan\dfrac{x}{2} = t$, and subsequently:

$$=\int\dfrac{1-t^2}{(1+t^2)^2-2t(t^2-1)}dt$$

I cannot see how to approach after this, I know we have to factor out two quadratics, but cant see how to.

Also, if there was another method instead of this substitution, please hint on that too! Thanks!

• You are correct: manipulating trig functions gets you nowhere on this one, and Weierstrauss is the only way to go. The denominator cannot be factored into polynomials with rational coefficients; the only way to factor is to express it as $(t^2+at+b)(t^2+ct+d)$ and bash coefficients. I believe each of the coefficients is expressable as $x+\sqrt{y}$ or $x-\sqrt{y}$. $y$ remains constant across $a$, $b$, $c$, and $d$ though. Can you guess what it might be? – Michael Wang Mar 19 '17 at 4:31
• Is there a typo? Is the integrand actually $\left( \sin x + \csc x \right)^{-1}$? – dantopa Mar 19 '17 at 4:36
• @MichaelWang Thanks for the hint, I'll try to determine the constants. – samjoe Mar 19 '17 at 4:39

## 3 Answers

Another way:

$$\dfrac{2\cos x}{2+2\cos x\sin x}=\dfrac{\cos x-\sin x}{2+2\cos x\sin x}+\dfrac{\cos x+\sin x}{2+2\cos x\sin x}$$

As $\displaystyle\int(\cos x-\sin x)dx=\cos x+\sin x,$ write $2\cos x\sin x=(\cos x+\sin x)^2-1$ and set $\cos x+\sin x=u$

and as $\displaystyle\int(\cos x+\sin x)dx=\sin x-\cos x,$ write $2\cos x\sin x=1-(\sin x-\cos x)^2$ and set $\sin x-\cos x=v$

• – lab bhattacharjee Mar 19 '17 at 8:00
• Thanks for the trignometric solution, i'll surely try this one. – samjoe Mar 19 '17 at 10:45
• @Claude, Would like to receive feedback – lab bhattacharjee Mar 20 '17 at 13:01
• This is much niftier solution! Thanks! – samjoe Mar 30 '17 at 12:39

As Michael Wang commented $$A=(1+t^2)^2-2t(t^2-1)=t^4-2 t^3+2 t^2+2 t+1$$ Computing the roots of the quartic equation (all are complex), you end with $$A=\left(t^2+(\sqrt{3}-1)t-\sqrt{3}+2\right)\left(t^2-(\sqrt{3}+1) t+\sqrt{3}+2\right)$$ Partial fraction decomposition then leads to $$\dfrac{1-t^2}{(1+t^2)^2-2t(t^2-1)}=\frac{1+t}{t^2+(\sqrt{3}-1)t-\sqrt{3}+2}+\frac{1+t}{t^2-(\sqrt{3}+1) t+\sqrt{3}+2}$$ which makes the problem workable.

Edit

Being less lazy, write $$(t^2+at+b)(t^2+ct+d)-(t^4-2 t^3+2 t^2+2 t+1)=0$$ Expand and group terms to get $$(a+c+2)t^3+ (a c+b+d-2)t^2+ (a d+b c-2)t+(b d-1)=0$$ So the equations to be solved are $$a+c+2=0\tag 1$$ $$a c+b+d-2=0\tag 2$$ $$a d+b c-2=0\tag 3$$ $$bd-1=0\tag 4$$ Using $(4)$, then $d=\frac 1b$. Using $(1)$, then $c=-2-a$. Replace in $(2)$ to get $$\frac{a}{b}-(a+2) b-2=0\implies a=\frac{2 b}{1-b}$$ Now, plug everything in $(3)$ to get $$\frac{(b^2-4b+1) \left(b^2+1\right)}{(b-1)^2 b}=0\implies b^2-4b+1=0$$

• Sorry I wasnt able to compute the constants, I tried comparing the coefficient of all terms of quartic and forming four equations. How did you manage to compute coefficients? – samjoe Mar 19 '17 at 4:51
• @samjoe. I am lazy ! So, I solved the quartic. – Claude Leibovici Mar 19 '17 at 4:56
• Thanks, the edit you made was exactly the way I started to proceed! quite cumbersome indeed. – samjoe Mar 19 '17 at 7:45
• @samjoe.Not cumbersome ! Just be patient and proceed in a systematic way as I tried to show in my edit. Cheers. – Claude Leibovici Mar 19 '17 at 7:47

This is an adjunct to @Claude Leibovici's insight. From Mathematica: $$\int \frac{dx} {\sin x + \sec x} = \tan ^{-1}\left(\left(\sqrt{3}+1\right) \tan \left(\frac{x}{2}\right)+1\right)+\tan ^{-1}\left(1-\left(\sqrt{3}-1\right) \tan \left(\frac{x}{2}\right)\right)+\frac{\log \left(2-\frac{2 \left(\sin (x)+\sqrt{3}+1\right)}{\cos (x)+1}\right)-\log \left(\sec ^2\left(\frac{x}{2}\right) \left(-\sin (x)+\cos (x)+\sqrt{3}\right)\right)}{2 \sqrt{3}}.$$