3.3.27 \(\int \frac {\frac {1}{x}+x}{\sqrt {(-2+x) (1+x)^3}} \, dx\) [227]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.23, antiderivative size = 133, normalized size of antiderivative = 1.09, number of steps used = 9, number of rules used = 9, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.474, Rules used = {1607, 6851, 1628, 21, 132, 56, 221, 95, 210} \begin {gather*} -\frac {\sqrt {2} \sqrt {x-2} (x+1)^{3/2} \text {ArcTan}\left (\frac {\sqrt {2} \sqrt {x+1}}{\sqrt {x-2}}\right )}{\sqrt {-\left ((2-x) (x+1)^3\right )}}+\frac {4 (2-x) (x+1)}{3 \sqrt {-\left ((2-x) (x+1)^3\right )}}+\frac {2 \sqrt {x-2} (x+1)^{3/2} \sinh ^{-1}\left (\frac {\sqrt {x-2}}{\sqrt {3}}\right )}{\sqrt {-\left ((2-x) (x+1)^3\right )}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 56

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

Rule 95

Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_)), x_Symbol] :> With[{q = Denomin
ator[m]}, Dist[q, Subst[Int[x^(q*(m + 1) - 1)/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^
(1/q)], x]] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && LtQ[-1, m, 0] && SimplerQ[
a + b*x, c + d*x]

Rule 132

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Dist[b*d^(m
+ n)*f^p, Int[(a + b*x)^(m - 1)/(c + d*x)^m, x], x] + Int[(a + b*x)^(m - 1)*((e + f*x)^p/(c + d*x)^m)*ExpandTo
Sum[(a + b*x)*(c + d*x)^(-p - 1) - (b*d^(-p - 1)*f^p)/(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x
] && EqQ[m + n + p + 1, 0] && ILtQ[p, 0] && (GtQ[m, 0] || SumSimplerQ[m, -1] ||  !(GtQ[n, 0] || SumSimplerQ[n,
 -1]))

Rule 210

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

Rule 221

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

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 1628

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> With[{
Qx = PolynomialQuotient[Px, a + b*x, x], R = PolynomialRemainder[Px, a + b*x, x]}, Simp[b*R*(a + b*x)^(m + 1)*
(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + Dist[1/((m + 1)*(b*c - a*d)*(b*e
 - a*f)), Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*x)^p*ExpandToSum[(m + 1)*(b*c - a*d)*(b*e - a*f)*Qx + a*d*f
*R*(m + 1) - b*R*(d*e*(m + n + 2) + c*f*(m + p + 2)) - b*d*f*R*(m + n + p + 3)*x, x], x], x]] /; FreeQ[{a, b,
c, d, e, f, n, p}, x] && PolyQ[Px, x] && LtQ[m, -1] && IntegersQ[2*m, 2*n, 2*p]

Rule 6851

Int[(u_.)*((a_.)*(v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> Dist[a^IntPart[p]*((a*v^m*w^n)^FracPart[p]/(v^(m*Fr
acPart[p])*w^(n*FracPart[p]))), Int[u*v^(m*p)*w^(n*p), x], x] /; FreeQ[{a, m, n, p}, x] &&  !IntegerQ[p] &&  !
FreeQ[v, x] &&  !FreeQ[w, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 96, normalized size = 0.79 \begin {gather*} -\frac {(1+x) \left (-8+4 x-3 \sqrt {2} \sqrt {-2+x} \sqrt {1+x} \tan ^{-1}\left (\frac {\sqrt {\frac {-2+x}{1+x}}}{\sqrt {2}}\right )-6 \sqrt {-2+x} \sqrt {1+x} \tanh ^{-1}\left (\sqrt {\frac {-2+x}{1+x}}\right )\right )}{3 \sqrt {(-2+x) (1+x)^3}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 118, normalized size = 0.97

method result size
risch \(-\frac {4 \left (-2+x \right ) \left (1+x \right )}{3 \sqrt {\left (-2+x \right ) \left (1+x \right )^{3}}}+\frac {\left (\ln \left (x -\frac {1}{2}+\sqrt {x^{2}-x -2}\right )+\frac {\sqrt {2}\, \arctan \left (\frac {\left (-4-x \right ) \sqrt {2}}{4 \sqrt {x^{2}-x -2}}\right )}{2}\right ) \left (1+x \right ) \sqrt {\left (1+x \right ) \left (-2+x \right )}}{\sqrt {\left (-2+x \right ) \left (1+x \right )^{3}}}\) \(86\)
default \(\frac {\left (-3 \sqrt {2}\, \arctan \left (\frac {\left (4+x \right ) \sqrt {2}}{4 \sqrt {x^{2}-x -2}}\right ) x +6 \ln \left (x -\frac {1}{2}+\sqrt {x^{2}-x -2}\right ) x -3 \sqrt {2}\, \arctan \left (\frac {\left (4+x \right ) \sqrt {2}}{4 \sqrt {x^{2}-x -2}}\right )+6 \ln \left (x -\frac {1}{2}+\sqrt {x^{2}-x -2}\right )-8 \sqrt {x^{2}-x -2}\right ) \sqrt {\left (1+x \right ) \left (-2+x \right )}}{6 \sqrt {\left (-2+x \right ) \left (1+x \right )^{3}}}\) \(118\)
trager \(-\frac {4 \sqrt {x^{4}+x^{3}-3 x^{2}-5 x -2}}{3 \left (1+x \right )^{2}}+\frac {\RootOf \left (\textit {\_Z}^{2}+2\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}+2\right ) x^{2}+5 \RootOf \left (\textit {\_Z}^{2}+2\right ) x +4 \sqrt {x^{4}+x^{3}-3 x^{2}-5 x -2}+4 \RootOf \left (\textit {\_Z}^{2}+2\right )}{x \left (1+x \right )}\right )}{2}-\ln \left (\frac {-2 x^{2}+2 \sqrt {x^{4}+x^{3}-3 x^{2}-5 x -2}-x +1}{1+x}\right )\) \(132\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/6*(-3*2^(1/2)*arctan(1/4*(4+x)*2^(1/2)/(x^2-x-2)^(1/2))*x+6*ln(x-1/2+(x^2-x-2)^(1/2))*x-3*2^(1/2)*arctan(1/4
*(4+x)*2^(1/2)/(x^2-x-2)^(1/2))+6*ln(x-1/2+(x^2-x-2)^(1/2))-8*(x^2-x-2)^(1/2))*((1+x)*(-2+x))^(1/2)/((-2+x)*(1
+x)^3)^(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((1/x+x)/((-2+x)*(1+x)^3)^(1/2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 142, normalized size = 1.16 \begin {gather*} \frac {3 \, \sqrt {2} {\left (x^{2} + 2 \, x + 1\right )} \arctan \left (-\frac {\sqrt {2} {\left (x^{2} + x\right )} - \sqrt {2} \sqrt {x^{4} + x^{3} - 3 \, x^{2} - 5 \, x - 2}}{2 \, {\left (x + 1\right )}}\right ) - 4 \, x^{2} - 3 \, {\left (x^{2} + 2 \, x + 1\right )} \log \left (-\frac {2 \, x^{2} + x - 2 \, \sqrt {x^{4} + x^{3} - 3 \, x^{2} - 5 \, x - 2} - 1}{x + 1}\right ) - 8 \, x - 4 \, \sqrt {x^{4} + x^{3} - 3 \, x^{2} - 5 \, x - 2} - 4}{3 \, {\left (x^{2} + 2 \, x + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*(3*sqrt(2)*(x^2 + 2*x + 1)*arctan(-1/2*(sqrt(2)*(x^2 + x) - sqrt(2)*sqrt(x^4 + x^3 - 3*x^2 - 5*x - 2))/(x
+ 1)) - 4*x^2 - 3*(x^2 + 2*x + 1)*log(-(2*x^2 + x - 2*sqrt(x^4 + x^3 - 3*x^2 - 5*x - 2) - 1)/(x + 1)) - 8*x -
4*sqrt(x^4 + x^3 - 3*x^2 - 5*x - 2) - 4)/(x^2 + 2*x + 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x^{2} + 1}{x \sqrt {\left (x - 2\right ) \left (x + 1\right )^{3}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.58, size = 83, normalized size = 0.68 \begin {gather*} \frac {\sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (x - \sqrt {x^{2} - x - 2}\right )}\right )}{\mathrm {sgn}\left (x + 1\right )} - \frac {\log \left ({\left | -2 \, x + 2 \, \sqrt {x^{2} - x - 2} + 1 \right |}\right )}{\mathrm {sgn}\left (x + 1\right )} - \frac {4}{{\left (x - \sqrt {x^{2} - x - 2} + 1\right )} \mathrm {sgn}\left (x + 1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x+\frac {1}{x}}{\sqrt {{\left (x+1\right )}^3\,\left (x-2\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________