3.290 \(\int \frac {2-x+x^3}{-7-6 x+x^2} \, dx\)

Optimal. Leaf size=29 \[ \frac {x^2}{2}+6 x+\frac {169}{4} \log (7-x)-\frac {1}{4} \log (x+1) \]

[Out]

6*x+1/2*x^2+169/4*ln(7-x)-1/4*ln(1+x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {1657, 632, 31} \[ \frac {x^2}{2}+6 x+\frac {169}{4} \log (7-x)-\frac {1}{4} \log (x+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

6*x + x^2/2 + (169*Log[7 - x])/4 - Log[1 + x]/4

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 632

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {align*} \int \frac {2-x+x^3}{-7-6 x+x^2} \, dx &=\int \left (6+x+\frac {2 (22+21 x)}{-7-6 x+x^2}\right ) \, dx\\ &=6 x+\frac {x^2}{2}+2 \int \frac {22+21 x}{-7-6 x+x^2} \, dx\\ &=6 x+\frac {x^2}{2}-\frac {1}{4} \int \frac {1}{1+x} \, dx+\frac {169}{4} \int \frac {1}{-7+x} \, dx\\ &=6 x+\frac {x^2}{2}+\frac {169}{4} \log (7-x)-\frac {1}{4} \log (1+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 29, normalized size = 1.00 \[ \frac {x^2}{2}+6 x+\frac {169}{4} \log (7-x)-\frac {1}{4} \log (x+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

6*x + x^2/2 + (169*Log[7 - x])/4 - Log[1 + x]/4

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 21, normalized size = 0.72 \[ \frac {1}{2} \, x^{2} + 6 \, x - \frac {1}{4} \, \log \left (x + 1\right ) + \frac {169}{4} \, \log \left (x - 7\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 + 6*x - 1/4*log(x + 1) + 169/4*log(x - 7)

________________________________________________________________________________________

giac [A]  time = 0.37, size = 23, normalized size = 0.79 \[ \frac {1}{2} \, x^{2} + 6 \, x - \frac {1}{4} \, \log \left ({\left | x + 1 \right |}\right ) + \frac {169}{4} \, \log \left ({\left | x - 7 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 + 6*x - 1/4*log(abs(x + 1)) + 169/4*log(abs(x - 7))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 22, normalized size = 0.76 \[ \frac {x^{2}}{2}+6 x -\frac {\ln \left (x +1\right )}{4}+\frac {169 \ln \left (x -7\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2+6*x-1/4*ln(x+1)+169/4*ln(x-7)

________________________________________________________________________________________

maxima [A]  time = 1.08, size = 21, normalized size = 0.72 \[ \frac {1}{2} \, x^{2} + 6 \, x - \frac {1}{4} \, \log \left (x + 1\right ) + \frac {169}{4} \, \log \left (x - 7\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2 + 6*x - 1/4*log(x + 1) + 169/4*log(x - 7)

________________________________________________________________________________________

mupad [B]  time = 2.21, size = 21, normalized size = 0.72 \[ 6\,x-\frac {\ln \left (x+1\right )}{4}+\frac {169\,\ln \left (x-7\right )}{4}+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

6*x - log(x + 1)/4 + (169*log(x - 7))/4 + x^2/2

________________________________________________________________________________________

sympy [A]  time = 0.11, size = 22, normalized size = 0.76 \[ \frac {x^{2}}{2} + 6 x + \frac {169 \log {\left (x - 7 \right )}}{4} - \frac {\log {\left (x + 1 \right )}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**3-x+2)/(x**2-6*x-7),x)

[Out]

x**2/2 + 6*x + 169*log(x - 7)/4 - log(x + 1)/4

________________________________________________________________________________________