3.131 \(\int -\frac {\tan ^{-1}(\sqrt {x}-\sqrt {1+x})}{x^2} \, dx\)

Optimal. Leaf size=41 \[ \frac {1}{2 \sqrt {x}}-\frac {\pi }{4 x}+\frac {\tan ^{-1}\left (\sqrt {x}\right )}{2 x}+\frac {1}{2} \tan ^{-1}\left (\sqrt {x}\right ) \]

[Out]

-1/4*Pi/x+1/2*arctan(x^(1/2))+1/2*arctan(x^(1/2))/x+1/2/x^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {5159, 30, 5033, 51, 63, 203} \[ \frac {1}{2 \sqrt {x}}-\frac {\pi }{4 x}+\frac {\tan ^{-1}\left (\sqrt {x}\right )}{2 x}+\frac {1}{2} \tan ^{-1}\left (\sqrt {x}\right ) \]

Antiderivative was successfully verified.

[In]

Int[-(ArcTan[Sqrt[x] - Sqrt[1 + x]]/x^2),x]

[Out]

-Pi/(4*x) + 1/(2*Sqrt[x]) + ArcTan[Sqrt[x]]/2 + ArcTan[Sqrt[x]]/(2*x)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 51

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^(n + 1
))/((b*c - a*d)*(m + 1)), x] - Dist[(d*(m + n + 2))/((b*c - a*d)*(m + 1)), Int[(a + b*x)^(m + 1)*(c + d*x)^n,
x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] &&  !(LtQ[n, -1] && (EqQ[a, 0] || (NeQ[
c, 0] && LtQ[m - n, 0] && IntegerQ[n]))) && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 203

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

Rule 5033

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*ArcTan
[c*x^n]))/(d*(m + 1)), x] - Dist[(b*c*n)/(d*(m + 1)), Int[(x^(n - 1)*(d*x)^(m + 1))/(1 + c^2*x^(2*n)), x], x]
/; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1]

Rule 5159

Int[ArcTan[(v_) + (s_.)*Sqrt[w_]]*(u_.), x_Symbol] :> Dist[(Pi*s)/4, Int[u, x], x] + Dist[1/2, Int[u*ArcTan[v]
, x], x] /; EqQ[s^2, 1] && EqQ[w, v^2 + 1]

Rubi steps

\begin {align*} \int -\frac {\tan ^{-1}\left (\sqrt {x}-\sqrt {1+x}\right )}{x^2} \, dx &=-\left (\frac {1}{2} \int \frac {\tan ^{-1}\left (\sqrt {x}\right )}{x^2} \, dx\right )+\frac {1}{4} \pi \int \frac {1}{x^2} \, dx\\ &=-\frac {\pi }{4 x}+\frac {\tan ^{-1}\left (\sqrt {x}\right )}{2 x}-\frac {1}{4} \int \frac {1}{x^{3/2} (1+x)} \, dx\\ &=-\frac {\pi }{4 x}+\frac {1}{2 \sqrt {x}}+\frac {\tan ^{-1}\left (\sqrt {x}\right )}{2 x}+\frac {1}{4} \int \frac {1}{\sqrt {x} (1+x)} \, dx\\ &=-\frac {\pi }{4 x}+\frac {1}{2 \sqrt {x}}+\frac {\tan ^{-1}\left (\sqrt {x}\right )}{2 x}+\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {x}\right )\\ &=-\frac {\pi }{4 x}+\frac {1}{2 \sqrt {x}}+\frac {1}{2} \tan ^{-1}\left (\sqrt {x}\right )+\frac {\tan ^{-1}\left (\sqrt {x}\right )}{2 x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 40, normalized size = 0.98 \[ \frac {1}{2 \sqrt {x}}+\frac {1}{2} \tan ^{-1}\left (\sqrt {x}\right )+\frac {\tan ^{-1}\left (\sqrt {x}-\sqrt {x+1}\right )}{x} \]

Antiderivative was successfully verified.

[In]

Integrate[-(ArcTan[Sqrt[x] - Sqrt[1 + x]]/x^2),x]

[Out]

1/(2*Sqrt[x]) + ArcTan[Sqrt[x]]/2 + ArcTan[Sqrt[x] - Sqrt[1 + x]]/x

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 28, normalized size = 0.68 \[ -\frac {2 \, {\left (x + 1\right )} \arctan \left (\sqrt {x + 1} - \sqrt {x}\right ) - \sqrt {x}}{2 \, x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*(2*(x + 1)*arctan(sqrt(x + 1) - sqrt(x)) - sqrt(x))/x

________________________________________________________________________________________

giac [A]  time = 0.15, size = 28, normalized size = 0.68 \[ \frac {\arctan \left (-\sqrt {x + 1} + \sqrt {x}\right )}{x} + \frac {1}{2 \, \sqrt {x}} + \frac {1}{2} \, \arctan \left (\sqrt {x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(-sqrt(x + 1) + sqrt(x))/x + 1/2/sqrt(x) + 1/2*arctan(sqrt(x))

________________________________________________________________________________________

maple [B]  time = 0.06, size = 57, normalized size = 1.39 \[ \frac {\arctan \left (\sqrt {x}-\sqrt {x +1}\right )}{x}+\frac {1}{2 \sqrt {x}}+\frac {\arctanh \left (\sqrt {x +1}\right )}{2}+\frac {\arctan \left (\sqrt {x}\right )}{2}-\frac {\ln \left (\sqrt {x +1}+1\right )}{4}+\frac {\ln \left (\sqrt {x +1}-1\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x^(1/2)-(x+1)^(1/2))/x+1/2/x^(1/2)+1/2*arctanh((x+1)^(1/2))+1/2*arctan(x^(1/2))-1/4*ln((x+1)^(1/2)+1)+1
/4*ln((x+1)^(1/2)-1)

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 29, normalized size = 0.71 \[ -\frac {\arctan \left (\sqrt {x + 1} - \sqrt {x}\right )}{x} + \frac {1}{2 \, \sqrt {x}} + \frac {1}{2} \, \arctan \left (\sqrt {x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-arctan(x^(1/2)-(1+x)^(1/2))/x^2,x, algorithm="maxima")

[Out]

-arctan(sqrt(x + 1) - sqrt(x))/x + 1/2/sqrt(x) + 1/2*arctan(sqrt(x))

________________________________________________________________________________________

mupad [B]  time = 1.41, size = 44, normalized size = 1.07 \[ -\frac {\mathrm {atan}\left (\sqrt {x+1}-\sqrt {x}\right )-\frac {\sqrt {x}}{2}}{x}+\frac {\ln \left (\frac {{\left (-1+\sqrt {x}\,1{}\mathrm {i}\right )}^2}{x+1}\right )\,1{}\mathrm {i}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(log((x^(1/2)*1i - 1)^2/(x + 1))*1i)/4 - (atan((x + 1)^(1/2) - x^(1/2)) - x^(1/2)/2)/x

________________________________________________________________________________________

sympy [B]  time = 68.66, size = 537, normalized size = 13.10 \[ - \frac {2 x^{\frac {5}{2}} \sqrt {x + 1} \operatorname {atan}{\left (\sqrt {x} - \sqrt {x + 1} \right )}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} + \frac {x^{\frac {5}{2}}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} - \frac {4 x^{\frac {3}{2}} \sqrt {x + 1} \operatorname {atan}{\left (\sqrt {x} - \sqrt {x + 1} \right )}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} + \frac {x^{\frac {3}{2}}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} - \frac {2 \sqrt {x} \sqrt {x + 1} \operatorname {atan}{\left (\sqrt {x} - \sqrt {x + 1} \right )}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} + \frac {2 x^{3} \operatorname {atan}{\left (\sqrt {x} - \sqrt {x + 1} \right )}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} - \frac {x^{2} \sqrt {x + 1}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} + \frac {4 x^{2} \operatorname {atan}{\left (\sqrt {x} - \sqrt {x + 1} \right )}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} - \frac {x \sqrt {x + 1}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} + \frac {2 x \operatorname {atan}{\left (\sqrt {x} - \sqrt {x + 1} \right )}}{- 2 x^{\frac {5}{2}} \sqrt {x + 1} - 2 x^{\frac {3}{2}} \sqrt {x + 1} + 2 x^{3} + 2 x^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*x**(5/2)*sqrt(x + 1)*atan(sqrt(x) - sqrt(x + 1))/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3
 + 2*x**2) + x**(5/2)/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3 + 2*x**2) - 4*x**(3/2)*sqrt(x
 + 1)*atan(sqrt(x) - sqrt(x + 1))/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3 + 2*x**2) + x**(3
/2)/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3 + 2*x**2) - 2*sqrt(x)*sqrt(x + 1)*atan(sqrt(x)
- sqrt(x + 1))/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3 + 2*x**2) + 2*x**3*atan(sqrt(x) - sq
rt(x + 1))/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3 + 2*x**2) - x**2*sqrt(x + 1)/(-2*x**(5/2
)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3 + 2*x**2) + 4*x**2*atan(sqrt(x) - sqrt(x + 1))/(-2*x**(5/2)*sq
rt(x + 1) - 2*x**(3/2)*sqrt(x + 1) + 2*x**3 + 2*x**2) - x*sqrt(x + 1)/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sq
rt(x + 1) + 2*x**3 + 2*x**2) + 2*x*atan(sqrt(x) - sqrt(x + 1))/(-2*x**(5/2)*sqrt(x + 1) - 2*x**(3/2)*sqrt(x +
1) + 2*x**3 + 2*x**2)

________________________________________________________________________________________