3.127 \(\int \frac{x^2}{-6+x+x^2} \, dx\)

Optimal. Leaf size=20 \[ x+\frac{4}{5} \log (2-x)-\frac{9}{5} \log (x+3) \]

[Out]

x + (4*Log[2 - x])/5 - (9*Log[3 + x])/5

________________________________________________________________________________________

Rubi [A]  time = 0.0075442, antiderivative size = 20, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {703, 632, 31} \[ x+\frac{4}{5} \log (2-x)-\frac{9}{5} \log (x+3) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + (4*Log[2 - x])/5 - (9*Log[3 + x])/5

Rule 703

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

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{x^2}{-6+x+x^2} \, dx &=x+\int \frac{6-x}{-6+x+x^2} \, dx\\ &=x+\frac{4}{5} \int \frac{1}{-2+x} \, dx-\frac{9}{5} \int \frac{1}{3+x} \, dx\\ &=x+\frac{4}{5} \log (2-x)-\frac{9}{5} \log (3+x)\\ \end{align*}

Mathematica [A]  time = 0.0027724, size = 20, normalized size = 1. \[ x+\frac{4}{5} \log (2-x)-\frac{9}{5} \log (x+3) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + (4*Log[2 - x])/5 - (9*Log[3 + x])/5

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 15, normalized size = 0.8 \begin{align*} x-{\frac{9\,\ln \left ( 3+x \right ) }{5}}+{\frac{4\,\ln \left ( -2+x \right ) }{5}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2/(x^2+x-6),x)

[Out]

x-9/5*ln(3+x)+4/5*ln(-2+x)

________________________________________________________________________________________

Maxima [A]  time = 0.933498, size = 19, normalized size = 0.95 \begin{align*} x - \frac{9}{5} \, \log \left (x + 3\right ) + \frac{4}{5} \, \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - 9/5*log(x + 3) + 4/5*log(x - 2)

________________________________________________________________________________________

Fricas [A]  time = 0.963386, size = 50, normalized size = 2.5 \begin{align*} x - \frac{9}{5} \, \log \left (x + 3\right ) + \frac{4}{5} \, \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - 9/5*log(x + 3) + 4/5*log(x - 2)

________________________________________________________________________________________

Sympy [A]  time = 0.096316, size = 17, normalized size = 0.85 \begin{align*} x + \frac{4 \log{\left (x - 2 \right )}}{5} - \frac{9 \log{\left (x + 3 \right )}}{5} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 4*log(x - 2)/5 - 9*log(x + 3)/5

________________________________________________________________________________________

Giac [A]  time = 1.11125, size = 22, normalized size = 1.1 \begin{align*} x - \frac{9}{5} \, \log \left ({\left | x + 3 \right |}\right ) + \frac{4}{5} \, \log \left ({\left | x - 2 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x - 9/5*log(abs(x + 3)) + 4/5*log(abs(x - 2))