\(\int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7)}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx\) [15]

Optimal result
Mathematica [A] (verified)
Rubi [C] (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)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 103, antiderivative size = 34 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=-5-2 x-x \left (-e^x+\frac {\left (x+\frac {4}{-3+\frac {3}{x}+x}\right )^2}{x}\right ) \] Output:

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.35 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=-2 x+e^x x-x^2-\frac {48 (-1+x)}{\left (3-3 x+x^2\right )^2}-\frac {8 (-1+3 x)}{3-3 x+x^2} \] Input:

Integrate[(-54 - 132*x + 162*x^2 - 142*x^3 + 114*x^4 - 54*x^5 + 16*x^6 - 2 
*x^7 + E^x*(27 - 54*x + 27*x^2 + 27*x^3 - 45*x^4 + 27*x^5 - 8*x^6 + x^7))/ 
(27 - 81*x + 108*x^2 - 81*x^3 + 36*x^4 - 9*x^5 + x^6),x]
 

Output:

-2*x + E^x*x - x^2 - (48*(-1 + x))/(3 - 3*x + x^2)^2 - (8*(-1 + 3*x))/(3 - 
 3*x + x^2)
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 10.94 (sec) , antiderivative size = 4620, normalized size of antiderivative = 135.88, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.019, Rules used = {2463, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {-2 x^7+16 x^6-54 x^5+114 x^4-142 x^3+162 x^2+e^x \left (x^7-8 x^6+27 x^5-45 x^4+27 x^3+27 x^2-54 x+27\right )-132 x-54}{x^6-9 x^5+36 x^4-81 x^3+108 x^2-81 x+27} \, dx\)

\(\Big \downarrow \) 2463

\(\displaystyle \int \left (\frac {4 i \left (-2 x^7+16 x^6-54 x^5+114 x^4-142 x^3+162 x^2+e^x \left (x^7-8 x^6+27 x^5-45 x^4+27 x^3+27 x^2-54 x+27\right )-132 x-54\right )}{3 \sqrt {3} \left (-2 x+i \sqrt {3}+3\right )}+\frac {4 i \left (-2 x^7+16 x^6-54 x^5+114 x^4-142 x^3+162 x^2+e^x \left (x^7-8 x^6+27 x^5-45 x^4+27 x^3+27 x^2-54 x+27\right )-132 x-54\right )}{3 \sqrt {3} \left (2 x+i \sqrt {3}-3\right )}-\frac {4 \left (-2 x^7+16 x^6-54 x^5+114 x^4-142 x^3+162 x^2+e^x \left (x^7-8 x^6+27 x^5-45 x^4+27 x^3+27 x^2-54 x+27\right )-132 x-54\right )}{3 \left (-2 x+i \sqrt {3}+3\right )^2}-\frac {4 \left (-2 x^7+16 x^6-54 x^5+114 x^4-142 x^3+162 x^2+e^x \left (x^7-8 x^6+27 x^5-45 x^4+27 x^3+27 x^2-54 x+27\right )-132 x-54\right )}{3 \left (2 x+i \sqrt {3}-3\right )^2}-\frac {8 i \left (-2 x^7+16 x^6-54 x^5+114 x^4-142 x^3+162 x^2+e^x \left (x^7-8 x^6+27 x^5-45 x^4+27 x^3+27 x^2-54 x+27\right )-132 x-54\right )}{3 \sqrt {3} \left (-2 x+i \sqrt {3}+3\right )^3}-\frac {8 i \left (-2 x^7+16 x^6-54 x^5+114 x^4-142 x^3+162 x^2+e^x \left (x^7-8 x^6+27 x^5-45 x^4+27 x^3+27 x^2-54 x+27\right )-132 x-54\right )}{3 \sqrt {3} \left (2 x+i \sqrt {3}-3\right )^3}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 i e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^6}{3 \sqrt {3}}+\frac {10 \left (i+\sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^5}{3 \left (3 i+\sqrt {3}\right )}+\frac {4 i e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^5}{\sqrt {3}}-\frac {2 \left (11 i+3 \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^4}{3 \left (i+\sqrt {3}\right )}+\frac {50 \left (i+\sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^4}{3 \left (3 i+\sqrt {3}\right )}+\frac {59 i e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^4}{3 \sqrt {3}}-\frac {8 \left (11 i+3 \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^3}{3 \left (i+\sqrt {3}\right )}+\frac {200 \left (i+\sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^3}{3 \left (3 i+\sqrt {3}\right )}+\frac {\left (i-3 \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^3}{3 \left (3 i+\sqrt {3}\right )}-\frac {1}{3} \left (3-5 i \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^3+\frac {236 i e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^3}{3 \sqrt {3}}-\frac {8 \left (11 i+3 \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^2}{i+\sqrt {3}}+\frac {200 \left (i+\sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^2}{3 i+\sqrt {3}}+\frac {\left (i-3 \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^2}{3 i+\sqrt {3}}-\left (3-5 i \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^2+80 i \sqrt {3} e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^2-\frac {4 i e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )^2}{\sqrt {3}}-\frac {16 \left (11 i+3 \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )}{i+\sqrt {3}}+\frac {400 \left (i+\sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )}{3 i+\sqrt {3}}+\frac {2 \left (i-3 \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )}{3 i+\sqrt {3}}-2 \left (3-5 i \sqrt {3}\right ) e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )+160 i \sqrt {3} e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )-\frac {8 i e^x \left (\frac {6}{3-i \sqrt {3}}-x\right )}{\sqrt {3}}-\frac {16 \left (11 i+3 \sqrt {3}\right ) e^x}{i+\sqrt {3}}+\frac {2 \left (i+3 \sqrt {3}\right ) e^x}{3 i-\sqrt {3}}+\frac {4 \left (3 i+2 \sqrt {3}\right ) e^x}{i-\sqrt {3}}-\frac {16 \left (6 i+\sqrt {3}\right ) e^x}{3 i-\sqrt {3}}+\frac {400 \left (i+\sqrt {3}\right ) e^x}{3 i+\sqrt {3}}-\frac {16 \left (6 i-\sqrt {3}\right ) e^x}{3 i+\sqrt {3}}+\frac {2 \left (i-3 \sqrt {3}\right ) e^x}{3 i+\sqrt {3}}+\frac {4 \left (3 i-2 \sqrt {3}\right ) e^x}{i+\sqrt {3}}-2 \left (3+5 i \sqrt {3}\right ) e^x-2 \left (3-5 i \sqrt {3}\right ) e^x+\frac {400 \left (i-\sqrt {3}\right ) e^x}{3 i-\sqrt {3}}-\frac {16 \left (11 i-3 \sqrt {3}\right ) e^x}{i-\sqrt {3}}+80 e^x-\frac {2 i e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^6}{3 \sqrt {3}}-\frac {1}{9} \left (1+i \sqrt {3}\right ) x^6-\frac {1}{9} \left (1-i \sqrt {3}\right ) x^6+\frac {2 x^6}{9}+\frac {10 \left (i-\sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^5}{3 \left (3 i-\sqrt {3}\right )}-\frac {4 i e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^5}{\sqrt {3}}+\frac {1}{3} i e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^5+\frac {1}{3} i e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^5+\frac {16}{15} \left (1+i \sqrt {3}\right ) x^5+\frac {16}{15} \left (1-i \sqrt {3}\right ) x^5-\frac {32 x^5}{15}+\frac {50 \left (i-\sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^4}{3 \left (3 i-\sqrt {3}\right )}-\frac {2 \left (11 i-3 \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^4}{3 \left (i-\sqrt {3}\right )}-\frac {59 i e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^4}{3 \sqrt {3}}-\frac {2 \left (6 i+\sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^4}{3 \left (3 i-\sqrt {3}\right )}+\frac {5}{3} e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^4-\frac {2 \left (6 i-\sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^4}{3 \left (3 i+\sqrt {3}\right )}+\frac {5}{3} e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^4-\frac {17}{4} \left (1+i \sqrt {3}\right ) x^4-\frac {7}{2} \left (1-i \sqrt {3}\right ) x^4-\frac {1}{8} \left (3 i-\sqrt {3}\right )^2 x^4+7 x^4+\frac {\left (i+3 \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^3}{3 \left (3 i-\sqrt {3}\right )}-\frac {1}{3} \left (3+5 i \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^3+\frac {200 \left (i-\sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^3}{3 \left (3 i-\sqrt {3}\right )}-\frac {8 \left (11 i-3 \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^3}{3 \left (i-\sqrt {3}\right )}-\frac {236 i e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^3}{3 \sqrt {3}}+\frac {8 \left (6 i+\sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^3}{3 \left (3+i \sqrt {3}\right )}+\frac {2 \left (3-2 i \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^3}{3 \left (i-\sqrt {3}\right )}-\frac {20}{3} i e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^3-\frac {8 \left (6+i \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^3}{3 \left (3 i+\sqrt {3}\right )}+\frac {2 \left (3+2 i \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^3}{3 \left (i+\sqrt {3}\right )}-\frac {20}{3} i e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^3+10 \left (1+i \sqrt {3}\right ) x^3+2 \left (1-i \sqrt {3}\right ) x^3+\frac {4}{3} \left (3 i-\sqrt {3}\right )^2 x^3-4 x^3+\frac {\left (i+3 \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^2}{3 i-\sqrt {3}}-\left (3+5 i \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^2+\frac {200 \left (i-\sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^2}{3 i-\sqrt {3}}-\frac {8 \left (11 i-3 \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^2}{i-\sqrt {3}}-80 i \sqrt {3} e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^2+\frac {4 i e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )^2}{\sqrt {3}}-\frac {2 \left (3 i+2 \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^2}{i-\sqrt {3}}+\frac {8 \left (6 i+\sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^2}{3 i-\sqrt {3}}-20 e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )^2+\frac {8 \left (6 i-\sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^2}{3 i+\sqrt {3}}-\frac {2 \left (3 i-2 \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^2}{i+\sqrt {3}}-20 e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )^2-\frac {176 x^2}{\sqrt {3} \left (3 i-\sqrt {3}\right ) \left (-2 x+i \sqrt {3}+3\right )^2}-\frac {176 x^2}{\sqrt {3} \left (3 i+\sqrt {3}\right ) \left (-2 i x+\sqrt {3}+3 i\right )^2}-\frac {62}{3} \left (1+i \sqrt {3}\right ) x^2+\frac {119}{6} \left (1-i \sqrt {3}\right ) x^2-\frac {27}{4} \left (3 i-\sqrt {3}\right )^2 x^2-\frac {122 x^2}{3}+\frac {2 \left (i+3 \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )}{3 i-\sqrt {3}}-2 \left (3+5 i \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )+\frac {400 \left (i-\sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )}{3 i-\sqrt {3}}-\frac {16 \left (11 i-3 \sqrt {3}\right ) e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )}{i-\sqrt {3}}-160 i \sqrt {3} e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )+\frac {8 i e^x \left (\frac {6}{3+i \sqrt {3}}-x\right )}{\sqrt {3}}-\frac {16 \left (6 i+\sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )}{3+i \sqrt {3}}-\frac {4 \left (3-2 i \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )}{i-\sqrt {3}}+40 i e^x \left (i x+\frac {6}{3 i-\sqrt {3}}\right )+\frac {16 \left (6+i \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )}{3 i+\sqrt {3}}-\frac {4 \left (3+2 i \sqrt {3}\right ) e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )}{i+\sqrt {3}}+40 i e^x \left (i x+\frac {6}{3 i+\sqrt {3}}\right )-3 \left (3+i \sqrt {3}\right ) x+165 \left (1+i \sqrt {3}\right ) x-3 \left (3-i \sqrt {3}\right ) x-6 \left (1-i \sqrt {3}\right ) x+\frac {57}{2} \left (3 i-\sqrt {3}\right )^2 x+28 x-60 \left (3+i \sqrt {3}\right ) \log \left (-2 i x-\sqrt {3}+3 i\right )+114 \left (1+i \sqrt {3}\right ) \log \left (-2 i x-\sqrt {3}+3 i\right )+84 \left (3-i \sqrt {3}\right ) \log \left (-2 i x-\sqrt {3}+3 i\right )-360 \left (1-i \sqrt {3}\right ) \log \left (-2 i x-\sqrt {3}+3 i\right )-330 i \sqrt {3} \log \left (-2 i x-\sqrt {3}+3 i\right )+174 \log \left (-2 i x-\sqrt {3}+3 i\right )+84 \left (3+i \sqrt {3}\right ) \log \left (-2 i x+\sqrt {3}+3 i\right )-360 \left (1+i \sqrt {3}\right ) \log \left (-2 i x+\sqrt {3}+3 i\right )-60 \left (3-i \sqrt {3}\right ) \log \left (-2 i x+\sqrt {3}+3 i\right )+114 \left (1-i \sqrt {3}\right ) \log \left (-2 i x+\sqrt {3}+3 i\right )+330 i \sqrt {3} \log \left (-2 i x+\sqrt {3}+3 i\right )+174 \log \left (-2 i x+\sqrt {3}+3 i\right )-\frac {20 \left (3 i+\sqrt {3}\right )}{-2 i x-\sqrt {3}+3 i}+\frac {234 \left (i+\sqrt {3}\right )}{-2 i x-\sqrt {3}+3 i}+\frac {296 \left (3 i-\sqrt {3}\right )}{-2 i x-\sqrt {3}+3 i}-\frac {450 \left (i-\sqrt {3}\right )}{-2 i x-\sqrt {3}+3 i}-\frac {368 \sqrt {3}}{-2 i x-\sqrt {3}+3 i}-\frac {588 i}{-2 i x-\sqrt {3}+3 i}+\frac {296 \left (3 i+\sqrt {3}\right )}{-2 i x+\sqrt {3}+3 i}-\frac {450 \left (i+\sqrt {3}\right )}{-2 i x+\sqrt {3}+3 i}-\frac {20 \left (3 i-\sqrt {3}\right )}{-2 i x+\sqrt {3}+3 i}+\frac {234 \left (i-\sqrt {3}\right )}{-2 i x+\sqrt {3}+3 i}+\frac {368 \sqrt {3}}{-2 i x+\sqrt {3}+3 i}-\frac {588 i}{-2 i x+\sqrt {3}+3 i}-\frac {114 \left (3+i \sqrt {3}\right )}{\left (-2 i x-\sqrt {3}+3 i\right )^2}+\frac {162 \left (1+i \sqrt {3}\right )}{\left (-2 i x-\sqrt {3}+3 i\right )^2}-\frac {54 \left (3-i \sqrt {3}\right )}{\left (-2 i x-\sqrt {3}+3 i\right )^2}-\frac {18 \left (1-i \sqrt {3}\right )}{\left (-2 i x-\sqrt {3}+3 i\right )^2}-\frac {108 i \sqrt {3}}{\left (-2 i x-\sqrt {3}+3 i\right )^2}+\frac {284}{\left (-2 i x-\sqrt {3}+3 i\right )^2}-\frac {54 \left (3+i \sqrt {3}\right )}{\left (-2 i x+\sqrt {3}+3 i\right )^2}-\frac {18 \left (1+i \sqrt {3}\right )}{\left (-2 i x+\sqrt {3}+3 i\right )^2}-\frac {114 \left (3-i \sqrt {3}\right )}{\left (-2 i x+\sqrt {3}+3 i\right )^2}+\frac {162 \left (1-i \sqrt {3}\right )}{\left (-2 i x+\sqrt {3}+3 i\right )^2}+\frac {108 i \sqrt {3}}{\left (-2 i x+\sqrt {3}+3 i\right )^2}+\frac {284}{\left (-2 i x+\sqrt {3}+3 i\right )^2}\)

Input:

Int[(-54 - 132*x + 162*x^2 - 142*x^3 + 114*x^4 - 54*x^5 + 16*x^6 - 2*x^7 + 
 E^x*(27 - 54*x + 27*x^2 + 27*x^3 - 45*x^4 + 27*x^5 - 8*x^6 + x^7))/(27 - 
81*x + 108*x^2 - 81*x^3 + 36*x^4 - 9*x^5 + x^6),x]
 

Output:

80*E^x - (16*(11*I - 3*Sqrt[3])*E^x)/(I - Sqrt[3]) + (400*(I - Sqrt[3])*E^ 
x)/(3*I - Sqrt[3]) - 2*(3 - (5*I)*Sqrt[3])*E^x - 2*(3 + (5*I)*Sqrt[3])*E^x 
 + (4*(3*I - 2*Sqrt[3])*E^x)/(I + Sqrt[3]) + (2*(I - 3*Sqrt[3])*E^x)/(3*I 
+ Sqrt[3]) - (16*(6*I - Sqrt[3])*E^x)/(3*I + Sqrt[3]) + (400*(I + Sqrt[3]) 
*E^x)/(3*I + Sqrt[3]) - (16*(6*I + Sqrt[3])*E^x)/(3*I - Sqrt[3]) + (4*(3*I 
 + 2*Sqrt[3])*E^x)/(I - Sqrt[3]) + (2*(I + 3*Sqrt[3])*E^x)/(3*I - Sqrt[3]) 
 - (16*(11*I + 3*Sqrt[3])*E^x)/(I + Sqrt[3]) - ((8*I)*E^x*(6/(3 - I*Sqrt[3 
]) - x))/Sqrt[3] + (160*I)*Sqrt[3]*E^x*(6/(3 - I*Sqrt[3]) - x) - 2*(3 - (5 
*I)*Sqrt[3])*E^x*(6/(3 - I*Sqrt[3]) - x) + (2*(I - 3*Sqrt[3])*E^x*(6/(3 - 
I*Sqrt[3]) - x))/(3*I + Sqrt[3]) + (400*(I + Sqrt[3])*E^x*(6/(3 - I*Sqrt[3 
]) - x))/(3*I + Sqrt[3]) - (16*(11*I + 3*Sqrt[3])*E^x*(6/(3 - I*Sqrt[3]) - 
 x))/(I + Sqrt[3]) - ((4*I)*E^x*(6/(3 - I*Sqrt[3]) - x)^2)/Sqrt[3] + (80*I 
)*Sqrt[3]*E^x*(6/(3 - I*Sqrt[3]) - x)^2 - (3 - (5*I)*Sqrt[3])*E^x*(6/(3 - 
I*Sqrt[3]) - x)^2 + ((I - 3*Sqrt[3])*E^x*(6/(3 - I*Sqrt[3]) - x)^2)/(3*I + 
 Sqrt[3]) + (200*(I + Sqrt[3])*E^x*(6/(3 - I*Sqrt[3]) - x)^2)/(3*I + Sqrt[ 
3]) - (8*(11*I + 3*Sqrt[3])*E^x*(6/(3 - I*Sqrt[3]) - x)^2)/(I + Sqrt[3]) + 
 (((236*I)/3)*E^x*(6/(3 - I*Sqrt[3]) - x)^3)/Sqrt[3] - ((3 - (5*I)*Sqrt[3] 
)*E^x*(6/(3 - I*Sqrt[3]) - x)^3)/3 + ((I - 3*Sqrt[3])*E^x*(6/(3 - I*Sqrt[3 
]) - x)^3)/(3*(3*I + Sqrt[3])) + (200*(I + Sqrt[3])*E^x*(6/(3 - I*Sqrt[3]) 
 - x)^3)/(3*(3*I + Sqrt[3])) - (8*(11*I + 3*Sqrt[3])*E^x*(6/(3 - I*Sqrt...
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2463
Int[(u_.)*(Px_)^(p_), x_Symbol] :> With[{Qx = Factor[Px]}, Int[ExpandIntegr 
and[u, Qx^p, x], x] /;  !SumQ[NonfreeFactors[Qx, x]]] /; PolyQ[Px, x] && Gt 
Q[Expon[Px, x], 2] &&  !BinomialQ[Px, x] &&  !TrinomialQ[Px, x] && ILtQ[p, 
0]
 
Maple [A] (verified)

Time = 1.22 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.21

method result size
parts \({\mathrm e}^{x} x -x^{2}-2 x +\frac {-24 x^{3}+80 x^{2}-144 x +72}{\left (x^{2}-3 x +3\right )^{2}}\) \(41\)
risch \(-x^{2}-2 x +\frac {-24 x^{3}+80 x^{2}-144 x +72}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}+{\mathrm e}^{x} x\) \(50\)
norman \(\frac {x^{5} {\mathrm e}^{x}-216 x -54 x^{3}+152 x^{2}+4 x^{5}-x^{6}+9 \,{\mathrm e}^{x} x -18 \,{\mathrm e}^{x} x^{2}+15 \,{\mathrm e}^{x} x^{3}-6 \,{\mathrm e}^{x} x^{4}+99}{\left (x^{2}-3 x +3\right )^{2}}\) \(69\)
parallelrisch \(-\frac {x^{6}-x^{5} {\mathrm e}^{x}-4 x^{5}+6 \,{\mathrm e}^{x} x^{4}-99-15 \,{\mathrm e}^{x} x^{3}+54 x^{3}+18 \,{\mathrm e}^{x} x^{2}-152 x^{2}-9 \,{\mathrm e}^{x} x +216 x}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}\) \(79\)
default \(-2 x -\frac {18 \left (-3 x^{3}+\frac {15}{2} x^{2}-6 x -\frac {3}{2}\right )}{\left (x^{2}-3 x +3\right )^{2}}+\frac {-432 x^{2}+1152 x -1080}{\left (x^{2}-3 x +3\right )^{2}}-\frac {54 \left (6 x^{3}-\frac {75}{2} x^{2}+72 x -54\right )}{\left (x^{2}-3 x +3\right )^{2}}+\frac {570 x^{3}-2907 x^{2}+5130 x -3591}{\left (x^{2}-3 x +3\right )^{2}}-\frac {142 \left (3 x^{3}-14 x^{2}+24 x -\frac {33}{2}\right )}{\left (x^{2}-3 x +3\right )^{2}}+\frac {270 x^{3}-1215 x^{2}+2106 x -1458}{\left (x^{2}-3 x +3\right )^{2}}-\frac {22 \left (3 x -6\right )}{\left (x^{2}-3 x +3\right )^{2}}-\frac {9 \left (-3+2 x \right )}{\left (x^{2}-3 x +3\right )^{2}}-\frac {84 \left (-3+2 x \right )}{x^{2}-3 x +3}+\left (x +8\right ) {\mathrm e}^{x}-x^{2}-8 \,{\mathrm e}^{x}-\frac {9 \,{\mathrm e}^{x} \left (7 x^{3}-18 x^{2}+15 x +3\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {36 \,{\mathrm e}^{x} \left (7 x^{2}-19 x +18\right )}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}-\frac {45 \,{\mathrm e}^{x} \left (13 x^{3}-66 x^{2}+117 x -81\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {27 \,{\mathrm e}^{x} \left (8 x^{3}-37 x^{2}+63 x -42\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {9 \,{\mathrm e}^{x} \left (13 x^{3}-57 x^{2}+96 x -63\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}-\frac {9 \,{\mathrm e}^{x} \left (7 x^{3}-30 x^{2}+51 x -33\right )}{x^{4}-6 x^{3}+15 x^{2}-18 x +9}+\frac {81 \,{\mathrm e}^{x} \left (5 x^{3}-31 x^{2}+60 x -45\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}+\frac {9 \,{\mathrm e}^{x} \left (4 x^{3}-17 x^{2}+29 x -18\right )}{2 \left (x^{4}-6 x^{3}+15 x^{2}-18 x +9\right )}\) \(535\)
orering \(\frac {\left (x^{11}-8 x^{10}-7 x^{9}+318 x^{8}-1583 x^{7}+3512 x^{6}-2217 x^{5}-7998 x^{4}+24087 x^{3}-29988 x^{2}+19287 x -5670\right ) \left (\left (x^{7}-8 x^{6}+27 x^{5}-45 x^{4}+27 x^{3}+27 x^{2}-54 x +27\right ) {\mathrm e}^{x}-2 x^{7}+16 x^{6}-54 x^{5}+114 x^{4}-142 x^{3}+162 x^{2}-132 x -54\right )}{2 \left (x^{10}-10 x^{9}+43 x^{8}-108 x^{7}+125 x^{6}+10 x^{5}-411 x^{4}+924 x^{3}-525 x^{2}+126 x -279\right ) \left (x^{6}-9 x^{5}+36 x^{4}-81 x^{3}+108 x^{2}-81 x +27\right )}-\frac {\left (x^{9}-8 x^{8}+195 x^{6}-806 x^{5}+1458 x^{4}-855 x^{3}-1038 x^{2}+1890 x -945\right ) \left (x^{2}-3 x +3\right ) \left (\frac {\left (7 x^{6}-48 x^{5}+135 x^{4}-180 x^{3}+81 x^{2}+54 x -54\right ) {\mathrm e}^{x}+\left (x^{7}-8 x^{6}+27 x^{5}-45 x^{4}+27 x^{3}+27 x^{2}-54 x +27\right ) {\mathrm e}^{x}-14 x^{6}+96 x^{5}-270 x^{4}+456 x^{3}-426 x^{2}+324 x -132}{x^{6}-9 x^{5}+36 x^{4}-81 x^{3}+108 x^{2}-81 x +27}-\frac {\left (\left (x^{7}-8 x^{6}+27 x^{5}-45 x^{4}+27 x^{3}+27 x^{2}-54 x +27\right ) {\mathrm e}^{x}-2 x^{7}+16 x^{6}-54 x^{5}+114 x^{4}-142 x^{3}+162 x^{2}-132 x -54\right ) \left (6 x^{5}-45 x^{4}+144 x^{3}-243 x^{2}+216 x -81\right )}{\left (x^{6}-9 x^{5}+36 x^{4}-81 x^{3}+108 x^{2}-81 x +27\right )^{2}}\right )}{2 \left (x^{10}-10 x^{9}+43 x^{8}-108 x^{7}+125 x^{6}+10 x^{5}-411 x^{4}+924 x^{3}-525 x^{2}+126 x -279\right )}\) \(565\)

Input:

int(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16*x^6-5 
4*x^5+114*x^4-142*x^3+162*x^2-132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108*x^2-8 
1*x+27),x,method=_RETURNVERBOSE)
 

Output:

exp(x)*x-x^2-2*x+8*(-3*x^3+10*x^2-18*x+9)/(x^2-3*x+3)^2
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (33) = 66\).

Time = 0.10 (sec) , antiderivative size = 76, normalized size of antiderivative = 2.24 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=-\frac {x^{6} - 4 \, x^{5} + 3 \, x^{4} + 36 \, x^{3} - 107 \, x^{2} - {\left (x^{5} - 6 \, x^{4} + 15 \, x^{3} - 18 \, x^{2} + 9 \, x\right )} e^{x} + 162 \, x - 72}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \] Input:

integrate(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16 
*x^6-54*x^5+114*x^4-142*x^3+162*x^2-132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108 
*x^2-81*x+27),x, algorithm="fricas")
 

Output:

-(x^6 - 4*x^5 + 3*x^4 + 36*x^3 - 107*x^2 - (x^5 - 6*x^4 + 15*x^3 - 18*x^2 
+ 9*x)*e^x + 162*x - 72)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9)
 

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.29 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=- x^{2} + x e^{x} - 2 x - \frac {24 x^{3} - 80 x^{2} + 144 x - 72}{x^{4} - 6 x^{3} + 15 x^{2} - 18 x + 9} \] Input:

integrate(((x**7-8*x**6+27*x**5-45*x**4+27*x**3+27*x**2-54*x+27)*exp(x)-2* 
x**7+16*x**6-54*x**5+114*x**4-142*x**3+162*x**2-132*x-54)/(x**6-9*x**5+36* 
x**4-81*x**3+108*x**2-81*x+27),x)
 

Output:

-x**2 + x*exp(x) - 2*x - (24*x**3 - 80*x**2 + 144*x - 72)/(x**4 - 6*x**3 + 
 15*x**2 - 18*x + 9)
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (33) = 66\).

Time = 0.17 (sec) , antiderivative size = 304, normalized size of antiderivative = 8.94 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=-x^{2} + x e^{x} - 2 \, x + \frac {27 \, {\left (10 \, x^{3} - 45 \, x^{2} + 78 \, x - 54\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} + \frac {57 \, {\left (10 \, x^{3} - 51 \, x^{2} + 90 \, x - 63\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {71 \, {\left (6 \, x^{3} - 28 \, x^{2} + 48 \, x - 33\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {9 \, {\left (4 \, x^{3} - 18 \, x^{2} + 32 \, x - 21\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {81 \, {\left (4 \, x^{3} - 25 \, x^{2} + 48 \, x - 36\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} + \frac {27 \, {\left (2 \, x^{3} - 5 \, x^{2} + 4 \, x + 1\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {66 \, {\left (2 \, x^{3} - 9 \, x^{2} + 16 \, x - 11\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} - \frac {72 \, {\left (6 \, x^{2} - 16 \, x + 15\right )}}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \] Input:

integrate(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16 
*x^6-54*x^5+114*x^4-142*x^3+162*x^2-132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108 
*x^2-81*x+27),x, algorithm="maxima")
 

Output:

-x^2 + x*e^x - 2*x + 27*(10*x^3 - 45*x^2 + 78*x - 54)/(x^4 - 6*x^3 + 15*x^ 
2 - 18*x + 9) + 57*(10*x^3 - 51*x^2 + 90*x - 63)/(x^4 - 6*x^3 + 15*x^2 - 1 
8*x + 9) - 71*(6*x^3 - 28*x^2 + 48*x - 33)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 
9) - 9*(4*x^3 - 18*x^2 + 32*x - 21)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) - 81 
*(4*x^3 - 25*x^2 + 48*x - 36)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) + 27*(2*x^ 
3 - 5*x^2 + 4*x + 1)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) - 66*(2*x^3 - 9*x^2 
 + 16*x - 11)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9) - 72*(6*x^2 - 16*x + 15)/( 
x^4 - 6*x^3 + 15*x^2 - 18*x + 9)
 

Giac [B] (verification not implemented)

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

Time = 0.11 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.44 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=-\frac {x^{6} - x^{5} e^{x} - 4 \, x^{5} + 6 \, x^{4} e^{x} + 3 \, x^{4} - 15 \, x^{3} e^{x} + 36 \, x^{3} + 18 \, x^{2} e^{x} - 107 \, x^{2} - 9 \, x e^{x} + 162 \, x - 72}{x^{4} - 6 \, x^{3} + 15 \, x^{2} - 18 \, x + 9} \] Input:

integrate(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16 
*x^6-54*x^5+114*x^4-142*x^3+162*x^2-132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108 
*x^2-81*x+27),x, algorithm="giac")
 

Output:

-(x^6 - x^5*e^x - 4*x^5 + 6*x^4*e^x + 3*x^4 - 15*x^3*e^x + 36*x^3 + 18*x^2 
*e^x - 107*x^2 - 9*x*e^x + 162*x - 72)/(x^4 - 6*x^3 + 15*x^2 - 18*x + 9)
 

Mupad [B] (verification not implemented)

Time = 3.98 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.47 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=x\,{\mathrm {e}}^x-2\,x-x^2-\frac {24\,x^3-80\,x^2+144\,x-72}{x^4-6\,x^3+15\,x^2-18\,x+9} \] Input:

int(-(132*x - exp(x)*(27*x^2 - 54*x + 27*x^3 - 45*x^4 + 27*x^5 - 8*x^6 + x 
^7 + 27) - 162*x^2 + 142*x^3 - 114*x^4 + 54*x^5 - 16*x^6 + 2*x^7 + 54)/(10 
8*x^2 - 81*x - 81*x^3 + 36*x^4 - 9*x^5 + x^6 + 27),x)
 

Output:

x*exp(x) - 2*x - x^2 - (144*x - 80*x^2 + 24*x^3 - 72)/(15*x^2 - 18*x - 6*x 
^3 + x^4 + 9)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 83, normalized size of antiderivative = 2.44 \[ \int \frac {-54-132 x+162 x^2-142 x^3+114 x^4-54 x^5+16 x^6-2 x^7+e^x \left (27-54 x+27 x^2+27 x^3-45 x^4+27 x^5-8 x^6+x^7\right )}{27-81 x+108 x^2-81 x^3+36 x^4-9 x^5+x^6} \, dx=\frac {e^{x} x^{5}-6 e^{x} x^{4}+15 e^{x} x^{3}-18 e^{x} x^{2}+9 e^{x} x -x^{6}+4 x^{5}-9 x^{4}+17 x^{2}-54 x +18}{x^{4}-6 x^{3}+15 x^{2}-18 x +9} \] Input:

int(((x^7-8*x^6+27*x^5-45*x^4+27*x^3+27*x^2-54*x+27)*exp(x)-2*x^7+16*x^6-5 
4*x^5+114*x^4-142*x^3+162*x^2-132*x-54)/(x^6-9*x^5+36*x^4-81*x^3+108*x^2-8 
1*x+27),x)
                                                                                    
                                                                                    
 

Output:

(e**x*x**5 - 6*e**x*x**4 + 15*e**x*x**3 - 18*e**x*x**2 + 9*e**x*x - x**6 + 
 4*x**5 - 9*x**4 + 17*x**2 - 54*x + 18)/(x**4 - 6*x**3 + 15*x**2 - 18*x + 
9)