Integral of $$$\operatorname{atan}{\left(\frac{1}{x} \right)}$$$
Related calculator: Integral Calculator
Solution
For the integral $$$\int{\operatorname{atan}{\left(\frac{1}{x} \right)} d x}$$$, use integration by parts $$$\int \operatorname{u} \operatorname{dv} = \operatorname{u}\operatorname{v} - \int \operatorname{v} \operatorname{du}$$$.
Let $$$\operatorname{u}=\operatorname{atan}{\left(\frac{1}{x} \right)}$$$ and $$$\operatorname{dv}=dx$$$.
Then $$$\operatorname{du}=\left(\operatorname{atan}{\left(\frac{1}{x} \right)}\right)^{\prime }dx=- \frac{1}{x^{2} + 1} dx$$$ (steps can be seen ») and $$$\operatorname{v}=\int{1 d x}=x$$$ (steps can be seen »).
The integral can be rewritten as
$${\color{red}{\int{\operatorname{atan}{\left(\frac{1}{x} \right)} d x}}}={\color{red}{\left(\operatorname{atan}{\left(\frac{1}{x} \right)} \cdot x-\int{x \cdot \left(- \frac{1}{x^{2} + 1}\right) d x}\right)}}={\color{red}{\left(x \operatorname{atan}{\left(\frac{1}{x} \right)} - \int{\left(- \frac{x}{x^{2} + 1}\right)d x}\right)}}$$
Let $$$u=x^{2} + 1$$$.
Then $$$du=\left(x^{2} + 1\right)^{\prime }dx = 2 x dx$$$ (steps can be seen »), and we have that $$$x dx = \frac{du}{2}$$$.
So,
$$x \operatorname{atan}{\left(\frac{1}{x} \right)} - {\color{red}{\int{\left(- \frac{x}{x^{2} + 1}\right)d x}}} = x \operatorname{atan}{\left(\frac{1}{x} \right)} - {\color{red}{\int{\left(- \frac{1}{2 u}\right)d u}}}$$
Apply the constant multiple rule $$$\int c f{\left(u \right)}\, du = c \int f{\left(u \right)}\, du$$$ with $$$c=- \frac{1}{2}$$$ and $$$f{\left(u \right)} = \frac{1}{u}$$$:
$$x \operatorname{atan}{\left(\frac{1}{x} \right)} - {\color{red}{\int{\left(- \frac{1}{2 u}\right)d u}}} = x \operatorname{atan}{\left(\frac{1}{x} \right)} - {\color{red}{\left(- \frac{\int{\frac{1}{u} d u}}{2}\right)}}$$
The integral of $$$\frac{1}{u}$$$ is $$$\int{\frac{1}{u} d u} = \ln{\left(\left|{u}\right| \right)}$$$:
$$x \operatorname{atan}{\left(\frac{1}{x} \right)} + \frac{{\color{red}{\int{\frac{1}{u} d u}}}}{2} = x \operatorname{atan}{\left(\frac{1}{x} \right)} + \frac{{\color{red}{\ln{\left(\left|{u}\right| \right)}}}}{2}$$
Recall that $$$u=x^{2} + 1$$$:
$$x \operatorname{atan}{\left(\frac{1}{x} \right)} + \frac{\ln{\left(\left|{{\color{red}{u}}}\right| \right)}}{2} = x \operatorname{atan}{\left(\frac{1}{x} \right)} + \frac{\ln{\left(\left|{{\color{red}{\left(x^{2} + 1\right)}}}\right| \right)}}{2}$$
Therefore,
$$\int{\operatorname{atan}{\left(\frac{1}{x} \right)} d x} = x \operatorname{atan}{\left(\frac{1}{x} \right)} + \frac{\ln{\left(x^{2} + 1 \right)}}{2}$$
Simplify:
$$\int{\operatorname{atan}{\left(\frac{1}{x} \right)} d x} = x \operatorname{acot}{\left(x \right)} + \frac{\ln{\left(x^{2} + 1 \right)}}{2}$$
Add the constant of integration:
$$\int{\operatorname{atan}{\left(\frac{1}{x} \right)} d x} = x \operatorname{acot}{\left(x \right)} + \frac{\ln{\left(x^{2} + 1 \right)}}{2}+C$$
Answer: $$$\int{\operatorname{atan}{\left(\frac{1}{x} \right)} d x}=x \operatorname{acot}{\left(x \right)} + \frac{\ln{\left(x^{2} + 1 \right)}}{2}+C$$$