Integrand size = 19, antiderivative size = 62 \[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=\frac {1}{3} \sqrt {3-2 (-1+x)^2-(-1+x)^4} (-1+x)+\frac {2 E\left (\arcsin (1-x)\left |-\frac {1}{3}\right .\right )}{\sqrt {3}}-\frac {4 \operatorname {EllipticF}\left (\arcsin (1-x),-\frac {1}{3}\right )}{\sqrt {3}} \]
[Out]
Time = 0.03 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {1120, 1105, 1194, 538, 435, 430} \[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=-\frac {4 \operatorname {EllipticF}\left (\arcsin (1-x),-\frac {1}{3}\right )}{\sqrt {3}}+\frac {2 E\left (\arcsin (1-x)\left |-\frac {1}{3}\right .\right )}{\sqrt {3}}+\frac {1}{3} \sqrt {-(x-1)^4-2 (x-1)^2+3} (x-1) \]
[In]
[Out]
Rule 430
Rule 435
Rule 538
Rule 1105
Rule 1120
Rule 1194
Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \sqrt {3-2 x^2-x^4} \, dx,x,-1+x\right ) \\ & = \frac {1}{3} \sqrt {3-2 (-1+x)^2-(-1+x)^4} (-1+x)+\frac {1}{3} \text {Subst}\left (\int \frac {6-2 x^2}{\sqrt {3-2 x^2-x^4}} \, dx,x,-1+x\right ) \\ & = \frac {1}{3} \sqrt {3-2 (-1+x)^2-(-1+x)^4} (-1+x)+\frac {2}{3} \text {Subst}\left (\int \frac {6-2 x^2}{\sqrt {2-2 x^2} \sqrt {6+2 x^2}} \, dx,x,-1+x\right ) \\ & = \frac {1}{3} \sqrt {3-2 (-1+x)^2-(-1+x)^4} (-1+x)-\frac {2}{3} \text {Subst}\left (\int \frac {\sqrt {6+2 x^2}}{\sqrt {2-2 x^2}} \, dx,x,-1+x\right )+8 \text {Subst}\left (\int \frac {1}{\sqrt {2-2 x^2} \sqrt {6+2 x^2}} \, dx,x,-1+x\right ) \\ & = \frac {1}{3} \sqrt {3-2 (-1+x)^2-(-1+x)^4} (-1+x)+\frac {2 E\left (\sin ^{-1}(1-x)|-\frac {1}{3}\right )}{\sqrt {3}}-\frac {4 F\left (\sin ^{-1}(1-x)|-\frac {1}{3}\right )}{\sqrt {3}} \\ \end{align*}
Result contains complex when optimal does not.
Time = 18.91 (sec) , antiderivative size = 256, normalized size of antiderivative = 4.13 \[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=\frac {\sqrt {-x \left (-8+8 x-4 x^2+x^3\right )} \left (\sqrt {\frac {4-2 x+x^2}{x^2}} \left (-4+4 x-3 x^2+x^3\right )+2 \sqrt {2} \left (-i+\sqrt {3}\right ) \sqrt {-\frac {i (-2+x)}{\left (-i+\sqrt {3}\right ) x}} E\left (\arcsin \left (\frac {\sqrt {i+\sqrt {3}-\frac {4 i}{x}}}{\sqrt {2} \sqrt [4]{3}}\right )|\frac {2 \sqrt {3}}{-i+\sqrt {3}}\right )+8 i \sqrt {2} \sqrt {-\frac {i (-2+x)}{\left (-i+\sqrt {3}\right ) x}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {i+\sqrt {3}-\frac {4 i}{x}}}{\sqrt {2} \sqrt [4]{3}}\right ),\frac {2 \sqrt {3}}{-i+\sqrt {3}}\right )\right )}{3 (-2+x) x \sqrt {\frac {4-2 x+x^2}{x^2}}} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 931 vs. \(2 (54 ) = 108\).
Time = 1.95 (sec) , antiderivative size = 932, normalized size of antiderivative = 15.03
method | result | size |
risch | \(-\frac {\left (x -1\right ) x \left (x -2\right ) \left (x^{2}-2 x +4\right )}{3 \sqrt {-x \left (x -2\right ) \left (x^{2}-2 x +4\right )}}+\frac {8 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{3 \left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}-\frac {2 \left (x \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )+2 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (\frac {\left (6+2 i \sqrt {3}\right ) F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{-2+2 i \sqrt {3}}+\frac {\left (-1+i \sqrt {3}\right ) E\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{2}-\frac {4 \Pi \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \frac {-1-i \sqrt {3}}{1-i \sqrt {3}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{-1+i \sqrt {3}}\right )\right )}{3 \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}+\frac {8 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (2 F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )-2 \Pi \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \frac {1+i \sqrt {3}}{-1+i \sqrt {3}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )\right )}{3 \left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}\) | \(932\) |
default | \(\frac {x \sqrt {-x^{4}+4 x^{3}-8 x^{2}+8 x}}{3}-\frac {\sqrt {-x^{4}+4 x^{3}-8 x^{2}+8 x}}{3}+\frac {8 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{3 \left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}+\frac {8 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (2 F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )-2 \Pi \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \frac {1+i \sqrt {3}}{-1+i \sqrt {3}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )\right )}{3 \left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}-\frac {2 \left (x \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )+2 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (\frac {\left (6+2 i \sqrt {3}\right ) F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{-2+2 i \sqrt {3}}+\frac {\left (-1+i \sqrt {3}\right ) E\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{2}-\frac {4 \Pi \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \frac {-1-i \sqrt {3}}{1-i \sqrt {3}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{-1+i \sqrt {3}}\right )\right )}{3 \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}\) | \(946\) |
elliptic | \(\frac {x \sqrt {-x^{4}+4 x^{3}-8 x^{2}+8 x}}{3}-\frac {\sqrt {-x^{4}+4 x^{3}-8 x^{2}+8 x}}{3}+\frac {8 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{3 \left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}+\frac {8 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (2 F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )-2 \Pi \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \frac {1+i \sqrt {3}}{-1+i \sqrt {3}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )\right )}{3 \left (-1+i \sqrt {3}\right ) \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}-\frac {2 \left (x \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )+2 \left (-1-i \sqrt {3}\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (x -2\right )^{2} \sqrt {\frac {x -1+i \sqrt {3}}{\left (1-i \sqrt {3}\right ) \left (x -2\right )}}\, \sqrt {\frac {x -1-i \sqrt {3}}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}\, \left (\frac {\left (6+2 i \sqrt {3}\right ) F\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{-2+2 i \sqrt {3}}+\frac {\left (-1+i \sqrt {3}\right ) E\left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{2}-\frac {4 \Pi \left (\sqrt {\frac {\left (-1+i \sqrt {3}\right ) x}{\left (1+i \sqrt {3}\right ) \left (x -2\right )}}, \frac {-1-i \sqrt {3}}{1-i \sqrt {3}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (-1-i \sqrt {3}\right )}{\left (-1+i \sqrt {3}\right ) \left (1-i \sqrt {3}\right )}}\right )}{-1+i \sqrt {3}}\right )\right )}{3 \sqrt {-x \left (x -2\right ) \left (x -1+i \sqrt {3}\right ) \left (x -1-i \sqrt {3}\right )}}\) | \(946\) |
[In]
[Out]
none
Time = 0.10 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.11 \[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=-\frac {2 \, {\left (-i \, x + i\right )} E(\arcsin \left (\frac {1}{x - 1}\right )\,|\,-3) + 4 \, {\left (-i \, x + i\right )} F(\arcsin \left (\frac {1}{x - 1}\right )\,|\,-3) - \sqrt {-x^{4} + 4 \, x^{3} - 8 \, x^{2} + 8 \, x} {\left (x^{2} - 2 \, x + 3\right )}}{3 \, {\left (x - 1\right )}} \]
[In]
[Out]
\[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=\int \sqrt {x \left (2 - x\right ) \left (x^{2} - 2 x + 4\right )}\, dx \]
[In]
[Out]
\[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=\int { \sqrt {-{\left (x^{2} - 2 \, x + 4\right )} {\left (x - 2\right )} x} \,d x } \]
[In]
[Out]
\[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=\int { \sqrt {-{\left (x^{2} - 2 \, x + 4\right )} {\left (x - 2\right )} x} \,d x } \]
[In]
[Out]
Timed out. \[ \int \sqrt {(2-x) x \left (4-2 x+x^2\right )} \, dx=\int \sqrt {-x\,\left (x-2\right )\,\left (x^2-2\,x+4\right )} \,d x \]
[In]
[Out]