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

________________________________________________________________________________________

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

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 31

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

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.0058195, size = 29, normalized size = 1. \[ \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

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 22, normalized size = 0.8 \begin{align*}{\frac{{x}^{2}}{2}}+6\,x+{\frac{169\,\ln \left ( x-7 \right ) }{4}}-{\frac{\ln \left ( 1+x \right ) }{4}} \end{align*}

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+169/4*ln(x-7)-1/4*ln(1+x)

________________________________________________________________________________________

Maxima [A]  time = 1.07431, size = 28, normalized size = 0.97 \begin{align*} \frac{1}{2} \, x^{2} + 6 \, x - \frac{1}{4} \, \log \left (x + 1\right ) + \frac{169}{4} \, \log \left (x - 7\right ) \end{align*}

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)

________________________________________________________________________________________

Fricas [A]  time = 1.49636, size = 69, normalized size = 2.38 \begin{align*} \frac{1}{2} \, x^{2} + 6 \, x - \frac{1}{4} \, \log \left (x + 1\right ) + \frac{169}{4} \, \log \left (x - 7\right ) \end{align*}

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)

________________________________________________________________________________________

Sympy [A]  time = 0.101816, size = 22, normalized size = 0.76 \begin{align*} \frac{x^{2}}{2} + 6 x + \frac{169 \log{\left (x - 7 \right )}}{4} - \frac{\log{\left (x + 1 \right )}}{4} \end{align*}

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

________________________________________________________________________________________

Giac [A]  time = 1.13385, size = 31, normalized size = 1.07 \begin{align*} \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 ) \end{align*}

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))