\(\int \frac {x}{(1-x) (1+x)^2} \, dx\) [343]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 16 \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=\frac {1}{2 (1+x)}+\frac {\text {arctanh}(x)}{2} \]

[Out]

1/2/(1+x)+1/2*arctanh(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {78, 213} \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=\frac {\text {arctanh}(x)}{2}+\frac {1}{2 (x+1)} \]

[In]

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

[Out]

1/(2*(1 + x)) + ArcTanh[x]/2

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {1}{2 (1+x)^2}-\frac {1}{2 \left (-1+x^2\right )}\right ) \, dx \\ & = \frac {1}{2 (1+x)}-\frac {1}{2} \int \frac {1}{-1+x^2} \, dx \\ & = \frac {1}{2 (1+x)}+\frac {1}{2} \tanh ^{-1}(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.50 \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=\frac {1}{4} \left (\frac {2}{1+x}-\log (1-x)+\log (1+x)\right ) \]

[In]

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

[Out]

(2/(1 + x) - Log[1 - x] + Log[1 + x])/4

Maple [A] (verified)

Time = 0.75 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.31

method result size
default \(\frac {1}{2 x +2}+\frac {\ln \left (x +1\right )}{4}-\frac {\ln \left (x -1\right )}{4}\) \(21\)
norman \(\frac {1}{2 x +2}+\frac {\ln \left (x +1\right )}{4}-\frac {\ln \left (x -1\right )}{4}\) \(21\)
risch \(\frac {1}{2 x +2}+\frac {\ln \left (x +1\right )}{4}-\frac {\ln \left (x -1\right )}{4}\) \(21\)
parallelrisch \(-\frac {\ln \left (x -1\right ) x -\ln \left (x +1\right ) x -2+\ln \left (x -1\right )-\ln \left (x +1\right )}{4 \left (x +1\right )}\) \(33\)

[In]

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

[Out]

1/2/(x+1)+1/4*ln(x+1)-1/4*ln(x-1)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 26 vs. \(2 (12) = 24\).

Time = 0.25 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.62 \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=\frac {{\left (x + 1\right )} \log \left (x + 1\right ) - {\left (x + 1\right )} \log \left (x - 1\right ) + 2}{4 \, {\left (x + 1\right )}} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.19 \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=- \frac {\log {\left (x - 1 \right )}}{4} + \frac {\log {\left (x + 1 \right )}}{4} + \frac {1}{2 x + 2} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=\frac {1}{2 \, {\left (x + 1\right )}} + \frac {1}{4} \, \log \left (x + 1\right ) - \frac {1}{4} \, \log \left (x - 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.31 \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=\frac {1}{2 \, {\left (x + 1\right )}} - \frac {1}{4} \, \log \left ({\left | -\frac {2}{x + 1} + 1 \right |}\right ) \]

[In]

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

[Out]

1/2/(x + 1) - 1/4*log(abs(-2/(x + 1) + 1))

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \frac {x}{(1-x) (1+x)^2} \, dx=\frac {\mathrm {atanh}\left (x\right )}{2}+\frac {1}{2\,\left (x+1\right )} \]

[In]

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

[Out]

atanh(x)/2 + 1/(2*(x + 1))