\(\int \frac {-4 x+28 x^2+16 x^3+e^x (-2 x-x^2)+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx\) [7630]

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

Optimal result

Integrand size = 47, antiderivative size = 29 \[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=-x+2 x^2+\frac {1}{4} \left (-e^x-3 \log ^2(x)\right )+\log (2+x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.97, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.106, Rules used = {1607, 6820, 2225, 712, 2338} \[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=2 x^2-x-\frac {e^x}{4}-\frac {3 \log ^2(x)}{4}+\log (x+2) \]

[In]

Int[(-4*x + 28*x^2 + 16*x^3 + E^x*(-2*x - x^2) + (-12 - 6*x)*Log[x])/(8*x + 4*x^2),x]

[Out]

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

Rule 712

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, 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] && IntegerQ[p] && (GtQ[p, 0] || (EqQ[a, 0] && IntegerQ[m]))

Rule 1607

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 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 6820

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

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.10 \[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=-\frac {e^x}{4}-9 (2+x)+2 (2+x)^2-\frac {3 \log ^2(x)}{4}+\log (2+x) \]

[In]

Integrate[(-4*x + 28*x^2 + 16*x^3 + E^x*(-2*x - x^2) + (-12 - 6*x)*Log[x])/(8*x + 4*x^2),x]

[Out]

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

Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.83

method result size
default \(\ln \left (2+x \right )-x -\frac {{\mathrm e}^{x}}{4}-\frac {3 \ln \left (x \right )^{2}}{4}+2 x^{2}\) \(24\)
norman \(\ln \left (2+x \right )-x -\frac {{\mathrm e}^{x}}{4}-\frac {3 \ln \left (x \right )^{2}}{4}+2 x^{2}\) \(24\)
risch \(\ln \left (2+x \right )-x -\frac {{\mathrm e}^{x}}{4}-\frac {3 \ln \left (x \right )^{2}}{4}+2 x^{2}\) \(24\)
parallelrisch \(\ln \left (2+x \right )-x -\frac {{\mathrm e}^{x}}{4}-\frac {3 \ln \left (x \right )^{2}}{4}+2 x^{2}\) \(24\)
parts \(\ln \left (2+x \right )-x -\frac {{\mathrm e}^{x}}{4}-\frac {3 \ln \left (x \right )^{2}}{4}+2 x^{2}\) \(24\)

[In]

int(((-6*x-12)*ln(x)+(-x^2-2*x)*exp(x)+16*x^3+28*x^2-4*x)/(4*x^2+8*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.79 \[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=2 \, x^{2} - \frac {3}{4} \, \log \left (x\right )^{2} - x - \frac {1}{4} \, e^{x} + \log \left (x + 2\right ) \]

[In]

integrate(((-6*x-12)*log(x)+(-x^2-2*x)*exp(x)+16*x^3+28*x^2-4*x)/(4*x^2+8*x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.83 \[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=2 x^{2} - x - \frac {e^{x}}{4} - \frac {3 \log {\left (x \right )}^{2}}{4} + \log {\left (x + 2 \right )} \]

[In]

integrate(((-6*x-12)*ln(x)+(-x**2-2*x)*exp(x)+16*x**3+28*x**2-4*x)/(4*x**2+8*x),x)

[Out]

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

Maxima [F]

\[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=\int { \frac {16 \, x^{3} + 28 \, x^{2} - {\left (x^{2} + 2 \, x\right )} e^{x} - 6 \, {\left (x + 2\right )} \log \left (x\right ) - 4 \, x}{4 \, {\left (x^{2} + 2 \, x\right )}} \,d x } \]

[In]

integrate(((-6*x-12)*log(x)+(-x^2-2*x)*exp(x)+16*x^3+28*x^2-4*x)/(4*x^2+8*x),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.79 \[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=2 \, x^{2} - \frac {3}{4} \, \log \left (x\right )^{2} - x - \frac {1}{4} \, e^{x} + \log \left (x + 2\right ) \]

[In]

integrate(((-6*x-12)*log(x)+(-x^2-2*x)*exp(x)+16*x^3+28*x^2-4*x)/(4*x^2+8*x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 13.75 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.79 \[ \int \frac {-4 x+28 x^2+16 x^3+e^x \left (-2 x-x^2\right )+(-12-6 x) \log (x)}{8 x+4 x^2} \, dx=\ln \left (x+2\right )-x-\frac {{\mathrm {e}}^x}{4}-\frac {3\,{\ln \left (x\right )}^2}{4}+2\,x^2 \]

[In]

int(-(4*x + exp(x)*(2*x + x^2) + log(x)*(6*x + 12) - 28*x^2 - 16*x^3)/(8*x + 4*x^2),x)

[Out]

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