If the integrand is of the form \(a^2 - x^2\), we can use trigonometric substitution:
Let \(x = a\sin\theta\) or \(x = a\cos\theta\).
Case: Using the substitution \(x = a\sin\theta\)
Then, \(dx = a\cos\theta\,d\theta\) and \(a^2 - x^2 = a^2 - a^2\sin^2\theta = a^2\cos^2\theta\)
\( \int \frac{dx}{a^2 - x^2} = \int \frac{a\cos\theta\,d\theta}{a^2\cos^2\theta} = \int \frac{1}{a}\cdot \frac{1}{\cos\theta}\,d\theta = \frac{1}{a}\int \sec\theta\,d\theta \)
We know: \( \int \sec\theta\,d\theta = \log|\sec\theta + \tan\theta| + c \) So, \( \int \frac{dx}{a^2 - x^2} = \frac{1}{a} \log|\sec\theta + \tan\theta| + c \)
Now back-substitute in terms of \(x\):
Since \(x = a\sin\theta\), then \(\theta = \sin^{-1}\left(\frac{x}{a}\right)\)
\(
\sec\theta = \frac{1}{\cos\theta} = \frac{1}{\sqrt{1 - \sin^2\theta}} = \frac{1}{\sqrt{1 - \left(\frac{x}{a}\right)^2}} = \frac{a}{\sqrt{a^2 - x^2}}
\)
\(
\tan\theta = \frac{\sin\theta}{\cos\theta} = \frac{x}{\sqrt{a^2 - x^2}}
\)
So,
\(
\sec\theta + \tan\theta = \frac{a + x}{\sqrt{a^2 - x^2}}
\)
Hence,
\(
\int \frac{dx}{a^2 - x^2} = \frac{1}{a} \log\left| \frac{a + x}{\sqrt{a^2 - x^2}} \right| + c
\)
Multiply numerator and denominator inside the log by \(a - x\), we get:
\(
\frac{a + x}{\sqrt{a^2 - x^2}} \cdot \frac{a - x}{a - x} = \frac{(a + x)(a - x)}{(a - x)\sqrt{a^2 - x^2}} = \frac{a^2 - x^2}{(a - x)\sqrt{a^2 - x^2}} = \frac{\sqrt{a^2 - x^2}}{a - x}
\)
Therefore, after simplification,
\(
\int \frac{dx}{a^2 - x^2} = \frac{1}{2a} \log\left| \frac{a + x}{a - x} \right| + c
\)