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 + x)^(-1) + ArcTan[x]^2/2 + Log[1 + x]

________________________________________________________________________________________

Rubi [A]  time = 0.150804, antiderivative size = 18, normalized size of antiderivative = 1., 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 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]

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]

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.030539, size = 18, normalized size = 1. \[ \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]

________________________________________________________________________________________

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

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 = 1.91213, size = 22, normalized size = 1.22 \begin{align*} \frac{1}{2} \, \arctan \left (x\right )^{2} + \frac{1}{x + 1} + \log \left (x + 1\right ) \end{align*}

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)

________________________________________________________________________________________

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

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)

________________________________________________________________________________________

Sympy [B]  time = 0.856435, size = 53, normalized size = 2.94 \begin{align*} \frac{2 x \log{\left (x + 1 \right )}}{2 x + 2} + \frac{x \operatorname{atan}^{2}{\left (x \right )}}{2 x + 2} + \frac{2 \log{\left (x + 1 \right )}}{2 x + 2} + \frac{\operatorname{atan}^{2}{\left (x \right )}}{2 x + 2} + \frac{2}{2 x + 2} \end{align*}

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
)

________________________________________________________________________________________

Giac [B]  time = 1.13125, size = 45, normalized size = 2.5 \begin{align*} \frac{1}{2} \, \arctan \left (-{\left (x + 1\right )}{\left (\frac{1}{x + 1} - 1\right )}\right )^{2} + \frac{1}{x + 1} - \log \left (-\frac{1}{x + 1}\right ) \end{align*}

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*arctan(-(x + 1)*(1/(x + 1) - 1))^2 + 1/(x + 1) - log(-1/(x + 1))