3.1.46 \(\int x \tan ^{-1}(x)^2 \log (1+x^2) \, dx\) [46]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.16, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 10, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {4946, 5036, 4930, 266, 5004, 5143, 5129, 2525, 2437, 2338} \begin {gather*} -\frac {1}{2} x^2 \text {ArcTan}(x)^2+\frac {1}{2} \left (x^2+1\right ) \text {ArcTan}(x)^2 \log \left (x^2+1\right )-x \text {ArcTan}(x) \log \left (x^2+1\right )-\frac {3 \text {ArcTan}(x)^2}{2}+3 x \text {ArcTan}(x)+\frac {1}{4} \log ^2\left (x^2+1\right )-\frac {3}{2} \log \left (x^2+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 266

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]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2437

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[(f*(x/d))^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2525

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.)*((f_) + (g_.)*(x_)^(s_))^(r_.),
 x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(f + g*x^(s/n))^r*(a + b*Log[c*(d + e*x)^p])^q,
x], x, x^n], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q, r, s}, x] && IntegerQ[r] && IntegerQ[s/n] && Intege
rQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0])

Rule 4930

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

Rule 4946

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

Rule 5004

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

Rule 5036

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

Rule 5129

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.)), x_Symbol] :> Simp[x*(d + e*L
og[f + g*x^2])*(a + b*ArcTan[c*x]), x] + (-Dist[b*c, Int[x*((d + e*Log[f + g*x^2])/(1 + c^2*x^2)), x], x] - Di
st[2*e*g, Int[x^2*((a + b*ArcTan[c*x])/(f + g*x^2)), x], x]) /; FreeQ[{a, b, c, d, e, f, g}, x]

Rule 5143

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^2*((d_.) + Log[(f_) + (g_.)*(x_)^2]*(e_.))*(x_), x_Symbol] :> Simp[(f +
 g*x^2)*(d + e*Log[f + g*x^2])*((a + b*ArcTan[c*x])^2/(2*g)), x] + (-Dist[b/c, Int[(d + e*Log[f + g*x^2])*(a +
 b*ArcTan[c*x]), x], x] + Dist[b*c*e, Int[x^2*((a + b*ArcTan[c*x])/(1 + c^2*x^2)), x], x] - Simp[e*x^2*((a + b
*ArcTan[c*x])^2/2), x]) /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[g, c^2*f]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 58, normalized size = 0.75 \begin {gather*} \frac {1}{4} \left (-4 x \tan ^{-1}(x) \left (-3+\log \left (1+x^2\right )\right )+\left (-6+\log \left (1+x^2\right )\right ) \log \left (1+x^2\right )+2 \tan ^{-1}(x)^2 \left (-3-x^2+\left (1+x^2\right ) \log \left (1+x^2\right )\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(-4*x*ArcTan[x]*(-3 + Log[1 + x^2]) + (-6 + Log[1 + x^2])*Log[1 + x^2] + 2*ArcTan[x]^2*(-3 - x^2 + (1 + x^2)*L
og[1 + x^2]))/4

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 2.35, size = 1134, normalized size = 14.73

method result size
default \(\text {Expression too large to display}\) \(1134\)
risch \(\text {Expression too large to display}\) \(113915\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln((1+I*x)^2/(x^2+1)+1)^2+I*csgn(I/(x^2+1)^(1/2))^2*csgn(I*((1+I*x)^2/(x^2+1)+1))*ln((1+I*x)^2/(x^2+1)+1)*Pi-1
/2*arctan(x)^2-1/2*x^2*arctan(x)^2+3*x*arctan(x)+I*csgn(I/(x^2+1)^(1/2))^2*csgn(I/(1+I*x)*(x^2+1)^(1/2))*ln((1
+I*x)^2/(x^2+1)+1)*Pi+3*ln((1+I*x)^2/(x^2+1)+1)-arctan(x)^2*ln((1+I*x)^2/(x^2+1)+1)-3*I*arctan(x)+ln(2)*arctan
(x)^2-arctan(x)*Pi*csgn(I/(x^2+1)^(1/2))*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+1)^(1/2))-1/2*I*arc
tan(x)^2*Pi*csgn(I/(x^2+1)^(1/2))^2*csgn(I*((1+I*x)^2/(x^2+1)+1))-1/2*I*arctan(x)^2*Pi*csgn(I/(x^2+1)^(1/2))^2
*csgn(I/(1+I*x)*(x^2+1)^(1/2))+1/2*I*arctan(x)^2*Pi*csgn(I/(x^2+1)^(1/2))^3*x^2-I*arctan(x)*Pi*csgn(I/(x^2+1)^
(1/2))^3*x-I*csgn(I/(x^2+1)^(1/2))^3*ln((1+I*x)^2/(x^2+1)+1)*Pi+1/2*I*arctan(x)^2*Pi*csgn(I/(x^2+1)^(1/2))^3+a
rctan(x)*Pi*csgn(I/(x^2+1)^(1/2))^2*csgn(I*((1+I*x)^2/(x^2+1)+1))+arctan(x)*Pi*csgn(I/(x^2+1)^(1/2))^2*csgn(I/
(1+I*x)*(x^2+1)^(1/2))+2*I*ln(2)*arctan(x)-arctan(x)^2*ln((1+I*x)^2/(x^2+1)+1)*x^2-arctan(x)*Pi*csgn(I/(x^2+1)
^(1/2))^3-2*ln(2)*arctan(x)*x+ln(2)*arctan(x)^2*x^2+2*arctan(x)*ln((1+I*x)^2/(x^2+1)+1)*x+(x^2*arctan(x)^2+2*I
*arctan(x)+arctan(x)^2-2*x*arctan(x)-2*ln((1+I*x)^2/(x^2+1)+1))*ln((1+I*x)/(x^2+1)^(1/2))+1/2*I*arctan(x)^2*Pi
*csgn(I/(x^2+1)^(1/2))*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+1)^(1/2))*x^2-I*arctan(x)*Pi*csgn(I/(
x^2+1)^(1/2))*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+1)^(1/2))*x-2*ln((1+I*x)^2/(x^2+1)+1)*ln(2)-I*
Pi*ln((1+I*x)^2/(x^2+1)+1)*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+1)^(1/2))*csgn(I/(x^2+1)^(1/2))+1
/2*I*arctan(x)^2*Pi*csgn(I/(x^2+1)^(1/2))*csgn(I*((1+I*x)^2/(x^2+1)+1))*csgn(I/(1+I*x)*(x^2+1)^(1/2))-1/2*I*ar
ctan(x)^2*Pi*csgn(I/(x^2+1)^(1/2))^2*csgn(I*((1+I*x)^2/(x^2+1)+1))*x^2-1/2*I*arctan(x)^2*Pi*csgn(I/(x^2+1)^(1/
2))^2*csgn(I/(1+I*x)*(x^2+1)^(1/2))*x^2+I*arctan(x)*Pi*csgn(I/(x^2+1)^(1/2))^2*csgn(I*((1+I*x)^2/(x^2+1)+1))*x
+I*arctan(x)*Pi*csgn(I/(x^2+1)^(1/2))^2*csgn(I/(1+I*x)*(x^2+1)^(1/2))*x

________________________________________________________________________________________

Maxima [A]
time = 3.14, size = 67, normalized size = 0.87 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} - {\left (x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 1\right )} \arctan \left (x\right )^{2} - {\left (x \log \left (x^{2} + 1\right ) - 3 \, x + 2 \, \arctan \left (x\right )\right )} \arctan \left (x\right ) + \arctan \left (x\right )^{2} + \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} - \frac {3}{2} \, \log \left (x^{2} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.97, size = 52, normalized size = 0.68 \begin {gather*} -\frac {1}{2} \, {\left (x^{2} + 3\right )} \arctan \left (x\right )^{2} + 3 \, x \arctan \left (x\right ) + \frac {1}{2} \, {\left ({\left (x^{2} + 1\right )} \arctan \left (x\right )^{2} - 2 \, x \arctan \left (x\right ) - 3\right )} \log \left (x^{2} + 1\right ) + \frac {1}{4} \, \log \left (x^{2} + 1\right )^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.48, size = 87, normalized size = 1.13 \begin {gather*} \frac {x^{2} \log {\left (x^{2} + 1 \right )} \operatorname {atan}^{2}{\left (x \right )}}{2} - \frac {x^{2} \operatorname {atan}^{2}{\left (x \right )}}{2} - x \log {\left (x^{2} + 1 \right )} \operatorname {atan}{\left (x \right )} + 3 x \operatorname {atan}{\left (x \right )} + \frac {\log {\left (x^{2} + 1 \right )}^{2}}{4} + \frac {\log {\left (x^{2} + 1 \right )} \operatorname {atan}^{2}{\left (x \right )}}{2} - \frac {3 \log {\left (x^{2} + 1 \right )}}{2} - \frac {3 \operatorname {atan}^{2}{\left (x \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.26, size = 78, normalized size = 1.01 \begin {gather*} \frac {{\ln \left (x^2+1\right )}^2}{4}-\frac {3\,\ln \left (x^2+1\right )}{2}-\frac {3\,{\mathrm {atan}\left (x\right )}^2}{2}+\frac {\ln \left (x^2+1\right )\,{\mathrm {atan}\left (x\right )}^2}{2}+x\,\left (3\,\mathrm {atan}\left (x\right )-\ln \left (x^2+1\right )\,\mathrm {atan}\left (x\right )\right )-x^2\,\left (\frac {{\mathrm {atan}\left (x\right )}^2}{2}-\frac {\ln \left (x^2+1\right )\,{\mathrm {atan}\left (x\right )}^2}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x^2 + 1)^2/4 - (3*log(x^2 + 1))/2 - (3*atan(x)^2)/2 + (log(x^2 + 1)*atan(x)^2)/2 + x*(3*atan(x) - log(x^2
+ 1)*atan(x)) - x^2*(atan(x)^2/2 - (log(x^2 + 1)*atan(x)^2)/2)

________________________________________________________________________________________