3.1.58 \(\int \frac {\sqrt {x}}{\sqrt {2012-x}+\sqrt {x}} \, dx\) [58]

Optimal. Leaf size=53 \[ -\frac {1}{2} \sqrt {2012-x} \sqrt {x}+\frac {x}{2}+503 \text {arctanh}\left (\frac {\sqrt {2012-x} \sqrt {x}}{1006}\right )+503 \log (1006-x) \]

[Out]

-1/2*(2012-x)^(1/2)*x^(1/2)+1/2*x+503*arctanh(1/1006*(2012-x)^(1/2)*x^(1/2))+503*ln(1006-x)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {2130, 103, 12, 94, 212, 45} \begin {gather*} 503 \text {arctanh}\left (\frac {\sqrt {2012-x} \sqrt {x}}{1006}\right )+\frac {x}{2}-\frac {1}{2} \sqrt {2012-x} \sqrt {x}+503 \log (1006-x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[x]/(Sqrt[2012 - x] + Sqrt[x]),x]

[Out]

-1/2*(Sqrt[2012 - x]*Sqrt[x]) + x/2 + 503*ArcTanh[(Sqrt[2012 - x]*Sqrt[x])/1006] + 503*Log[1006 - x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 94

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

Rule 103

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(a + b
*x)^m*(c + d*x)^n*((e + f*x)^(p + 1)/(f*(m + n + p + 1))), x] - Dist[1/(f*(m + n + p + 1)), Int[(a + b*x)^(m -
 1)*(c + d*x)^(n - 1)*(e + f*x)^p*Simp[c*m*(b*e - a*f) + a*n*(d*e - c*f) + (d*m*(b*e - a*f) + b*n*(d*e - c*f))
*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && GtQ[m, 0] && GtQ[n, 0] && NeQ[m + n + p + 1, 0] && (Integ
ersQ[2*m, 2*n, 2*p] || (IntegersQ[m, n + p] || IntegersQ[p, m + n]))

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 2130

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

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=\int \frac {\sqrt {2012-x} \sqrt {x}}{2012-2 x} \, dx-\int \frac {x}{2012-2 x} \, dx\\ &=-\frac {1}{2} \sqrt {2012-x} \sqrt {x}+\frac {1}{2} \int \frac {2024072}{(2012-2 x) \sqrt {2012-x} \sqrt {x}} \, dx-\int \left (-\frac {1}{2}-\frac {503}{-1006+x}\right ) \, dx\\ &=-\frac {1}{2} \sqrt {2012-x} \sqrt {x}+\frac {x}{2}+503 \log (1006-x)+1012036 \int \frac {1}{(2012-2 x) \sqrt {2012-x} \sqrt {x}} \, dx\\ &=-\frac {1}{2} \sqrt {2012-x} \sqrt {x}+\frac {x}{2}+503 \log (1006-x)+2024072 \text {Subst}\left (\int \frac {1}{4048144-4 x^2} \, dx,x,\sqrt {2012-x} \sqrt {x}\right )\\ &=-\frac {1}{2} \sqrt {2012-x} \sqrt {x}+\frac {x}{2}+503 \text {arctanh}\left (\frac {\sqrt {2012-x} \sqrt {x}}{1006}\right )+503 \log (1006-x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.08, size = 62, normalized size = 1.17 \begin {gather*} \frac {1}{2} \left (x-\sqrt {-((-2012+x) x)}-2012 \log \left (\sqrt {2012-x}-i \sqrt {x}\right )+2012 \log \left ((1006+1006 i)-i x+\sqrt {-((-2012+x) x)}\right )\right ) \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Sqrt[x]/(Sqrt[2012 - x] + Sqrt[x]),x]

[Out]

(x - Sqrt[-((-2012 + x)*x)] - 2012*Log[Sqrt[2012 - x] - I*Sqrt[x]] + 2012*Log[(1006 + 1006*I) - I*x + Sqrt[-((
-2012 + x)*x)]])/2

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 53, normalized size = 1.00

method result size
default \(\frac {x}{2}+503 \ln \left (x -1006\right )-\frac {\sqrt {x}\, \sqrt {2012-x}\, \left (\sqrt {-x \left (-2012+x \right )}-1006 \,\arctanh \left (\frac {1006}{\sqrt {-x \left (-2012+x \right )}}\right )\right )}{2 \sqrt {-x \left (-2012+x \right )}}\) \(53\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(1/2)/((2012-x)^(1/2)+x^(1/2)),x,method=_RETURNVERBOSE)

[Out]

1/2*x+503*ln(x-1006)-1/2*x^(1/2)*(2012-x)^(1/2)*((-x*(-2012+x))^(1/2)-1006*arctanh(1006/(-x*(-2012+x))^(1/2)))
/(-x*(-2012+x))^(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(x^(1/2)/((2012-x)^(1/2)+x^(1/2)),x, algorithm="maxima")

[Out]

integrate(sqrt(x)/(sqrt(x) + sqrt(-x + 2012)), x)

________________________________________________________________________________________

Fricas [A]
time = 0.58, size = 64, normalized size = 1.21 \begin {gather*} \frac {1}{2} \, x - \frac {1}{2} \, \sqrt {x} \sqrt {-x + 2012} + 503 \, \log \left (x - 1006\right ) + 503 \, \log \left (\frac {x + \sqrt {x} \sqrt {-x + 2012}}{x}\right ) - 503 \, \log \left (-\frac {x - \sqrt {x} \sqrt {-x + 2012}}{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(1/2)/((2012-x)^(1/2)+x^(1/2)),x, algorithm="fricas")

[Out]

1/2*x - 1/2*sqrt(x)*sqrt(-x + 2012) + 503*log(x - 1006) + 503*log((x + sqrt(x)*sqrt(-x + 2012))/x) - 503*log(-
(x - sqrt(x)*sqrt(-x + 2012))/x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {x}}{\sqrt {x} + \sqrt {2012 - x}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**(1/2)/((2012-x)**(1/2)+x**(1/2)),x)

[Out]

Integral(sqrt(x)/(sqrt(x) + sqrt(2012 - x)), x)

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(1/2)/((2012-x)^(1/2)+x^(1/2)),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> unable to parse Giac output: Warning, choosing root of [1,0,-4024,0,%
%%{4,[2]%%%}+%%%{-8048,[1]%%%}+%%%{4048144,[0]%%%}] at parameters values [1917.38357631]Warning, choosing root
 of [1,0,-4024,0,%%%{

________________________________________________________________________________________

Mupad [B]
time = 1.59, size = 64, normalized size = 1.21 \begin {gather*} \frac {x}{2}+1006\,\mathrm {atanh}\left (\frac {2\,\sqrt {503}\,\sqrt {x}-\sqrt {x}\,\sqrt {2012-x}}{x+2\,\sqrt {503}\,\sqrt {2012-x}-2012}\right )+503\,\ln \left (x-1006\right )-\frac {\sqrt {x}\,\sqrt {2012-x}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(1/2)/((2012 - x)^(1/2) + x^(1/2)),x)

[Out]

x/2 + 1006*atanh((2*503^(1/2)*x^(1/2) - x^(1/2)*(2012 - x)^(1/2))/(x + 2*503^(1/2)*(2012 - x)^(1/2) - 2012)) +
 503*log(x - 1006) - (x^(1/2)*(2012 - x)^(1/2))/2

________________________________________________________________________________________

Chatgpt [F] Failed to verify
time = 1.00, size = 51, normalized size = 0.96 \begin {gather*} \frac {2 \sqrt {x}\, \left (2012-x -2 \sqrt {x}\, \sqrt {2012-x}+2012 \ln \left (\sqrt {2012-x}+\sqrt {x}\right )-2 x \ln \left (\sqrt {2012-x}+\sqrt {x}\right )\right )}{3} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

int(x^(1/2)/((2012-x)^(1/2)+x^(1/2)),x)

[Out]

2/3*x^(1/2)*(2012-x-2*x^(1/2)*(2012-x)^(1/2)+2012*ln((2012-x)^(1/2)+x^(1/2))-2*x*ln((2012-x)^(1/2)+x^(1/2)))

________________________________________________________________________________________