\(\int \frac {3+2 x-36 x^3-12 x^4+e^4 (-1+12 x^3)+(-36 x^3+12 e^4 x^3-12 x^4) \log (3 x-e^4 x+x^2)+(-9 x^3+3 e^4 x^3-3 x^4) \log ^2(3 x-e^4 x+x^2)}{-12 x+4 e^4 x-4 x^2+(-12 x+4 e^4 x-4 x^2) \log (3 x-e^4 x+x^2)+(-3 x+e^4 x-x^2) \log ^2(3 x-e^4 x+x^2)} \, dx\) [8574]

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

Optimal result

Integrand size = 175, antiderivative size = 19 \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=x^3+\frac {1}{2+\log \left (x \left (3-e^4+x\right )\right )} \]

[Out]

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

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.023, Rules used = {6, 6820, 6874, 6818} \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=x^3+\frac {1}{\log \left (x \left (x-e^4+3\right )\right )+2} \]

[In]

Int[(3 + 2*x - 36*x^3 - 12*x^4 + E^4*(-1 + 12*x^3) + (-36*x^3 + 12*E^4*x^3 - 12*x^4)*Log[3*x - E^4*x + x^2] +
(-9*x^3 + 3*E^4*x^3 - 3*x^4)*Log[3*x - E^4*x + x^2]^2)/(-12*x + 4*E^4*x - 4*x^2 + (-12*x + 4*E^4*x - 4*x^2)*Lo
g[3*x - E^4*x + x^2] + (-3*x + E^4*x - x^2)*Log[3*x - E^4*x + x^2]^2),x]

[Out]

x^3 + (2 + Log[x*(3 - E^4 + x)])^(-1)

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, x]

Rule 6818

Int[(u_)*(y_)^(m_.), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*(y^(m + 1)/(m + 1)), x] /;  !F
alseQ[q]] /; FreeQ[m, x] && NeQ[m, -1]

Rule 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{\left (-12+4 e^4\right ) x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx \\ & = \int \frac {-3-2 x+36 x^3+12 x^4+e^4 \left (1-12 x^3\right )+12 x^3 \left (3-e^4+x\right ) \log \left (x \left (3-e^4+x\right )\right )+3 x^3 \left (3-e^4+x\right ) \log ^2\left (x \left (3-e^4+x\right )\right )}{x \left (3-e^4+x\right ) \left (2+\log \left (x \left (3-e^4+x\right )\right )\right )^2} \, dx \\ & = \int \left (3 x^2+\frac {3-e^4+2 x}{\left (-3+e^4-x\right ) x \left (2+\log \left (x \left (3-e^4+x\right )\right )\right )^2}\right ) \, dx \\ & = x^3+\int \frac {3-e^4+2 x}{\left (-3+e^4-x\right ) x \left (2+\log \left (x \left (3-e^4+x\right )\right )\right )^2} \, dx \\ & = x^3+\frac {1}{2+\log \left (x \left (3-e^4+x\right )\right )} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=x^3+\frac {1}{2+\log \left (x \left (3-e^4+x\right )\right )} \]

[In]

Integrate[(3 + 2*x - 36*x^3 - 12*x^4 + E^4*(-1 + 12*x^3) + (-36*x^3 + 12*E^4*x^3 - 12*x^4)*Log[3*x - E^4*x + x
^2] + (-9*x^3 + 3*E^4*x^3 - 3*x^4)*Log[3*x - E^4*x + x^2]^2)/(-12*x + 4*E^4*x - 4*x^2 + (-12*x + 4*E^4*x - 4*x
^2)*Log[3*x - E^4*x + x^2] + (-3*x + E^4*x - x^2)*Log[3*x - E^4*x + x^2]^2),x]

[Out]

x^3 + (2 + Log[x*(3 - E^4 + x)])^(-1)

Maple [A] (verified)

Time = 1.82 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.16

method result size
risch \(x^{3}+\frac {1}{\ln \left (-x \,{\mathrm e}^{4}+x^{2}+3 x \right )+2}\) \(22\)
parallelrisch \(\frac {\ln \left (-x \left ({\mathrm e}^{4}-x -3\right )\right ) x^{3}+1+2 x^{3}}{\ln \left (-x \left ({\mathrm e}^{4}-x -3\right )\right )+2}\) \(39\)
norman \(\frac {x^{3} \ln \left (-x \,{\mathrm e}^{4}+x^{2}+3 x \right )+2 x^{3}+1}{\ln \left (-x \,{\mathrm e}^{4}+x^{2}+3 x \right )+2}\) \(43\)

[In]

int(((3*x^3*exp(4)-3*x^4-9*x^3)*ln(-x*exp(4)+x^2+3*x)^2+(12*x^3*exp(4)-12*x^4-36*x^3)*ln(-x*exp(4)+x^2+3*x)+(1
2*x^3-1)*exp(4)-12*x^4-36*x^3+2*x+3)/((x*exp(4)-x^2-3*x)*ln(-x*exp(4)+x^2+3*x)^2+(4*x*exp(4)-4*x^2-12*x)*ln(-x
*exp(4)+x^2+3*x)+4*x*exp(4)-4*x^2-12*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 42 vs. \(2 (18) = 36\).

Time = 0.26 (sec) , antiderivative size = 42, normalized size of antiderivative = 2.21 \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=\frac {x^{3} \log \left (x^{2} - x e^{4} + 3 \, x\right ) + 2 \, x^{3} + 1}{\log \left (x^{2} - x e^{4} + 3 \, x\right ) + 2} \]

[In]

integrate(((3*x^3*exp(4)-3*x^4-9*x^3)*log(-x*exp(4)+x^2+3*x)^2+(12*x^3*exp(4)-12*x^4-36*x^3)*log(-x*exp(4)+x^2
+3*x)+(12*x^3-1)*exp(4)-12*x^4-36*x^3+2*x+3)/((x*exp(4)-x^2-3*x)*log(-x*exp(4)+x^2+3*x)^2+(4*x*exp(4)-4*x^2-12
*x)*log(-x*exp(4)+x^2+3*x)+4*x*exp(4)-4*x^2-12*x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=x^{3} + \frac {1}{\log {\left (x^{2} - x e^{4} + 3 x \right )} + 2} \]

[In]

integrate(((3*x**3*exp(4)-3*x**4-9*x**3)*ln(-x*exp(4)+x**2+3*x)**2+(12*x**3*exp(4)-12*x**4-36*x**3)*ln(-x*exp(
4)+x**2+3*x)+(12*x**3-1)*exp(4)-12*x**4-36*x**3+2*x+3)/((x*exp(4)-x**2-3*x)*ln(-x*exp(4)+x**2+3*x)**2+(4*x*exp
(4)-4*x**2-12*x)*ln(-x*exp(4)+x**2+3*x)+4*x*exp(4)-4*x**2-12*x),x)

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 40 vs. \(2 (18) = 36\).

Time = 0.27 (sec) , antiderivative size = 40, normalized size of antiderivative = 2.11 \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=\frac {x^{3} \log \left (x - e^{4} + 3\right ) + x^{3} \log \left (x\right ) + 2 \, x^{3} + 1}{\log \left (x - e^{4} + 3\right ) + \log \left (x\right ) + 2} \]

[In]

integrate(((3*x^3*exp(4)-3*x^4-9*x^3)*log(-x*exp(4)+x^2+3*x)^2+(12*x^3*exp(4)-12*x^4-36*x^3)*log(-x*exp(4)+x^2
+3*x)+(12*x^3-1)*exp(4)-12*x^4-36*x^3+2*x+3)/((x*exp(4)-x^2-3*x)*log(-x*exp(4)+x^2+3*x)^2+(4*x*exp(4)-4*x^2-12
*x)*log(-x*exp(4)+x^2+3*x)+4*x*exp(4)-4*x^2-12*x),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 42 vs. \(2 (18) = 36\).

Time = 0.37 (sec) , antiderivative size = 42, normalized size of antiderivative = 2.21 \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=\frac {x^{3} \log \left (x^{2} - x e^{4} + 3 \, x\right ) + 2 \, x^{3} + 1}{\log \left (x^{2} - x e^{4} + 3 \, x\right ) + 2} \]

[In]

integrate(((3*x^3*exp(4)-3*x^4-9*x^3)*log(-x*exp(4)+x^2+3*x)^2+(12*x^3*exp(4)-12*x^4-36*x^3)*log(-x*exp(4)+x^2
+3*x)+(12*x^3-1)*exp(4)-12*x^4-36*x^3+2*x+3)/((x*exp(4)-x^2-3*x)*log(-x*exp(4)+x^2+3*x)^2+(4*x*exp(4)-4*x^2-12
*x)*log(-x*exp(4)+x^2+3*x)+4*x*exp(4)-4*x^2-12*x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 15.63 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11 \[ \int \frac {3+2 x-36 x^3-12 x^4+e^4 \left (-1+12 x^3\right )+\left (-36 x^3+12 e^4 x^3-12 x^4\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-9 x^3+3 e^4 x^3-3 x^4\right ) \log ^2\left (3 x-e^4 x+x^2\right )}{-12 x+4 e^4 x-4 x^2+\left (-12 x+4 e^4 x-4 x^2\right ) \log \left (3 x-e^4 x+x^2\right )+\left (-3 x+e^4 x-x^2\right ) \log ^2\left (3 x-e^4 x+x^2\right )} \, dx=\frac {1}{\ln \left (3\,x-x\,{\mathrm {e}}^4+x^2\right )+2}+x^3 \]

[In]

int((log(3*x - x*exp(4) + x^2)*(36*x^3 - 12*x^3*exp(4) + 12*x^4) - exp(4)*(12*x^3 - 1) - 2*x + 36*x^3 + 12*x^4
 + log(3*x - x*exp(4) + x^2)^2*(9*x^3 - 3*x^3*exp(4) + 3*x^4) - 3)/(12*x - 4*x*exp(4) + log(3*x - x*exp(4) + x
^2)*(12*x - 4*x*exp(4) + 4*x^2) + log(3*x - x*exp(4) + x^2)^2*(3*x - x*exp(4) + x^2) + 4*x^2),x)

[Out]

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