\(\int \frac {(3+x)^3 (30-68 x+30 x^2-4 x^3)}{27-9 x-3 x^2+x^3} \, dx\) [5414]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 36, antiderivative size = 20 \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=\left (3-\frac {2}{3-x}-x\right ) (3+x)^3 \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.40, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {1600, 27, 1634} \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=-x^4-6 x^3+2 x^2+78 x-\frac {432}{3-x} \]

[In]

Int[((3 + x)^3*(30 - 68*x + 30*x^2 - 4*x^3))/(27 - 9*x - 3*x^2 + x^3),x]

[Out]

-432/(3 - x) + 78*x + 2*x^2 - 6*x^3 - x^4

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1634

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

Rubi steps \begin{align*} \text {integral}& = \int \frac {(3+x)^2 \left (30-68 x+30 x^2-4 x^3\right )}{9-6 x+x^2} \, dx \\ & = \int \frac {(3+x)^2 \left (30-68 x+30 x^2-4 x^3\right )}{(-3+x)^2} \, dx \\ & = \int \left (78-\frac {432}{(-3+x)^2}+4 x-18 x^2-4 x^3\right ) \, dx \\ & = -\frac {432}{3-x}+78 x+2 x^2-6 x^3-x^4 \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.50 \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=-\frac {-459+243 x-72 x^2-20 x^3+3 x^4+x^5}{-3+x} \]

[In]

Integrate[((3 + x)^3*(30 - 68*x + 30*x^2 - 4*x^3))/(27 - 9*x - 3*x^2 + x^3),x]

[Out]

-((-459 + 243*x - 72*x^2 - 20*x^3 + 3*x^4 + x^5)/(-3 + x))

Maple [A] (verified)

Time = 0.27 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.35

method result size
default \(-x^{4}-6 x^{3}+2 x^{2}+78 x +\frac {432}{-3+x}\) \(27\)
risch \(-x^{4}-6 x^{3}+2 x^{2}+78 x +\frac {432}{-3+x}\) \(27\)
gosper \(-\frac {x^{5}+3 x^{4}-20 x^{3}-72 x^{2}+270}{-3+x}\) \(28\)
parallelrisch \(-\frac {x^{5}+3 x^{4}-20 x^{3}-72 x^{2}+270}{-3+x}\) \(28\)
norman \(\frac {-x^{5}-3 x^{4}+20 x^{3}+72 x^{2}-270}{-3+x}\) \(29\)

[In]

int((-4*x^3+30*x^2-68*x+30)*(3+x)^3/(x^3-3*x^2-9*x+27),x,method=_RETURNVERBOSE)

[Out]

-x^4-6*x^3+2*x^2+78*x+432/(-3+x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.50 \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=-\frac {x^{5} + 3 \, x^{4} - 20 \, x^{3} - 72 \, x^{2} + 234 \, x - 432}{x - 3} \]

[In]

integrate((-4*x^3+30*x^2-68*x+30)*(3+x)^3/(x^3-3*x^2-9*x+27),x, algorithm="fricas")

[Out]

-(x^5 + 3*x^4 - 20*x^3 - 72*x^2 + 234*x - 432)/(x - 3)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=- x^{4} - 6 x^{3} + 2 x^{2} + 78 x + \frac {432}{x - 3} \]

[In]

integrate((-4*x**3+30*x**2-68*x+30)*(3+x)**3/(x**3-3*x**2-9*x+27),x)

[Out]

-x**4 - 6*x**3 + 2*x**2 + 78*x + 432/(x - 3)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.30 \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=-x^{4} - 6 \, x^{3} + 2 \, x^{2} + 78 \, x + \frac {432}{x - 3} \]

[In]

integrate((-4*x^3+30*x^2-68*x+30)*(3+x)^3/(x^3-3*x^2-9*x+27),x, algorithm="maxima")

[Out]

-x^4 - 6*x^3 + 2*x^2 + 78*x + 432/(x - 3)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.30 \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=-x^{4} - 6 \, x^{3} + 2 \, x^{2} + 78 \, x + \frac {432}{x - 3} \]

[In]

integrate((-4*x^3+30*x^2-68*x+30)*(3+x)^3/(x^3-3*x^2-9*x+27),x, algorithm="giac")

[Out]

-x^4 - 6*x^3 + 2*x^2 + 78*x + 432/(x - 3)

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.30 \[ \int \frac {(3+x)^3 \left (30-68 x+30 x^2-4 x^3\right )}{27-9 x-3 x^2+x^3} \, dx=78\,x+\frac {432}{x-3}+2\,x^2-6\,x^3-x^4 \]

[In]

int(((x + 3)^3*(68*x - 30*x^2 + 4*x^3 - 30))/(9*x + 3*x^2 - x^3 - 27),x)

[Out]

78*x + 432/(x - 3) + 2*x^2 - 6*x^3 - x^4