\(\int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e (9 x^2+4 x^3))+e^{2+x^2} (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e (8 x^3+4 x^4))}{e^2 (4 x^2+e^2 x^2+4 x^3+x^4+e (4 x^2+2 x^3))} \, dx\) [3201]

   Optimal result
   Rubi [B] (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 = 148, antiderivative size = 25 \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx=e^{x^2}+\frac {4}{e^2 x}+2 x+\frac {x}{2+e+x} \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(213\) vs. \(2(25)=50\).

Time = 0.66 (sec) , antiderivative size = 213, normalized size of antiderivative = 8.52, number of steps used = 15, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.061, Rules used = {6, 12, 6873, 27, 6874, 2240, 46, 78, 697} \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx=e^{x^2}+2 x+\frac {4 \left (4+e^2\right )}{e^2 (2+e)^2 (x+e+2)}-\frac {2+e}{x+e+2}-\frac {16}{e^2 (2+e) (x+e+2)}-\frac {8}{(2+e)^2 (x+e+2)}+\frac {4}{e^2 (x+e+2)}+\frac {4 \left (4+e^2\right )}{e^2 (2+e)^2 x}+\frac {16}{e (2+e)^2 x}+\frac {8 \left (4+e^2\right ) \log (x)}{e^2 (2+e)^3}-\frac {16 \log (x)}{e^2 (2+e)^2}+\frac {8 (2-e) \log (x)}{e (2+e)^3}-\frac {8 \left (4+e^2\right ) \log (x+e+2)}{e^2 (2+e)^3}+\frac {16 \log (x+e+2)}{e^2 (2+e)^2}-\frac {8 (2-e) \log (x+e+2)}{e (2+e)^3} \]

[In]

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

[Out]

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

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 12

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

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 697

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] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

Rule 2240

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[(e + f*x)^n*(
F^(a + b*(c + d*x)^n)/(b*f*n*(c + d*x)^n*Log[F])), x] /; FreeQ[{F, a, b, c, d, e, f, n}, x] && EqQ[m, n - 1] &
& EqQ[d*e - c*f, 0]

Rule 6873

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

Rule 6874

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

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

Mathematica [A] (verified)

Time = 2.51 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.48 \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx=\frac {e^{2+x^2}+\frac {4}{x}+2 e^2 x-\frac {e^2 (2+e)}{2+e+x}}{e^2} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 4.91 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.60

method result size
risch \(2 x +\frac {{\mathrm e}^{-2} \left (\left (-{\mathrm e}^{3}-2 \,{\mathrm e}^{2}+4\right ) x +4 \,{\mathrm e}+8\right )}{\left (2+x +{\mathrm e}\right ) x}+{\mathrm e}^{x^{2}}\) \(40\)
parts \(\frac {-\left (2 \left ({\mathrm e}^{2}\right )^{2}+9 \,{\mathrm e} \,{\mathrm e}^{2}+10 \,{\mathrm e}^{2}-4\right ) {\mathrm e}^{-2} x +2 x^{3}+4 \left ({\mathrm e}+2\right ) {\mathrm e}^{-2}}{x \left (2+x +{\mathrm e}\right )}+{\mathrm e}^{x^{2}}\) \(60\)
norman \(\frac {x^{2} {\mathrm e}^{x^{2}}-\left (2 \left ({\mathrm e}^{2}\right )^{2}+9 \,{\mathrm e} \,{\mathrm e}^{2}+10 \,{\mathrm e}^{2}-4\right ) {\mathrm e}^{-2} x +x \left ({\mathrm e}+2\right ) {\mathrm e}^{x^{2}}+2 x^{3}+4 \left ({\mathrm e}+2\right ) {\mathrm e}^{-2}}{x \left (2+x +{\mathrm e}\right )}\) \(73\)
parallelrisch \(-\frac {{\mathrm e}^{-2} \left (2 x \left ({\mathrm e}^{2}\right )^{2}-{\mathrm e}^{2} {\mathrm e} x \,{\mathrm e}^{x^{2}}-2 x^{3} {\mathrm e}^{2}-{\mathrm e}^{2} {\mathrm e}^{x^{2}} x^{2}+9 x \,{\mathrm e} \,{\mathrm e}^{2}-2 \,{\mathrm e}^{x^{2}} {\mathrm e}^{2} x -8+10 \,{\mathrm e}^{2} x -4 \,{\mathrm e}-4 x \right )}{x \left (2+x +{\mathrm e}\right )}\) \(85\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 73 vs. \(2 (24) = 48\).

Time = 0.26 (sec) , antiderivative size = 73, normalized size of antiderivative = 2.92 \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx=\frac {{\left (2 \, x^{2} - x\right )} e^{3} + 2 \, {\left (x^{3} + 2 \, x^{2} - x\right )} e^{2} + {\left (x^{2} + x e + 2 \, x\right )} e^{\left (x^{2} + 2\right )} + 4 \, x + 4 \, e + 8}{x e^{3} + {\left (x^{2} + 2 \, x\right )} e^{2}} \]

[In]

integrate(((2*x^3*exp(1)^2+(4*x^4+8*x^3)*exp(1)+2*x^5+8*x^4+8*x^3)*exp(2)*exp(x^2)+(2*x^2*exp(1)^2+(4*x^3+9*x^
2)*exp(1)+2*x^4+8*x^3+10*x^2)*exp(2)-4*exp(1)^2+(-8*x-16)*exp(1)-4*x^2-16*x-16)/(x^2*exp(1)^2+(2*x^3+4*x^2)*ex
p(1)+x^4+4*x^3+4*x^2)/exp(2),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.61 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.68 \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx=2 x + e^{x^{2}} + \frac {x \left (- e^{3} - 2 e^{2} + 4\right ) + 8 + 4 e}{x^{2} e^{2} + x \left (2 e^{2} + e^{3}\right )} \]

[In]

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

[Out]

2*x + exp(x**2) + (x*(-exp(3) - 2*exp(2) + 4) + 8 + 4*E)/(x**2*exp(2) + x*(2*exp(2) + exp(3)))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 480 vs. \(2 (24) = 48\).

Time = 0.24 (sec) , antiderivative size = 480, normalized size of antiderivative = 19.20 \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx={\left (4 \, {\left (\frac {e + 2}{x + e + 2} + \log \left (x + e + 2\right )\right )} e^{3} - 2 \, {\left (2 \, {\left (e + 2\right )} \log \left (x + e + 2\right ) - x + \frac {e^{2} + 4 \, e + 4}{x + e + 2}\right )} e^{2} + 4 \, {\left (\frac {2 \, x + e + 2}{x^{2} {\left (e^{2} + 4 \, e + 4\right )} + x {\left (e^{3} + 6 \, e^{2} + 12 \, e + 8\right )}} - \frac {2 \, \log \left (x + e + 2\right )}{e^{3} + 6 \, e^{2} + 12 \, e + 8} + \frac {2 \, \log \left (x\right )}{e^{3} + 6 \, e^{2} + 12 \, e + 8}\right )} e^{2} + 8 \, {\left (\frac {e + 2}{x + e + 2} + \log \left (x + e + 2\right )\right )} e^{2} + 16 \, {\left (\frac {2 \, x + e + 2}{x^{2} {\left (e^{2} + 4 \, e + 4\right )} + x {\left (e^{3} + 6 \, e^{2} + 12 \, e + 8\right )}} - \frac {2 \, \log \left (x + e + 2\right )}{e^{3} + 6 \, e^{2} + 12 \, e + 8} + \frac {2 \, \log \left (x\right )}{e^{3} + 6 \, e^{2} + 12 \, e + 8}\right )} e + 8 \, {\left (\frac {\log \left (x + e + 2\right )}{e^{2} + 4 \, e + 4} - \frac {\log \left (x\right )}{e^{2} + 4 \, e + 4} - \frac {1}{x {\left (e + 2\right )} + e^{2} + 4 \, e + 4}\right )} e + \frac {16 \, {\left (2 \, x + e + 2\right )}}{x^{2} {\left (e^{2} + 4 \, e + 4\right )} + x {\left (e^{3} + 6 \, e^{2} + 12 \, e + 8\right )}} - \frac {2 \, e^{4}}{x + e + 2} - \frac {9 \, e^{3}}{x + e + 2} - \frac {10 \, e^{2}}{x + e + 2} - \frac {32 \, \log \left (x + e + 2\right )}{e^{3} + 6 \, e^{2} + 12 \, e + 8} + \frac {16 \, \log \left (x + e + 2\right )}{e^{2} + 4 \, e + 4} + \frac {32 \, \log \left (x\right )}{e^{3} + 6 \, e^{2} + 12 \, e + 8} - \frac {16 \, \log \left (x\right )}{e^{2} + 4 \, e + 4} - \frac {16}{x {\left (e + 2\right )} + e^{2} + 4 \, e + 4} + \frac {4}{x + e + 2} + e^{\left (x^{2} + 2\right )}\right )} e^{\left (-2\right )} \]

[In]

integrate(((2*x^3*exp(1)^2+(4*x^4+8*x^3)*exp(1)+2*x^5+8*x^4+8*x^3)*exp(2)*exp(x^2)+(2*x^2*exp(1)^2+(4*x^3+9*x^
2)*exp(1)+2*x^4+8*x^3+10*x^2)*exp(2)-4*exp(1)^2+(-8*x-16)*exp(1)-4*x^2-16*x-16)/(x^2*exp(1)^2+(2*x^3+4*x^2)*ex
p(1)+x^4+4*x^3+4*x^2)/exp(2),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (24) = 48\).

Time = 0.27 (sec) , antiderivative size = 83, normalized size of antiderivative = 3.32 \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx=\frac {{\left (2 \, x^{3} e^{2} + 2 \, x^{2} e^{3} + 4 \, x^{2} e^{2} + x^{2} e^{\left (x^{2} + 2\right )} - x e^{3} - 2 \, x e^{2} + x e^{\left (x^{2} + 3\right )} + 2 \, x e^{\left (x^{2} + 2\right )} + 4 \, x + 4 \, e + 8\right )} e^{\left (-2\right )}}{x^{2} + x e + 2 \, x} \]

[In]

integrate(((2*x^3*exp(1)^2+(4*x^4+8*x^3)*exp(1)+2*x^5+8*x^4+8*x^3)*exp(2)*exp(x^2)+(2*x^2*exp(1)^2+(4*x^3+9*x^
2)*exp(1)+2*x^4+8*x^3+10*x^2)*exp(2)-4*exp(1)^2+(-8*x-16)*exp(1)-4*x^2-16*x-16)/(x^2*exp(1)^2+(2*x^3+4*x^2)*ex
p(1)+x^4+4*x^3+4*x^2)/exp(2),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.60 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.76 \[ \int \frac {-16-4 e^2+e (-16-8 x)-16 x-4 x^2+e^2 \left (10 x^2+2 e^2 x^2+8 x^3+2 x^4+e \left (9 x^2+4 x^3\right )\right )+e^{2+x^2} \left (8 x^3+2 e^2 x^3+8 x^4+2 x^5+e \left (8 x^3+4 x^4\right )\right )}{e^2 \left (4 x^2+e^2 x^2+4 x^3+x^4+e \left (4 x^2+2 x^3\right )\right )} \, dx=2\,x+{\mathrm {e}}^{x^2}+\frac {4\,\mathrm {e}-x\,\left (2\,{\mathrm {e}}^2+{\mathrm {e}}^3-4\right )+8}{{\mathrm {e}}^2\,x^2+\left (2\,{\mathrm {e}}^2+{\mathrm {e}}^3\right )\,x} \]

[In]

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

[Out]

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