Optimal. Leaf size=130 \[ \frac {\left (1+2 a+2 a^2\right ) \sqrt {1-a-b x} \sqrt {1+a+b x}}{2 b^3}+\frac {(1+4 a) (1-a-b x)^{3/2} \sqrt {1+a+b x}}{6 b^3}-\frac {x (1-a-b x)^{3/2} \sqrt {1+a+b x}}{3 b^2}+\frac {\left (1+2 a+2 a^2\right ) \text {ArcSin}(a+b x)}{2 b^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {6298, 92, 81,
52, 55, 633, 222} \begin {gather*} \frac {\left (2 a^2+2 a+1\right ) \text {ArcSin}(a+b x)}{2 b^3}+\frac {\left (2 a^2+2 a+1\right ) \sqrt {a+b x+1} \sqrt {-a-b x+1}}{2 b^3}+\frac {(4 a+1) \sqrt {a+b x+1} (-a-b x+1)^{3/2}}{6 b^3}-\frac {x \sqrt {a+b x+1} (-a-b x+1)^{3/2}}{3 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 52
Rule 55
Rule 81
Rule 92
Rule 222
Rule 633
Rule 6298
Rubi steps
\begin {align*} \int e^{-\tanh ^{-1}(a+b x)} x^2 \, dx &=\int \frac {x^2 \sqrt {1-a-b x}}{\sqrt {1+a+b x}} \, dx\\ &=-\frac {x (1-a-b x)^{3/2} \sqrt {1+a+b x}}{3 b^2}-\frac {\int \frac {\sqrt {1-a-b x} \left (-1+a^2+(1+4 a) b x\right )}{\sqrt {1+a+b x}} \, dx}{3 b^2}\\ &=\frac {(1+4 a) (1-a-b x)^{3/2} \sqrt {1+a+b x}}{6 b^3}-\frac {x (1-a-b x)^{3/2} \sqrt {1+a+b x}}{3 b^2}+\frac {\left (1+2 a+2 a^2\right ) \int \frac {\sqrt {1-a-b x}}{\sqrt {1+a+b x}} \, dx}{2 b^2}\\ &=\frac {\left (1+2 a+2 a^2\right ) \sqrt {1-a-b x} \sqrt {1+a+b x}}{2 b^3}+\frac {(1+4 a) (1-a-b x)^{3/2} \sqrt {1+a+b x}}{6 b^3}-\frac {x (1-a-b x)^{3/2} \sqrt {1+a+b x}}{3 b^2}+\frac {\left (1+2 a+2 a^2\right ) \int \frac {1}{\sqrt {1-a-b x} \sqrt {1+a+b x}} \, dx}{2 b^2}\\ &=\frac {\left (1+2 a+2 a^2\right ) \sqrt {1-a-b x} \sqrt {1+a+b x}}{2 b^3}+\frac {(1+4 a) (1-a-b x)^{3/2} \sqrt {1+a+b x}}{6 b^3}-\frac {x (1-a-b x)^{3/2} \sqrt {1+a+b x}}{3 b^2}+\frac {\left (1+2 a+2 a^2\right ) \int \frac {1}{\sqrt {(1-a) (1+a)-2 a b x-b^2 x^2}} \, dx}{2 b^2}\\ &=\frac {\left (1+2 a+2 a^2\right ) \sqrt {1-a-b x} \sqrt {1+a+b x}}{2 b^3}+\frac {(1+4 a) (1-a-b x)^{3/2} \sqrt {1+a+b x}}{6 b^3}-\frac {x (1-a-b x)^{3/2} \sqrt {1+a+b x}}{3 b^2}-\frac {\left (1+2 a+2 a^2\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{4 b^2}}} \, dx,x,-2 a b-2 b^2 x\right )}{4 b^4}\\ &=\frac {\left (1+2 a+2 a^2\right ) \sqrt {1-a-b x} \sqrt {1+a+b x}}{2 b^3}+\frac {(1+4 a) (1-a-b x)^{3/2} \sqrt {1+a+b x}}{6 b^3}-\frac {x (1-a-b x)^{3/2} \sqrt {1+a+b x}}{3 b^2}+\frac {\left (1+2 a+2 a^2\right ) \sin ^{-1}(a+b x)}{2 b^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 126, normalized size = 0.97 \begin {gather*} -\frac {\sqrt {1+a+b x} \left (-4+7 a^2+2 a^3+7 b x-5 b^2 x^2+2 b^3 x^3+a (-5+8 b x)\right )}{6 b^3 \sqrt {1-a-b x}}+\frac {\left (1+2 a+2 a^2\right ) \sqrt {-b} \sinh ^{-1}\left (\frac {\sqrt {-b} \sqrt {1-a-b x}}{\sqrt {2} \sqrt {b}}\right )}{b^{7/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(466\) vs.
\(2(110)=220\).
time = 0.07, size = 467, normalized size = 3.59
method | result | size |
risch | \(-\frac {\left (2 b^{2} x^{2}-2 a b x +2 a^{2}-3 b x +9 a +4\right ) \left (b^{2} x^{2}+2 a b x +a^{2}-1\right )}{6 b^{3} \sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}+\frac {\arctan \left (\frac {\sqrt {b^{2}}\, \left (x +\frac {a}{b}\right )}{\sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}\right ) a^{2}}{b^{2} \sqrt {b^{2}}}+\frac {\arctan \left (\frac {\sqrt {b^{2}}\, \left (x +\frac {a}{b}\right )}{\sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}\right ) a}{b^{2} \sqrt {b^{2}}}+\frac {\arctan \left (\frac {\sqrt {b^{2}}\, \left (x +\frac {a}{b}\right )}{\sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}\right )}{2 b^{2} \sqrt {b^{2}}}\) | \(213\) |
default | \(-\frac {-b \left (-\frac {\left (-b^{2} x^{2}-2 a b x -a^{2}+1\right )^{\frac {3}{2}}}{3 b^{2}}-\frac {a \left (-\frac {\left (-2 b^{2} x -2 b a \right ) \sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}{4 b^{2}}-\frac {\left (-4 b^{2} \left (-a^{2}+1\right )-4 b^{2} a^{2}\right ) \arctan \left (\frac {\sqrt {b^{2}}\, \left (x +\frac {a}{b}\right )}{\sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}\right )}{8 b^{2} \sqrt {b^{2}}}\right )}{b}\right )+a \left (-\frac {\left (-2 b^{2} x -2 b a \right ) \sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}{4 b^{2}}-\frac {\left (-4 b^{2} \left (-a^{2}+1\right )-4 b^{2} a^{2}\right ) \arctan \left (\frac {\sqrt {b^{2}}\, \left (x +\frac {a}{b}\right )}{\sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}\right )}{8 b^{2} \sqrt {b^{2}}}\right )-\frac {\left (-2 b^{2} x -2 b a \right ) \sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}{4 b^{2}}-\frac {\left (-4 b^{2} \left (-a^{2}+1\right )-4 b^{2} a^{2}\right ) \arctan \left (\frac {\sqrt {b^{2}}\, \left (x +\frac {a}{b}\right )}{\sqrt {-b^{2} x^{2}-2 a b x -a^{2}+1}}\right )}{8 b^{2} \sqrt {b^{2}}}}{b^{2}}+\frac {\left (a^{2}+2 a +1\right ) \left (\sqrt {-b^{2} \left (x +\frac {1+a}{b}\right )^{2}+2 b \left (x +\frac {1+a}{b}\right )}+\frac {b \arctan \left (\frac {\sqrt {b^{2}}\, \left (x +\frac {1+a}{b}-\frac {1}{b}\right )}{\sqrt {-b^{2} \left (x +\frac {1+a}{b}\right )^{2}+2 b \left (x +\frac {1+a}{b}\right )}}\right )}{\sqrt {b^{2}}}\right )}{b^{3}}\) | \(467\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.46, size = 174, normalized size = 1.34 \begin {gather*} -\frac {\sqrt {-b^{2} x^{2} - 2 \, a b x - a^{2} + 1} a x}{b^{2}} + \frac {a^{2} \arcsin \left (b x + a\right )}{b^{3}} - \frac {\sqrt {-b^{2} x^{2} - 2 \, a b x - a^{2} + 1} x}{2 \, b^{2}} + \frac {a \arcsin \left (b x + a\right )}{b^{3}} - \frac {{\left (-b^{2} x^{2} - 2 \, a b x - a^{2} + 1\right )}^{\frac {3}{2}}}{3 \, b^{3}} + \frac {3 \, \sqrt {-b^{2} x^{2} - 2 \, a b x - a^{2} + 1} a}{2 \, b^{3}} + \frac {\arcsin \left (b x + a\right )}{2 \, b^{3}} + \frac {\sqrt {-b^{2} x^{2} - 2 \, a b x - a^{2} + 1}}{b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 117, normalized size = 0.90 \begin {gather*} -\frac {3 \, {\left (2 \, a^{2} + 2 \, a + 1\right )} \arctan \left (\frac {\sqrt {-b^{2} x^{2} - 2 \, a b x - a^{2} + 1} {\left (b x + a\right )}}{b^{2} x^{2} + 2 \, a b x + a^{2} - 1}\right ) - {\left (2 \, b^{2} x^{2} - {\left (2 \, a + 3\right )} b x + 2 \, a^{2} + 9 \, a + 4\right )} \sqrt {-b^{2} x^{2} - 2 \, a b x - a^{2} + 1}}{6 \, b^{3}} \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 {x^{2} \sqrt {- \left (a + b x - 1\right ) \left (a + b x + 1\right )}}{a + b x + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 106, normalized size = 0.82 \begin {gather*} \frac {1}{6} \, \sqrt {-b^{2} x^{2} - 2 \, a b x - a^{2} + 1} {\left (x {\left (\frac {2 \, x}{b} - \frac {2 \, a b^{3} + 3 \, b^{3}}{b^{5}}\right )} + \frac {2 \, a^{2} b^{2} + 9 \, a b^{2} + 4 \, b^{2}}{b^{5}}\right )} - \frac {{\left (2 \, a^{2} + 2 \, a + 1\right )} \arcsin \left (-b x - a\right ) \mathrm {sgn}\left (b\right )}{2 \, b^{2} {\left | b \right |}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^2\,\sqrt {1-{\left (a+b\,x\right )}^2}}{a+b\,x+1} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________