# How do you evaluate the integral int 1/(sintheta+costheta)?

May 1, 2018

$I = \frac{1}{\sqrt{2}} \ln | \frac{\tan \left(\frac{x}{2}\right) + \sqrt{2} - 1}{\tan \left(\frac{x}{2}\right) - \sqrt{2} - 1} | + c$

#### Explanation:

Here,

$I = \int \frac{1}{\sin x + \cos x} \mathrm{dx}$

Let,

$\tan \left(\frac{x}{2}\right) = t \implies {\sec}^{2} \left(\frac{x}{2}\right) \cdot \frac{1}{2} \mathrm{dx} = \mathrm{dt}$

=>dx=(2dt)/sec^2(x/2)=(2dt)/(1+tan^2(x/2))=(2dt)/(1+t^2

also, $\sin x = \frac{2 \tan \left(\frac{x}{2}\right)}{1 + {\tan}^{2} \left(\frac{x}{2}\right)} = \frac{2 t}{1 + {t}^{2}}$

and $\cos x = \frac{1 - {\tan}^{2} \left(\frac{x}{2}\right)}{1 + {\tan}^{2} \left(\frac{x}{2}\right)} = \frac{1 - {t}^{2}}{1 + {t}^{2}}$

So,

I=int1/((2t)/(1+t^2)+(1-t^2)/(1+t^2))xx(2dt)/(1+t^2

$= \int \frac{2}{2 t + 1 - {t}^{2}} \mathrm{dt}$

$= 2 \int \frac{1}{2 - {t}^{2} + 2 t - 1} \mathrm{dt}$

$= 2 \int \frac{1}{{\left(\sqrt{2}\right)}^{2} - {\left(t - 1\right)}^{2}} \mathrm{dt}$

$= 2 \times \frac{1}{2 \sqrt{2}} \ln | \frac{t - 1 + \sqrt{2}}{t - 1 - \sqrt{2}} | + c$

Subst. back , $t = \tan \left(\frac{x}{2}\right)$

$I = \frac{1}{\sqrt{2}} \ln | \frac{\tan \left(\frac{x}{2}\right) + \sqrt{2} - 1}{\tan \left(\frac{x}{2}\right) - \sqrt{2} - 1} | + c$

Note: For typing simplicity $x$ is taken in place of $\theta$.

May 1, 2018

$I = \frac{1}{\sqrt{2}} \ln | \sec \left(\theta - \frac{\pi}{4}\right) + \tan \left(\theta - \frac{\pi}{4}\right) | + c$

#### Explanation:

We know that,

color(red)(cosC+cosD=2cos((C+D)/2)cos((C-D)/2)

So,

sintheta+costheta=color(red)(cos(pi/2-theta)+costheta

=color(red)(2cos((pi/2-theta+theta)/2)cos((pi/2-theta-theta)/2)

$= 2 \cos \left(\frac{\pi}{4}\right) \cos \left(\frac{\pi}{4} - \theta\right)$

$= 2 \left(\frac{1}{\sqrt{2}}\right) \cos \left(\theta - \frac{\pi}{4}\right) \ldots \to \left[a s , \cos \left(- \alpha\right) = \cos \alpha\right]$

$= \sqrt{2} \cos \left(\theta - \frac{\pi}{4}\right)$

Now,

$I = \int \frac{1}{\cos \theta + \sin \theta} d \theta$

$= \int \frac{1}{\sqrt{2} \cos \left(\theta - \frac{\pi}{4}\right)} d \theta$

$= \frac{1}{\sqrt{2}} \int \sec \left(\theta - \frac{\pi}{4}\right) d \theta$

$I = \frac{1}{\sqrt{2}} \ln | \sec \left(\theta - \frac{\pi}{4}\right) + \tan \left(\theta - \frac{\pi}{4}\right) | + c$

Note:

ans(1) and ans(2) are same but in different form.