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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {6725, 43, 4884} \[ \frac {1}{x+1}+\log (x+1)+\frac {1}{2} \tan ^{-1}(x)^2 \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 4884

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 6725

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 18, normalized size = 1.00 \[ \frac {1}{x+1}+\log (x+1)+\frac {1}{2} \tan ^{-1}(x)^2 \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 26, normalized size = 1.44 \[ \frac {{\left (x + 1\right )} \arctan \relax (x)^{2} + 2 \, {\left (x + 1\right )} \log \left (x + 1\right ) + 2}{2 \, {\left (x + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.14, size = 104, normalized size = 5.78 \[ \frac {{\left (x + 1\right )} {\left (\frac {1}{x + 1} - 1\right )} \arctan \left ({\left (x + 1\right )} {\left (\frac {1}{x + 1} - 1\right )}\right )^{2} + 2 \, {\left (x + 1\right )} {\left (\frac {1}{x + 1} - 1\right )} \log \left (-{\left (x + 1\right )} {\left (\frac {1}{x + 1} - 1\right )} + 1\right ) - \arctan \left ({\left (x + 1\right )} {\left (\frac {1}{x + 1} - 1\right )}\right )^{2} - 2 \, \log \left (-{\left (x + 1\right )} {\left (\frac {1}{x + 1} - 1\right )} + 1\right ) - 2}{2 \, {\left ({\left (x + 1\right )} {\left (\frac {1}{x + 1} - 1\right )} - 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.05, size = 17, normalized size = 0.94 \[ \frac {1}{x +1}+\frac {\arctan \relax (x )^{2}}{2}+\ln \left (x +1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.56, size = 16, normalized size = 0.89 \[ \frac {1}{2} \, \arctan \relax (x)^{2} + \frac {1}{x + 1} + \log \left (x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.13, size = 16, normalized size = 0.89 \[ \ln \left (x+1\right )+\frac {1}{x+1}+\frac {{\mathrm {atan}\relax (x)}^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x + 1) + 1/(x + 1) + atan(x)^2/2

________________________________________________________________________________________

sympy [B]  time = 0.62, size = 53, normalized size = 2.94 \[ \frac {2 x \log {\left (x + 1 \right )}}{2 x + 2} + \frac {x \operatorname {atan}^{2}{\relax (x )}}{2 x + 2} + \frac {2 \log {\left (x + 1 \right )}}{2 x + 2} + \frac {\operatorname {atan}^{2}{\relax (x )}}{2 x + 2} + \frac {2}{2 x + 2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________