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

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

Optimal result

Integrand size = 21, antiderivative size = 12 \[ \int \frac {5+3 x}{1-x-x^2+x^3} \, dx=\frac {4}{1-x}+\text {arctanh}(x) \]

[Out]

4/(1-x)+arctanh(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, 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.095, Rules used = {2099, 212} \[ \int \frac {5+3 x}{1-x-x^2+x^3} \, dx=\text {arctanh}(x)+\frac {4}{1-x} \]

[In]

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

[Out]

4/(1 - x) + ArcTanh[x]

Rule 212

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

Rule 2099

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.75

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

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (7) = 14\).

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 22 vs. \(2 (10) = 20\).

Time = 0.29 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.83 \[ \int \frac {5+3 x}{1-x-x^2+x^3} \, dx=-\frac {4}{x - 1} + \frac {1}{2} \, \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{2} \, \log \left ({\left | x - 1 \right |}\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.83 \[ \int \frac {5+3 x}{1-x-x^2+x^3} \, dx=\mathrm {atanh}\left (x\right )-\frac {4}{x-1} \]

[In]

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

[Out]

atanh(x) - 4/(x - 1)