What is wrong with my integral calculation? I want to solve the integral $\int_1^\infty\frac{a}{a^2+x^2}dx$ where $a>0$ is a constant
I first tried simplifying so
\begin{align}
\frac{a}{a^2+x^2}
&=\frac{1}{a+\frac{x^2}{a}} \\[6px]
&=\frac{1}{a}\cdot\frac{1}{1+(\frac{x}{a})^2}
\end{align}
which got me
\begin{align}
\int_1^\infty\frac{a}{a^2+x^2}dx
&=\frac{1}{a}\int_1^\infty\frac{1}{1+(\frac{x}{a})^2}dx\\[6px]
&=\frac{1}{a}\left[\arctan \frac{x}{a}\right]_1^\infty
\end{align}
which is wrong, but I can't see my mistake, can anyone help me with this?

\begin{align}
\int_1^\infty\frac{a}{a^2+x^2}dx
&=\frac{1}{a}\int_1^\infty\frac{1}{1+(\frac{x}{a})^2}dx\\[6px]
&=\int_1^\infty\frac{1}{1+(\frac{x}{a})^2}d\frac{x}{a}\\[6px]
&=\left[\arctan \frac{x}{a}\right]_1^\infty\\[6px]
&=\frac{\pi}{2}-\arctan\frac{1}{a}=\arctan a
\end{align}
If $a<0$, then the final step will give $\pi+\arctan a$.
