3.30.61 \(\int \frac {\sqrt {a x+\sqrt {-b+a x}}}{1+\sqrt {-b+a x}} \, dx\) [2961]

Optimal. Leaf size=363 \[ -\frac {\sqrt {-b+a x} \sqrt {\frac {a x+\sqrt {-b+a x}}{\left (1+\sqrt {-b+a x}\right )^2}}}{2 a}+\frac {(-3-2 b+2 a x) \sqrt {\frac {a x+\sqrt {-b+a x}}{\left (1+\sqrt {-b+a x}\right )^2}}}{2 a}+\frac {(-3-4 b) \tanh ^{-1}\left (\frac {\sqrt {b}-\sqrt {\frac {a x+\sqrt {-b+a x}}{\left (1+\sqrt {-b+a x}\right )^2}}-\sqrt {-b+a x} \sqrt {\frac {a x+\sqrt {-b+a x}}{\left (1+\sqrt {-b+a x}\right )^2}}}{1+\sqrt {-b+a x}}\right )}{2 a}+\frac {2 \sqrt {b} \log \left (1+\sqrt {-b+a x}\right )}{a}-\frac {2 \sqrt {b} \log \left (1-2 b+2 \sqrt {b} \sqrt {\frac {a x+\sqrt {-b+a x}}{\left (1+\sqrt {-b+a x}\right )^2}}+\sqrt {-b+a x} \left (1+2 \sqrt {b} \sqrt {\frac {a x+\sqrt {-b+a x}}{\left (1+\sqrt {-b+a x}\right )^2}}\right )\right )}{a} \]

[Out]

-1/2*(a*x-b)^(1/2)*((a*x+(a*x-b)^(1/2))/(1+(a*x-b)^(1/2))^2)^(1/2)/a+1/2*(2*a*x-2*b-3)*((a*x+(a*x-b)^(1/2))/(1
+(a*x-b)^(1/2))^2)^(1/2)/a+1/2*(-3-4*b)*arctanh((b^(1/2)-((a*x+(a*x-b)^(1/2))/(1+(a*x-b)^(1/2))^2)^(1/2)-(a*x-
b)^(1/2)*((a*x+(a*x-b)^(1/2))/(1+(a*x-b)^(1/2))^2)^(1/2))/(1+(a*x-b)^(1/2)))/a+2*b^(1/2)*ln(1+(a*x-b)^(1/2))/a
-2*b^(1/2)*ln(1-2*b+2*b^(1/2)*((a*x+(a*x-b)^(1/2))/(1+(a*x-b)^(1/2))^2)^(1/2)+(a*x-b)^(1/2)*(1+2*b^(1/2)*((a*x
+(a*x-b)^(1/2))/(1+(a*x-b)^(1/2))^2)^(1/2)))/a

________________________________________________________________________________________

Rubi [A]
time = 0.23, 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 = {828, 857, 635, 212, 738} \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]

Int[Sqrt[a*x + Sqrt[-b + a*x]]/(1 + Sqrt[-b + a*x]),x]

[Out]

-1/2*((3 - 2*Sqrt[-b + a*x])*Sqrt[a*x + Sqrt[-b + a*x]])/a - (2*Sqrt[b]*ArcTanh[(1 - 2*b + Sqrt[-b + a*x])/(2*
Sqrt[b]*Sqrt[a*x + Sqrt[-b + a*x]])])/a + ((3 + 4*b)*ArcTanh[(1 + 2*Sqrt[-b + a*x])/(2*Sqrt[a*x + Sqrt[-b + a*
x]])])/(4*a)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 738

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 828

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Sim
p[(d + e*x)^(m + 1)*(c*e*f*(m + 2*p + 2) - g*(c*d + 2*c*d*p - b*e*p) + g*c*e*(m + 2*p + 1)*x)*((a + b*x + c*x^
2)^p/(c*e^2*(m + 2*p + 1)*(m + 2*p + 2))), x] - Dist[p/(c*e^2*(m + 2*p + 1)*(m + 2*p + 2)), Int[(d + e*x)^m*(a
 + b*x + c*x^2)^(p - 1)*Simp[c*e*f*(b*d - 2*a*e)*(m + 2*p + 2) + g*(a*e*(b*e - 2*c*d*m + b*e*m) + b*d*(b*e*p -
 c*d - 2*c*d*p)) + (c*e*f*(2*c*d - b*e)*(m + 2*p + 2) + g*(b^2*e^2*(p + m + 1) - 2*c^2*d^2*(1 + 2*p) - c*e*(b*
d*(m - 2*p) + 2*a*e*(m + 2*p + 1))))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && NeQ[b^2 - 4*a*c, 0
] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && GtQ[p, 0] && (IntegerQ[p] ||  !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 0])
) &&  !ILtQ[m + 2*p, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])

Rule 857

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {\sqrt {a x+\sqrt {-b+a x}}}{1+\sqrt {-b+a x}} \, dx &=\frac {2 \text {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 {\text {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) \text {Subst}\left (\int \frac {1}{(1+x) \sqrt {b+x+x^2}} \, dx,x,\sqrt {-b+a x}\right )}{a}+\frac {(3+4 b) \text {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) \text {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) \text {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.30, size = 137, normalized size = 0.38 \begin {gather*} -\frac {2 \left (3-2 \sqrt {-b+a x}\right ) \sqrt {a x+\sqrt {-b+a x}}+16 \sqrt {b} \tanh ^{-1}\left (\frac {1+\sqrt {-b+a x}-\sqrt {a x+\sqrt {-b+a x}}}{\sqrt {b}}\right )+(3+4 b) \log \left (a \left (-1-2 \sqrt {-b+a x}+2 \sqrt {a x+\sqrt {-b+a x}}\right )\right )}{4 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a*x + Sqrt[-b + a*x]]/(1 + Sqrt[-b + a*x]),x]

[Out]

-1/4*(2*(3 - 2*Sqrt[-b + a*x])*Sqrt[a*x + Sqrt[-b + a*x]] + 16*Sqrt[b]*ArcTanh[(1 + Sqrt[-b + a*x] - Sqrt[a*x
+ Sqrt[-b + a*x]])/Sqrt[b]] + (3 + 4*b)*Log[a*(-1 - 2*Sqrt[-b + a*x] + 2*Sqrt[a*x + Sqrt[-b + a*x]])])/a

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 214, normalized size = 0.59

method result size
derivativedivides \(\frac {\frac {\left (2 \sqrt {a x -b}+1\right ) \sqrt {a x +\sqrt {a x -b}}}{2}+\frac {\left (4 b -1\right ) \ln \left (\frac {1}{2}+\sqrt {a x -b}+\sqrt {a x +\sqrt {a x -b}}\right )}{4}-2 \sqrt {\left (1+\sqrt {a x -b}\right )^{2}+b -\sqrt {a x -b}-1}+\ln \left (\frac {1}{2}+\sqrt {a x -b}+\sqrt {\left (1+\sqrt {a x -b}\right )^{2}+b -\sqrt {a x -b}-1}\right )+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}+b -\sqrt {a x -b}-1}}{1+\sqrt {a x -b}}\right )}{a}\) \(214\)
default \(\frac {\frac {\left (2 \sqrt {a x -b}+1\right ) \sqrt {a x +\sqrt {a x -b}}}{2}+\frac {\left (4 b -1\right ) \ln \left (\frac {1}{2}+\sqrt {a x -b}+\sqrt {a x +\sqrt {a x -b}}\right )}{4}-2 \sqrt {\left (1+\sqrt {a x -b}\right )^{2}+b -\sqrt {a x -b}-1}+\ln \left (\frac {1}{2}+\sqrt {a x -b}+\sqrt {\left (1+\sqrt {a x -b}\right )^{2}+b -\sqrt {a x -b}-1}\right )+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}+b -\sqrt {a x -b}-1}}{1+\sqrt {a x -b}}\right )}{a}\) \(214\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*x+(a*x-b)^(1/2))^(1/2)/(1+(a*x-b)^(1/2)),x,method=_RETURNVERBOSE)

[Out]

2/a*(1/4*(2*(a*x-b)^(1/2)+1)*(a*x+(a*x-b)^(1/2))^(1/2)+1/8*(4*b-1)*ln(1/2+(a*x-b)^(1/2)+(a*x+(a*x-b)^(1/2))^(1
/2))-((1+(a*x-b)^(1/2))^2+b-(a*x-b)^(1/2)-1)^(1/2)+1/2*ln(1/2+(a*x-b)^(1/2)+((1+(a*x-b)^(1/2))^2+b-(a*x-b)^(1/
2)-1)^(1/2))+b^(1/2)*ln((2*b-(a*x-b)^(1/2)-1+2*b^(1/2)*((1+(a*x-b)^(1/2))^2+b-(a*x-b)^(1/2)-1)^(1/2))/(1+(a*x-
b)^(1/2))))

________________________________________________________________________________________

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]

integrate((a*x+(a*x-b)^(1/2))^(1/2)/(1+(a*x-b)^(1/2)),x, algorithm="maxima")

[Out]

integrate(sqrt(a*x + sqrt(a*x - b))/(sqrt(a*x - b) + 1), x)

________________________________________________________________________________________

Fricas [F(-1)] Timed out
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]

integrate((a*x+(a*x-b)^(1/2))^(1/2)/(1+(a*x-b)^(1/2)),x, algorithm="fricas")

[Out]

Timed 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]

integrate((a*x+(a*x-b)**(1/2))**(1/2)/(1+(a*x-b)**(1/2)),x)

[Out]

Integral(sqrt(a*x + sqrt(a*x - b))/(sqrt(a*x - b) + 1), x)

________________________________________________________________________________________

Giac [A]
time = 0.65, 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]

integrate((a*x+(a*x-b)^(1/2))^(1/2)/(1+(a*x-b)^(1/2)),x, algorithm="giac")

[Out]

1/2*sqrt(a*x + sqrt(a*x - b))*(2*sqrt(a*x - b)/a - 3/a) - 1/4*(4*b + 3)*log(abs(-2*sqrt(a*x - b) + 2*sqrt(a*x
+ sqrt(a*x - b)) - 1))/a - 4*b*arctan(-(sqrt(a*x - b) - sqrt(a*x + sqrt(a*x - b)) + 1)/sqrt(-b))/(a*sqrt(-b))

________________________________________________________________________________________

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]

int((a*x + (a*x - b)^(1/2))^(1/2)/((a*x - b)^(1/2) + 1),x)

[Out]

int((a*x + (a*x - b)^(1/2))^(1/2)/((a*x - b)^(1/2) + 1), x)

________________________________________________________________________________________