Definite Integration

Evaluate $\displaystyle \int \limits_{0}^{\frac{\pi}{4}} \dfrac{dx}{a^2 \cos^2 x - b^2 \sin^2 x}$ $\hspace{3em}$ $\left(a > b > 0\right)$


$\begin{aligned} \text{Let } I & = \int \limits_{0}^{\frac{\pi}{4}} \dfrac{dx}{a^2 \cos^2 x - b^2 \sin^2 x} \\\\ & = \int \limits_{0}^{\frac{\pi}{4}} \dfrac{\dfrac{dx}{\cos^2 x}}{a^2 - \dfrac{b^2 \sin^2 x}{\cos^2 x}} \\\\ & = \int \limits_{0}^{\frac{\pi}{4}} \dfrac{\sec^2 x \; dx}{a^2 - b^2 \tan^2 x} \\\\ & = \dfrac{1}{b^2} \int \limits_{0}^{\frac{\pi}{4}} \dfrac{\sec^2 x \; dx}{\dfrac{a^2}{b^2} - \tan^2 x} \;\;\; \cdots \; (1) \end{aligned}$

Let $\tan x = u$ $\;\;\; \cdots \; (2)$

Differentiating equation $(2)$ gives

$\sec^2 x \; dx = du$ $\;\;\; \cdots \; (2a)$

$\text{When } \begin{cases} x = 0, & u = \tan \left(0\right) = 0 \\ x = \dfrac{\pi}{4}, & u = \tan \left(\dfrac{\pi}{4}\right) = 1 \end{cases}$ $\;\;\; \cdots \; (2b)$

$\therefore$ $\;$ In view of equations $(2)$, $(2a)$ and $(2b)$, equation $(1)$ becomes

$\begin{aligned} I & = \dfrac{1}{b^2} \int \limits_{0}^{1} \dfrac{du}{\dfrac{a^2}{b^2} - u^2} \\\\ & = \dfrac{1}{b^2} \int \limits_{0}^{1} \dfrac{du}{\left(a / b\right)^2 - \left(u\right)^2} \\\\ & = \dfrac{1}{b^2} \times \dfrac{b}{2a} \left[\log \left|\dfrac{\dfrac{a}{b} + u}{\dfrac{a}{b} - u}\right|\right]_{0}^{1} \hspace{3em} \left[\text{Note: }\int \limits_{p}^{q} \dfrac{dx}{a^2 - x^2} = \dfrac{1}{2a} \left[\log\left|\dfrac{a + x}{a - x}\right|\right]_{p}^{q}\right] \\\\ & = \dfrac{1}{2ab} \left[\log \left|\dfrac{\dfrac{a}{b} + 1}{\dfrac{a}{b} - 1}\right| - \log \left|\dfrac{a / b}{a / b}\right|\right] \\\\ & = \dfrac{1}{2ab} \log \left|\dfrac{a + b}{a - b}\right| \end{aligned}$