Evaluate the following integrals:
$\int \frac{\sin 2 x}{\sin \left(x-\frac{\pi}{6}\right) \sin \left(x+\frac{\pi}{6}\right)} d x$
$\sin (A-B)=\sin A \cos B-\cos A \sin B$
$\therefore$ We can write $\sin \left(x-\frac{\pi}{6}\right)=\sin x \cos \frac{\pi}{6}-\cos x \sin \frac{\pi}{6}$
$\sin (A+B)=\sin A \cos B+\cos A \sin B$
$\therefore$ We can write $\sin \left(x+\frac{\pi}{6}\right)=\sin x \cos \frac{\pi}{6}+\cos x \sin \frac{\pi}{6}$
$\therefore$ The given equation becomes
$\Rightarrow \int \frac{\sin 2 x}{\left(\sin x \cos \frac{\pi}{6}-\cos x \sin \frac{\pi}{6}\right)\left(\sin x \cos \frac{\pi}{6}+\cos x \sin \frac{\pi}{6}\right)} d x$
$\Rightarrow \int \frac{\sin 2 x}{\left(\sin x \frac{\sqrt{3}}{2}-\cos x \frac{1}{2}\right)\left(\sin x \frac{\sqrt{3}}{2}+\cos x \frac{1}{2}\right)} d x$
Denominator is of the form $(a-b)(a+b)=a^{2}-b^{2}$
$\Rightarrow \int \frac{\sin 2 x}{\left(\frac{3}{4} \sin ^{2} x-\cos ^{2} x \frac{1}{4}\right)} d x \ldots$ (1)
We know $\sin ^{2} x+\cos ^{2} x=1$
$\therefore \sin ^{2} x=1-\cos ^{2} x$
Substituting the above result in (1) we get
$\Rightarrow \int \frac{\sin 2 x}{\left(\frac{3}{4}\left(1-\cos ^{2} x\right)-\cos ^{2} x \frac{1}{4}\right)} d x$
$\Rightarrow \int \frac{\sin 2 x}{\left(\frac{2}{4}-\cos ^{2} x\right)} d x \ldots(2)$
Let us assume $\left(\frac{3}{4}-\cos ^{2} x\right)=t$
$\Rightarrow \mathrm{d}\left(\frac{3}{4}-\cos ^{2} \mathrm{x}\right)=\mathrm{dt}$
$\Rightarrow 2 \sin x \cdot \cos x \cdot \mathrm{dx}=\mathrm{dt}$
$\Rightarrow \sin 2 x \cdot \mathrm{d} x=\mathrm{dt}$
Substituting $\mathrm{dt}$ and $\mathrm{t}$ in $(2)$ we get
$\Rightarrow \int \frac{\mathrm{d} t}{t}$
$=\ln |t|+c$
But $t=\left(\frac{3}{4}-\cos ^{2} x\right)$
$\therefore \ln \left|\left(\frac{3}{4}-\cos ^{2} x\right)\right|+c$