TITLE: taking an integral without trigonometric substitution
QUESTION [5 upvotes]: 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?

REPLY [5 votes]: You have the right motivation, just use a clever substitution to justify the power series.
\begin{align}
\int_{-\infty}^\infty\frac{dx}{x^2+a^2}&\overset{x=at}{=}\frac1a\int_{-\infty}^\infty\frac{dt}{1+t^2}\\
&=\frac2a\int_0^\infty\frac{dt}{1+t^2}\\
&=\underbrace{\frac2a\int_0^1\frac{dt}{1+t^2}}_{x=t}+\underbrace{\frac2a\int_1^\infty\frac{dt}{1+t^2}}_{x=\frac1t}\\
&=\frac2a\int_0^1\frac{dx}{1+x^2}+\frac2a\int_0^1\frac{dx}{1+x^2}\\
&=\frac4a\int_0^1(1-x^2+x^4-x^6+\dots)dx\\
&=\frac4a\left(1-\frac13+\frac15-\frac17+\dots\right)\\
&=\frac4a\times\frac\pi4\\
&=\boxed{\frac\pi a}
\end{align}