Integrand size = 58, antiderivative size = 23 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {-3+e^{2+2 x}}{x \left (1-x+x^2\right )} \]
[Out]
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 1.21 (sec) , antiderivative size = 467, normalized size of antiderivative = 20.30, number of steps used = 31, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {6820, 6874, 2208, 2209, 6860, 1604} \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )+\frac {1}{3} \left (1+i \sqrt {3}\right ) e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )+\frac {i e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )}{\sqrt {3}}+\frac {2}{3} e^{3+i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x-i \sqrt {3}-1\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )+\frac {1}{3} \left (1-i \sqrt {3}\right ) e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )-\frac {i e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )}{\sqrt {3}}+\frac {2}{3} e^{3-i \sqrt {3}} \operatorname {ExpIntegralEi}\left (2 x+i \sqrt {3}-1\right )-\frac {3}{x \left (x^2-x+1\right )}+\frac {\left (1-i \sqrt {3}\right ) e^{2 x+2}}{3 \left (-2 x-i \sqrt {3}+1\right )}+\frac {2 e^{2 x+2}}{3 \left (-2 x-i \sqrt {3}+1\right )}+\frac {\left (1+i \sqrt {3}\right ) e^{2 x+2}}{3 \left (-2 x+i \sqrt {3}+1\right )}+\frac {2 e^{2 x+2}}{3 \left (-2 x+i \sqrt {3}+1\right )}+\frac {e^{2 x+2}}{x} \]
[In]
[Out]
Rule 1604
Rule 2208
Rule 2209
Rule 6820
Rule 6860
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \int \frac {3-6 x+9 x^2+e^{2+2 x} (-1+x)^2 (-1+2 x)}{x^2 \left (1-x+x^2\right )^2} \, dx \\ & = \int \left (\frac {e^{2+2 x} (-1+x)^2 (-1+2 x)}{x^2 \left (1-x+x^2\right )^2}+\frac {3 \left (1-2 x+3 x^2\right )}{x^2 \left (1-x+x^2\right )^2}\right ) \, dx \\ & = 3 \int \frac {1-2 x+3 x^2}{x^2 \left (1-x+x^2\right )^2} \, dx+\int \frac {e^{2+2 x} (-1+x)^2 (-1+2 x)}{x^2 \left (1-x+x^2\right )^2} \, dx \\ & = -\frac {3}{x \left (1-x+x^2\right )}+\int \left (-\frac {e^{2+2 x}}{x^2}+\frac {2 e^{2+2 x}}{x}+\frac {e^{2+2 x} (-1-x)}{\left (1-x+x^2\right )^2}+\frac {e^{2+2 x} (3-2 x)}{1-x+x^2}\right ) \, dx \\ & = -\frac {3}{x \left (1-x+x^2\right )}+2 \int \frac {e^{2+2 x}}{x} \, dx-\int \frac {e^{2+2 x}}{x^2} \, dx+\int \frac {e^{2+2 x} (-1-x)}{\left (1-x+x^2\right )^2} \, dx+\int \frac {e^{2+2 x} (3-2 x)}{1-x+x^2} \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}+2 e^2 \text {Ei}(2 x)-2 \int \frac {e^{2+2 x}}{x} \, dx+\int \left (\frac {\left (-2-\frac {4 i}{\sqrt {3}}\right ) e^{2+2 x}}{-1-i \sqrt {3}+2 x}+\frac {\left (-2+\frac {4 i}{\sqrt {3}}\right ) e^{2+2 x}}{-1+i \sqrt {3}+2 x}\right ) \, dx+\int \left (-\frac {e^{2+2 x}}{\left (1-x+x^2\right )^2}-\frac {e^{2+2 x} x}{\left (1-x+x^2\right )^2}\right ) \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}-\frac {1}{3} \left (2 \left (3-2 i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx-\frac {1}{3} \left (2 \left (3+2 i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{-1-i \sqrt {3}+2 x} \, dx-\int \frac {e^{2+2 x}}{\left (1-x+x^2\right )^2} \, dx-\int \frac {e^{2+2 x} x}{\left (1-x+x^2\right )^2} \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\int \left (-\frac {2 \left (1+i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )^2}+\frac {2 i e^{2+2 x}}{3 \sqrt {3} \left (1+i \sqrt {3}-2 x\right )}-\frac {2 \left (1-i \sqrt {3}\right ) e^{2+2 x}}{3 \left (-1+i \sqrt {3}+2 x\right )^2}+\frac {2 i e^{2+2 x}}{3 \sqrt {3} \left (-1+i \sqrt {3}+2 x\right )}\right ) \, dx-\int \left (-\frac {4 e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )^2}+\frac {4 i e^{2+2 x}}{3 \sqrt {3} \left (1+i \sqrt {3}-2 x\right )}-\frac {4 e^{2+2 x}}{3 \left (-1+i \sqrt {3}+2 x\right )^2}+\frac {4 i e^{2+2 x}}{3 \sqrt {3} \left (-1+i \sqrt {3}+2 x\right )}\right ) \, dx \\ & = \frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )+\frac {4}{3} \int \frac {e^{2+2 x}}{\left (1+i \sqrt {3}-2 x\right )^2} \, dx+\frac {4}{3} \int \frac {e^{2+2 x}}{\left (-1+i \sqrt {3}+2 x\right )^2} \, dx-\frac {(2 i) \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx}{3 \sqrt {3}}-\frac {(2 i) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx}{3 \sqrt {3}}-\frac {(4 i) \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx}{3 \sqrt {3}}-\frac {(4 i) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx}{3 \sqrt {3}}+\frac {1}{3} \left (2 \left (1-i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{\left (-1+i \sqrt {3}+2 x\right )^2} \, dx+\frac {1}{3} \left (2 \left (1+i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{\left (1+i \sqrt {3}-2 x\right )^2} \, dx \\ & = \frac {2 e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {\left (1-i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {2 e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {\left (1+i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}+\frac {i e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )}{\sqrt {3}}-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {i e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )}{\sqrt {3}}-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\frac {4}{3} \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx+\frac {4}{3} \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx+\frac {1}{3} \left (2 \left (1-i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{-1+i \sqrt {3}+2 x} \, dx-\frac {1}{3} \left (2 \left (1+i \sqrt {3}\right )\right ) \int \frac {e^{2+2 x}}{1+i \sqrt {3}-2 x} \, dx \\ & = \frac {2 e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {\left (1-i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1-i \sqrt {3}-2 x\right )}+\frac {2 e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {\left (1+i \sqrt {3}\right ) e^{2+2 x}}{3 \left (1+i \sqrt {3}-2 x\right )}+\frac {e^{2+2 x}}{x}-\frac {3}{x \left (1-x+x^2\right )}+\frac {2}{3} e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )+\frac {i e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )}{\sqrt {3}}+\frac {1}{3} \left (1+i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3+2 i \sqrt {3}\right ) e^{3+i \sqrt {3}} \text {Ei}\left (-1-i \sqrt {3}+2 x\right )+\frac {2}{3} e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\frac {i e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )}{\sqrt {3}}+\frac {1}{3} \left (1-i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right )-\frac {1}{3} \left (3-2 i \sqrt {3}\right ) e^{3-i \sqrt {3}} \text {Ei}\left (-1+i \sqrt {3}+2 x\right ) \\ \end{align*}
Time = 1.45 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {-3+e^{2+2 x}}{x \left (1-x+x^2\right )} \]
[In]
[Out]
Time = 0.22 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00
method | result | size |
norman | \(\frac {-3+{\mathrm e}^{2+2 x}}{x \left (x^{2}-x +1\right )}\) | \(23\) |
parallelrisch | \(\frac {-3+{\mathrm e}^{2+2 x}}{x \left (x^{2}-x +1\right )}\) | \(23\) |
risch | \(-\frac {3}{x \left (x^{2}-x +1\right )}+\frac {{\mathrm e}^{2+2 x}}{x \left (x^{2}-x +1\right )}\) | \(37\) |
parts | \(\frac {4 \,{\mathrm e}^{2+2 x} \left (4 \left (1+x \right )^{2}-1-13 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}-\frac {20 \,{\mathrm e}^{2+2 x} \left (\left (1+x \right )^{2}-4 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}-\frac {11 \,{\mathrm e}^{2+2 x} \left (-1+2 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}+\frac {2 \,{\mathrm e}^{2+2 x} \left (1+x \right ) \left (-1+2 x \right )}{\left (\left (1+x \right )^{2}-3 x \right ) x}-\frac {3}{x}-\frac {3 \left (1-x \right )}{x^{2}-x +1}\) | \(146\) |
derivativedivides | \(-\frac {3}{x}-\frac {18 \left (-\frac {2}{3}+\frac {x}{3}\right )}{\left (1+x \right )^{2}-3 x}-\frac {24}{\left (1+x \right )^{2}-3 x}+\frac {9 x +9}{\left (1+x \right )^{2}-3 x}+\frac {4 \,{\mathrm e}^{2+2 x} \left (4 \left (1+x \right )^{2}-1-13 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {20 \,{\mathrm e}^{2+2 x} \left (\left (1+x \right )^{2}-4 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {11 \,{\mathrm e}^{2+2 x} \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}+\frac {2 \,{\mathrm e}^{2+2 x} \left (1+x \right ) \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}\) | \(196\) |
default | \(-\frac {3}{x}-\frac {18 \left (-\frac {2}{3}+\frac {x}{3}\right )}{\left (1+x \right )^{2}-3 x}-\frac {24}{\left (1+x \right )^{2}-3 x}+\frac {9 x +9}{\left (1+x \right )^{2}-3 x}+\frac {4 \,{\mathrm e}^{2+2 x} \left (4 \left (1+x \right )^{2}-1-13 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {20 \,{\mathrm e}^{2+2 x} \left (\left (1+x \right )^{2}-4 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}-\frac {11 \,{\mathrm e}^{2+2 x} \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}+\frac {2 \,{\mathrm e}^{2+2 x} \left (1+x \right ) \left (-1+2 x \right )}{\left (1+x \right )^{3}-4 \left (1+x \right )^{2}+3+6 x}\) | \(196\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {e^{\left (2 \, x + 2\right )} - 3}{x^{3} - x^{2} + x} \]
[In]
[Out]
Time = 0.08 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.04 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {e^{2 x + 2}}{x^{3} - x^{2} + x} - \frac {3}{x^{3} - x^{2} + x} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (22) = 44\).
Time = 0.32 (sec) , antiderivative size = 76, normalized size of antiderivative = 3.30 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=-\frac {4 \, x^{2} - 5 \, x + 3}{x^{3} - x^{2} + x} + \frac {3 \, {\left (2 \, x - 1\right )}}{x^{2} - x + 1} - \frac {2 \, {\left (x + 1\right )}}{x^{2} - x + 1} + \frac {e^{\left (2 \, x + 2\right )}}{x^{3} - x^{2} + x} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.91 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {e^{\left (2 \, x + 2\right )} - 3}{x^{3} - x^{2} + x} \]
[In]
[Out]
Time = 0.16 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.96 \[ \int \frac {3-6 x+9 x^2+e^{2+2 x} \left (-1+4 x-5 x^2+2 x^3\right )}{x^2-2 x^3+3 x^4-2 x^5+x^6} \, dx=\frac {{\mathrm {e}}^{2\,x+2}-3}{x\,\left (x^2-x+1\right )} \]
[In]
[Out]