\(\int \sqrt {1+x^2} \arctan (x)^2 \, dx\) [35]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (warning: unable to verify)
   Maple [A] (verified)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 14, antiderivative size = 121 \[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=\text {arcsinh}(x)-\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2-i \arctan \left (e^{i \arctan (x)}\right ) \arctan (x)^2+i \arctan (x) \operatorname {PolyLog}\left (2,-i e^{i \arctan (x)}\right )-i \arctan (x) \operatorname {PolyLog}\left (2,i e^{i \arctan (x)}\right )-\operatorname {PolyLog}\left (3,-i e^{i \arctan (x)}\right )+\operatorname {PolyLog}\left (3,i e^{i \arctan (x)}\right ) \]

[Out]

arcsinh(x)-I*arctan((1+I*x)/(x^2+1)^(1/2))*arctan(x)^2+I*arctan(x)*polylog(2,-I*(1+I*x)/(x^2+1)^(1/2))-I*arcta
n(x)*polylog(2,I*(1+I*x)/(x^2+1)^(1/2))-polylog(3,-I*(1+I*x)/(x^2+1)^(1/2))+polylog(3,I*(1+I*x)/(x^2+1)^(1/2))
-arctan(x)*(x^2+1)^(1/2)+1/2*x*arctan(x)^2*(x^2+1)^(1/2)

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {5000, 5008, 4266, 2611, 2320, 6724, 221} \[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=\text {arcsinh}(x)+i \arctan (x) \operatorname {PolyLog}\left (2,-i e^{i \arctan (x)}\right )-i \arctan (x) \operatorname {PolyLog}\left (2,i e^{i \arctan (x)}\right )-\operatorname {PolyLog}\left (3,-i e^{i \arctan (x)}\right )+\operatorname {PolyLog}\left (3,i e^{i \arctan (x)}\right )+\frac {1}{2} x \sqrt {x^2+1} \arctan (x)^2-\sqrt {x^2+1} \arctan (x)-i \arctan \left (e^{i \arctan (x)}\right ) \arctan (x)^2 \]

[In]

Int[Sqrt[1 + x^2]*ArcTan[x]^2,x]

[Out]

ArcSinh[x] - Sqrt[1 + x^2]*ArcTan[x] + (x*Sqrt[1 + x^2]*ArcTan[x]^2)/2 - I*ArcTan[E^(I*ArcTan[x])]*ArcTan[x]^2
 + I*ArcTan[x]*PolyLog[2, (-I)*E^(I*ArcTan[x])] - I*ArcTan[x]*PolyLog[2, I*E^(I*ArcTan[x])] - PolyLog[3, (-I)*
E^(I*ArcTan[x])] + PolyLog[3, I*E^(I*ArcTan[x])]

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2611

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 4266

Int[csc[(e_.) + Pi*(k_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E
^(I*k*Pi)*E^(I*(e + f*x))]/f), x] + (-Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 - E^(I*k*Pi)*E^(I*(e + f*x))],
 x], x] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 + E^(I*k*Pi)*E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e,
f}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 5000

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

Rule 5008

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/Sqrt[(d_) + (e_.)*(x_)^2], x_Symbol] :> Dist[1/(c*Sqrt[d]), Subst
[Int[(a + b*x)^p*Sec[x], x], x, ArcTan[c*x]], x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[e, c^2*d] && IGtQ[p, 0] &
& GtQ[d, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps \begin{align*} \text {integral}& = -\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2+\frac {1}{2} \int \frac {\arctan (x)^2}{\sqrt {1+x^2}} \, dx+\int \frac {1}{\sqrt {1+x^2}} \, dx \\ & = \text {arcsinh}(x)-\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2+\frac {1}{2} \text {Subst}\left (\int x^2 \sec (x) \, dx,x,\arctan (x)\right ) \\ & = \text {arcsinh}(x)-\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2-i \arctan \left (e^{i \arctan (x)}\right ) \arctan (x)^2-\text {Subst}\left (\int x \log \left (1-i e^{i x}\right ) \, dx,x,\arctan (x)\right )+\text {Subst}\left (\int x \log \left (1+i e^{i x}\right ) \, dx,x,\arctan (x)\right ) \\ & = \text {arcsinh}(x)-\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2-i \arctan \left (e^{i \arctan (x)}\right ) \arctan (x)^2+i \arctan (x) \operatorname {PolyLog}\left (2,-i e^{i \arctan (x)}\right )-i \arctan (x) \operatorname {PolyLog}\left (2,i e^{i \arctan (x)}\right )-i \text {Subst}\left (\int \operatorname {PolyLog}\left (2,-i e^{i x}\right ) \, dx,x,\arctan (x)\right )+i \text {Subst}\left (\int \operatorname {PolyLog}\left (2,i e^{i x}\right ) \, dx,x,\arctan (x)\right ) \\ & = \text {arcsinh}(x)-\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2-i \arctan \left (e^{i \arctan (x)}\right ) \arctan (x)^2+i \arctan (x) \operatorname {PolyLog}\left (2,-i e^{i \arctan (x)}\right )-i \arctan (x) \operatorname {PolyLog}\left (2,i e^{i \arctan (x)}\right )-\text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{i \arctan (x)}\right )+\text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{i \arctan (x)}\right ) \\ & = \text {arcsinh}(x)-\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2-i \arctan \left (e^{i \arctan (x)}\right ) \arctan (x)^2+i \arctan (x) \operatorname {PolyLog}\left (2,-i e^{i \arctan (x)}\right )-i \arctan (x) \operatorname {PolyLog}\left (2,i e^{i \arctan (x)}\right )-\operatorname {PolyLog}\left (3,-i e^{i \arctan (x)}\right )+\operatorname {PolyLog}\left (3,i e^{i \arctan (x)}\right ) \\ \end{align*}

Mathematica [A] (warning: unable to verify)

Time = 0.15 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.08 \[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=-\sqrt {1+x^2} \arctan (x)+\frac {1}{2} x \sqrt {1+x^2} \arctan (x)^2-i \arctan \left (e^{i \arctan (x)}\right ) \arctan (x)^2+\text {arctanh}\left (\frac {x}{\sqrt {1+x^2}}\right )+i \arctan (x) \operatorname {PolyLog}\left (2,-i e^{i \arctan (x)}\right )-i \arctan (x) \operatorname {PolyLog}\left (2,i e^{i \arctan (x)}\right )-\operatorname {PolyLog}\left (3,-i e^{i \arctan (x)}\right )+\operatorname {PolyLog}\left (3,i e^{i \arctan (x)}\right ) \]

[In]

Integrate[Sqrt[1 + x^2]*ArcTan[x]^2,x]

[Out]

-(Sqrt[1 + x^2]*ArcTan[x]) + (x*Sqrt[1 + x^2]*ArcTan[x]^2)/2 - I*ArcTan[E^(I*ArcTan[x])]*ArcTan[x]^2 + ArcTanh
[x/Sqrt[1 + x^2]] + I*ArcTan[x]*PolyLog[2, (-I)*E^(I*ArcTan[x])] - I*ArcTan[x]*PolyLog[2, I*E^(I*ArcTan[x])] -
 PolyLog[3, (-I)*E^(I*ArcTan[x])] + PolyLog[3, I*E^(I*ArcTan[x])]

Maple [A] (verified)

Time = 0.72 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.41

method result size
default \(\frac {\left (x \arctan \left (x \right )-2\right ) \arctan \left (x \right ) \sqrt {x^{2}+1}}{2}+\frac {\arctan \left (x \right )^{2} \ln \left (1-\frac {i \left (i x +1\right )}{\sqrt {x^{2}+1}}\right )}{2}-\frac {\arctan \left (x \right )^{2} \ln \left (1+\frac {i \left (i x +1\right )}{\sqrt {x^{2}+1}}\right )}{2}-i \arctan \left (x \right ) \operatorname {Li}_{2}\left (\frac {i \left (i x +1\right )}{\sqrt {x^{2}+1}}\right )+i \arctan \left (x \right ) \operatorname {Li}_{2}\left (-\frac {i \left (i x +1\right )}{\sqrt {x^{2}+1}}\right )+\operatorname {Li}_{3}\left (\frac {i \left (i x +1\right )}{\sqrt {x^{2}+1}}\right )-\operatorname {Li}_{3}\left (-\frac {i \left (i x +1\right )}{\sqrt {x^{2}+1}}\right )-2 i \arctan \left (\frac {i x +1}{\sqrt {x^{2}+1}}\right )\) \(171\)

[In]

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

[Out]

1/2*(x*arctan(x)-2)*arctan(x)*(x^2+1)^(1/2)+1/2*arctan(x)^2*ln(1-I*(1+I*x)/(x^2+1)^(1/2))-1/2*arctan(x)^2*ln(1
+I*(1+I*x)/(x^2+1)^(1/2))-I*arctan(x)*polylog(2,I*(1+I*x)/(x^2+1)^(1/2))+I*arctan(x)*polylog(2,-I*(1+I*x)/(x^2
+1)^(1/2))+polylog(3,I*(1+I*x)/(x^2+1)^(1/2))-polylog(3,-I*(1+I*x)/(x^2+1)^(1/2))-2*I*arctan((1+I*x)/(x^2+1)^(
1/2))

Fricas [F]

\[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=\int { \sqrt {x^{2} + 1} \arctan \left (x\right )^{2} \,d x } \]

[In]

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

[Out]

integral(sqrt(x^2 + 1)*arctan(x)^2, x)

Sympy [F]

\[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=\int \sqrt {x^{2} + 1} \operatorname {atan}^{2}{\left (x \right )}\, dx \]

[In]

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

[Out]

Integral(sqrt(x**2 + 1)*atan(x)**2, x)

Maxima [F]

\[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=\int { \sqrt {x^{2} + 1} \arctan \left (x\right )^{2} \,d x } \]

[In]

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

[Out]

integrate(sqrt(x^2 + 1)*arctan(x)^2, x)

Giac [F]

\[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=\int { \sqrt {x^{2} + 1} \arctan \left (x\right )^{2} \,d x } \]

[In]

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

[Out]

integrate(sqrt(x^2 + 1)*arctan(x)^2, x)

Mupad [F(-1)]

Timed out. \[ \int \sqrt {1+x^2} \arctan (x)^2 \, dx=\int {\mathrm {atan}\left (x\right )}^2\,\sqrt {x^2+1} \,d x \]

[In]

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

[Out]

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