3.315 \(\int \frac {1-12 x+x^2+x^3}{-12+x+x^2} \, dx\)

Optimal. Leaf size=22 \[ \frac {x^2}{2}-\frac {2}{7} \tanh ^{-1}\left (\frac {1}{7} (2 x+1)\right ) \]

[Out]

1/2*x^2-2/7*arctanh(1/7+2/7*x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 26, normalized size of antiderivative = 1.18, number of steps used = 5, number of rules used = 3, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {1657, 616, 31} \[ \frac {x^2}{2}+\frac {1}{7} \log (3-x)-\frac {1}{7} \log (x+4) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x^2/2 + Log[3 - x]/7 - Log[4 + x]/7

Rule 31

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

Rule 616

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[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 {1-12 x+x^2+x^3}{-12+x+x^2} \, dx &=\int \left (x+\frac {1}{-12+x+x^2}\right ) \, dx\\ &=\frac {x^2}{2}+\int \frac {1}{-12+x+x^2} \, dx\\ &=\frac {x^2}{2}+\frac {1}{7} \int \frac {1}{-3+x} \, dx-\frac {1}{7} \int \frac {1}{4+x} \, dx\\ &=\frac {x^2}{2}+\frac {1}{7} \log (3-x)-\frac {1}{7} \log (4+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 26, normalized size = 1.18 \[ \frac {x^2}{2}+\frac {1}{7} \log (3-x)-\frac {1}{7} \log (x+4) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x^2/2 + Log[3 - x]/7 - Log[4 + x]/7

________________________________________________________________________________________

fricas [A]  time = 0.85, size = 18, normalized size = 0.82 \[ \frac {1}{2} \, x^{2} - \frac {1}{7} \, \log \left (x + 4\right ) + \frac {1}{7} \, \log \left (x - 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.28, size = 20, normalized size = 0.91 \[ \frac {1}{2} \, x^{2} - \frac {1}{7} \, \log \left ({\left | x + 4 \right |}\right ) + \frac {1}{7} \, \log \left ({\left | x - 3 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.00, size = 19, normalized size = 0.86 \[ \frac {x^{2}}{2}+\frac {\ln \left (x -3\right )}{7}-\frac {\ln \left (x +4\right )}{7} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.97, size = 18, normalized size = 0.82 \[ \frac {1}{2} \, x^{2} - \frac {1}{7} \, \log \left (x + 4\right ) + \frac {1}{7} \, \log \left (x - 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 14, normalized size = 0.64 \[ \frac {x^2}{2}-\frac {2\,\mathrm {atanh}\left (\frac {2\,x}{7}+\frac {1}{7}\right )}{7} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x^2/2 - (2*atanh((2*x)/7 + 1/7))/7

________________________________________________________________________________________

sympy [A]  time = 0.10, size = 17, normalized size = 0.77 \[ \frac {x^{2}}{2} + \frac {\log {\left (x - 3 \right )}}{7} - \frac {\log {\left (x + 4 \right )}}{7} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**2/2 + log(x - 3)/7 - log(x + 4)/7

________________________________________________________________________________________