# How do you integrate this? int(1/(1+sinx+cosx))dx

Feb 26, 2018

Break the fraction apart, solve the little pieces, then add them back together.

#### Explanation:

The fraction integrand can be separated into $\int \left(\left(\frac{1}{1}\right) + \left(\frac{1}{\sin} \left(x\right)\right) + \left(\frac{1}{\cos} \left(x\right)\right)\right) \mathrm{dx}$. If an integrand can be separated, then all its parts can be solved separately.

This can be split into $\int 1 \mathrm{dx}$ + $\int \left(\frac{1}{\sin} \left(x\right)\right) \mathrm{dx}$ + $\int \left(\frac{1}{\cos} \left(x\right)\right) \mathrm{dx}$

Which is equivalent to

$\int \mathrm{dx}$ + $\int \csc \left(x\right) \mathrm{dx}$ + $\int \sec \left(x\right) \mathrm{dx}$

$\int \mathrm{dx}$ = $x$,
$\int \csc \left(x\right) \mathrm{dx}$ = $\ln | \csc \left(x\right) - \cot \left(x\right) | + C$,
$\int \sec \left(x\right) \mathrm{dx}$ = $\ln | \sec \left(x\right) + \tan \left(x\right) | + C$

Now the three parts are added together.

$\int \left(\frac{1}{1 + \sin \left(x\right) + \cos \left(x\right)}\right) \mathrm{dx}$ = $\ln | \csc \left(x\right) - \cot \left(x\right) | + \ln | \sec \left(x\right) + \tan \left(x\right) | + 1 + C$

In order to calculate this integral you may use the following transform

$t = \tan \left(\frac{x}{2}\right)$

hence

$\sin x = \frac{2 t}{1 + {t}^{2}}$ , $\cos x = \frac{1 - {t}^{2}}{1 + {t}^{2}}$ , $\mathrm{dx} = \frac{2}{1 + {t}^{2}} \mathrm{dt}$

After some basic calculations which means just replace the above values to the integral and deduce you will get

$\int \frac{1}{1 + \sin x + \cos x} \mathrm{dx} = \ln \left(\left\mid 1 + \tan \left(\frac{x}{2}\right) \right\mid\right) + c$

Feb 26, 2018

Kindly refer to the Explanation.

#### Explanation:

We have, $1 + \sin x + \cos x = \left(1 + \cos x\right) + \sin x$,

$= 2 {\cos}^{2} \left(\frac{x}{2}\right) + 2 \sin \left(\frac{x}{2}\right) \cos \left(\frac{x}{2}\right)$,

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

$= \frac{2}{\sec} ^ 2 \left(\frac{x}{2}\right) \left\{1 + \tan \left(\frac{x}{2}\right)\right\}$.

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

$= \int \frac{\frac{1}{2} \cdot {\sec}^{2} \left(\frac{x}{2}\right)}{1 + \tan \left(\frac{x}{2}\right)} \mathrm{dx}$,

$= \int \frac{\frac{d}{\mathrm{dx}} \left(1 + \tan \left(\frac{x}{2}\right)\right)}{1 + \tan \left(\frac{x}{2}\right)} \mathrm{dx}$,

$= \ln | 1 + \tan \left(\frac{x}{2}\right) | + C , \text{ as Respected Konstantinos Michailidis Sir has already derived!}$

Enjoy Maths.!

Feb 26, 2018

$\setminus \quad \setminus \int \setminus \left(\frac{1}{1 + \sin x + \cos x}\right) \setminus \mathrm{dx} \setminus = \setminus \ln \setminus \sqrt{| \frac{1 + \sin x}{1 + \cos x} |} + C \setminus \quad .$

#### Explanation:

$\text{We want to find:}$

$\setminus q \quad \setminus q \quad \setminus q \quad \int \setminus \left(\frac{1}{1 + \sin x + \cos x}\right) \setminus \mathrm{dx} .$

$\text{We can proceed as follows:}$

$\setminus q \quad \int \setminus \frac{1}{1 + \sin x + \cos x} \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus \quad \setminus = \setminus \int \setminus \left(\frac{1}{1 + \sin x + \cos x}\right) \cdot \left(\frac{1 - \left(\sin x + \cos x\right)}{1 - \left(\sin x + \cos x\right)}\right) \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus q \quad = \setminus \int \setminus \frac{1 - \left(\sin x + \cos x\right)}{\left(1 + \sin x + \cos x\right) \left(1 - \left(\sin x + \cos x\right)\right)} \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus q \quad = \setminus \int \setminus \frac{1 - \left(\sin x + \cos x\right)}{1 - {\left(\sin x + \cos x\right)}^{2}} \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus q \quad = \setminus \int \setminus \frac{1 - \left(\sin x + \cos x\right)}{1 - \left({\sin}^{2} x + 2 \sin x \cos x + {\cos}^{2} x\right)} \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus q \quad = \setminus \int \setminus \frac{1 - \left(\sin x + \cos x\right)}{1 - \left({\sin}^{2} x + {\cos}^{2} x + 2 \sin x \cos x\right)} \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus q \quad = \setminus \int \setminus \frac{1 - \left(\sin x + \cos x\right)}{1 - \left(1 + 2 \sin x \cos x\right)} \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus q \quad = \setminus \int \setminus \frac{1 - \left(\sin x + \cos x\right)}{\textcolor{red}{\cancel{1}} - \textcolor{red}{\cancel{1}} - 2 \sin x \cos x} \setminus \mathrm{dx}$

$\setminus q \quad \setminus q \quad \setminus q \quad = \setminus - \int \setminus \frac{1 - \left(\sin x + \cos x\right)}{2 \sin x \cos x} \setminus \mathrm{dx}$

$\setminus \quad = \setminus - \int \setminus \left(\frac{1}{2 \sin x \cos x} - \frac{\textcolor{red}{\cancel{\sin x}}}{2 \textcolor{red}{\cancel{\sin x}} \cos x} - \frac{\textcolor{red}{\cancel{\cos x}}}{2 \sin x \textcolor{red}{\cancel{\cos x}}}\right) \setminus \mathrm{dx}$

$\setminus \quad = \setminus - \int \setminus \left(\frac{1}{\sin 2 x} - \frac{1}{2 \cos x} - \frac{1}{2 \sin x}\right) \setminus \mathrm{dx}$

$\setminus \quad \setminus = \setminus - \int \setminus \left(\csc 2 x - \frac{1}{2} \sec x - \frac{1}{2} \csc x\right) \setminus \mathrm{dx}$

 \quad \ = \ - ( - 1/2 ln | csc 2 x + cot 2 x | - 1/2 ln | sec x + tan x |

 \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad + 1/2 ln | csc x + cot x | )

 \quad \ = \ 1/2 ( \ ln | csc 2 x + cot 2 x | + ln | sec x + tan x |

 \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad - ln | csc x + cot x | \ )

$\setminus \quad \setminus = \setminus \ln \setminus \sqrt{\frac{| \csc 2 x + \cot 2 x | \cdot | \sec x + \tan x |}{| \csc x + \cot x |}}$

$\setminus \quad \setminus = \setminus \ln \setminus \sqrt{\frac{| \frac{1 + \cos 2 x}{\sin 2 x} | \cdot | \frac{1 + \sin x}{\cos x} |}{| \frac{1 + \cos x}{\sin x} |}}$

$\setminus \quad \setminus = \setminus \ln \setminus \sqrt{| \frac{\frac{1 + \cos 2 x}{\sin 2 x} \cdot \frac{1 + \sin x}{\cos x}}{\frac{1 + \cos x}{\sin x}} |}$

$\setminus \quad \setminus = \setminus \ln \setminus \sqrt{| \frac{1 + \cos 2 x}{\sin 2 x} \cdot \frac{1 + \sin x}{\cos x} \cdot \frac{\sin x}{1 + \cos x} |}$

$\setminus \quad \setminus = \setminus \ln \setminus \sqrt{| \frac{\left({\sin}^{2} x + {\cos}^{2} x\right) + \left({\cos}^{2} x - {\sin}^{2} x\right)}{\sin 2 x} \cdot \frac{1 + \sin x}{\cos x} \cdot \frac{\sin x}{1 + \cos x} |}$

 \quad \ = \ ln \sqrt{ | { color{red}cancel{ sin^2 x } + cos^2 x +cos^2 x - color{red}cancel{ sin^2 x } } / { sin 2 x } cdot { 1 + sin x } / { cos x } cdot { sin x } / { 1 + cos x } |

$\setminus \quad \setminus = \setminus \ln \setminus \sqrt{| \frac{\textcolor{red}{\cancel{2}} \textcolor{red}{\cancel{{\cos}^{2} x}}}{\textcolor{red}{\cancel{2}} \textcolor{red}{\cancel{\sin x}} \textcolor{red}{\cancel{\cos x}}} \cdot \frac{1 + \sin x}{\textcolor{red}{\cancel{\cos x}}} \cdot \frac{\textcolor{red}{\cancel{\sin x}}}{1 + \cos x} |}$

$\setminus \quad \setminus = \setminus \ln \setminus \sqrt{| \frac{1 + \sin x}{1 + \cos x} |} \setminus \quad .$

$\text{So, at last !! :}$

$\setminus \quad \setminus \int \setminus \left(\frac{1}{1 + \sin x + \cos x}\right) \setminus \mathrm{dx} \setminus = \setminus \ln \setminus \sqrt{| \frac{1 + \sin x}{1 + \cos x} |} + C \setminus \quad . \setminus \quad \setminus \square$