3.108 \(\int \frac {3 x+x^3}{-3-2 x+x^2} \, dx\)

Optimal. Leaf size=23 \[ \frac {x^2}{2}+2 x+9 \log (3-x)+\log (x+1) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {1593, 1628, 632, 31} \[ \frac {x^2}{2}+2 x+9 \log (3-x)+\log (x+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*x + x^2/2 + 9*Log[3 - x] + Log[1 + x]

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 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 1628

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegra
nd[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

\begin {align*} \int \frac {3 x+x^3}{-3-2 x+x^2} \, dx &=\int \frac {x \left (3+x^2\right )}{-3-2 x+x^2} \, dx\\ &=\int \left (2+x+\frac {2 (3+5 x)}{-3-2 x+x^2}\right ) \, dx\\ &=2 x+\frac {x^2}{2}+2 \int \frac {3+5 x}{-3-2 x+x^2} \, dx\\ &=2 x+\frac {x^2}{2}+9 \int \frac {1}{-3+x} \, dx+\int \frac {1}{1+x} \, dx\\ &=2 x+\frac {x^2}{2}+9 \log (3-x)+\log (1+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 23, normalized size = 1.00 \[ \frac {x^2}{2}+2 x+9 \log (3-x)+\log (x+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*x + x^2/2 + 9*Log[3 - x] + Log[1 + x]

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 19, normalized size = 0.83 \[ \frac {1}{2} \, x^{2} + 2 \, x + \log \left (x + 1\right ) + 9 \, \log \left (x - 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.01, size = 21, normalized size = 0.91 \[ \frac {1}{2} \, x^{2} + 2 \, x + \log \left ({\left | x + 1 \right |}\right ) + 9 \, \log \left ({\left | x - 3 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 20, normalized size = 0.87 \[ \frac {x^{2}}{2}+2 x +9 \ln \left (x -3\right )+\ln \left (x +1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.48, size = 19, normalized size = 0.83 \[ \frac {1}{2} \, x^{2} + 2 \, x + \log \left (x + 1\right ) + 9 \, \log \left (x - 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 19, normalized size = 0.83 \[ 2\,x+\ln \left (x+1\right )+9\,\ln \left (x-3\right )+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.11, size = 19, normalized size = 0.83 \[ \frac {x^{2}}{2} + 2 x + 9 \log {\left (x - 3 \right )} + \log {\left (x + 1 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**2/2 + 2*x + 9*log(x - 3) + log(x + 1)

________________________________________________________________________________________