Integrand size = 38, antiderivative size = 278 \[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=\frac {2 (6 a d+3 a c x) \sqrt {b^2+a^2 x^2}+2 \left (b^2 c+6 a^2 d x+3 a^2 c x^2\right )}{3 a c \left (a x+\sqrt {b^2+a^2 x^2}\right )^{3/2}}+\frac {4 d \arctan \left (\frac {\sqrt {c} \sqrt {a x+\sqrt {b^2+a^2 x^2}}}{\sqrt {-a d-\sqrt {b^2 c^2+a^2 d^2}}}\right )}{\sqrt {c} \sqrt {-a d-\sqrt {b^2 c^2+a^2 d^2}}}+\frac {4 d \arctan \left (\frac {\sqrt {c} \sqrt {a x+\sqrt {b^2+a^2 x^2}}}{\sqrt {-a d+\sqrt {b^2 c^2+a^2 d^2}}}\right )}{\sqrt {c} \sqrt {-a d+\sqrt {b^2 c^2+a^2 d^2}}} \]
[Out]
Time = 1.03 (sec) , antiderivative size = 278, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.237, Rules used = {6874, 2142, 14, 2144, 1642, 842, 840, 1180, 214} \[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=-\frac {4 d \text {arctanh}\left (\frac {\sqrt {c} \sqrt {\sqrt {a^2 x^2+b^2}+a x}}{\sqrt {a d-\sqrt {a^2 d^2+b^2 c^2}}}\right )}{\sqrt {c} \sqrt {a d-\sqrt {a^2 d^2+b^2 c^2}}}-\frac {4 d \text {arctanh}\left (\frac {\sqrt {c} \sqrt {\sqrt {a^2 x^2+b^2}+a x}}{\sqrt {\sqrt {a^2 d^2+b^2 c^2}+a d}}\right )}{\sqrt {c} \sqrt {\sqrt {a^2 d^2+b^2 c^2}+a d}}+\frac {4 d}{c \sqrt {\sqrt {a^2 x^2+b^2}+a x}}-\frac {b^2}{3 a \left (\sqrt {a^2 x^2+b^2}+a x\right )^{3/2}}+\frac {\sqrt {\sqrt {a^2 x^2+b^2}+a x}}{a} \]
[In]
[Out]
Rule 14
Rule 214
Rule 840
Rule 842
Rule 1180
Rule 1642
Rule 2142
Rule 2144
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {1}{\sqrt {a x+\sqrt {b^2+a^2 x^2}}}-\frac {2 d}{(d-c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}}\right ) \, dx \\ & = -\left ((2 d) \int \frac {1}{(d-c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx\right )+\int \frac {1}{\sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx \\ & = \frac {\text {Subst}\left (\int \frac {b^2+x^2}{x^{5/2}} \, dx,x,a x+\sqrt {b^2+a^2 x^2}\right )}{2 a}-(2 d) \text {Subst}\left (\int \frac {b^2+x^2}{x^{3/2} \left (b^2 c+2 a d x-c x^2\right )} \, dx,x,a x+\sqrt {b^2+a^2 x^2}\right ) \\ & = \frac {\text {Subst}\left (\int \left (\frac {b^2}{x^{5/2}}+\frac {1}{\sqrt {x}}\right ) \, dx,x,a x+\sqrt {b^2+a^2 x^2}\right )}{2 a}-(2 d) \text {Subst}\left (\int \left (-\frac {1}{c x^{3/2}}+\frac {2 \left (b^2 c+a d x\right )}{c x^{3/2} \left (b^2 c+2 a d x-c x^2\right )}\right ) \, dx,x,a x+\sqrt {b^2+a^2 x^2}\right ) \\ & = -\frac {b^2}{3 a \left (a x+\sqrt {b^2+a^2 x^2}\right )^{3/2}}-\frac {4 d}{c \sqrt {a x+\sqrt {b^2+a^2 x^2}}}+\frac {\sqrt {a x+\sqrt {b^2+a^2 x^2}}}{a}-\frac {(4 d) \text {Subst}\left (\int \frac {b^2 c+a d x}{x^{3/2} \left (b^2 c+2 a d x-c x^2\right )} \, dx,x,a x+\sqrt {b^2+a^2 x^2}\right )}{c} \\ & = -\frac {b^2}{3 a \left (a x+\sqrt {b^2+a^2 x^2}\right )^{3/2}}+\frac {4 d}{c \sqrt {a x+\sqrt {b^2+a^2 x^2}}}+\frac {\sqrt {a x+\sqrt {b^2+a^2 x^2}}}{a}-\frac {(4 d) \text {Subst}\left (\int \frac {-a b^2 c d+b^2 c^2 x}{\sqrt {x} \left (b^2 c+2 a d x-c x^2\right )} \, dx,x,a x+\sqrt {b^2+a^2 x^2}\right )}{b^2 c^2} \\ & = -\frac {b^2}{3 a \left (a x+\sqrt {b^2+a^2 x^2}\right )^{3/2}}+\frac {4 d}{c \sqrt {a x+\sqrt {b^2+a^2 x^2}}}+\frac {\sqrt {a x+\sqrt {b^2+a^2 x^2}}}{a}-\frac {(8 d) \text {Subst}\left (\int \frac {-a b^2 c d+b^2 c^2 x^2}{b^2 c+2 a d x^2-c x^4} \, dx,x,\sqrt {a x+\sqrt {b^2+a^2 x^2}}\right )}{b^2 c^2} \\ & = -\frac {b^2}{3 a \left (a x+\sqrt {b^2+a^2 x^2}\right )^{3/2}}+\frac {4 d}{c \sqrt {a x+\sqrt {b^2+a^2 x^2}}}+\frac {\sqrt {a x+\sqrt {b^2+a^2 x^2}}}{a}-(4 d) \text {Subst}\left (\int \frac {1}{a d-\sqrt {b^2 c^2+a^2 d^2}-c x^2} \, dx,x,\sqrt {a x+\sqrt {b^2+a^2 x^2}}\right )-(4 d) \text {Subst}\left (\int \frac {1}{a d+\sqrt {b^2 c^2+a^2 d^2}-c x^2} \, dx,x,\sqrt {a x+\sqrt {b^2+a^2 x^2}}\right ) \\ & = -\frac {b^2}{3 a \left (a x+\sqrt {b^2+a^2 x^2}\right )^{3/2}}+\frac {4 d}{c \sqrt {a x+\sqrt {b^2+a^2 x^2}}}+\frac {\sqrt {a x+\sqrt {b^2+a^2 x^2}}}{a}-\frac {4 d \text {arctanh}\left (\frac {\sqrt {c} \sqrt {a x+\sqrt {b^2+a^2 x^2}}}{\sqrt {a d-\sqrt {b^2 c^2+a^2 d^2}}}\right )}{\sqrt {c} \sqrt {a d-\sqrt {b^2 c^2+a^2 d^2}}}-\frac {4 d \text {arctanh}\left (\frac {\sqrt {c} \sqrt {a x+\sqrt {b^2+a^2 x^2}}}{\sqrt {a d+\sqrt {b^2 c^2+a^2 d^2}}}\right )}{\sqrt {c} \sqrt {a d+\sqrt {b^2 c^2+a^2 d^2}}} \\ \end{align*}
Time = 0.79 (sec) , antiderivative size = 262, normalized size of antiderivative = 0.94 \[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=\frac {2 \left (\frac {b^2 c+3 a (2 d+c x) \left (a x+\sqrt {b^2+a^2 x^2}\right )}{a \left (a x+\sqrt {b^2+a^2 x^2}\right )^{3/2}}+\frac {6 \sqrt {c} d \arctan \left (\frac {\sqrt {c} \sqrt {a x+\sqrt {b^2+a^2 x^2}}}{\sqrt {-a d-\sqrt {b^2 c^2+a^2 d^2}}}\right )}{\sqrt {-a d-\sqrt {b^2 c^2+a^2 d^2}}}+\frac {6 \sqrt {c} d \arctan \left (\frac {\sqrt {c} \sqrt {a x+\sqrt {b^2+a^2 x^2}}}{\sqrt {-a d+\sqrt {b^2 c^2+a^2 d^2}}}\right )}{\sqrt {-a d+\sqrt {b^2 c^2+a^2 d^2}}}\right )}{3 c} \]
[In]
[Out]
\[\int \frac {c x +d}{\left (c x -d \right ) \sqrt {a x +\sqrt {a^{2} x^{2}+b^{2}}}}d x\]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 781 vs. \(2 (234) = 468\).
Time = 0.29 (sec) , antiderivative size = 781, normalized size of antiderivative = 2.81 \[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=\frac {2 \, {\left (3 \, a b^{2} c \sqrt {-\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} + a d^{3}}{b^{2} c^{3}}} \log \left (32 \, \sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}} d^{3} + 32 \, {\left (b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} - a d^{3}\right )} \sqrt {-\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} + a d^{3}}{b^{2} c^{3}}}\right ) - 3 \, a b^{2} c \sqrt {-\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} + a d^{3}}{b^{2} c^{3}}} \log \left (32 \, \sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}} d^{3} - 32 \, {\left (b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} - a d^{3}\right )} \sqrt {-\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} + a d^{3}}{b^{2} c^{3}}}\right ) - 3 \, a b^{2} c \sqrt {\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} - a d^{3}}{b^{2} c^{3}}} \log \left (32 \, \sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}} d^{3} + 32 \, {\left (b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} + a d^{3}\right )} \sqrt {\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} - a d^{3}}{b^{2} c^{3}}}\right ) + 3 \, a b^{2} c \sqrt {\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} - a d^{3}}{b^{2} c^{3}}} \log \left (32 \, \sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}} d^{3} - 32 \, {\left (b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} + a d^{3}\right )} \sqrt {\frac {b^{2} c^{3} \sqrt {\frac {b^{2} c^{2} d^{4} + a^{2} d^{6}}{b^{4} c^{6}}} - a d^{3}}{b^{2} c^{3}}}\right ) - {\left (a^{2} c x^{2} + 6 \, a^{2} d x - b^{2} c - \sqrt {a^{2} x^{2} + b^{2}} {\left (a c x + 6 \, a d\right )}\right )} \sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}}\right )}}{3 \, a b^{2} c} \]
[In]
[Out]
\[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=\int \frac {c x + d}{\sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}} \left (c x - d\right )}\, dx \]
[In]
[Out]
\[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=\int { \frac {c x + d}{\sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}} {\left (c x - d\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=\int { \frac {c x + d}{\sqrt {a x + \sqrt {a^{2} x^{2} + b^{2}}} {\left (c x - d\right )}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {d+c x}{(-d+c x) \sqrt {a x+\sqrt {b^2+a^2 x^2}}} \, dx=\int -\frac {d+c\,x}{\sqrt {a\,x+\sqrt {a^2\,x^2+b^2}}\,\left (d-c\,x\right )} \,d x \]
[In]
[Out]