\(\int \frac {e^{x^2} (-4+2 x-e^x \log (3)+(-e^5+x) \log (3)) (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+(-1+2 e^5 x-2 x^2) \log (3))}{4-2 x+e^x \log (3)+(e^5-x) \log (3)} \, dx\) [1469]

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

Optimal result

Integrand size = 88, antiderivative size = 26 \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=e^{x^2} \left (-4+2 x+\left (-e^5-e^x+x\right ) \log (3)\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 1.20 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.46, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.023, Rules used = {6820, 2326} \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=\frac {e^{x^2} \left (x^2 (4+\log (9))-x \left (e^x \log (9)+8+e^5 \log (9)\right )\right )}{2 x} \]

[In]

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

[Out]

(E^x^2*(x^2*(4 + Log[9]) - x*(8 + E^5*Log[9] + E^x*Log[9])))/(2*x)

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]

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 e^{x^2} \left (2 \left (1+\frac {\log (3)}{2}\right )-e^x \log (3)+x^2 (4+\log (9))-x \left (8+e^5 \log (9)+e^x \log (9)\right )\right ) \, dx \\ & = \frac {e^{x^2} \left (x^2 (4+\log (9))-x \left (8+e^5 \log (9)+e^x \log (9)\right )\right )}{2 x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.19 \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=\frac {1}{2} e^{x^2} \left (-8-e^5 \log (9)-e^x \log (9)+x (4+\log (9))\right ) \]

[In]

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

[Out]

(E^x^2*(-8 - E^5*Log[9] - E^x*Log[9] + x*(4 + Log[9])))/2

Maple [A] (verified)

Time = 0.53 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00

method result size
risch \(\left (-\ln \left (3\right ) {\mathrm e}^{x}+\left (-{\mathrm e}^{5}+x \right ) \ln \left (3\right )+2 x -4\right ) {\mathrm e}^{x^{2}}\) \(26\)
norman \({\mathrm e}^{\ln \left (-\ln \left (3\right ) {\mathrm e}^{x}+\left (-{\mathrm e}^{5}+x \right ) \ln \left (3\right )+2 x -4\right )+x^{2}}\) \(27\)
parallelrisch \({\mathrm e}^{\ln \left (-\ln \left (3\right ) {\mathrm e}^{x}+\left (-{\mathrm e}^{5}+x \right ) \ln \left (3\right )+2 x -4\right )+x^{2}}\) \(27\)

[In]

int(((1+2*x)*ln(3)*exp(x)+(2*x*exp(5)-2*x^2-1)*ln(3)-4*x^2+8*x-2)*exp(ln(-ln(3)*exp(x)+(-exp(5)+x)*ln(3)+2*x-4
)+x^2)/(ln(3)*exp(x)+(exp(5)-x)*ln(3)+4-2*x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00 \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=e^{\left (x^{2} + \log \left ({\left (x - e^{5}\right )} \log \left (3\right ) - e^{x} \log \left (3\right ) + 2 \, x - 4\right )\right )} \]

[In]

integrate(((1+2*x)*log(3)*exp(x)+(2*x*exp(5)-2*x^2-1)*log(3)-4*x^2+8*x-2)*exp(log(-log(3)*exp(x)+(-exp(5)+x)*l
og(3)+2*x-4)+x^2)/(log(3)*exp(x)+(exp(5)-x)*log(3)+4-2*x),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.04 \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=\left (x \log {\left (3 \right )} + 2 x - e^{x} \log {\left (3 \right )} - e^{5} \log {\left (3 \right )} - 4\right ) e^{x^{2}} \]

[In]

integrate(((1+2*x)*ln(3)*exp(x)+(2*x*exp(5)-2*x**2-1)*ln(3)-4*x**2+8*x-2)*exp(ln(-ln(3)*exp(x)+(-exp(5)+x)*ln(
3)+2*x-4)+x**2)/(ln(3)*exp(x)+(exp(5)-x)*ln(3)+4-2*x),x)

[Out]

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

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.22 (sec) , antiderivative size = 126, normalized size of antiderivative = 4.85 \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=\frac {1}{2} i \, \sqrt {\pi } \operatorname {erf}\left (i \, x + \frac {1}{2} i\right ) e^{\left (-\frac {1}{4}\right )} \log \left (3\right ) + \frac {1}{2} \, {\left (\frac {\sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} - 2 \, e^{\left (\frac {1}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} e^{\left (-\frac {1}{4}\right )} \log \left (3\right ) - \frac {1}{2} i \, \sqrt {\pi } \operatorname {erf}\left (i \, x\right ) \log \left (3\right ) + 2 \, x e^{\left (x^{2}\right )} + \frac {1}{2} \, {\left (2 \, x e^{\left (x^{2}\right )} + i \, \sqrt {\pi } \operatorname {erf}\left (i \, x\right )\right )} \log \left (3\right ) - e^{\left (x^{2} + 5\right )} \log \left (3\right ) - 4 \, e^{\left (x^{2}\right )} \]

[In]

integrate(((1+2*x)*log(3)*exp(x)+(2*x*exp(5)-2*x^2-1)*log(3)-4*x^2+8*x-2)*exp(log(-log(3)*exp(x)+(-exp(5)+x)*l
og(3)+2*x-4)+x^2)/(log(3)*exp(x)+(exp(5)-x)*log(3)+4-2*x),x, algorithm="maxima")

[Out]

1/2*I*sqrt(pi)*erf(I*x + 1/2*I)*e^(-1/4)*log(3) + 1/2*(sqrt(pi)*(2*x + 1)*(erf(1/2*sqrt(-(2*x + 1)^2)) - 1)/sq
rt(-(2*x + 1)^2) - 2*e^(1/4*(2*x + 1)^2))*e^(-1/4)*log(3) - 1/2*I*sqrt(pi)*erf(I*x)*log(3) + 2*x*e^(x^2) + 1/2
*(2*x*e^(x^2) + I*sqrt(pi)*erf(I*x))*log(3) - e^(x^2 + 5)*log(3) - 4*e^(x^2)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.62 \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=x e^{\left (x^{2}\right )} \log \left (3\right ) + 2 \, x e^{\left (x^{2}\right )} - e^{\left (x^{2} + x\right )} \log \left (3\right ) - e^{\left (x^{2} + 5\right )} \log \left (3\right ) - 4 \, e^{\left (x^{2}\right )} \]

[In]

integrate(((1+2*x)*log(3)*exp(x)+(2*x*exp(5)-2*x^2-1)*log(3)-4*x^2+8*x-2)*exp(log(-log(3)*exp(x)+(-exp(5)+x)*l
og(3)+2*x-4)+x^2)/(log(3)*exp(x)+(exp(5)-x)*log(3)+4-2*x),x, algorithm="giac")

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {e^{x^2} \left (-4+2 x-e^x \log (3)+\left (-e^5+x\right ) \log (3)\right ) \left (-2+8 x-4 x^2+e^x (1+2 x) \log (3)+\left (-1+2 e^5 x-2 x^2\right ) \log (3)\right )}{4-2 x+e^x \log (3)+\left (e^5-x\right ) \log (3)} \, dx=\int \frac {{\mathrm {e}}^{\ln \left (2\,x+\ln \left (3\right )\,\left (x-{\mathrm {e}}^5\right )-{\mathrm {e}}^x\,\ln \left (3\right )-4\right )+x^2}\,\left (\ln \left (3\right )\,\left (2\,x^2-2\,{\mathrm {e}}^5\,x+1\right )-8\,x+4\,x^2-{\mathrm {e}}^x\,\ln \left (3\right )\,\left (2\,x+1\right )+2\right )}{2\,x+\ln \left (3\right )\,\left (x-{\mathrm {e}}^5\right )-{\mathrm {e}}^x\,\ln \left (3\right )-4} \,d x \]

[In]

int((exp(log(2*x + log(3)*(x - exp(5)) - exp(x)*log(3) - 4) + x^2)*(log(3)*(2*x^2 - 2*x*exp(5) + 1) - 8*x + 4*
x^2 - exp(x)*log(3)*(2*x + 1) + 2))/(2*x + log(3)*(x - exp(5)) - exp(x)*log(3) - 4),x)

[Out]

int((exp(log(2*x + log(3)*(x - exp(5)) - exp(x)*log(3) - 4) + x^2)*(log(3)*(2*x^2 - 2*x*exp(5) + 1) - 8*x + 4*
x^2 - exp(x)*log(3)*(2*x + 1) + 2))/(2*x + log(3)*(x - exp(5)) - exp(x)*log(3) - 4), x)