3.2370 $$\int \frac{\sqrt{-1-x+x^2}}{1-x} \, dx$$

Optimal. Leaf size=65 $-\sqrt{x^2-x-1}-\tan ^{-1}\left (\frac{3-x}{2 \sqrt{x^2-x-1}}\right )+\frac{1}{2} \tanh ^{-1}\left (\frac{1-2 x}{2 \sqrt{x^2-x-1}}\right )$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0428585, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 20, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.3, Rules used = {734, 843, 621, 206, 724, 204} $-\sqrt{x^2-x-1}-\tan ^{-1}\left (\frac{3-x}{2 \sqrt{x^2-x-1}}\right )+\frac{1}{2} \tanh ^{-1}\left (\frac{1-2 x}{2 \sqrt{x^2-x-1}}\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 734

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m + 1)*(
a + b*x + c*x^2)^p)/(e*(m + 2*p + 1)), x] - Dist[p/(e*(m + 2*p + 1)), Int[(d + e*x)^m*Simp[b*d - 2*a*e + (2*c*
d - b*e)*x, x]*(a + b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c, d, e, m}, 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] && GtQ[p, 0] && NeQ[m + 2*p + 1, 0] && ( !RationalQ[m] || Lt
Q[m, 1]) &&  !ILtQ[m + 2*p, 0] && IntQuadraticQ[a, b, c, d, e, m, p, x]

Rule 843

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]

Rule 621

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 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 724

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

Rubi steps

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

Mathematica [A]  time = 0.0137811, size = 65, normalized size = 1. $-\sqrt{x^2-x-1}-\tan ^{-1}\left (\frac{3-x}{2 \sqrt{x^2-x-1}}\right )-\frac{1}{2} \tanh ^{-1}\left (\frac{2 x-1}{2 \sqrt{x^2-x-1}}\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.045, size = 46, normalized size = 0.7 \begin{align*} -\sqrt{ \left ( -1+x \right ) ^{2}-2+x}-{\frac{1}{2}\ln \left ( -{\frac{1}{2}}+x+\sqrt{ \left ( -1+x \right ) ^{2}-2+x} \right ) }+\arctan \left ({\frac{-3+x}{2}{\frac{1}{\sqrt{ \left ( -1+x \right ) ^{2}-2+x}}}} \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.51435, size = 78, normalized size = 1.2 \begin{align*} -\sqrt{x^{2} - x - 1} + \arcsin \left (\frac{\sqrt{5} x}{5 \,{\left | x - 1 \right |}} - \frac{3 \, \sqrt{5}}{5 \,{\left | x - 1 \right |}}\right ) - \frac{1}{2} \, \log \left (2 \, x + 2 \, \sqrt{x^{2} - x - 1} - 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-sqrt(x^2 - x - 1) + arcsin(1/5*sqrt(5)*x/abs(x - 1) - 3/5*sqrt(5)/abs(x - 1)) - 1/2*log(2*x + 2*sqrt(x^2 - x
- 1) - 1)

________________________________________________________________________________________

Fricas [A]  time = 2.48509, size = 136, normalized size = 2.09 \begin{align*} -\sqrt{x^{2} - x - 1} + 2 \, \arctan \left (-x + \sqrt{x^{2} - x - 1} + 1\right ) + \frac{1}{2} \, \log \left (-2 \, x + 2 \, \sqrt{x^{2} - x - 1} + 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int \frac{\sqrt{x^{2} - x - 1}}{x - 1}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-Integral(sqrt(x**2 - x - 1)/(x - 1), x)

________________________________________________________________________________________

Giac [A]  time = 1.10441, size = 70, normalized size = 1.08 \begin{align*} -\sqrt{x^{2} - x - 1} + 2 \, \arctan \left (-x + \sqrt{x^{2} - x - 1} + 1\right ) + \frac{1}{2} \, \log \left ({\left | -2 \, x + 2 \, \sqrt{x^{2} - x - 1} + 1 \right |}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-sqrt(x^2 - x - 1) + 2*arctan(-x + sqrt(x^2 - x - 1) + 1) + 1/2*log(abs(-2*x + 2*sqrt(x^2 - x - 1) + 1))