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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0161322, antiderivative size = 29, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {1657, 632, 31} \[ \frac{x^2}{2}+6 x+\frac{85}{2} \log (7-x)+\frac{1}{2} \log (x+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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{-3+x^3}{-7-6 x+x^2} \, dx &=\int \left (6+x+\frac{39+43 x}{-7-6 x+x^2}\right ) \, dx\\ &=6 x+\frac{x^2}{2}+\int \frac{39+43 x}{-7-6 x+x^2} \, dx\\ &=6 x+\frac{x^2}{2}+\frac{1}{2} \int \frac{1}{1+x} \, dx+\frac{85}{2} \int \frac{1}{-7+x} \, dx\\ &=6 x+\frac{x^2}{2}+\frac{85}{2} \log (7-x)+\frac{1}{2} \log (1+x)\\ \end{align*}

Mathematica [A]  time = 0.0050677, size = 29, normalized size = 1. \[ \frac{x^2}{2}+6 x+\frac{85}{2} \log (7-x)+\frac{1}{2} \log (x+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.43253, size = 68, normalized size = 2.34 \begin{align*} \frac{1}{2} \, x^{2} + 6 \, x + \frac{1}{2} \, \log \left (x + 1\right ) + \frac{85}{2} \, \log \left (x - 7\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.10221, size = 31, normalized size = 1.07 \begin{align*} \frac{1}{2} \, x^{2} + 6 \, x + \frac{1}{2} \, \log \left ({\left | x + 1 \right |}\right ) + \frac{85}{2} \, \log \left ({\left | x - 7 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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