taking an integral without trigonometric substitution I needed to evaluate $$\int_{-\infty}^\infty\frac{1}{x^2+a^2}dx$$
I looked around and found it's solved by trigonometric substitution $x = a\tan\theta$ and the answer is $\frac{\pi}{a}$. I understand the derivation but have been curious: supposing I didn't know the "trick", are there more staightforward methods (even if more laborious) to find this integral?
For example, I figured out the power series $$\frac{1}{x^2+a^2} = \frac{1}{a^2} - \frac{1}{a^4}x^2 + \frac{1}{a^6}x^4 - ...$$
I can integrate the power series term-by-term. But what I end up with obviously diverges as $x\to \infty$ or $x \to -\infty$. Is there a way to continue with this approach and end up with the value of the integral? Or some other way, perhaps?

Another approach is as follows:
$$\begin{align}
\int_{-\infty}^\infty\frac{1}{x^2+a^2}dx 
&= 2\int_0^\infty \frac{1}{x^2+a^2}dx \\
&= \frac{2}{a^2} \int_0^\infty \frac{1}{1+(x/a)^2}dx \\
&= \frac{2}{a} \int_0^\infty \frac{1}{1+t^2}dt \\
&= \frac{2}{a} \arctan t\bigg|_0^\infty  \\
&= \frac{\pi}{a}\end{align}$$
Note that if $a = 0$, the integral diverges.
