3.676 \(\int \frac{(1+x^2) \tan ^{-1}(x)}{x^2} \, dx\)

Optimal. Leaf size=22 \[ -\log \left (x^2+1\right )+\log (x)+x \tan ^{-1}(x)-\frac{\tan ^{-1}(x)}{x} \]

[Out]

-(ArcTan[x]/x) + x*ArcTan[x] + Log[x] - Log[1 + x^2]

________________________________________________________________________________________

Rubi [A]  time = 0.0341581, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 8, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.727, Rules used = {4950, 4852, 266, 36, 29, 31, 4846, 260} \[ -\log \left (x^2+1\right )+\log (x)+x \tan ^{-1}(x)-\frac{\tan ^{-1}(x)}{x} \]

Antiderivative was successfully verified.

[In]

Int[((1 + x^2)*ArcTan[x])/x^2,x]

[Out]

-(ArcTan[x]/x) + x*ArcTan[x] + Log[x] - Log[1 + x^2]

Rule 4950

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_)*((d_) + (e_.)*(x_)^2)^(q_.), x_Symbol] :> Dist[
d, Int[(f*x)^m*(d + e*x^2)^(q - 1)*(a + b*ArcTan[c*x])^p, x], x] + Dist[(c^2*d)/f^2, Int[(f*x)^(m + 2)*(d + e*
x^2)^(q - 1)*(a + b*ArcTan[c*x])^p, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[e, c^2*d] && GtQ[q, 0] &&
 IGtQ[p, 0] && (RationalQ[m] || (EqQ[p, 1] && IntegerQ[q]))

Rule 4852

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*ArcTa
n[c*x])^p)/(d*(m + 1)), x] - Dist[(b*c*p)/(d*(m + 1)), Int[((d*x)^(m + 1)*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^
2*x^2), x], x] /; FreeQ[{a, b, c, d, m}, x] && IGtQ[p, 0] && (EqQ[p, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 4846

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x])^p, x] - Dist[b*c*p, Int[
(x*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^2*x^2), x], x] /; FreeQ[{a, b, c}, x] && IGtQ[p, 0]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{\left (1+x^2\right ) \tan ^{-1}(x)}{x^2} \, dx &=\int \tan ^{-1}(x) \, dx+\int \frac{\tan ^{-1}(x)}{x^2} \, dx\\ &=-\frac{\tan ^{-1}(x)}{x}+x \tan ^{-1}(x)+\int \frac{1}{x \left (1+x^2\right )} \, dx-\int \frac{x}{1+x^2} \, dx\\ &=-\frac{\tan ^{-1}(x)}{x}+x \tan ^{-1}(x)-\frac{1}{2} \log \left (1+x^2\right )+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{x (1+x)} \, dx,x,x^2\right )\\ &=-\frac{\tan ^{-1}(x)}{x}+x \tan ^{-1}(x)-\frac{1}{2} \log \left (1+x^2\right )+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{x} \, dx,x,x^2\right )-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,x^2\right )\\ &=-\frac{\tan ^{-1}(x)}{x}+x \tan ^{-1}(x)+\log (x)-\log \left (1+x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.0064361, size = 22, normalized size = 1. \[ -\log \left (x^2+1\right )+\log (x)+x \tan ^{-1}(x)-\frac{\tan ^{-1}(x)}{x} \]

Antiderivative was successfully verified.

[In]

Integrate[((1 + x^2)*ArcTan[x])/x^2,x]

[Out]

-(ArcTan[x]/x) + x*ArcTan[x] + Log[x] - Log[1 + x^2]

________________________________________________________________________________________

Maple [A]  time = 0.008, size = 23, normalized size = 1.1 \begin{align*} -{\frac{\arctan \left ( x \right ) }{x}}+x\arctan \left ( x \right ) +\ln \left ( x \right ) -\ln \left ({x}^{2}+1 \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+1)*arctan(x)/x^2,x)

[Out]

-arctan(x)/x+x*arctan(x)+ln(x)-ln(x^2+1)

________________________________________________________________________________________

Maxima [A]  time = 1.41546, size = 28, normalized size = 1.27 \begin{align*}{\left (x - \frac{1}{x}\right )} \arctan \left (x\right ) - \log \left (x^{2} + 1\right ) + \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)*arctan(x)/x^2,x, algorithm="maxima")

[Out]

(x - 1/x)*arctan(x) - log(x^2 + 1) + log(x)

________________________________________________________________________________________

Fricas [A]  time = 2.31242, size = 72, normalized size = 3.27 \begin{align*} \frac{{\left (x^{2} - 1\right )} \arctan \left (x\right ) - x \log \left (x^{2} + 1\right ) + x \log \left (x\right )}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)*arctan(x)/x^2,x, algorithm="fricas")

[Out]

((x^2 - 1)*arctan(x) - x*log(x^2 + 1) + x*log(x))/x

________________________________________________________________________________________

Sympy [A]  time = 0.384592, size = 19, normalized size = 0.86 \begin{align*} x \operatorname{atan}{\left (x \right )} + \log{\left (x \right )} - \log{\left (x^{2} + 1 \right )} - \frac{\operatorname{atan}{\left (x \right )}}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+1)*atan(x)/x**2,x)

[Out]

x*atan(x) + log(x) - log(x**2 + 1) - atan(x)/x

________________________________________________________________________________________

Giac [A]  time = 1.0688, size = 34, normalized size = 1.55 \begin{align*}{\left (x - \frac{1}{x}\right )} \arctan \left (x\right ) - \log \left (x^{2} + 1\right ) + \frac{1}{2} \, \log \left (x^{2}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)*arctan(x)/x^2,x, algorithm="giac")

[Out]

(x - 1/x)*arctan(x) - log(x^2 + 1) + 1/2*log(x^2)