Optimal. Leaf size=25 \[ x-4 \sqrt{x}+\frac{4}{\sqrt{x}}-\frac{1}{x}+3 \log (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0184495, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {1357, 698} \[ x-4 \sqrt{x}+\frac{4}{\sqrt{x}}-\frac{1}{x}+3 \log (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1357
Rule 698
Rubi steps
\begin{align*} \int \frac{\left (1-\sqrt{x}+x\right )^2}{x^2} \, dx &=2 \operatorname{Subst}\left (\int \frac{\left (1-x+x^2\right )^2}{x^3} \, dx,x,\sqrt{x}\right )\\ &=2 \operatorname{Subst}\left (\int \left (-2+\frac{1}{x^3}-\frac{2}{x^2}+\frac{3}{x}+x\right ) \, dx,x,\sqrt{x}\right )\\ &=-\frac{1}{x}+\frac{4}{\sqrt{x}}-4 \sqrt{x}+x+3 \log (x)\\ \end{align*}
Mathematica [A] time = 0.0129274, size = 25, normalized size = 1. \[ x-4 \sqrt{x}+\frac{4}{\sqrt{x}}-\frac{1}{x}+3 \log (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.008, size = 22, normalized size = 0.9 \begin{align*} -{x}^{-1}+x+3\,\ln \left ( x \right ) +4\,{\frac{1}{\sqrt{x}}}-4\,\sqrt{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.929867, size = 30, normalized size = 1.2 \begin{align*} x - 4 \, \sqrt{x} + \frac{4 \, \sqrt{x} - 1}{x} + 3 \, \log \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.18741, size = 70, normalized size = 2.8 \begin{align*} \frac{x^{2} + 6 \, x \log \left (\sqrt{x}\right ) - 4 \,{\left (x - 1\right )} \sqrt{x} - 1}{x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.402118, size = 22, normalized size = 0.88 \begin{align*} - 4 \sqrt{x} + x + 3 \log{\left (x \right )} - \frac{1}{x} + \frac{4}{\sqrt{x}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.05138, size = 31, normalized size = 1.24 \begin{align*} x - 4 \, \sqrt{x} + \frac{4 \, \sqrt{x} - 1}{x} + 3 \, \log \left ({\left | x \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]