Optimal. Leaf size=56 \[ -4 x+12 \sin ^{-1}\left (\frac {1-x}{2}\right )-24 \sqrt {3} \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {1+x}}{\sqrt {3-x}}\right )+21 \log (x)-9 \log (1+x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 11, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.407, Rules used = {6874, 36, 29,
31, 132, 55, 633, 222, 12, 95, 213} \begin {gather*} 12 \text {ArcSin}\left (\frac {1-x}{2}\right )-4 x+21 \log (x)-9 \log (x+1)-24 \sqrt {3} \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {x+1}}{\sqrt {3-x}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 29
Rule 31
Rule 36
Rule 55
Rule 95
Rule 132
Rule 213
Rule 222
Rule 633
Rule 6874
Rubi steps
\begin {align*} \int \frac {\left (2 \sqrt {3-x}+\frac {3}{\sqrt {1+x}}\right )^2}{x} \, dx &=\int \left (-4+\frac {12}{x}+\frac {9}{x (1+x)}+\frac {12 \sqrt {3-x}}{x \sqrt {1+x}}\right ) \, dx\\ &=-4 x+12 \log (x)+9 \int \frac {1}{x (1+x)} \, dx+12 \int \frac {\sqrt {3-x}}{x \sqrt {1+x}} \, dx\\ &=-4 x+12 \log (x)+9 \int \frac {1}{x} \, dx-9 \int \frac {1}{1+x} \, dx-12 \int \frac {1}{\sqrt {3-x} \sqrt {1+x}} \, dx+36 \int \frac {1}{\sqrt {3-x} x \sqrt {1+x}} \, dx\\ &=-4 x+21 \log (x)-9 \log (1+x)-12 \int \frac {1}{\sqrt {3+2 x-x^2}} \, dx+72 \text {Subst}\left (\int \frac {1}{-1+3 x^2} \, dx,x,\frac {\sqrt {1+x}}{\sqrt {3-x}}\right )\\ &=-4 x-24 \sqrt {3} \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {1+x}}{\sqrt {3-x}}\right )+21 \log (x)-9 \log (1+x)+3 \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{16}}} \, dx,x,2-2 x\right )\\ &=-4 x+12 \sin ^{-1}\left (\frac {1-x}{2}\right )-24 \sqrt {3} \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {1+x}}{\sqrt {3-x}}\right )+21 \log (x)-9 \log (1+x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(257\) vs. \(2(56)=112\).
time = 0.62, size = 257, normalized size = 4.59 \begin {gather*} -4-4 x-48 \tan ^{-1}\left (\frac {\sqrt {1+x}}{-2+\sqrt {3-x}}\right )-42 \log \left (-2+\sqrt {3-x}\right )-30 \log (1+x)+21 \log \left (-\left ((-3+x) \sqrt {1+x}\right )+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)-2 \sqrt {-((-3+x) (1+x))}\right )-12 \sqrt {3} \log \left (-\left ((-3+x) \sqrt {1+x}\right )+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)-2 \sqrt {-((-3+x) (1+x))}\right )+21 \log \left ((-3+x) \sqrt {1+x}+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)+2 \sqrt {-((-3+x) (1+x))}\right )+12 \sqrt {3} \log \left ((-3+x) \sqrt {1+x}+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)+2 \sqrt {-((-3+x) (1+x))}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.47, size = 76, normalized size = 1.36
method | result | size |
default | \(21 \ln \left (x \right )-9 \ln \left (1+x \right )+\frac {12 \sqrt {-x +3}\, \sqrt {1+x}\, \left (-\arcsin \left (-\frac {1}{2}+\frac {x}{2}\right )-\sqrt {3}\, \arctanh \left (\frac {\left (3+x \right ) \sqrt {3}}{3 \sqrt {-x^{2}+2 x +3}}\right )\right )}{\sqrt {-x^{2}+2 x +3}}-4 x\) | \(76\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 57, normalized size = 1.02 \begin {gather*} -12 \, \sqrt {3} \log \left (\frac {2 \, \sqrt {3} \sqrt {-x^{2} + 2 \, x + 3}}{{\left | x \right |}} + \frac {6}{{\left | x \right |}} + 2\right ) - 4 \, x + 12 \, \arcsin \left (-\frac {1}{2} \, x + \frac {1}{2}\right ) - 9 \, \log \left (x + 1\right ) + 21 \, \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 81, normalized size = 1.45 \begin {gather*} 6 \, \sqrt {3} \log \left (-\frac {\sqrt {3} {\left (x + 3\right )} \sqrt {x + 1} \sqrt {-x + 3} + x^{2} - 6 \, x - 9}{x^{2}}\right ) - 4 \, x + 12 \, \arctan \left (\frac {\sqrt {x + 1} {\left (x - 1\right )} \sqrt {-x + 3}}{x^{2} - 2 \, x - 3}\right ) - 9 \, \log \left (x + 1\right ) + 21 \, \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (2 \sqrt {3 - x} \sqrt {x + 1} + 3\right )^{2}}{x \left (x + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.91, size = 158, normalized size = 2.82 \begin {gather*} 48\,\mathrm {atan}\left (\frac {\sqrt {3-x}-4\,\sqrt {3}+3\,\sqrt {3}\,\sqrt {x+1}}{\sqrt {x+1}-3\,\sqrt {3}\,\sqrt {3-x}+8}\right )-9\,\ln \left (x+1\right )-4\,x+21\,\ln \left (x\right )+12\,\sqrt {3}\,\ln \left (\frac {6\,x-12\,\sqrt {x+1}+4\,\sqrt {3}\,\sqrt {3-x}+2\,\sqrt {3}\,\sqrt {x+1}\,\sqrt {3-x}-6}{3\,x+6\,\sqrt {3}\,\sqrt {3-x}-18}\right )-12\,\sqrt {3}\,\ln \left (\frac {\sqrt {x+1}-1}{\sqrt {3}-\sqrt {3-x}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________