3.7.43 \(\int \frac {4+4 x^2+x^4+e^x (-4-4 x+2 x^2-2 x^3)+e^{e^x} (e^{2 x} (4 x+2 x^3)+e^x (4+4 x-2 x^2+2 x^3))}{4+4 x^2+x^4} \, dx\)

Optimal. Leaf size=30 \[ -e^4+x-\frac {2 e^x \left (1-e^{e^x}\right )}{\frac {2}{x}+x} \]

________________________________________________________________________________________

Rubi [F]  time = 1.80, antiderivative size = 0, normalized size of antiderivative = 0.00, number of steps used = 0, number of rules used = 0, integrand size = 0, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.000, Rules used = {} \begin {gather*} \int \frac {4+4 x^2+x^4+e^x \left (-4-4 x+2 x^2-2 x^3\right )+e^{e^x} \left (e^{2 x} \left (4 x+2 x^3\right )+e^x \left (4+4 x-2 x^2+2 x^3\right )\right )}{4+4 x^2+x^4} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

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

[Out]

x - (2*E^x*(2*x + x^3))/(2 + x^2)^2 - Defer[Int][E^(E^x + x)/(I*Sqrt[2] - x)^2, x] + (I*Defer[Int][E^(E^x + x)
/(I*Sqrt[2] - x), x])/Sqrt[2] - ((2 + I*Sqrt[2])*Defer[Int][E^(E^x + x)/(I*Sqrt[2] - x), x])/2 - Defer[Int][E^
(E^x + 2*x)/(I*Sqrt[2] - x), x] - Defer[Int][E^(E^x + x)/(I*Sqrt[2] + x)^2, x] + (I*Defer[Int][E^(E^x + x)/(I*
Sqrt[2] + x), x])/Sqrt[2] + ((2 - I*Sqrt[2])*Defer[Int][E^(E^x + x)/(I*Sqrt[2] + x), x])/2 + Defer[Int][E^(E^x
 + 2*x)/(I*Sqrt[2] + x), x]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {4+4 x^2+x^4+e^x \left (-4-4 x+2 x^2-2 x^3\right )+e^{e^x} \left (e^{2 x} \left (4 x+2 x^3\right )+e^x \left (4+4 x-2 x^2+2 x^3\right )\right )}{\left (2+x^2\right )^2} \, dx\\ &=\int \left (1+\frac {2 e^{e^x+2 x} x}{2+x^2}+\frac {2 e^x \left (-1+e^{e^x}\right ) \left (2+2 x-x^2+x^3\right )}{\left (2+x^2\right )^2}\right ) \, dx\\ &=x+2 \int \frac {e^{e^x+2 x} x}{2+x^2} \, dx+2 \int \frac {e^x \left (-1+e^{e^x}\right ) \left (2+2 x-x^2+x^3\right )}{\left (2+x^2\right )^2} \, dx\\ &=x+2 \int \left (-\frac {e^{e^x+2 x}}{2 \left (i \sqrt {2}-x\right )}+\frac {e^{e^x+2 x}}{2 \left (i \sqrt {2}+x\right )}\right ) \, dx+2 \int \left (\frac {e^x \left (-2-2 x+x^2-x^3\right )}{\left (2+x^2\right )^2}+\frac {e^{e^x+x} \left (2+2 x-x^2+x^3\right )}{\left (2+x^2\right )^2}\right ) \, dx\\ &=x+2 \int \frac {e^x \left (-2-2 x+x^2-x^3\right )}{\left (2+x^2\right )^2} \, dx+2 \int \frac {e^{e^x+x} \left (2+2 x-x^2+x^3\right )}{\left (2+x^2\right )^2} \, dx-\int \frac {e^{e^x+2 x}}{i \sqrt {2}-x} \, dx+\int \frac {e^{e^x+2 x}}{i \sqrt {2}+x} \, dx\\ &=x-\frac {2 e^x \left (2 x+x^3\right )}{\left (2+x^2\right )^2}+2 \int \left (\frac {4 e^{e^x+x}}{\left (2+x^2\right )^2}+\frac {e^{e^x+x} (-1+x)}{2+x^2}\right ) \, dx-\int \frac {e^{e^x+2 x}}{i \sqrt {2}-x} \, dx+\int \frac {e^{e^x+2 x}}{i \sqrt {2}+x} \, dx\\ &=x-\frac {2 e^x \left (2 x+x^3\right )}{\left (2+x^2\right )^2}+2 \int \frac {e^{e^x+x} (-1+x)}{2+x^2} \, dx+8 \int \frac {e^{e^x+x}}{\left (2+x^2\right )^2} \, dx-\int \frac {e^{e^x+2 x}}{i \sqrt {2}-x} \, dx+\int \frac {e^{e^x+2 x}}{i \sqrt {2}+x} \, dx\\ &=x-\frac {2 e^x \left (2 x+x^3\right )}{\left (2+x^2\right )^2}+2 \int \left (\frac {\left (-2-i \sqrt {2}\right ) e^{e^x+x}}{4 \left (i \sqrt {2}-x\right )}+\frac {\left (2-i \sqrt {2}\right ) e^{e^x+x}}{4 \left (i \sqrt {2}+x\right )}\right ) \, dx+8 \int \left (-\frac {e^{e^x+x}}{8 \left (i \sqrt {2}-x\right )^2}-\frac {e^{e^x+x}}{8 \left (i \sqrt {2}+x\right )^2}-\frac {e^{e^x+x}}{4 \left (-2-x^2\right )}\right ) \, dx-\int \frac {e^{e^x+2 x}}{i \sqrt {2}-x} \, dx+\int \frac {e^{e^x+2 x}}{i \sqrt {2}+x} \, dx\\ &=x-\frac {2 e^x \left (2 x+x^3\right )}{\left (2+x^2\right )^2}-2 \int \frac {e^{e^x+x}}{-2-x^2} \, dx+\frac {1}{2} \left (2-i \sqrt {2}\right ) \int \frac {e^{e^x+x}}{i \sqrt {2}+x} \, dx-\frac {1}{2} \left (2+i \sqrt {2}\right ) \int \frac {e^{e^x+x}}{i \sqrt {2}-x} \, dx-\int \frac {e^{e^x+x}}{\left (i \sqrt {2}-x\right )^2} \, dx-\int \frac {e^{e^x+2 x}}{i \sqrt {2}-x} \, dx-\int \frac {e^{e^x+x}}{\left (i \sqrt {2}+x\right )^2} \, dx+\int \frac {e^{e^x+2 x}}{i \sqrt {2}+x} \, dx\\ &=x-\frac {2 e^x \left (2 x+x^3\right )}{\left (2+x^2\right )^2}-2 \int \left (-\frac {i e^{e^x+x}}{2 \sqrt {2} \left (i \sqrt {2}-x\right )}-\frac {i e^{e^x+x}}{2 \sqrt {2} \left (i \sqrt {2}+x\right )}\right ) \, dx+\frac {1}{2} \left (2-i \sqrt {2}\right ) \int \frac {e^{e^x+x}}{i \sqrt {2}+x} \, dx-\frac {1}{2} \left (2+i \sqrt {2}\right ) \int \frac {e^{e^x+x}}{i \sqrt {2}-x} \, dx-\int \frac {e^{e^x+x}}{\left (i \sqrt {2}-x\right )^2} \, dx-\int \frac {e^{e^x+2 x}}{i \sqrt {2}-x} \, dx-\int \frac {e^{e^x+x}}{\left (i \sqrt {2}+x\right )^2} \, dx+\int \frac {e^{e^x+2 x}}{i \sqrt {2}+x} \, dx\\ &=x-\frac {2 e^x \left (2 x+x^3\right )}{\left (2+x^2\right )^2}+\frac {i \int \frac {e^{e^x+x}}{i \sqrt {2}-x} \, dx}{\sqrt {2}}+\frac {i \int \frac {e^{e^x+x}}{i \sqrt {2}+x} \, dx}{\sqrt {2}}+\frac {1}{2} \left (2-i \sqrt {2}\right ) \int \frac {e^{e^x+x}}{i \sqrt {2}+x} \, dx-\frac {1}{2} \left (2+i \sqrt {2}\right ) \int \frac {e^{e^x+x}}{i \sqrt {2}-x} \, dx-\int \frac {e^{e^x+x}}{\left (i \sqrt {2}-x\right )^2} \, dx-\int \frac {e^{e^x+2 x}}{i \sqrt {2}-x} \, dx-\int \frac {e^{e^x+x}}{\left (i \sqrt {2}+x\right )^2} \, dx+\int \frac {e^{e^x+2 x}}{i \sqrt {2}+x} \, dx\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.68, size = 28, normalized size = 0.93 \begin {gather*} \frac {x \left (2-2 e^x+2 e^{e^x+x}+x^2\right )}{2+x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.74, size = 28, normalized size = 0.93 \begin {gather*} \frac {x^{3} + 2 \, x e^{\left (x + e^{x}\right )} - 2 \, x e^{x} + 2 \, x}{x^{2} + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^{4} + 4 \, x^{2} - 2 \, {\left (x^{3} - x^{2} + 2 \, x + 2\right )} e^{x} + 2 \, {\left ({\left (x^{3} + 2 \, x\right )} e^{\left (2 \, x\right )} + {\left (x^{3} - x^{2} + 2 \, x + 2\right )} e^{x}\right )} e^{\left (e^{x}\right )} + 4}{x^{4} + 4 \, x^{2} + 4}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.13, size = 29, normalized size = 0.97




method result size



norman \(\frac {x^{3}+2 x -2 \,{\mathrm e}^{x} x +2 x \,{\mathrm e}^{x} {\mathrm e}^{{\mathrm e}^{x}}}{x^{2}+2}\) \(29\)
risch \(x -\frac {2 \,{\mathrm e}^{x} x}{x^{2}+2}+\frac {2 x \,{\mathrm e}^{{\mathrm e}^{x}+x}}{x^{2}+2}\) \(30\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.69, size = 24, normalized size = 0.80 \begin {gather*} x + \frac {2 \, {\left (x e^{\left (x + e^{x}\right )} - x e^{x}\right )}}{x^{2} + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 2*(x*e^(x + e^x) - x*e^x)/(x^2 + 2)

________________________________________________________________________________________

mupad [B]  time = 0.24, size = 29, normalized size = 0.97 \begin {gather*} x-\frac {2\,x\,{\mathrm {e}}^x}{x^2+2}+\frac {2\,x\,{\mathrm {e}}^{{\mathrm {e}}^x}\,{\mathrm {e}}^x}{x^2+2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.20, size = 29, normalized size = 0.97 \begin {gather*} x + \frac {2 x e^{x} e^{e^{x}}}{x^{2} + 2} - \frac {2 x e^{x}}{x^{2} + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((((2*x**3+4*x)*exp(x)**2+(2*x**3-2*x**2+4*x+4)*exp(x))*exp(exp(x))+(-2*x**3+2*x**2-4*x-4)*exp(x)+x**
4+4*x**2+4)/(x**4+4*x**2+4),x)

[Out]

x + 2*x*exp(x)*exp(exp(x))/(x**2 + 2) - 2*x*exp(x)/(x**2 + 2)

________________________________________________________________________________________