### An interesting integral found in Snail's solution.

Evaluate $\int \frac{dx}{\sqrt{3} - \cos x - \sin x}$

$\int \frac{dx}{\sqrt{3} - \cos x - \sin x}$

$=\int \frac{dx}{\sqrt{3} - \sqrt{2}(\sin (x + \frac{\pi}{4})}$

Substitute $u = x + \frac{\pi}{4}$, and we have

$\int \frac{dx}{\sqrt{3} - \sqrt{2}(\sin (x + \frac{\pi}{4})}$

$=\int \frac{du}{\sqrt{3} - \sqrt{2}\sin u}$

We will derive a formula for $\int \frac{dx}{a - b\sin x}$

Substitute $\sin x = \frac{2t}{1+t^2}$, then

$\cos x = \frac{1-t^2}{1+t^2}$ and $tan x = \frac{2t}{1-t^2}$, and also

$\cos x \; dx = \frac{2(1-t^2)}{(1+t^2)^2} \; dt$

or $dx = \frac{2}{1 + t^2}$

or,

So, $\int \frac{dx}{a - b\sin x}$

$= \int \frac{ \frac{2}{1 + t^2}\;dt } { a - b \frac{2t}{1+t^2} }$

$= \int \frac{2 \; dt}{a(1+t^2) - 2bt}$

$= \frac{2}{a} \int \frac{dt}{(t - \frac{b}{a})^2 + 1 - \frac{b^2}{a^2}}$

Substituting $s = t - \frac{b}{a}$, we have

$\frac{2}{a} \int \frac{dt}{(t - \frac{b}{a})^2 + 1 - \frac{b^2}{a^2}}$

$= \frac{2}{a} \int \frac{ds}{s^2 +\frac{a^2-b^2}{a^2}}$

$= \frac{2}{a} \frac{a}{\sqrt{a^2 - b^2}} \tan^{-1} \frac{as}{\sqrt{a^2 - b^2}} + C$

$= \frac{2}{\sqrt{a^2 - b^2}} \tan^{-1} \frac{at - b }{\sqrt{a^2 - b^2}} + C$

$= \frac{2}{\sqrt{a^2 - b^2}} \tan^{-1} \frac{a\tan \frac{x}{2} - b }{\sqrt{a^2 - b^2}} + C$

So,

$\int \frac{du}{\sqrt{3} - \sqrt{2}\sin u}$

$= 2 \tan^{-1} \left( \sqrt{3}\tan \frac{u}{2} - \sqrt{2} \right) + C$

$= 2 \tan^{-1} \left( \sqrt{3}\tan \frac{x + \frac{\pi}{4}}{2} - \sqrt{2} \right) + C$

Solution was inspired by +Snail Erato work on the integral of the following

$\int \frac{dx}{\cos^3 x + \sin^3 x}$

here in two these pages:

1. Page 1

2. Page 2