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

Optimal. Leaf size=220 \[ \frac{2-4 x}{5 \left (\sqrt{x^2-1}+\sqrt{x}\right )}-\frac{1}{50} \sqrt{50 \sqrt{5}-110} \tan ^{-1}\left (\frac{\sqrt{2 \sqrt{5}-2} \sqrt{x^2-1}}{2-\left (1-\sqrt{5}\right ) x}\right )-\frac{1}{50} \sqrt{110+50 \sqrt{5}} \tanh ^{-1}\left (\frac{\sqrt{2+2 \sqrt{5}} \sqrt{x^2-1}}{-\sqrt{5} x-x+2}\right )+\frac{1}{25} \sqrt{50 \sqrt{5}-110} \tan ^{-1}\left (\frac{1}{2} \sqrt{2+2 \sqrt{5}} \sqrt{x}\right )-\frac{1}{25} \sqrt{110+50 \sqrt{5}} \tanh ^{-1}\left (\frac{1}{2} \sqrt{2 \sqrt{5}-2} \sqrt{x}\right ) \]

[Out]

(2 - 4*x)/(5*(Sqrt[x] + Sqrt[-1 + x^2])) + (Sqrt[-110 + 50*Sqrt[5]]*ArcTan[(Sqrt[2 + 2*Sqrt[5]]*Sqrt[x])/2])/2
5 - (Sqrt[-110 + 50*Sqrt[5]]*ArcTan[(Sqrt[-2 + 2*Sqrt[5]]*Sqrt[-1 + x^2])/(2 - (1 - Sqrt[5])*x)])/50 - (Sqrt[1
10 + 50*Sqrt[5]]*ArcTanh[(Sqrt[-2 + 2*Sqrt[5]]*Sqrt[x])/2])/25 - (Sqrt[110 + 50*Sqrt[5]]*ArcTanh[(Sqrt[2 + 2*S
qrt[5]]*Sqrt[-1 + x^2])/(2 - x - Sqrt[5]*x)])/50

________________________________________________________________________________________

Rubi [B]  time = 0.751087, antiderivative size = 541, normalized size of antiderivative = 2.46, number of steps used = 25, number of rules used = 13, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {6742, 736, 826, 1166, 207, 203, 975, 1034, 725, 206, 204, 1018, 1065} \[ -\frac{\sqrt{x^2-1} (1-2 x)}{5 \left (-x^2+x+1\right )}+\frac{2 \sqrt{x} (1-2 x)}{5 \left (-x^2+x+1\right )}-\frac{(3-x) \sqrt{x^2-1}}{5 \left (-x^2+x+1\right )}+\frac{(x+2) \sqrt{x^2-1}}{5 \left (-x^2+x+1\right )}+\frac{1}{5} \sqrt{\frac{1}{5} \left (2+5 \sqrt{5}\right )} \tan ^{-1}\left (\frac{2-\left (1-\sqrt{5}\right ) x}{\sqrt{2 \left (\sqrt{5}-1\right )} \sqrt{x^2-1}}\right )-\frac{1}{5} \sqrt{\frac{1}{5} \left (5 \sqrt{5}-2\right )} \tan ^{-1}\left (\frac{2-\left (1-\sqrt{5}\right ) x}{\sqrt{2 \left (\sqrt{5}-1\right )} \sqrt{x^2-1}}\right )-\frac{1}{5} \sqrt{\frac{1}{10} \left (5 \sqrt{5}-11\right )} \tan ^{-1}\left (\frac{2-\left (1-\sqrt{5}\right ) x}{\sqrt{2 \left (\sqrt{5}-1\right )} \sqrt{x^2-1}}\right )+\frac{1}{5} \sqrt{\frac{1}{10} \left (11+5 \sqrt{5}\right )} \tanh ^{-1}\left (\frac{2-\left (1+\sqrt{5}\right ) x}{\sqrt{2 \left (1+\sqrt{5}\right )} \sqrt{x^2-1}}\right )-\frac{1}{5} \sqrt{\frac{1}{5} \left (2+5 \sqrt{5}\right )} \tanh ^{-1}\left (\frac{2-\left (1+\sqrt{5}\right ) x}{\sqrt{2 \left (1+\sqrt{5}\right )} \sqrt{x^2-1}}\right )-\frac{1}{5} \sqrt{\frac{1}{5} \left (5 \sqrt{5}-2\right )} \tanh ^{-1}\left (\frac{2-\left (1+\sqrt{5}\right ) x}{\sqrt{2 \left (1+\sqrt{5}\right )} \sqrt{x^2-1}}\right )+\frac{1}{5} \sqrt{\frac{2}{5} \left (5 \sqrt{5}-11\right )} \tan ^{-1}\left (\sqrt{\frac{2}{\sqrt{5}-1}} \sqrt{x}\right )-\frac{1}{5} \sqrt{\frac{2}{5} \left (11+5 \sqrt{5}\right )} \tanh ^{-1}\left (\sqrt{\frac{2}{1+\sqrt{5}}} \sqrt{x}\right ) \]

Warning: Unable to verify antiderivative.

[In]

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

[Out]

(2*(1 - 2*x)*Sqrt[x])/(5*(1 + x - x^2)) - ((1 - 2*x)*Sqrt[-1 + x^2])/(5*(1 + x - x^2)) - ((3 - x)*Sqrt[-1 + x^
2])/(5*(1 + x - x^2)) + ((2 + x)*Sqrt[-1 + x^2])/(5*(1 + x - x^2)) + (Sqrt[(2*(-11 + 5*Sqrt[5]))/5]*ArcTan[Sqr
t[2/(-1 + Sqrt[5])]*Sqrt[x]])/5 - (Sqrt[(-11 + 5*Sqrt[5])/10]*ArcTan[(2 - (1 - Sqrt[5])*x)/(Sqrt[2*(-1 + Sqrt[
5])]*Sqrt[-1 + x^2])])/5 - (Sqrt[(-2 + 5*Sqrt[5])/5]*ArcTan[(2 - (1 - Sqrt[5])*x)/(Sqrt[2*(-1 + Sqrt[5])]*Sqrt
[-1 + x^2])])/5 + (Sqrt[(2 + 5*Sqrt[5])/5]*ArcTan[(2 - (1 - Sqrt[5])*x)/(Sqrt[2*(-1 + Sqrt[5])]*Sqrt[-1 + x^2]
)])/5 - (Sqrt[(2*(11 + 5*Sqrt[5]))/5]*ArcTanh[Sqrt[2/(1 + Sqrt[5])]*Sqrt[x]])/5 - (Sqrt[(-2 + 5*Sqrt[5])/5]*Ar
cTanh[(2 - (1 + Sqrt[5])*x)/(Sqrt[2*(1 + Sqrt[5])]*Sqrt[-1 + x^2])])/5 - (Sqrt[(2 + 5*Sqrt[5])/5]*ArcTanh[(2 -
 (1 + Sqrt[5])*x)/(Sqrt[2*(1 + Sqrt[5])]*Sqrt[-1 + x^2])])/5 + (Sqrt[(11 + 5*Sqrt[5])/10]*ArcTanh[(2 - (1 + Sq
rt[5])*x)/(Sqrt[2*(1 + Sqrt[5])]*Sqrt[-1 + x^2])])/5

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 736

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^m*(b + 2*
c*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] - Dist[1/((p + 1)*(b^2 - 4*a*c)), Int[(d + e*x)^(m
 - 1)*(b*e*m + 2*c*d*(2*p + 3) + 2*c*e*(m + 2*p + 3)*x)*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d
, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && LtQ[p, -1] && GtQ[m
, 0] && (LtQ[m, 1] || (ILtQ[m + 2*p + 3, 0] && NeQ[m, 2])) && IntQuadraticQ[a, b, c, d, e, m, p, x]

Rule 826

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

Rule 1166

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

Rule 207

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

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 975

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)*((d_.) + (f_.)*(x_)^2)^(q_), x_Symbol] :> Simp[((b^3*f + b*c*(c*d
 - 3*a*f) + c*(2*c^2*d + b^2*f - c*(2*a*f))*x)*(a + b*x + c*x^2)^(p + 1)*(d + f*x^2)^(q + 1))/((b^2 - 4*a*c)*(
b^2*d*f + (c*d - a*f)^2)*(p + 1)), x] - Dist[1/((b^2 - 4*a*c)*(b^2*d*f + (c*d - a*f)^2)*(p + 1)), Int[(a + b*x
 + c*x^2)^(p + 1)*(d + f*x^2)^q*Simp[2*c*(b^2*d*f + (c*d - a*f)^2)*(p + 1) - (2*c^2*d + b^2*f - c*(2*a*f))*(a*
f*(p + 1) - c*d*(p + 2)) + (2*f*(b^3*f + b*c*(c*d - 3*a*f))*(p + q + 2) - (2*c^2*d + b^2*f - c*(2*a*f))*(b*f*(
p + 1)))*x + c*f*(2*c^2*d + b^2*f - c*(2*a*f))*(2*p + 2*q + 5)*x^2, x], x], x] /; FreeQ[{a, b, c, d, f, q}, x]
 && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[b^2*d*f + (c*d - a*f)^2, 0] &&  !( !IntegerQ[p] && ILtQ[q, -1]) &
&  !IGtQ[q, 0]

Rule 1034

Int[((g_.) + (h_.)*(x_))/(((a_) + (b_.)*(x_) + (c_.)*(x_)^2)*Sqrt[(d_) + (f_.)*(x_)^2]), x_Symbol] :> With[{q
= Rt[b^2 - 4*a*c, 2]}, Dist[(2*c*g - h*(b - q))/q, Int[1/((b - q + 2*c*x)*Sqrt[d + f*x^2]), x], x] - Dist[(2*c
*g - h*(b + q))/q, Int[1/((b + q + 2*c*x)*Sqrt[d + f*x^2]), x], x]] /; FreeQ[{a, b, c, d, f, g, h}, x] && NeQ[
b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c]

Rule 725

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

Rule 206

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

Rule 204

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

Rule 1018

Int[((g_.) + (h_.)*(x_))*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)*((d_) + (f_.)*(x_)^2)^(q_), x_Symbol] :> Simp
[((a + b*x + c*x^2)^(p + 1)*(d + f*x^2)^(q + 1)*((g*c)*(-(b*(c*d + a*f))) + (g*b - a*h)*(2*c^2*d + b^2*f - c*(
2*a*f)) + c*(g*(2*c^2*d + b^2*f - c*(2*a*f)) - h*(b*c*d + a*b*f))*x))/((b^2 - 4*a*c)*(b^2*d*f + (c*d - a*f)^2)
*(p + 1)), x] + Dist[1/((b^2 - 4*a*c)*(b^2*d*f + (c*d - a*f)^2)*(p + 1)), Int[(a + b*x + c*x^2)^(p + 1)*(d + f
*x^2)^q*Simp[(b*h - 2*g*c)*((c*d - a*f)^2 - (b*d)*(-(b*f)))*(p + 1) + (b^2*(g*f) - b*(h*c*d + a*h*f) + 2*(g*c*
(c*d - a*f)))*(a*f*(p + 1) - c*d*(p + 2)) - (2*f*((g*c)*(-(b*(c*d + a*f))) + (g*b - a*h)*(2*c^2*d + b^2*f - c*
(2*a*f)))*(p + q + 2) - (b^2*(g*f) - b*(h*c*d + a*h*f) + 2*(g*c*(c*d - a*f)))*(b*f*(p + 1)))*x - c*f*(b^2*(g*f
) - b*(h*c*d + a*h*f) + 2*(g*c*(c*d - a*f)))*(2*p + 2*q + 5)*x^2, x], x], x] /; FreeQ[{a, b, c, d, f, g, h, q}
, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[b^2*d*f + (c*d - a*f)^2, 0] &&  !( !IntegerQ[p] && ILtQ[q, -1
])

Rule 1065

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)*((A_.) + (C_.)*(x_)^2)*((d_) + (f_.)*(x_)^2)^(q_), x_Symbol] :> Si
mp[((a + b*x + c*x^2)^(p + 1)*(d + f*x^2)^(q + 1)*((A*c - a*C)*(-(b*(c*d + a*f))) + (A*b)*(2*c^2*d + b^2*f - c
*(2*a*f)) + c*(A*(2*c^2*d + b^2*f - c*(2*a*f)) + C*(b^2*d - 2*a*(c*d - a*f)))*x))/((b^2 - 4*a*c)*(b^2*d*f + (c
*d - a*f)^2)*(p + 1)), x] + Dist[1/((b^2 - 4*a*c)*(b^2*d*f + (c*d - a*f)^2)*(p + 1)), Int[(a + b*x + c*x^2)^(p
 + 1)*(d + f*x^2)^q*Simp[(-2*A*c - 2*a*C)*((c*d - a*f)^2 - (b*d)*(-(b*f)))*(p + 1) + (b^2*(C*d + A*f) + 2*(A*c
*(c*d - a*f) - a*(c*C*d - a*C*f)))*(a*f*(p + 1) - c*d*(p + 2)) - (2*f*((A*c - a*C)*(-(b*(c*d + a*f))) + (A*b)*
(2*c^2*d + b^2*f - c*(2*a*f)))*(p + q + 2) - (b^2*(C*d + A*f) + 2*(A*c*(c*d - a*f) - a*(c*C*d - a*C*f)))*(b*f*
(p + 1)))*x - c*f*(b^2*(C*d + A*f) + 2*(A*c*(c*d - a*f) - a*(c*C*d - a*C*f)))*(2*p + 2*q + 5)*x^2, x], x], x]
/; FreeQ[{a, b, c, d, f, A, C, q}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[b^2*d*f + (c*d - a*f)^2, 0]
&&  !( !IntegerQ[p] && ILtQ[q, -1]) &&  !IGtQ[q, 0]

Rubi steps

\begin{align*} \int \frac{\left (\sqrt{x}-\sqrt{-1+x^2}\right )^2}{\left (1+x-x^2\right )^2 \sqrt{-1+x^2}} \, dx &=\int \left (-\frac{2 \sqrt{x}}{\left (-1-x+x^2\right )^2}-\frac{1}{\sqrt{-1+x^2} \left (-1-x+x^2\right )^2}+\frac{x}{\sqrt{-1+x^2} \left (-1-x+x^2\right )^2}+\frac{x^2}{\sqrt{-1+x^2} \left (-1-x+x^2\right )^2}\right ) \, dx\\ &=-\left (2 \int \frac{\sqrt{x}}{\left (-1-x+x^2\right )^2} \, dx\right )-\int \frac{1}{\sqrt{-1+x^2} \left (-1-x+x^2\right )^2} \, dx+\int \frac{x}{\sqrt{-1+x^2} \left (-1-x+x^2\right )^2} \, dx+\int \frac{x^2}{\sqrt{-1+x^2} \left (-1-x+x^2\right )^2} \, dx\\ &=\frac{2 (1-2 x) \sqrt{x}}{5 \left (1+x-x^2\right )}-\frac{(1-2 x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}-\frac{(3-x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}+\frac{(2+x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}+\frac{1}{5} \int \frac{1-3 x}{\sqrt{-1+x^2} \left (-1-x+x^2\right )} \, dx+\frac{1}{5} \int \frac{-3-x}{\sqrt{-1+x^2} \left (-1-x+x^2\right )} \, dx+\frac{1}{5} \int \frac{1+2 x}{\sqrt{-1+x^2} \left (-1-x+x^2\right )} \, dx-\frac{2}{5} \int \frac{-\frac{1}{2}-x}{\sqrt{x} \left (-1-x+x^2\right )} \, dx\\ &=\frac{2 (1-2 x) \sqrt{x}}{5 \left (1+x-x^2\right )}-\frac{(1-2 x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}-\frac{(3-x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}+\frac{(2+x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}-\frac{4}{5} \operatorname{Subst}\left (\int \frac{-\frac{1}{2}-x^2}{-1-x^2+x^4} \, dx,x,\sqrt{x}\right )+\frac{1}{25} \left (2 \left (5-2 \sqrt{5}\right )\right ) \int \frac{1}{\left (-1+\sqrt{5}+2 x\right ) \sqrt{-1+x^2}} \, dx+\frac{1}{25} \left (-15+\sqrt{5}\right ) \int \frac{1}{\left (-1+\sqrt{5}+2 x\right ) \sqrt{-1+x^2}} \, dx-\frac{1}{25} \left (15+\sqrt{5}\right ) \int \frac{1}{\left (-1-\sqrt{5}+2 x\right ) \sqrt{-1+x^2}} \, dx+\frac{1}{25} \left (2 \left (5+2 \sqrt{5}\right )\right ) \int \frac{1}{\left (-1-\sqrt{5}+2 x\right ) \sqrt{-1+x^2}} \, dx+\frac{1}{25} \left (-5+7 \sqrt{5}\right ) \int \frac{1}{\left (-1+\sqrt{5}+2 x\right ) \sqrt{-1+x^2}} \, dx-\frac{1}{25} \left (5+7 \sqrt{5}\right ) \int \frac{1}{\left (-1-\sqrt{5}+2 x\right ) \sqrt{-1+x^2}} \, dx\\ &=\frac{2 (1-2 x) \sqrt{x}}{5 \left (1+x-x^2\right )}-\frac{(1-2 x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}-\frac{(3-x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}+\frac{(2+x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}+\frac{1}{25} \left (5-7 \sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{1}{-4+\left (-1+\sqrt{5}\right )^2-x^2} \, dx,x,\frac{-2-\left (-1+\sqrt{5}\right ) x}{\sqrt{-1+x^2}}\right )-\frac{1}{25} \left (2 \left (5-2 \sqrt{5}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-4+\left (-1+\sqrt{5}\right )^2-x^2} \, dx,x,\frac{-2-\left (-1+\sqrt{5}\right ) x}{\sqrt{-1+x^2}}\right )+\frac{1}{25} \left (2 \left (5-2 \sqrt{5}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-\frac{1}{2}+\frac{\sqrt{5}}{2}+x^2} \, dx,x,\sqrt{x}\right )+\frac{1}{25} \left (15-\sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{1}{-4+\left (-1+\sqrt{5}\right )^2-x^2} \, dx,x,\frac{-2-\left (-1+\sqrt{5}\right ) x}{\sqrt{-1+x^2}}\right )+\frac{1}{25} \left (15+\sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{1}{-4+\left (-1-\sqrt{5}\right )^2-x^2} \, dx,x,\frac{-2-\left (-1-\sqrt{5}\right ) x}{\sqrt{-1+x^2}}\right )-\frac{1}{25} \left (2 \left (5+2 \sqrt{5}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-4+\left (-1-\sqrt{5}\right )^2-x^2} \, dx,x,\frac{-2-\left (-1-\sqrt{5}\right ) x}{\sqrt{-1+x^2}}\right )+\frac{1}{25} \left (2 \left (5+2 \sqrt{5}\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-\frac{1}{2}-\frac{\sqrt{5}}{2}+x^2} \, dx,x,\sqrt{x}\right )+\frac{1}{25} \left (5+7 \sqrt{5}\right ) \operatorname{Subst}\left (\int \frac{1}{-4+\left (-1-\sqrt{5}\right )^2-x^2} \, dx,x,\frac{-2-\left (-1-\sqrt{5}\right ) x}{\sqrt{-1+x^2}}\right )\\ &=\frac{2 (1-2 x) \sqrt{x}}{5 \left (1+x-x^2\right )}-\frac{(1-2 x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}-\frac{(3-x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}+\frac{(2+x) \sqrt{-1+x^2}}{5 \left (1+x-x^2\right )}+\frac{1}{5} \sqrt{\frac{2}{5} \left (-11+5 \sqrt{5}\right )} \tan ^{-1}\left (\sqrt{\frac{2}{-1+\sqrt{5}}} \sqrt{x}\right )-\frac{1}{5} \sqrt{\frac{1}{10} \left (-11+5 \sqrt{5}\right )} \tan ^{-1}\left (\frac{2-\left (1-\sqrt{5}\right ) x}{\sqrt{2 \left (-1+\sqrt{5}\right )} \sqrt{-1+x^2}}\right )-\frac{1}{5} \sqrt{\frac{1}{5} \left (-2+5 \sqrt{5}\right )} \tan ^{-1}\left (\frac{2-\left (1-\sqrt{5}\right ) x}{\sqrt{2 \left (-1+\sqrt{5}\right )} \sqrt{-1+x^2}}\right )+\frac{1}{5} \sqrt{\frac{1}{5} \left (2+5 \sqrt{5}\right )} \tan ^{-1}\left (\frac{2-\left (1-\sqrt{5}\right ) x}{\sqrt{2 \left (-1+\sqrt{5}\right )} \sqrt{-1+x^2}}\right )-\frac{1}{5} \sqrt{\frac{2}{5} \left (11+5 \sqrt{5}\right )} \tanh ^{-1}\left (\sqrt{\frac{2}{1+\sqrt{5}}} \sqrt{x}\right )-\frac{1}{5} \sqrt{\frac{1}{5} \left (-2+5 \sqrt{5}\right )} \tanh ^{-1}\left (\frac{2-\left (1+\sqrt{5}\right ) x}{\sqrt{2 \left (1+\sqrt{5}\right )} \sqrt{-1+x^2}}\right )-\frac{1}{5} \sqrt{\frac{1}{5} \left (2+5 \sqrt{5}\right )} \tanh ^{-1}\left (\frac{2-\left (1+\sqrt{5}\right ) x}{\sqrt{2 \left (1+\sqrt{5}\right )} \sqrt{-1+x^2}}\right )+\frac{1}{5} \sqrt{\frac{1}{10} \left (11+5 \sqrt{5}\right )} \tanh ^{-1}\left (\frac{2-\left (1+\sqrt{5}\right ) x}{\sqrt{2 \left (1+\sqrt{5}\right )} \sqrt{-1+x^2}}\right )\\ \end{align*}

Mathematica [A]  time = 0.648909, size = 311, normalized size = 1.41 \[ \frac{1}{25} \left (\frac{-20 x^{3/2}+20 \sqrt{x^2-1} x-10 \sqrt{x^2-1}+\sqrt{50 \sqrt{5}-110} \left (-x^2+x+1\right ) \tan ^{-1}\left (\sqrt{\frac{2}{\sqrt{5}-1}} \sqrt{x}\right )+\sqrt{10 \left (1+\sqrt{5}\right )} \left (-x^2+x+1\right ) \tan ^{-1}\left (\frac{-\sqrt{5} x+x-2}{\sqrt{2 \left (\sqrt{5}-1\right )} \sqrt{x^2-1}}\right )+5 \sqrt{\frac{2}{\sqrt{5}-1}} \left (x^2-x-1\right ) \tan ^{-1}\left (\frac{-\sqrt{5} x+x-2}{\sqrt{2 \left (\sqrt{5}-1\right )} \sqrt{x^2-1}}\right )+10 \sqrt{x}}{-x^2+x+1}+\sqrt{\frac{2}{1+\sqrt{5}}} \left (5+2 \sqrt{5}\right ) \tanh ^{-1}\left (\frac{\sqrt{5} x+x-2}{\sqrt{2 \left (1+\sqrt{5}\right )} \sqrt{x^2-1}}\right )-\sqrt{110+50 \sqrt{5}} \tanh ^{-1}\left (\sqrt{\frac{2}{1+\sqrt{5}}} \sqrt{x}\right )\right ) \]

Warning: Unable to verify antiderivative.

[In]

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

[Out]

((10*Sqrt[x] - 20*x^(3/2) - 10*Sqrt[-1 + x^2] + 20*x*Sqrt[-1 + x^2] + Sqrt[-110 + 50*Sqrt[5]]*(1 + x - x^2)*Ar
cTan[Sqrt[2/(-1 + Sqrt[5])]*Sqrt[x]] + Sqrt[10*(1 + Sqrt[5])]*(1 + x - x^2)*ArcTan[(-2 + x - Sqrt[5]*x)/(Sqrt[
2*(-1 + Sqrt[5])]*Sqrt[-1 + x^2])] + 5*Sqrt[2/(-1 + Sqrt[5])]*(-1 - x + x^2)*ArcTan[(-2 + x - Sqrt[5]*x)/(Sqrt
[2*(-1 + Sqrt[5])]*Sqrt[-1 + x^2])])/(1 + x - x^2) - Sqrt[110 + 50*Sqrt[5]]*ArcTanh[Sqrt[2/(1 + Sqrt[5])]*Sqrt
[x]] + Sqrt[2/(1 + Sqrt[5])]*(5 + 2*Sqrt[5])*ArcTanh[(-2 + x + Sqrt[5]*x)/(Sqrt[2*(1 + Sqrt[5])]*Sqrt[-1 + x^2
])])/25

________________________________________________________________________________________

Maple [B]  time = 0.021, size = 1542, normalized size = 7. \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/5*x^(1/2)/(x-1/2*5^(1/2)-1/2)-4/5/(2+2*5^(1/2))^(1/2)*arctanh(2*x^(1/2)/(2+2*5^(1/2))^(1/2))+2/5*x^(1/2)/(x+
1/2*5^(1/2)-1/2)+4/5/(-2+2*5^(1/2))^(1/2)*arctan(2*x^(1/2)/(-2+2*5^(1/2))^(1/2))+1/10*5^(1/2)/(1/2-1/2*5^(1/2)
)/(x+1/2*5^(1/2)-1/2)*((x+1/2*5^(1/2)-1/2)^2+(-5^(1/2)+1)*(x+1/2*5^(1/2)-1/2)+1/2-1/2*5^(1/2))^(1/2)-1/10*5^(1
/2)/(1/2+1/2*5^(1/2))/(x-1/2*5^(1/2)-1/2)*((x-1/2*5^(1/2)-1/2)^2+(5^(1/2)+1)*(x-1/2*5^(1/2)-1/2)+1/2+1/2*5^(1/
2))^(1/2)-2/5/(-2+2*5^(1/2))^(1/2)*arctan(2*(1-5^(1/2)+(-5^(1/2)+1)*(x+1/2*5^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^2+(5^(1/2)+1)*(x-1/2*5
^(1/2)-1/2)+1/2+1/2*5^(1/2))^(1/2))+4/25*5^(1/2)/(2+2*5^(1/2))^(1/2)*arctanh(2*(1+5^(1/2)+(5^(1/2)+1)*(x-1/2*5
^(1/2)-1/2))/(2+2*5^(1/2))^(1/2)/(4*(x-1/2*5^(1/2)-1/2)^2+4*(5^(1/2)+1)*(x-1/2*5^(1/2)-1/2)+2+2*5^(1/2))^(1/2)
)-1/10/(1/2-1/2*5^(1/2))/(x+1/2*5^(1/2)-1/2)*((x+1/2*5^(1/2)-1/2)^2+(-5^(1/2)+1)*(x+1/2*5^(1/2)-1/2)+1/2-1/2*5
^(1/2))^(1/2)-1/10/(1/2+1/2*5^(1/2))/(x-1/2*5^(1/2)-1/2)*((x-1/2*5^(1/2)-1/2)^2+(5^(1/2)+1)*(x-1/2*5^(1/2)-1/2
)+1/2+1/2*5^(1/2))^(1/2)+4/25*5^(1/2)/(-2+2*5^(1/2))^(1/2)*arctan(2*(1-5^(1/2)+(-5^(1/2)+1)*(x+1/2*5^(1/2)-1/2
))/(-2+2*5^(1/2))^(1/2)/(4*(x+1/2*5^(1/2)-1/2)^2+4*(-5^(1/2)+1)*(x+1/2*5^(1/2)-1/2)+2-2*5^(1/2))^(1/2))-8/25/(
2+2*5^(1/2))^(1/2)*arctanh(2*x^(1/2)/(2+2*5^(1/2))^(1/2))*5^(1/2)-8/25/(-2+2*5^(1/2))^(1/2)*arctan(2*x^(1/2)/(
-2+2*5^(1/2))^(1/2))*5^(1/2)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} -\frac{2 \,{\left (x^{\frac{5}{2}} - 3 \, x^{\frac{3}{2}}\right )}}{5 \,{\left (x^{2} - x - 1\right )}} + \int \frac{x^{\frac{3}{2}} + \sqrt{x}}{5 \,{\left (x^{2} - x - 1\right )}}\,{d x} + \int \frac{x^{2} + x - 1}{{\left (x^{4} - 2 \, x^{3} - x^{2} + 2 \, x + 1\right )} \sqrt{x + 1} \sqrt{x - 1}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2/5*(x^(5/2) - 3*x^(3/2))/(x^2 - x - 1) + integrate(1/5*(x^(3/2) + sqrt(x))/(x^2 - x - 1), x) + integrate((x^
2 + x - 1)/((x^4 - 2*x^3 - x^2 + 2*x + 1)*sqrt(x + 1)*sqrt(x - 1)), x)

________________________________________________________________________________________

Fricas [B]  time = 2.35997, size = 1287, normalized size = 5.85 \begin{align*} \frac{4 \, \sqrt{5}{\left (x^{2} - x - 1\right )} \sqrt{10 \, \sqrt{5} - 22} \arctan \left (\frac{1}{2} \, \sqrt{2 \, x^{2} - \sqrt{x^{2} - 1}{\left (2 \, x + \sqrt{5} - 1\right )} + \sqrt{5} x - x} \sqrt{10 \, \sqrt{5} - 22}{\left (\sqrt{5} + 2\right )} + \frac{1}{4} \,{\left (\sqrt{5}{\left (2 \, x + 1\right )} - 2 \, \sqrt{x^{2} - 1}{\left (\sqrt{5} + 2\right )} + 4 \, x + 3\right )} \sqrt{10 \, \sqrt{5} - 22}\right ) - 4 \, \sqrt{5}{\left (x^{2} - x - 1\right )} \sqrt{10 \, \sqrt{5} - 22} \arctan \left (\frac{1}{4} \,{\left (\sqrt{2} \sqrt{2 \, x + \sqrt{5} - 1}{\left (\sqrt{5} + 2\right )} - 2 \, \sqrt{x}{\left (\sqrt{5} + 2\right )}\right )} \sqrt{10 \, \sqrt{5} - 22}\right ) - \sqrt{5}{\left (x^{2} - x - 1\right )} \sqrt{10 \, \sqrt{5} + 22} \log \left (\sqrt{10 \, \sqrt{5} + 22}{\left (\sqrt{5} - 3\right )} - 4 \, x + 2 \, \sqrt{5} + 4 \, \sqrt{x^{2} - 1} + 2\right ) + \sqrt{5}{\left (x^{2} - x - 1\right )} \sqrt{10 \, \sqrt{5} + 22} \log \left (\sqrt{10 \, \sqrt{5} + 22}{\left (\sqrt{5} - 3\right )} + 4 \, \sqrt{x}\right ) + \sqrt{5}{\left (x^{2} - x - 1\right )} \sqrt{10 \, \sqrt{5} + 22} \log \left (-\sqrt{10 \, \sqrt{5} + 22}{\left (\sqrt{5} - 3\right )} - 4 \, x + 2 \, \sqrt{5} + 4 \, \sqrt{x^{2} - 1} + 2\right ) - \sqrt{5}{\left (x^{2} - x - 1\right )} \sqrt{10 \, \sqrt{5} + 22} \log \left (-\sqrt{10 \, \sqrt{5} + 22}{\left (\sqrt{5} - 3\right )} + 4 \, \sqrt{x}\right ) - 40 \, x^{2} - 20 \, \sqrt{x^{2} - 1}{\left (2 \, x - 1\right )} + 20 \,{\left (2 \, x - 1\right )} \sqrt{x} + 40 \, x + 40}{50 \,{\left (x^{2} - x - 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/50*(4*sqrt(5)*(x^2 - x - 1)*sqrt(10*sqrt(5) - 22)*arctan(1/2*sqrt(2*x^2 - sqrt(x^2 - 1)*(2*x + sqrt(5) - 1)
+ sqrt(5)*x - x)*sqrt(10*sqrt(5) - 22)*(sqrt(5) + 2) + 1/4*(sqrt(5)*(2*x + 1) - 2*sqrt(x^2 - 1)*(sqrt(5) + 2)
+ 4*x + 3)*sqrt(10*sqrt(5) - 22)) - 4*sqrt(5)*(x^2 - x - 1)*sqrt(10*sqrt(5) - 22)*arctan(1/4*(sqrt(2)*sqrt(2*x
 + sqrt(5) - 1)*(sqrt(5) + 2) - 2*sqrt(x)*(sqrt(5) + 2))*sqrt(10*sqrt(5) - 22)) - sqrt(5)*(x^2 - x - 1)*sqrt(1
0*sqrt(5) + 22)*log(sqrt(10*sqrt(5) + 22)*(sqrt(5) - 3) - 4*x + 2*sqrt(5) + 4*sqrt(x^2 - 1) + 2) + sqrt(5)*(x^
2 - x - 1)*sqrt(10*sqrt(5) + 22)*log(sqrt(10*sqrt(5) + 22)*(sqrt(5) - 3) + 4*sqrt(x)) + sqrt(5)*(x^2 - x - 1)*
sqrt(10*sqrt(5) + 22)*log(-sqrt(10*sqrt(5) + 22)*(sqrt(5) - 3) - 4*x + 2*sqrt(5) + 4*sqrt(x^2 - 1) + 2) - sqrt
(5)*(x^2 - x - 1)*sqrt(10*sqrt(5) + 22)*log(-sqrt(10*sqrt(5) + 22)*(sqrt(5) - 3) + 4*sqrt(x)) - 40*x^2 - 20*sq
rt(x^2 - 1)*(2*x - 1) + 20*(2*x - 1)*sqrt(x) + 40*x + 40)/(x^2 - x - 1)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (\sqrt{x^{2} - 1} - \sqrt{x}\right )}^{2}}{{\left (x^{2} - x - 1\right )}^{2} \sqrt{x^{2} - 1}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((sqrt(x^2 - 1) - sqrt(x))^2/((x^2 - x - 1)^2*sqrt(x^2 - 1)), x)