Optimal. Leaf size=103 \[ -\frac {\sqrt {a+b x}}{(b-c) x}+\frac {\sqrt {a+c x}}{(b-c) x}-\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a} (b-c)}+\frac {c \tanh ^{-1}\left (\frac {\sqrt {a+c x}}{\sqrt {a}}\right )}{\sqrt {a} (b-c)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {2128, 43, 65,
214} \begin {gather*} -\frac {\sqrt {a+b x}}{x (b-c)}+\frac {\sqrt {a+c x}}{x (b-c)}-\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a} (b-c)}+\frac {c \tanh ^{-1}\left (\frac {\sqrt {a+c x}}{\sqrt {a}}\right )}{\sqrt {a} (b-c)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 43
Rule 65
Rule 214
Rule 2128
Rubi steps
\begin {align*} \int \frac {1}{x \left (\sqrt {a+b x}+\sqrt {a+c x}\right )} \, dx &=\frac {\int \frac {\sqrt {a+b x}}{x^2} \, dx}{b-c}-\frac {\int \frac {\sqrt {a+c x}}{x^2} \, dx}{b-c}\\ &=-\frac {\sqrt {a+b x}}{(b-c) x}+\frac {\sqrt {a+c x}}{(b-c) x}+\frac {b \int \frac {1}{x \sqrt {a+b x}} \, dx}{2 (b-c)}-\frac {c \int \frac {1}{x \sqrt {a+c x}} \, dx}{2 (b-c)}\\ &=-\frac {\sqrt {a+b x}}{(b-c) x}+\frac {\sqrt {a+c x}}{(b-c) x}+\frac {\text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b x}\right )}{b-c}-\frac {\text {Subst}\left (\int \frac {1}{-\frac {a}{c}+\frac {x^2}{c}} \, dx,x,\sqrt {a+c x}\right )}{b-c}\\ &=-\frac {\sqrt {a+b x}}{(b-c) x}+\frac {\sqrt {a+c x}}{(b-c) x}-\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a} (b-c)}+\frac {c \tanh ^{-1}\left (\frac {\sqrt {a+c x}}{\sqrt {a}}\right )}{\sqrt {a} (b-c)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 10.15, size = 81, normalized size = 0.79 \begin {gather*} \frac {-\sqrt {a+b x}+\sqrt {a+c x}-\frac {b x \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}}+\frac {c x \tanh ^{-1}\left (\frac {\sqrt {a+c x}}{\sqrt {a}}\right )}{\sqrt {a}}}{b x-c x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.01, size = 88, normalized size = 0.85
method | result | size |
default | \(\frac {2 b \left (-\frac {\sqrt {b x +a}}{2 x b}-\frac {\arctanh \left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )}{2 \sqrt {a}}\right )}{b -c}-\frac {2 c \left (-\frac {\sqrt {c x +a}}{2 x c}-\frac {\arctanh \left (\frac {\sqrt {c x +a}}{\sqrt {a}}\right )}{2 \sqrt {a}}\right )}{b -c}\) | \(88\) |
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*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 182, normalized size = 1.77 \begin {gather*} \left [-\frac {\sqrt {a} b x \log \left (\frac {b x + 2 \, \sqrt {b x + a} \sqrt {a} + 2 \, a}{x}\right ) + \sqrt {a} c x \log \left (\frac {c x - 2 \, \sqrt {c x + a} \sqrt {a} + 2 \, a}{x}\right ) + 2 \, \sqrt {b x + a} a - 2 \, \sqrt {c x + a} a}{2 \, {\left (a b - a c\right )} x}, \frac {\sqrt {-a} b x \arctan \left (\frac {\sqrt {b x + a} \sqrt {-a}}{a}\right ) - \sqrt {-a} c x \arctan \left (\frac {\sqrt {c x + a} \sqrt {-a}}{a}\right ) - \sqrt {b x + a} a + \sqrt {c x + a} a}{{\left (a b - a c\right )} 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 {1}{x \left (\sqrt {a + b x} + \sqrt {a + c x}\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1402 vs.
\(2 (87) = 174\).
time = 7.40, size = 1402, normalized size = 13.61 \begin {gather*} \frac {b \arctan \left (\frac {\sqrt {b x + a}}{\sqrt {-a}}\right )}{\sqrt {-a} {\left (b - c\right )}} - \frac {2 \, {\left ({\left (\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}\right )} a b^{2} c {\left | b \right |} - {\left (\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}\right )} a b c^{2} {\left | b \right |} + {\left (\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}\right )}^{3} c {\left | b \right |}\right )}}{{\left (a^{2} b^{4} - 2 \, a^{2} b^{3} c + a^{2} b^{2} c^{2} - 2 \, {\left (\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}\right )}^{2} a b^{2} - 2 \, {\left (\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}\right )}^{2} a b c + {\left (\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}\right )}^{4}\right )} {\left (b - c\right )}} - \frac {\sqrt {b x + a}}{{\left (b - c\right )} x} + \frac {{\left (2 \, {\left (a b^{3} c^{2} - a b^{2} c^{3}\right )} {\left (a b^{2} - a b c\right )}^{2} \sqrt {-a} {\left | b \right |} \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + 2 \, {\left (a b^{3} c - a b^{2} c^{2}\right )} {\left (a b^{2} - a b c\right )}^{2} \sqrt {-a b c} {\left | b \right |} + {\left (a^{2} b^{5} c - 3 \, a^{2} b^{4} c^{2} + 3 \, a^{2} b^{3} c^{3} - a^{2} b^{2} c^{4}\right )} \sqrt {-a b c} {\left | -a b^{2} + a b c \right |} {\left | b \right |} \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + {\left (a^{2} b^{6} c - 3 \, a^{2} b^{5} c^{2} + 3 \, a^{2} b^{4} c^{3} - a^{2} b^{3} c^{4}\right )} \sqrt {-a} {\left | -a b^{2} + a b c \right |} {\left | b \right |} + {\left (a^{3} b^{7} c^{2} - 2 \, a^{3} b^{6} c^{3} + 2 \, a^{3} b^{4} c^{5} - a^{3} b^{3} c^{6}\right )} \sqrt {-a} {\left | b \right |} \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + {\left (a^{3} b^{7} c - 2 \, a^{3} b^{6} c^{2} + 2 \, a^{3} b^{4} c^{4} - a^{3} b^{3} c^{5}\right )} \sqrt {-a b c} {\left | b \right |}\right )} \arctan \left (-\frac {\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}}{\sqrt {-\frac {a b^{3} - a b c^{2} + \sqrt {{\left (a b^{3} - a b c^{2}\right )}^{2} - {\left (a^{2} b^{5} - 3 \, a^{2} b^{4} c + 3 \, a^{2} b^{3} c^{2} - a^{2} b^{2} c^{3}\right )} {\left (b - c\right )}}}{b - c}}}\right )}{{\left (b^{8} - 5 \, b^{7} c + 10 \, b^{6} c^{2} - 10 \, b^{5} c^{3} + 5 \, b^{4} c^{4} - b^{3} c^{5}\right )} a^{3} {\left | -a b^{2} + a b c \right |}} - \frac {{\left (2 \, {\left (a b^{3} c^{2} - a b^{2} c^{3}\right )} {\left (a b^{2} - a b c\right )}^{2} \sqrt {-a} {\left | b \right |} \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + 2 \, {\left (a b^{3} c - a b^{2} c^{2}\right )} {\left (a b^{2} - a b c\right )}^{2} \sqrt {-a b c} {\left | b \right |} + {\left (a^{2} b^{5} c - 3 \, a^{2} b^{4} c^{2} + 3 \, a^{2} b^{3} c^{3} - a^{2} b^{2} c^{4}\right )} \sqrt {-a b c} {\left | -a b^{2} + a b c \right |} {\left | b \right |} \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + {\left (a^{2} b^{6} c - 3 \, a^{2} b^{5} c^{2} + 3 \, a^{2} b^{4} c^{3} - a^{2} b^{3} c^{4}\right )} \sqrt {-a} {\left | -a b^{2} + a b c \right |} {\left | b \right |} + {\left (a^{3} b^{7} c^{2} - 2 \, a^{3} b^{6} c^{3} + 2 \, a^{3} b^{4} c^{5} - a^{3} b^{3} c^{6}\right )} \sqrt {-a} {\left | b \right |} \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + {\left (a^{3} b^{7} c - 2 \, a^{3} b^{6} c^{2} + 2 \, a^{3} b^{4} c^{4} - a^{3} b^{3} c^{5}\right )} \sqrt {-a b c} {\left | b \right |}\right )} \arctan \left (-\frac {\sqrt {b c} \sqrt {b x + a} - \sqrt {a b^{2} + {\left (b x + a\right )} b c - a b c}}{\sqrt {-\frac {a b^{3} - a b c^{2} - \sqrt {{\left (a b^{3} - a b c^{2}\right )}^{2} - {\left (a^{2} b^{5} - 3 \, a^{2} b^{4} c + 3 \, a^{2} b^{3} c^{2} - a^{2} b^{2} c^{3}\right )} {\left (b - c\right )}}}{b - c}}}\right )}{{\left (b^{8} - 5 \, b^{7} c + 10 \, b^{6} c^{2} - 10 \, b^{5} c^{3} + 5 \, b^{4} c^{4} - b^{3} c^{5}\right )} a^{3} {\left | -a b^{2} + a b c \right |}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.93, size = 1637, normalized size = 15.89 \begin {gather*} \frac {2\,a\,b-2\,a\,c+a\,c\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )-2\,\sqrt {a}\,b\,\sqrt {a+c\,x}+2\,\sqrt {a}\,c\,\sqrt {a+b\,x}+a\,b\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )+b\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )\,\sqrt {a+b\,x}\,\sqrt {a+c\,x}+c\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )\,\sqrt {a+b\,x}\,\sqrt {a+c\,x}-\sqrt {a}\,b\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )\,\sqrt {a+b\,x}-\sqrt {a}\,b\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )\,\sqrt {a+c\,x}-\sqrt {a}\,c\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )\,\sqrt {a+b\,x}-\sqrt {a}\,c\,\ln \left (\frac {\sqrt {a+b\,x}-\sqrt {a}}{\sqrt {a+c\,x}-\sqrt {a}}\right )\,\sqrt {a+c\,x}+a\,b\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,2{}\mathrm {i}-a\,c\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,2{}\mathrm {i}+b\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,\sqrt {a+b\,x}\,\sqrt {a+c\,x}\,2{}\mathrm {i}-c\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,\sqrt {a+b\,x}\,\sqrt {a+c\,x}\,2{}\mathrm {i}-\sqrt {a}\,b\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,\sqrt {a+b\,x}\,2{}\mathrm {i}-\sqrt {a}\,b\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,\sqrt {a+c\,x}\,2{}\mathrm {i}+\sqrt {a}\,c\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,\sqrt {a+b\,x}\,2{}\mathrm {i}+\sqrt {a}\,c\,\mathrm {atan}\left (\frac {b^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-b^3\,\sqrt {a+c\,x}\,1{}\mathrm {i}+c^3\,\sqrt {a+b\,x}\,1{}\mathrm {i}-\sqrt {a}\,c^3\,1{}\mathrm {i}+\sqrt {a}\,b\,c^2\,1{}\mathrm {i}-b\,c^2\,\sqrt {a+c\,x}\,1{}\mathrm {i}}{b^3\,\sqrt {a+b\,x}-b^3\,\sqrt {a+c\,x}-c^3\,\sqrt {a+b\,x}+\sqrt {a}\,c^3-\sqrt {a}\,b\,c^2+b\,c^2\,\sqrt {a+c\,x}}\right )\,\sqrt {a+c\,x}\,2{}\mathrm {i}}{2\,\sqrt {a}\,\left (b-c\right )\,\left (\sqrt {a+b\,x}-\sqrt {a}\right )\,\left (\sqrt {a+c\,x}-\sqrt {a}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________