\(\int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} (4+4 x-x^2)}{4 x} \, dx\) [5828]

   Optimal result
   Rubi [B] (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 = 46, antiderivative size = 21 \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=\left (6+e^{1-\frac {1}{x}-\frac {x}{4}}-2 x\right ) x \]

[Out]

(exp(1-1/4*x-1/x)-2*x+6)*x

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(63\) vs. \(2(21)=42\).

Time = 0.06 (sec) , antiderivative size = 63, normalized size of antiderivative = 3.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {12, 14, 2326} \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=\frac {e^{-\frac {(2-x)^2}{4 x}} \left (4-x^2\right )}{\left (\frac {(2-x)^2}{x^2}+\frac {2 (2-x)}{x}\right ) x}-\frac {1}{2} (3-2 x)^2 \]

[In]

Int[(24*x - 16*x^2 + E^((-4 + 4*x - x^2)/(4*x))*(4 + 4*x - x^2))/(4*x),x]

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2326

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, x]))}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

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

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00 \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=\left (6+e^{1-\frac {1}{x}-\frac {x}{4}}-2 x\right ) x \]

[In]

Integrate[(24*x - 16*x^2 + E^((-4 + 4*x - x^2)/(4*x))*(4 + 4*x - x^2))/(4*x),x]

[Out]

(6 + E^(1 - x^(-1) - x/4) - 2*x)*x

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.10

method result size
risch \(x \,{\mathrm e}^{-\frac {\left (-2+x \right )^{2}}{4 x}}+6 x -2 x^{2}\) \(23\)
parallelrisch \(-2 x^{2}+{\mathrm e}^{-\frac {x^{2}-4 x +4}{4 x}} x +6 x\) \(26\)
norman \(x \,{\mathrm e}^{\frac {-x^{2}+4 x -4}{4 x}}+6 x -2 x^{2}\) \(28\)
parts \(x \,{\mathrm e}^{\frac {-x^{2}+4 x -4}{4 x}}+6 x -2 x^{2}\) \(28\)

[In]

int(1/4*((-x^2+4*x+4)*exp(1/4*(-x^2+4*x-4)/x)-16*x^2+24*x)/x,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.19 \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=-2 \, x^{2} + x e^{\left (-\frac {x^{2} - 4 \, x + 4}{4 \, x}\right )} + 6 \, x \]

[In]

integrate(1/4*((-x^2+4*x+4)*exp(1/4*(-x^2+4*x-4)/x)-16*x^2+24*x)/x,x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.95 \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=- 2 x^{2} + x e^{\frac {- \frac {x^{2}}{4} + x - 1}{x}} + 6 x \]

[In]

integrate(1/4*((-x**2+4*x+4)*exp(1/4*(-x**2+4*x-4)/x)-16*x**2+24*x)/x,x)

[Out]

-2*x**2 + x*exp((-x**2/4 + x - 1)/x) + 6*x

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.05 \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=-2 \, x^{2} + x e^{\left (-\frac {1}{4} \, x - \frac {1}{x} + 1\right )} + 6 \, x \]

[In]

integrate(1/4*((-x^2+4*x+4)*exp(1/4*(-x^2+4*x-4)/x)-16*x^2+24*x)/x,x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.19 \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=-2 \, x^{2} + x e^{\left (-\frac {x^{2} - 4 \, x + 4}{4 \, x}\right )} + 6 \, x \]

[In]

integrate(1/4*((-x^2+4*x+4)*exp(1/4*(-x^2+4*x-4)/x)-16*x^2+24*x)/x,x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 12.22 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86 \[ \int \frac {24 x-16 x^2+e^{\frac {-4+4 x-x^2}{4 x}} \left (4+4 x-x^2\right )}{4 x} \, dx=x\,\left ({\mathrm {e}}^{1-\frac {1}{x}-\frac {x}{4}}-2\,x+6\right ) \]

[In]

int((6*x + (exp(-(x^2/4 - x + 1)/x)*(4*x - x^2 + 4))/4 - 4*x^2)/x,x)

[Out]

x*(exp(1 - 1/x - x/4) - 2*x + 6)