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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0425961, antiderivative size = 61, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 18, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.278, Rules used = {734, 843, 621, 206, 724} $\sqrt{x^2-x-1}+\frac{3}{2} \tanh ^{-1}\left (\frac{1-2 x}{2 \sqrt{x^2-x-1}}\right )+\tanh ^{-1}\left (\frac{3 x+1}{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] + (3*ArcTanh[(1 - 2*x)/(2*Sqrt[-1 - x + x^2])])/2 + ArcTanh[(1 + 3*x)/(2*Sqrt[-1 - x + x^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]

Rubi steps

\begin{align*} \int \frac{\sqrt{-1-x+x^2}}{1+x} \, dx &=\sqrt{-1-x+x^2}-\frac{1}{2} \int \frac{1+3 x}{(1+x) \sqrt{-1-x+x^2}} \, dx\\ &=\sqrt{-1-x+x^2}-\frac{3}{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{-1-3 x}{\sqrt{-1-x+x^2}}\right )-3 \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}+\frac{3}{2} \tanh ^{-1}\left (\frac{1-2 x}{2 \sqrt{-1-x+x^2}}\right )+\tanh ^{-1}\left (\frac{1+3 x}{2 \sqrt{-1-x+x^2}}\right )\\ \end{align*}

Mathematica [A]  time = 0.0165095, size = 63, normalized size = 1.03 $\sqrt{x^2-x-1}-\tanh ^{-1}\left (\frac{-3 x-1}{2 \sqrt{x^2-x-1}}\right )-\frac{3}{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] - ArcTanh[(-1 - 3*x)/(2*Sqrt[-1 - x + x^2])] - (3*ArcTanh[(-1 + 2*x)/(2*Sqrt[-1 - x + x^2])
])/2

________________________________________________________________________________________

Maple [A]  time = 0.042, size = 54, normalized size = 0.9 \begin{align*} \sqrt{ \left ( 1+x \right ) ^{2}-2-3\,x}-{\frac{3}{2}\ln \left ( -{\frac{1}{2}}+x+\sqrt{ \left ( 1+x \right ) ^{2}-2-3\,x} \right ) }-{\it Artanh} \left ({\frac{-1-3\,x}{2}{\frac{1}{\sqrt{ \left ( 1+x \right ) ^{2}-2-3\,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-3*x)^(1/2)-3/2*ln(-1/2+x+((1+x)^2-2-3*x)^(1/2))-arctanh(1/2*(-1-3*x)/((1+x)^2-2-3*x)^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 0.993341, size = 84, normalized size = 1.38 \begin{align*} \sqrt{x^{2} - x - 1} - \frac{3}{2} \, \log \left (2 \, x + 2 \, \sqrt{x^{2} - x - 1} - 1\right ) - \log \left (\frac{2 \, \sqrt{x^{2} - x - 1}}{{\left | x + 1 \right |}} + \frac{2}{{\left | x + 1 \right |}} - 3\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) - 3/2*log(2*x + 2*sqrt(x^2 - x - 1) - 1) - log(2*sqrt(x^2 - x - 1)/abs(x + 1) + 2/abs(x + 1)
- 3)

________________________________________________________________________________________

Fricas [A]  time = 2.37564, size = 169, normalized size = 2.77 \begin{align*} \sqrt{x^{2} - x - 1} - \log \left (-x + \sqrt{x^{2} - x - 1}\right ) + \log \left (-x + \sqrt{x^{2} - x - 1} - 2\right ) + \frac{3}{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) - log(-x + sqrt(x^2 - x - 1)) + log(-x + sqrt(x^2 - x - 1) - 2) + 3/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.08727, size = 90, normalized size = 1.48 \begin{align*} \sqrt{x^{2} - x - 1} - \log \left ({\left | -x + \sqrt{x^{2} - x - 1} \right |}\right ) + \log \left ({\left | -x + \sqrt{x^{2} - x - 1} - 2 \right |}\right ) + \frac{3}{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) - log(abs(-x + sqrt(x^2 - x - 1))) + log(abs(-x + sqrt(x^2 - x - 1) - 2)) + 3/2*log(abs(-2*x
+ 2*sqrt(x^2 - x - 1) + 1))