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

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

Optimal result

Integrand size = 64, antiderivative size = 28 \[ \int \frac {e^{\frac {9-24 x+16 x^2}{4 e x^2}} (3-4 x)+e^{\frac {9-24 x+16 x^2}{2 e x^2}} (-3+4 x)}{e x^3} \, dx=\frac {1}{3} \left (-1+e^{\frac {\left (3+\frac {-3+x}{x}\right )^2}{4 e}}\right )^2 \]

[Out]

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

Rubi [A] (verified)

Time = 0.22 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.68, number of steps used = 5, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.047, Rules used = {12, 14, 6838} \[ \int \frac {e^{\frac {9-24 x+16 x^2}{4 e x^2}} (3-4 x)+e^{\frac {9-24 x+16 x^2}{2 e x^2}} (-3+4 x)}{e x^3} \, dx=\frac {1}{3} e^{\frac {(3-4 x)^2}{2 e x^2}}-\frac {2}{3} e^{\frac {(3-4 x)^2}{4 e x^2}} \]

[In]

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

[Out]

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

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 6838

Int[(F_)^(v_)*(u_), x_Symbol] :> With[{q = DerivativeDivides[v, u, x]}, Simp[q*(F^v/Log[F]), x] /;  !FalseQ[q]
] /; FreeQ[F, x]

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

Mathematica [A] (verified)

Time = 0.84 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.57 \[ \int \frac {e^{\frac {9-24 x+16 x^2}{4 e x^2}} (3-4 x)+e^{\frac {9-24 x+16 x^2}{2 e x^2}} (-3+4 x)}{e x^3} \, dx=\frac {1}{3} e^{\frac {(3-4 x)^2}{4 e x^2}} \left (-2+e^{\frac {(3-4 x)^2}{4 e x^2}}\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.40 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.29

method result size
risch \(\frac {{\mathrm e}^{\frac {\left (-3+4 x \right )^{2} {\mathrm e}^{-1}}{2 x^{2}}}}{3}-\frac {2 \,{\mathrm e}^{\frac {\left (-3+4 x \right )^{2} {\mathrm e}^{-1}}{4 x^{2}}}}{3}\) \(36\)
parts \(\frac {{\mathrm e}^{\frac {\left (16 x^{2}-24 x +9\right ) {\mathrm e}^{-1}}{2 x^{2}}}}{3}-\frac {2 \,{\mathrm e}^{\frac {\left (16 x^{2}-24 x +9\right ) {\mathrm e}^{-1}}{4 x^{2}}}}{3}\) \(48\)
norman \(\frac {\frac {x^{2} {\mathrm e}^{\frac {\left (16 x^{2}-24 x +9\right ) {\mathrm e}^{-1}}{2 x^{2}}}}{3}-\frac {2 \,{\mathrm e}^{\frac {\left (16 x^{2}-24 x +9\right ) {\mathrm e}^{-1}}{4 x^{2}}} x^{2}}{3}}{x^{2}}\) \(58\)
default \({\mathrm e}^{-1} \left (-\frac {4 i {\mathrm e}^{4 \,{\mathrm e}^{-1}} \sqrt {\pi }\, {\mathrm e}^{-4 \,{\mathrm e}^{-1}} {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} {\mathrm e}^{\frac {1}{2}}\right )}{3}+\frac {2 i {\mathrm e}^{8 \,{\mathrm e}^{-1}} \sqrt {\pi }\, {\mathrm e}^{-8 \,{\mathrm e}^{-1}} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i \sqrt {2}\, {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}}\right )}{3}-3 \,{\mathrm e}^{4 \,{\mathrm e}^{-1}} \left (\frac {2 \,{\mathrm e} \,{\mathrm e}^{\frac {9 \,{\mathrm e}^{-1}}{4 x^{2}}-\frac {6 \,{\mathrm e}^{-1}}{x}}}{9}-\frac {4 i \sqrt {\pi }\, {\mathrm e}^{-4 \,{\mathrm e}^{-1}} {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} {\mathrm e}^{\frac {1}{2}}\right )}{9}\right )+3 \,{\mathrm e}^{8 \,{\mathrm e}^{-1}} \left (\frac {{\mathrm e} \,{\mathrm e}^{\frac {9 \,{\mathrm e}^{-1}}{2 x^{2}}-\frac {12 \,{\mathrm e}^{-1}}{x}}}{9}-\frac {2 i \sqrt {\pi }\, {\mathrm e}^{-8 \,{\mathrm e}^{-1}} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i \sqrt {2}\, {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}}\right )}{9}\right )\right )\) \(239\)
derivativedivides \(-{\mathrm e}^{-1} \left (\frac {4 i {\mathrm e}^{4 \,{\mathrm e}^{-1}} \sqrt {\pi }\, {\mathrm e}^{-4 \,{\mathrm e}^{-1}} {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} {\mathrm e}^{\frac {1}{2}}\right )}{3}-\frac {2 i {\mathrm e}^{8 \,{\mathrm e}^{-1}} \sqrt {\pi }\, {\mathrm e}^{-8 \,{\mathrm e}^{-1}} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i \sqrt {2}\, {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}}\right )}{3}+3 \,{\mathrm e}^{4 \,{\mathrm e}^{-1}} \left (\frac {2 \,{\mathrm e} \,{\mathrm e}^{\frac {9 \,{\mathrm e}^{-1}}{4 x^{2}}-\frac {6 \,{\mathrm e}^{-1}}{x}}}{9}-\frac {4 i \sqrt {\pi }\, {\mathrm e}^{-4 \,{\mathrm e}^{-1}} {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} {\mathrm e}^{\frac {1}{2}}\right )}{9}\right )-3 \,{\mathrm e}^{8 \,{\mathrm e}^{-1}} \left (\frac {{\mathrm e} \,{\mathrm e}^{\frac {9 \,{\mathrm e}^{-1}}{2 x^{2}}-\frac {12 \,{\mathrm e}^{-1}}{x}}}{9}-\frac {2 i \sqrt {\pi }\, {\mathrm e}^{-8 \,{\mathrm e}^{-1}} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}} \operatorname {erf}\left (\frac {3 i \sqrt {2}\, {\mathrm e}^{-\frac {1}{2}}}{2 x}-2 i {\mathrm e}^{-1} \sqrt {2}\, {\mathrm e}^{\frac {1}{2}}\right )}{9}\right )\right )\) \(240\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.46 \[ \int \frac {e^{\frac {9-24 x+16 x^2}{4 e x^2}} (3-4 x)+e^{\frac {9-24 x+16 x^2}{2 e x^2}} (-3+4 x)}{e x^3} \, dx=\frac {1}{3} \, e^{\left (\frac {{\left (16 \, x^{2} - 24 \, x + 9\right )} e^{\left (-1\right )}}{2 \, x^{2}}\right )} - \frac {2}{3} \, e^{\left (\frac {{\left (16 \, x^{2} - 24 \, x + 9\right )} e^{\left (-1\right )}}{4 \, x^{2}}\right )} \]

[In]

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

[Out]

1/3*e^(1/2*(16*x^2 - 24*x + 9)*e^(-1)/x^2) - 2/3*e^(1/4*(16*x^2 - 24*x + 9)*e^(-1)/x^2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 44 vs. \(2 (19) = 38\).

Time = 0.11 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.57 \[ \int \frac {e^{\frac {9-24 x+16 x^2}{4 e x^2}} (3-4 x)+e^{\frac {9-24 x+16 x^2}{2 e x^2}} (-3+4 x)}{e x^3} \, dx=\frac {e^{\frac {2 \cdot \left (4 x^{2} - 6 x + \frac {9}{4}\right )}{e x^{2}}}}{3} - \frac {2 e^{\frac {4 x^{2} - 6 x + \frac {9}{4}}{e x^{2}}}}{3} \]

[In]

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

[Out]

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 52 vs. \(2 (22) = 44\).

Time = 0.30 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.86 \[ \int \frac {e^{\frac {9-24 x+16 x^2}{4 e x^2}} (3-4 x)+e^{\frac {9-24 x+16 x^2}{2 e x^2}} (-3+4 x)}{e x^3} \, dx=-\frac {1}{3} \, {\left (2 \, e^{\left (\frac {6 \, e^{\left (-1\right )}}{x} + \frac {9 \, e^{\left (-1\right )}}{4 \, x^{2}} + 4 \, e^{\left (-1\right )} + 1\right )} - e^{\left (\frac {9 \, e^{\left (-1\right )}}{2 \, x^{2}} + 8 \, e^{\left (-1\right )} + 1\right )}\right )} e^{\left (-\frac {12 \, e^{\left (-1\right )}}{x} - 1\right )} \]

[In]

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

[Out]

-1/3*(2*e^(6*e^(-1)/x + 9/4*e^(-1)/x^2 + 4*e^(-1) + 1) - e^(9/2*e^(-1)/x^2 + 8*e^(-1) + 1))*e^(-12*e^(-1)/x -
1)

Giac [F]

\[ \int \frac {e^{\frac {9-24 x+16 x^2}{4 e x^2}} (3-4 x)+e^{\frac {9-24 x+16 x^2}{2 e x^2}} (-3+4 x)}{e x^3} \, dx=\int { \frac {{\left ({\left (4 \, x - 3\right )} e^{\left (\frac {{\left (16 \, x^{2} - 24 \, x + 9\right )} e^{\left (-1\right )}}{2 \, x^{2}}\right )} - {\left (4 \, x - 3\right )} e^{\left (\frac {{\left (16 \, x^{2} - 24 \, x + 9\right )} e^{\left (-1\right )}}{4 \, x^{2}}\right )}\right )} e^{\left (-1\right )}}{x^{3}} \,d x } \]

[In]

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

[Out]

integrate(((4*x - 3)*e^(1/2*(16*x^2 - 24*x + 9)*e^(-1)/x^2) - (4*x - 3)*e^(1/4*(16*x^2 - 24*x + 9)*e^(-1)/x^2)
)*e^(-1)/x^3, x)

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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