3

Kindly solve this question

$$\int \frac{1}{(\sin x + \cos x)} dx$$

I reached up to

$$\frac{(1+\tan^2x)}{1-\tan^2x + 2\tan x}$$

amWhy
  • 209,954

3 Answers3

8

HINT:

$$\sin x+\cos x=\sqrt2\sin\left(x+\frac\pi4\right)$$ or $$\sin x+\cos x=\sqrt2\cos\left(x-\frac\pi4\right)$$

More generally, set $a=r\cos\phi,b=r\sin\phi$ to find

$a\sin x+b\cos x=\sqrt{a^2+b^2}\sin\left(x+\arctan2(b,a)\right)$

Similarly, set $a=r\sin\psi,b=r\cos\psi$ to find

$a\sin x+b\cos x=\sqrt{a^2+b^2}\cos\left(x-\arctan2(a,b)\right)$

arctan2 has been defined here

  • Was just in the process of writing this exact formula. +1, this is by far the easiest way to go. – 5xum Dec 09 '14 at 13:20
  • thanks, nice solution but can't we do it in any easy way?

    I converted sinx and Cosx into tan(x/2) form and reached as mentioned

    – sunny malhotra Dec 09 '14 at 13:26
  • 1
    @sunnymalhotra: This is the easy way! If you follow this hint you will end up integrating a secant, which is a standard formula. – Rory Daulton Dec 09 '14 at 13:42
  • Nice answer. Could you also show how they are derived for future reference? – Ali Caglayan Dec 09 '14 at 13:53
  • You should add a factor of $\mathrm{sgn}(a)$ in $\sqrt{a^2+b^2}\sin\left(x+\tan^{-1}\left(\dfrac{b}{a}\right)\right)$. – Frank Vel Dec 09 '14 at 13:53
  • @Alizter, Hav ea look into http://math.stackexchange.com/questions/444887/solving-the-trigonometric-equation-a-cos-x-b-sin-x-c and http://en.wikibooks.org/wiki/Trigonometry/Simplifying_a_sin(x)_%2B_b_cos(x) – lab bhattacharjee Dec 09 '14 at 16:51
  • @fvel, I would like use http://en.wikipedia.org/wiki/Atan2#Definition_and_computation in place of sgn$(a)$ – lab bhattacharjee Dec 09 '14 at 16:54
  • @labbhattacharjee Your formula is only correct to the sign, mind elaborating how $\mathrm{atan2}(x,y)$ is going to replace the $\mathrm{sgn}$-function? – Frank Vel Dec 09 '14 at 17:44
  • @fvel, If $a<0, b\ge0,$ $\arctan 2(y,x)=\arctan\dfrac yx+\pi$ $$\implies\sin[x+\arctan2(y,x)]=\sin[\pi+x+\arctan\dfrac yx]=-\sin[x+\arctan\dfrac yx]$$ etc. – lab bhattacharjee Dec 09 '14 at 17:51
  • @labbhattacharjee It's easier to just multiply by $\mathrm{sgn}(a)$ since that'd give you one simple formula instead of a piecewise one defined for $a>0$ and $a<0$. Although guess both work – Frank Vel Dec 09 '14 at 19:44
1

Hint:
Use the formula $$ \cos x = \frac{e^{ix} + e^{-ix}}{2}\qquad\text{and}\qquad\sin x = \frac{e^{ix}-e^{-ix}}{2i}. $$ Now use the substitution $u = e^{ix}$. Can you proceed from here?

Hakim
  • 10,213
0

Hint : \begin{align} \int \frac{\mathrm dx}{\sin x + \cos x} &=\int \frac{\mathrm dx}{\sin x + \cos x}\cdot \frac{\sin x - \cos x}{\sin x - \cos x}\\ &=\int \frac{\sin x - \cos x}{\sin^2 x - \cos^2 x}\mathrm dx\\ &=\int \frac{\sin x}{1 - 2\cos^2 x}\mathrm dx-\int \frac{\cos x}{2\sin^2 x -1}\mathrm dx\\ &=\int \frac{1}{2\cos^2 x-1}\mathrm d(\cos x)-\int \frac{1}{2\sin^2 x -1}\mathrm d(\sin x)\\ \end{align}

Venus
  • 10,966