Valid proof for integral of $1/(x^2+a^2)$ I'm trying to prove some integral table formulae and had a concern over my proof of the following formula:
$$\int\frac{1}{x^2+a^2}\;dx=\frac{1}{a}\arctan\left(\frac{x}{a}\right)+C$$
Claim:
$$\frac{1}{x^2+a^2}=\frac{1}{a^2}\sum_{k=1}^\infty(-1)^{k-1}\left(\frac{x}{a}\right)^{2k}\hspace{5mm}\forall\;x\in(-a,a)$$
Proof:
$$\frac{1}{x^2+a^2}=\frac{1}{a^2}-\frac{x^2}{a^4}+\frac{x^4}{a^6}-\frac{x^6}{a^8}+\dots$$
$$\implies 1=(x^2+a^2)\left(\frac{1}{a^2}-\frac{x^2}{a^4}+\frac{x^4}{a^6}-\frac{x^6}{a^8}+\dots\right)$$
$$\implies 1=\left(\frac{x^2}{a^2}-\frac{x^4}{a^4}+\frac{x^6}{a^6}-\frac{x^8}{a^8}+\dots\right)+\left(1-\frac{x^2}{a^2}+\frac{x^4}{a^4}-\frac{x^6}{a^6}+\dots\right)$$
$$\implies 1=1\hspace{5mm}\forall\;x\in(-a,a)$$
My proof then uses the following:
$$\int\frac{1}{x^2+a^2}\;dx=\frac{1}{a^2}\int\sum_{k=1}^\infty(-1)^{k-1}\left(\frac{x}{a}\right)^{2k}\;dx=\frac{1}{a}\arctan\left(\frac{x}{a}\right)+C$$
My concern is that this isn't a valid proof since the radius of convergence of arctangent's Taylor Series is finite. I'm 7 years removed from taking calculus so I'm admittedly forgetful of the fine details on this. Could someone explain if this is a valid approach or, if not, why?

It’s valid for $|x|\leq 1$ due to the uniform convergence of the Taylor series you obtain after integrating to arctan, but not outside this interval and has to do with not being able to pull that sum outside the integral on this region. I can give you a simpler way to integrate this if you’d like?
