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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 19, antiderivative size = 24 \[ \int \frac {3+2 x+x^2}{(-1+x) (1+x)^2} \, dx=\frac {1}{1+x}+\frac {3}{2} \log (1-x)-\frac {1}{2} \log (1+x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {907} \[ \int \frac {3+2 x+x^2}{(-1+x) (1+x)^2} \, dx=\frac {1}{x+1}+\frac {3}{2} \log (1-x)-\frac {1}{2} \log (x+1) \]

[In]

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

[Out]

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

Rule 907

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && I
ntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.92 \[ \int \frac {3+2 x+x^2}{(-1+x) (1+x)^2} \, dx=\frac {1}{1+x}+\frac {3}{2} \log (-1+x)-\frac {1}{2} \log (1+x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.79

method result size
default \(\frac {3 \ln \left (-1+x \right )}{2}+\frac {1}{1+x}-\frac {\ln \left (1+x \right )}{2}\) \(19\)
norman \(\frac {3 \ln \left (-1+x \right )}{2}+\frac {1}{1+x}-\frac {\ln \left (1+x \right )}{2}\) \(19\)
risch \(\frac {3 \ln \left (-1+x \right )}{2}+\frac {1}{1+x}-\frac {\ln \left (1+x \right )}{2}\) \(19\)
parallelrisch \(\frac {3 \ln \left (-1+x \right ) x -\ln \left (1+x \right ) x +2+3 \ln \left (-1+x \right )-\ln \left (1+x \right )}{2 x +2}\) \(36\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.75 \[ \int \frac {3+2 x+x^2}{(-1+x) (1+x)^2} \, dx=\frac {1}{x + 1} - \frac {1}{2} \, \log \left (x + 1\right ) + \frac {3}{2} \, \log \left (x - 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.75 \[ \int \frac {3+2 x+x^2}{(-1+x) (1+x)^2} \, dx=\frac {3\,\ln \left (x-1\right )}{2}-\frac {\ln \left (x+1\right )}{2}+\frac {1}{x+1} \]

[In]

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

[Out]

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