\(\int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 (2+x+3 x^2-x^3)}{1+2 x-x^2-2 x^3+x^4}}{-4 x-4 x^2+4 x^3} \, dx\) [9696]

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

Optimal result

Integrand size = 76, antiderivative size = 30 \[ \int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 \left (2+x+3 x^2-x^3\right )}{1+2 x-x^2-2 x^3+x^4}}{-4 x-4 x^2+4 x^3} \, dx=x+\frac {1}{4} \left (-x^2-\frac {e^x x^2}{\left (1+x-x^2\right )^2}\right ) \]

[Out]

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

Rubi [C] (verified)

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

Time = 1.58 (sec) , antiderivative size = 774, normalized size of antiderivative = 25.80, number of steps used = 57, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.079, Rules used = {1608, 6860, 6874, 2208, 2209, 2300} \[ \int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 \left (2+x+3 x^2-x^3\right )}{1+2 x-x^2-2 x^3+x^4}}{-4 x-4 x^2+4 x^3} \, dx=\frac {3}{200} \left (5+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x-\sqrt {5}-1\right )\right )-\frac {3}{100} \left (3+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x-\sqrt {5}-1\right )\right )+\frac {1}{40} \left (1+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x-\sqrt {5}-1\right )\right )-\frac {e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x-\sqrt {5}-1\right )\right )}{20 \sqrt {5}}-\frac {1}{100} e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x-\sqrt {5}-1\right )\right )+\frac {3}{200} \left (5-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x+\sqrt {5}-1\right )\right )-\frac {3}{100} \left (3-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x+\sqrt {5}-1\right )\right )+\frac {1}{40} \left (1-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x+\sqrt {5}-1\right )\right )+\frac {e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x+\sqrt {5}-1\right )\right )}{20 \sqrt {5}}-\frac {1}{100} e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (2 x+\sqrt {5}-1\right )\right )-\frac {1}{4} (2-x)^2+\frac {3 \left (5-\sqrt {5}\right ) e^x}{100 \left (-2 x-\sqrt {5}+1\right )}-\frac {3 \left (3-\sqrt {5}\right ) e^x}{50 \left (-2 x-\sqrt {5}+1\right )}+\frac {\left (1-\sqrt {5}\right ) e^x}{20 \left (-2 x-\sqrt {5}+1\right )}-\frac {e^x}{10 \sqrt {5} \left (-2 x-\sqrt {5}+1\right )}-\frac {e^x}{50 \left (-2 x-\sqrt {5}+1\right )}+\frac {3 \left (5+\sqrt {5}\right ) e^x}{100 \left (-2 x+\sqrt {5}+1\right )}-\frac {3 \left (3+\sqrt {5}\right ) e^x}{50 \left (-2 x+\sqrt {5}+1\right )}+\frac {\left (1+\sqrt {5}\right ) e^x}{20 \left (-2 x+\sqrt {5}+1\right )}+\frac {e^x}{10 \sqrt {5} \left (-2 x+\sqrt {5}+1\right )}-\frac {e^x}{50 \left (-2 x+\sqrt {5}+1\right )}-\frac {3 \left (5-\sqrt {5}\right ) e^x}{50 \left (-2 x-\sqrt {5}+1\right )^2}+\frac {e^x}{5 \sqrt {5} \left (-2 x-\sqrt {5}+1\right )^2}-\frac {3 \left (5+\sqrt {5}\right ) e^x}{50 \left (-2 x+\sqrt {5}+1\right )^2}-\frac {e^x}{5 \sqrt {5} \left (-2 x+\sqrt {5}+1\right )^2} \]

[In]

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

[Out]

E^x/(5*Sqrt[5]*(1 - Sqrt[5] - 2*x)^2) - (3*(5 - Sqrt[5])*E^x)/(50*(1 - Sqrt[5] - 2*x)^2) - E^x/(50*(1 - Sqrt[5
] - 2*x)) - E^x/(10*Sqrt[5]*(1 - Sqrt[5] - 2*x)) + ((1 - Sqrt[5])*E^x)/(20*(1 - Sqrt[5] - 2*x)) - (3*(3 - Sqrt
[5])*E^x)/(50*(1 - Sqrt[5] - 2*x)) + (3*(5 - Sqrt[5])*E^x)/(100*(1 - Sqrt[5] - 2*x)) - E^x/(5*Sqrt[5]*(1 + Sqr
t[5] - 2*x)^2) - (3*(5 + Sqrt[5])*E^x)/(50*(1 + Sqrt[5] - 2*x)^2) - E^x/(50*(1 + Sqrt[5] - 2*x)) + E^x/(10*Sqr
t[5]*(1 + Sqrt[5] - 2*x)) + ((1 + Sqrt[5])*E^x)/(20*(1 + Sqrt[5] - 2*x)) - (3*(3 + Sqrt[5])*E^x)/(50*(1 + Sqrt
[5] - 2*x)) + (3*(5 + Sqrt[5])*E^x)/(100*(1 + Sqrt[5] - 2*x)) - (2 - x)^2/4 - (E^((1 + Sqrt[5])/2)*ExpIntegral
Ei[(-1 - Sqrt[5] + 2*x)/2])/100 - (E^((1 + Sqrt[5])/2)*ExpIntegralEi[(-1 - Sqrt[5] + 2*x)/2])/(20*Sqrt[5]) + (
(1 + Sqrt[5])*E^((1 + Sqrt[5])/2)*ExpIntegralEi[(-1 - Sqrt[5] + 2*x)/2])/40 - (3*(3 + Sqrt[5])*E^((1 + Sqrt[5]
)/2)*ExpIntegralEi[(-1 - Sqrt[5] + 2*x)/2])/100 + (3*(5 + Sqrt[5])*E^((1 + Sqrt[5])/2)*ExpIntegralEi[(-1 - Sqr
t[5] + 2*x)/2])/200 - (E^(1/2 - Sqrt[5]/2)*ExpIntegralEi[(-1 + Sqrt[5] + 2*x)/2])/100 + (E^(1/2 - Sqrt[5]/2)*E
xpIntegralEi[(-1 + Sqrt[5] + 2*x)/2])/(20*Sqrt[5]) + ((1 - Sqrt[5])*E^(1/2 - Sqrt[5]/2)*ExpIntegralEi[(-1 + Sq
rt[5] + 2*x)/2])/40 - (3*(3 - Sqrt[5])*E^(1/2 - Sqrt[5]/2)*ExpIntegralEi[(-1 + Sqrt[5] + 2*x)/2])/100 + (3*(5
- Sqrt[5])*E^(1/2 - Sqrt[5]/2)*ExpIntegralEi[(-1 + Sqrt[5] + 2*x)/2])/200

Rule 1608

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^
(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] && PosQ[r - p]

Rule 2208

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(c + d*x)^(m
+ 1)*((b*F^(g*(e + f*x)))^n/(d*(m + 1))), x] - Dist[f*g*n*(Log[F]/(d*(m + 1))), Int[(c + d*x)^(m + 1)*(b*F^(g*
(e + f*x)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && LtQ[m, -1] && IntegerQ[2*m] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 2300

Int[(F_)^((g_.)*((d_.) + (e_.)*(x_))^(n_.))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegr
and[F^(g*(d + e*x)^n), 1/(a + b*x + c*x^2), x], x] /; FreeQ[{F, a, b, c, d, e, g, n}, x]

Rule 6860

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 \left (2+x+3 x^2-x^3\right )}{1+2 x-x^2-2 x^3+x^4}}{x \left (-4-4 x+4 x^2\right )} \, dx \\ & = \int \left (\frac {2-x}{2}-\frac {e^x x \left (-2-x-3 x^2+x^3\right )}{4 \left (-1-x+x^2\right )^3}\right ) \, dx \\ & = -\frac {1}{4} (2-x)^2-\frac {1}{4} \int \frac {e^x x \left (-2-x-3 x^2+x^3\right )}{\left (-1-x+x^2\right )^3} \, dx \\ & = -\frac {1}{4} (2-x)^2-\frac {1}{4} \int \left (-\frac {2 e^x (1+3 x)}{\left (-1-x+x^2\right )^3}+\frac {e^x (-1-x)}{\left (-1-x+x^2\right )^2}+\frac {e^x}{-1-x+x^2}\right ) \, dx \\ & = -\frac {1}{4} (2-x)^2-\frac {1}{4} \int \frac {e^x (-1-x)}{\left (-1-x+x^2\right )^2} \, dx-\frac {1}{4} \int \frac {e^x}{-1-x+x^2} \, dx+\frac {1}{2} \int \frac {e^x (1+3 x)}{\left (-1-x+x^2\right )^3} \, dx \\ & = -\frac {1}{4} (2-x)^2-\frac {1}{4} \int \left (-\frac {2 e^x}{\sqrt {5} \left (1+\sqrt {5}-2 x\right )}-\frac {2 e^x}{\sqrt {5} \left (-1+\sqrt {5}+2 x\right )}\right ) \, dx-\frac {1}{4} \int \left (-\frac {e^x}{\left (-1-x+x^2\right )^2}-\frac {e^x x}{\left (-1-x+x^2\right )^2}\right ) \, dx+\frac {1}{2} \int \left (\frac {e^x}{\left (-1-x+x^2\right )^3}+\frac {3 e^x x}{\left (-1-x+x^2\right )^3}\right ) \, dx \\ & = -\frac {1}{4} (2-x)^2+\frac {1}{4} \int \frac {e^x}{\left (-1-x+x^2\right )^2} \, dx+\frac {1}{4} \int \frac {e^x x}{\left (-1-x+x^2\right )^2} \, dx+\frac {1}{2} \int \frac {e^x}{\left (-1-x+x^2\right )^3} \, dx+\frac {3}{2} \int \frac {e^x x}{\left (-1-x+x^2\right )^3} \, dx+\frac {\int \frac {e^x}{1+\sqrt {5}-2 x} \, dx}{2 \sqrt {5}}+\frac {\int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx}{2 \sqrt {5}} \\ & = -\frac {1}{4} (2-x)^2-\frac {e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )}{4 \sqrt {5}}+\frac {e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )}{4 \sqrt {5}}+\frac {1}{4} \int \left (\frac {2 \left (1+\sqrt {5}\right ) e^x}{5 \left (1+\sqrt {5}-2 x\right )^2}+\frac {2 e^x}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}+\frac {2 \left (1-\sqrt {5}\right ) e^x}{5 \left (-1+\sqrt {5}+2 x\right )^2}+\frac {2 e^x}{5 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )}\right ) \, dx+\frac {1}{4} \int \left (\frac {4 e^x}{5 \left (1+\sqrt {5}-2 x\right )^2}+\frac {4 e^x}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}+\frac {4 e^x}{5 \left (-1+\sqrt {5}+2 x\right )^2}+\frac {4 e^x}{5 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )}\right ) \, dx+\frac {1}{2} \int \left (-\frac {8 e^x}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )^3}-\frac {12 e^x}{25 \left (1+\sqrt {5}-2 x\right )^2}-\frac {12 e^x}{25 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}-\frac {8 e^x}{5 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )^3}-\frac {12 e^x}{25 \left (-1+\sqrt {5}+2 x\right )^2}-\frac {12 e^x}{25 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )}\right ) \, dx+\frac {3}{2} \int \left (\frac {4 \left (-1-\sqrt {5}\right ) e^x}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )^3}+\frac {2 \left (-3-\sqrt {5}\right ) e^x}{25 \left (1+\sqrt {5}-2 x\right )^2}-\frac {6 e^x}{25 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}+\frac {4 \left (-1+\sqrt {5}\right ) e^x}{5 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )^3}+\frac {2 \left (-3+\sqrt {5}\right ) e^x}{25 \left (-1+\sqrt {5}+2 x\right )^2}-\frac {6 e^x}{25 \sqrt {5} \left (-1+\sqrt {5}+2 x\right )}\right ) \, dx \\ & = -\frac {1}{4} (2-x)^2-\frac {e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )}{4 \sqrt {5}}+\frac {e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )}{4 \sqrt {5}}+\frac {1}{5} \int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^2} \, dx+\frac {1}{5} \int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx-\frac {6}{25} \int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^2} \, dx-\frac {6}{25} \int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx+\frac {\int \frac {e^x}{1+\sqrt {5}-2 x} \, dx}{10 \sqrt {5}}+\frac {\int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx}{10 \sqrt {5}}+\frac {\int \frac {e^x}{1+\sqrt {5}-2 x} \, dx}{5 \sqrt {5}}+\frac {\int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx}{5 \sqrt {5}}-\frac {6 \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx}{25 \sqrt {5}}-\frac {6 \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx}{25 \sqrt {5}}-\frac {9 \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx}{25 \sqrt {5}}-\frac {9 \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx}{25 \sqrt {5}}-\frac {4 \int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^3} \, dx}{5 \sqrt {5}}-\frac {4 \int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^3} \, dx}{5 \sqrt {5}}+\frac {1}{10} \left (1-\sqrt {5}\right ) \int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx-\frac {1}{25} \left (3 \left (3-\sqrt {5}\right )\right ) \int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx+\frac {1}{25} \left (6 \left (5-\sqrt {5}\right )\right ) \int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^3} \, dx+\frac {1}{10} \left (1+\sqrt {5}\right ) \int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^2} \, dx-\frac {1}{25} \left (3 \left (3+\sqrt {5}\right )\right ) \int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^2} \, dx-\frac {1}{25} \left (6 \left (5+\sqrt {5}\right )\right ) \int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^3} \, dx \\ & = \frac {e^x}{5 \sqrt {5} \left (1-\sqrt {5}-2 x\right )^2}-\frac {3 \left (5-\sqrt {5}\right ) e^x}{50 \left (1-\sqrt {5}-2 x\right )^2}-\frac {e^x}{50 \left (1-\sqrt {5}-2 x\right )}+\frac {\left (1-\sqrt {5}\right ) e^x}{20 \left (1-\sqrt {5}-2 x\right )}-\frac {3 \left (3-\sqrt {5}\right ) e^x}{50 \left (1-\sqrt {5}-2 x\right )}-\frac {e^x}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )^2}-\frac {3 \left (5+\sqrt {5}\right ) e^x}{50 \left (1+\sqrt {5}-2 x\right )^2}-\frac {e^x}{50 \left (1+\sqrt {5}-2 x\right )}+\frac {\left (1+\sqrt {5}\right ) e^x}{20 \left (1+\sqrt {5}-2 x\right )}-\frac {3 \left (3+\sqrt {5}\right ) e^x}{50 \left (1+\sqrt {5}-2 x\right )}-\frac {1}{4} (2-x)^2-\frac {e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )}{10 \sqrt {5}}+\frac {e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )}{10 \sqrt {5}}-\frac {1}{10} \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx+\frac {1}{10} \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx+\frac {3}{25} \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx-\frac {3}{25} \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx+\frac {\int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^2} \, dx}{5 \sqrt {5}}-\frac {\int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx}{5 \sqrt {5}}+\frac {1}{20} \left (-1-\sqrt {5}\right ) \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx+\frac {1}{20} \left (1-\sqrt {5}\right ) \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx-\frac {1}{50} \left (3 \left (3-\sqrt {5}\right )\right ) \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx+\frac {1}{50} \left (3 \left (5-\sqrt {5}\right )\right ) \int \frac {e^x}{\left (-1+\sqrt {5}+2 x\right )^2} \, dx+\frac {1}{50} \left (3 \left (3+\sqrt {5}\right )\right ) \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx+\frac {1}{50} \left (3 \left (5+\sqrt {5}\right )\right ) \int \frac {e^x}{\left (1+\sqrt {5}-2 x\right )^2} \, dx \\ & = \frac {e^x}{5 \sqrt {5} \left (1-\sqrt {5}-2 x\right )^2}-\frac {3 \left (5-\sqrt {5}\right ) e^x}{50 \left (1-\sqrt {5}-2 x\right )^2}-\frac {e^x}{50 \left (1-\sqrt {5}-2 x\right )}-\frac {e^x}{10 \sqrt {5} \left (1-\sqrt {5}-2 x\right )}+\frac {\left (1-\sqrt {5}\right ) e^x}{20 \left (1-\sqrt {5}-2 x\right )}-\frac {3 \left (3-\sqrt {5}\right ) e^x}{50 \left (1-\sqrt {5}-2 x\right )}+\frac {3 \left (5-\sqrt {5}\right ) e^x}{100 \left (1-\sqrt {5}-2 x\right )}-\frac {e^x}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )^2}-\frac {3 \left (5+\sqrt {5}\right ) e^x}{50 \left (1+\sqrt {5}-2 x\right )^2}-\frac {e^x}{50 \left (1+\sqrt {5}-2 x\right )}+\frac {e^x}{10 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}+\frac {\left (1+\sqrt {5}\right ) e^x}{20 \left (1+\sqrt {5}-2 x\right )}-\frac {3 \left (3+\sqrt {5}\right ) e^x}{50 \left (1+\sqrt {5}-2 x\right )}+\frac {3 \left (5+\sqrt {5}\right ) e^x}{100 \left (1+\sqrt {5}-2 x\right )}-\frac {1}{4} (2-x)^2-\frac {1}{100} e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )-\frac {e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )}{10 \sqrt {5}}+\frac {1}{40} \left (1+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )-\frac {3}{100} \left (3+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )-\frac {1}{100} e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )+\frac {e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )}{10 \sqrt {5}}+\frac {1}{40} \left (1-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )-\frac {3}{100} \left (3-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )-\frac {\int \frac {e^x}{1+\sqrt {5}-2 x} \, dx}{10 \sqrt {5}}-\frac {\int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx}{10 \sqrt {5}}+\frac {1}{100} \left (3 \left (5-\sqrt {5}\right )\right ) \int \frac {e^x}{-1+\sqrt {5}+2 x} \, dx-\frac {1}{100} \left (3 \left (5+\sqrt {5}\right )\right ) \int \frac {e^x}{1+\sqrt {5}-2 x} \, dx \\ & = \frac {e^x}{5 \sqrt {5} \left (1-\sqrt {5}-2 x\right )^2}-\frac {3 \left (5-\sqrt {5}\right ) e^x}{50 \left (1-\sqrt {5}-2 x\right )^2}-\frac {e^x}{50 \left (1-\sqrt {5}-2 x\right )}-\frac {e^x}{10 \sqrt {5} \left (1-\sqrt {5}-2 x\right )}+\frac {\left (1-\sqrt {5}\right ) e^x}{20 \left (1-\sqrt {5}-2 x\right )}-\frac {3 \left (3-\sqrt {5}\right ) e^x}{50 \left (1-\sqrt {5}-2 x\right )}+\frac {3 \left (5-\sqrt {5}\right ) e^x}{100 \left (1-\sqrt {5}-2 x\right )}-\frac {e^x}{5 \sqrt {5} \left (1+\sqrt {5}-2 x\right )^2}-\frac {3 \left (5+\sqrt {5}\right ) e^x}{50 \left (1+\sqrt {5}-2 x\right )^2}-\frac {e^x}{50 \left (1+\sqrt {5}-2 x\right )}+\frac {e^x}{10 \sqrt {5} \left (1+\sqrt {5}-2 x\right )}+\frac {\left (1+\sqrt {5}\right ) e^x}{20 \left (1+\sqrt {5}-2 x\right )}-\frac {3 \left (3+\sqrt {5}\right ) e^x}{50 \left (1+\sqrt {5}-2 x\right )}+\frac {3 \left (5+\sqrt {5}\right ) e^x}{100 \left (1+\sqrt {5}-2 x\right )}-\frac {1}{4} (2-x)^2-\frac {1}{100} e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )-\frac {e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )}{20 \sqrt {5}}+\frac {1}{40} \left (1+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )-\frac {3}{100} \left (3+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )+\frac {3}{200} \left (5+\sqrt {5}\right ) e^{\frac {1}{2} \left (1+\sqrt {5}\right )} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1-\sqrt {5}+2 x\right )\right )-\frac {1}{100} e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )+\frac {e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )}{20 \sqrt {5}}+\frac {1}{40} \left (1-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )-\frac {3}{100} \left (3-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right )+\frac {3}{200} \left (5-\sqrt {5}\right ) e^{\frac {1}{2}-\frac {\sqrt {5}}{2}} \operatorname {ExpIntegralEi}\left (\frac {1}{2} \left (-1+\sqrt {5}+2 x\right )\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 2.73 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.53 \[ \int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 \left (2+x+3 x^2-x^3\right )}{1+2 x-x^2-2 x^3+x^4}}{-4 x-4 x^2+4 x^3} \, dx=\frac {1}{4} \left (4 x-x^2+e^x \left (\frac {-1-x}{\left (-1-x+x^2\right )^2}-\frac {1}{-1-x+x^2}\right )\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 1.11 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.17

method result size
risch \(-\frac {x^{2}}{4}+x -\frac {x^{2} {\mathrm e}^{x}}{4 \left (x^{4}-2 x^{3}-x^{2}+2 x +1\right )}\) \(35\)
default \(-\frac {x^{2}}{4}+x -\frac {{\mathrm e}^{\ln \left (\frac {x^{2}}{x^{4}-2 x^{3}-x^{2}+2 x +1}\right )+x}}{4}\) \(38\)
norman \(-\frac {x^{2}}{4}+x -\frac {{\mathrm e}^{\ln \left (\frac {x^{2}}{x^{4}-2 x^{3}-x^{2}+2 x +1}\right )+x}}{4}\) \(38\)
parts \(-\frac {x^{2}}{4}+x -\frac {{\mathrm e}^{\ln \left (\frac {x^{2}}{x^{4}-2 x^{3}-x^{2}+2 x +1}\right )+x}}{4}\) \(38\)
parallelrisch \(-\frac {3}{4}-\frac {x^{2}}{4}+x -\frac {{\mathrm e}^{\ln \left (\frac {x^{2}}{x^{4}-2 x^{3}-x^{2}+2 x +1}\right )+x}}{4}\) \(39\)

[In]

int(((-x^3+3*x^2+x+2)*exp(ln(x^2/(x^4-2*x^3-x^2+2*x+1))+x)-2*x^4+6*x^3-2*x^2-4*x)/(4*x^3-4*x^2-4*x),x,method=_
RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.07 \[ \int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 \left (2+x+3 x^2-x^3\right )}{1+2 x-x^2-2 x^3+x^4}}{-4 x-4 x^2+4 x^3} \, dx=- \frac {x^{2}}{4} - \frac {x^{2} e^{x}}{4 x^{4} - 8 x^{3} - 4 x^{2} + 8 x + 4} + x \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.13 \[ \int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 \left (2+x+3 x^2-x^3\right )}{1+2 x-x^2-2 x^3+x^4}}{-4 x-4 x^2+4 x^3} \, dx=-\frac {1}{4} \, x^{2} - \frac {x^{2} e^{x}}{4 \, {\left (x^{4} - 2 \, x^{3} - x^{2} + 2 \, x + 1\right )}} + x \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (27) = 54\).

Time = 0.26 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.83 \[ \int \frac {-4 x-2 x^2+6 x^3-2 x^4+\frac {e^x x^2 \left (2+x+3 x^2-x^3\right )}{1+2 x-x^2-2 x^3+x^4}}{-4 x-4 x^2+4 x^3} \, dx=-\frac {x^{6} - 6 \, x^{5} + 7 \, x^{4} + 6 \, x^{3} + x^{2} e^{x} - 7 \, x^{2} - 4 \, x}{4 \, {\left (x^{4} - 2 \, x^{3} - x^{2} + 2 \, x + 1\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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