Optimal. Leaf size=363 \[ \frac {\sqrt {\frac {\sqrt {a x-b}+a x}{\left (\sqrt {a x-b}+1\right )^2}} (2 a x-2 b-3)}{2 a}-\frac {\sqrt {a x-b} \sqrt {\frac {\sqrt {a x-b}+a x}{\left (\sqrt {a x-b}+1\right )^2}}}{2 a}+\frac {2 \sqrt {b} \log \left (\sqrt {a x-b}+1\right )}{a}-\frac {2 \sqrt {b} \log \left (2 \sqrt {b} \sqrt {\frac {\sqrt {a x-b}+a x}{\left (\sqrt {a x-b}+1\right )^2}}+\sqrt {a x-b} \left (2 \sqrt {b} \sqrt {\frac {\sqrt {a x-b}+a x}{\left (\sqrt {a x-b}+1\right )^2}}+1\right )-2 b+1\right )}{a}+\frac {(-4 b-3) \tanh ^{-1}\left (\frac {-\sqrt {a x-b} \sqrt {\frac {\sqrt {a x-b}+a x}{\left (\sqrt {a x-b}+1\right )^2}}-\sqrt {\frac {\sqrt {a x-b}+a x}{\left (\sqrt {a x-b}+1\right )^2}}+\sqrt {b}}{\sqrt {a x-b}+1}\right )}{2 a} \]
________________________________________________________________________________________
Rubi [A] time = 0.30, antiderivative size = 148, normalized size of antiderivative = 0.41, number of steps used = 7, number of rules used = 5, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {814, 843, 621, 206, 724} \begin {gather*} -\frac {\sqrt {\sqrt {a x-b}+a x} \left (3-2 \sqrt {a x-b}\right )}{2 a}-\frac {2 \sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {a x-b}-2 b+1}{2 \sqrt {b} \sqrt {\sqrt {a x-b}+a x}}\right )}{a}+\frac {(4 b+3) \tanh ^{-1}\left (\frac {2 \sqrt {a x-b}+1}{2 \sqrt {\sqrt {a x-b}+a x}}\right )}{4 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 621
Rule 724
Rule 814
Rule 843
Rubi steps
\begin {align*} \int \frac {\sqrt {a x+\sqrt {-b+a x}}}{1+\sqrt {-b+a x}} \, dx &=\frac {2 \operatorname {Subst}\left (\int \frac {x \sqrt {b+x+x^2}}{1+x} \, dx,x,\sqrt {-b+a x}\right )}{a}\\ &=-\frac {\left (3-2 \sqrt {-b+a x}\right ) \sqrt {a x+\sqrt {-b+a x}}}{2 a}-\frac {\operatorname {Subst}\left (\int \frac {\frac {1}{2} (-3+4 b)-\frac {1}{2} (3+4 b) x}{(1+x) \sqrt {b+x+x^2}} \, dx,x,\sqrt {-b+a x}\right )}{2 a}\\ &=-\frac {\left (3-2 \sqrt {-b+a x}\right ) \sqrt {a x+\sqrt {-b+a x}}}{2 a}-\frac {(2 b) \operatorname {Subst}\left (\int \frac {1}{(1+x) \sqrt {b+x+x^2}} \, dx,x,\sqrt {-b+a x}\right )}{a}+\frac {(3+4 b) \operatorname {Subst}\left (\int \frac {1}{\sqrt {b+x+x^2}} \, dx,x,\sqrt {-b+a x}\right )}{4 a}\\ &=-\frac {\left (3-2 \sqrt {-b+a x}\right ) \sqrt {a x+\sqrt {-b+a x}}}{2 a}+\frac {(4 b) \operatorname {Subst}\left (\int \frac {1}{4 b-x^2} \, dx,x,\frac {-1+2 b-\sqrt {-b+a x}}{\sqrt {a x+\sqrt {-b+a x}}}\right )}{a}+\frac {(3+4 b) \operatorname {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {1+2 \sqrt {-b+a x}}{\sqrt {a x+\sqrt {-b+a x}}}\right )}{2 a}\\ &=-\frac {\left (3-2 \sqrt {-b+a x}\right ) \sqrt {a x+\sqrt {-b+a x}}}{2 a}-\frac {2 \sqrt {b} \tanh ^{-1}\left (\frac {1-2 b+\sqrt {-b+a x}}{2 \sqrt {b} \sqrt {a x+\sqrt {-b+a x}}}\right )}{a}+\frac {(3+4 b) \tanh ^{-1}\left (\frac {1+2 \sqrt {-b+a x}}{2 \sqrt {a x+\sqrt {-b+a x}}}\right )}{4 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.19, size = 143, normalized size = 0.39 \begin {gather*} \frac {2 \sqrt {\sqrt {a x-b}+a x} \left (2 \sqrt {a x-b}-3\right )+8 \sqrt {b} \tanh ^{-1}\left (\frac {-\sqrt {a x-b}+2 b-1}{2 \sqrt {b} \sqrt {\sqrt {a x-b}+a x}}\right )+(4 b+3) \tanh ^{-1}\left (\frac {2 \sqrt {a x-b}+1}{2 \sqrt {\sqrt {a x-b}+a x}}\right )}{4 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.40, size = 155, normalized size = 0.43 \begin {gather*} \frac {\sqrt {\sqrt {a x-b}+a x} \left (2 \sqrt {a x-b}-3\right )}{2 a}+\frac {(-4 b-3) \log \left (a \left (-2 \sqrt {a x-b}-1\right )+2 a \sqrt {\sqrt {a x-b}+a x}\right )}{4 a}-\frac {4 \sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {a x-b}}{\sqrt {b}}-\frac {\sqrt {\sqrt {a x-b}+a x}}{\sqrt {b}}+\frac {1}{\sqrt {b}}\right )}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 6.04, size = 127, normalized size = 0.35 \begin {gather*} \frac {1}{2} \, \sqrt {a x + \sqrt {a x - b}} {\left (\frac {2 \, \sqrt {a x - b}}{a} - \frac {3}{a}\right )} - \frac {{\left (4 \, b + 3\right )} \log \left ({\left | -2 \, \sqrt {a x - b} + 2 \, \sqrt {a x + \sqrt {a x - b}} - 1 \right |}\right )}{4 \, a} - \frac {4 \, b \arctan \left (-\frac {\sqrt {a x - b} - \sqrt {a x + \sqrt {a x - b}} + 1}{\sqrt {-b}}\right )}{a \sqrt {-b}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 266, normalized size = 0.73 \begin {gather*} \frac {\sqrt {a x -b}\, \sqrt {a x +\sqrt {a x -b}}}{a}+\frac {\sqrt {a x +\sqrt {a x -b}}}{2 a}+\frac {\ln \left (\frac {1}{2}+\sqrt {a x -b}+\sqrt {a x +\sqrt {a x -b}}\right ) b}{a}-\frac {\ln \left (\frac {1}{2}+\sqrt {a x -b}+\sqrt {a x +\sqrt {a x -b}}\right )}{4 a}-\frac {2 \sqrt {\left (1+\sqrt {a x -b}\right )^{2}-\sqrt {a x -b}-1+b}}{a}+\frac {\ln \left (\sqrt {a x -b}+\frac {1}{2}+\sqrt {\left (1+\sqrt {a x -b}\right )^{2}-\sqrt {a x -b}-1+b}\right )}{a}+\frac {2 \sqrt {b}\, \ln \left (\frac {2 b -\sqrt {a x -b}-1+2 \sqrt {b}\, \sqrt {\left (1+\sqrt {a x -b}\right )^{2}-\sqrt {a x -b}-1+b}}{1+\sqrt {a x -b}}\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {a x + \sqrt {a x - b}}}{\sqrt {a x - b} + 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {\sqrt {a\,x+\sqrt {a\,x-b}}}{\sqrt {a\,x-b}+1} \,d x \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 {\sqrt {a x + \sqrt {a x - b}}}{\sqrt {a x - b} + 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________