3.11.15 \(\int \frac {-\sqrt {-4+x}-4 \sqrt {-1+x}+\sqrt {-4+x} x+\sqrt {-1+x} x}{(1+\sqrt {-4+x}+\sqrt {-1+x}) (4-5 x+x^2)} \, dx\) [1015]

Optimal. Leaf size=19 \[ 2 \log \left (1+\sqrt {-4+x}+\sqrt {-1+x}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.37, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 66, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.045, Rules used = {6820, 1600, 6816} \begin {gather*} 2 \log \left (\sqrt {x-4}+\sqrt {x-1}+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

2*Log[1 + Sqrt[-4 + x] + Sqrt[-1 + x]]

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 6816

Int[(u_)/(y_), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*Log[RemoveContent[y, x]], x] /;  !Fa
lseQ[q]]

Rule 6820

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

Rubi steps

\begin {align*} \int \frac {-\sqrt {-4+x}-4 \sqrt {-1+x}+\sqrt {-4+x} x+\sqrt {-1+x} x}{\left (1+\sqrt {-4+x}+\sqrt {-1+x}\right ) \left (4-5 x+x^2\right )} \, dx &=\int \frac {\sqrt {-1+x} \left (-4+\sqrt {-4+x} \sqrt {-1+x}+x\right )}{\left (1+\sqrt {-4+x}+\sqrt {-1+x}\right ) \left (4-5 x+x^2\right )} \, dx\\ &=\int \frac {-4+\sqrt {-4+x} \sqrt {-1+x}+x}{\left (1+\sqrt {-4+x}+\sqrt {-1+x}\right ) (-4+x) \sqrt {-1+x}} \, dx\\ &=2 \log \left (1+\sqrt {-4+x}+\sqrt {-1+x}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.27, size = 27, normalized size = 1.42 \begin {gather*} 4 \tanh ^{-1}\left (1-\frac {2 \sqrt {-4+x}}{3}+\frac {2 \sqrt {-1+x}}{3}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(146\) vs. \(2(15)=30\).
time = 0.40, size = 147, normalized size = 7.74

method result size
default \(\frac {\ln \left (-5+x \right )}{2}+\frac {\ln \left (2+\sqrt {-1+x}\right )}{2}-\frac {\ln \left (-2+\sqrt {-1+x}\right )}{2}-\frac {\ln \left (1+\sqrt {x -4}\right )}{2}+\frac {\ln \left (-1+\sqrt {x -4}\right )}{2}+\frac {7 \sqrt {x -4}\, \sqrt {-1+x}\, \arctanh \left (\frac {-17+5 x}{4 \sqrt {x^{2}-5 x +4}}\right )}{4 \sqrt {x^{2}-5 x +4}}+\frac {\sqrt {x -4}\, \sqrt {-1+x}\, \left (2 \ln \left (-\frac {5}{2}+x +\sqrt {x^{2}-5 x +4}\right )-5 \arctanh \left (\frac {-17+5 x}{4 \sqrt {x^{2}-5 x +4}}\right )\right )}{4 \sqrt {x^{2}-5 x +4}}\) \(147\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-(x-4)^(1/2)+x*(x-4)^(1/2)-4*(-1+x)^(1/2)+x*(-1+x)^(1/2))/(x^2-5*x+4)/(1+(x-4)^(1/2)+(-1+x)^(1/2)),x,meth
od=_RETURNVERBOSE)

[Out]

1/2*ln(-5+x)+1/2*ln(2+(-1+x)^(1/2))-1/2*ln(-2+(-1+x)^(1/2))-1/2*ln(1+(x-4)^(1/2))+1/2*ln(-1+(x-4)^(1/2))+7/4*(
x-4)^(1/2)*(-1+x)^(1/2)/(x^2-5*x+4)^(1/2)*arctanh(1/4*(-17+5*x)/(x^2-5*x+4)^(1/2))+1/4*(x-4)^(1/2)*(-1+x)^(1/2
)*(2*ln(-5/2+x+(x^2-5*x+4)^(1/2))-5*arctanh(1/4*(-17+5*x)/(x^2-5*x+4)^(1/2)))/(x^2-5*x+4)^(1/2)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 94 vs. \(2 (15) = 30\).
time = 0.33, size = 94, normalized size = 4.95 \begin {gather*} \frac {1}{2} \, \log \left (x - 1\right ) + \frac {1}{2} \, \log \left (\frac {2 \, x^{2} + 2 \, {\left ({\left (x - 1\right )} \sqrt {x - 4} + 2 \, x - 6\right )} \sqrt {x - 1} + 2 \, {\left (2 \, x - 3\right )} \sqrt {x - 4} - 7 \, x + 3}{2 \, {\left ({\left (x - 1\right )} \sqrt {x - 4} + 2 \, x - 6\right )}}\right ) + \frac {1}{2} \, \log \left (\frac {{\left (x - 1\right )} \sqrt {x - 4} + 2 \, x - 6}{x - 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*log(x - 1) + 1/2*log(1/2*(2*x^2 + 2*((x - 1)*sqrt(x - 4) + 2*x - 6)*sqrt(x - 1) + 2*(2*x - 3)*sqrt(x - 4)
- 7*x + 3)/((x - 1)*sqrt(x - 4) + 2*x - 6)) + 1/2*log(((x - 1)*sqrt(x - 4) + 2*x - 6)/(x - 1))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 96 vs. \(2 (15) = 30\).
time = 0.36, size = 96, normalized size = 5.05 \begin {gather*} -\frac {1}{2} \, \log \left (-{\left (4 \, x - 11\right )} \sqrt {x - 1} \sqrt {x - 4} + 4 \, x^{2} - 21 \, x + 23\right ) + \frac {1}{2} \, \log \left (\sqrt {x - 1} \sqrt {x - 4} - x + 7\right ) + \frac {1}{2} \, \log \left (x - 5\right ) + \frac {1}{2} \, \log \left (\sqrt {x - 1} + 2\right ) - \frac {1}{2} \, \log \left (\sqrt {x - 1} - 2\right ) - \frac {1}{2} \, \log \left (\sqrt {x - 4} + 1\right ) + \frac {1}{2} \, \log \left (\sqrt {x - 4} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*log(-(4*x - 11)*sqrt(x - 1)*sqrt(x - 4) + 4*x^2 - 21*x + 23) + 1/2*log(sqrt(x - 1)*sqrt(x - 4) - x + 7) +
 1/2*log(x - 5) + 1/2*log(sqrt(x - 1) + 2) - 1/2*log(sqrt(x - 1) - 2) - 1/2*log(sqrt(x - 4) + 1) + 1/2*log(sqr
t(x - 4) - 1)

________________________________________________________________________________________

Sympy [A]
time = 157.08, size = 17, normalized size = 0.89 \begin {gather*} 2 \log {\left (\sqrt {x - 4} + \sqrt {x - 1} + 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*log(sqrt(x - 4) + sqrt(x - 1) + 1)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (15) = 30\).
time = 3.33, size = 58, normalized size = 3.05 \begin {gather*} -\log \left (\sqrt {x - 1} - \sqrt {x - 4} + 1\right ) - \log \left (\sqrt {x - 1} - \sqrt {x - 4}\right ) + \log \left (\sqrt {x - 1} + 2\right ) + \log \left ({\left | -\sqrt {x - 1} + \sqrt {x - 4} - 3 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(sqrt(x - 1) - sqrt(x - 4) + 1) - log(sqrt(x - 1) - sqrt(x - 4)) + log(sqrt(x - 1) + 2) + log(abs(-sqrt(x
- 1) + sqrt(x - 4) - 3))

________________________________________________________________________________________

Mupad [B]
time = 6.10, size = 132, normalized size = 6.95 \begin {gather*} \frac {\ln \left (x-5\right )}{2}+2\,\mathrm {atanh}\left (\frac {\sqrt {x-1}-\sqrt {3}}{\sqrt {x-4}}\right )+\frac {7\,\mathrm {atanh}\left (\frac {4\,\left (\sqrt {x-1}-\sqrt {3}\right )}{\left (\frac {{\left (\sqrt {x-1}-\sqrt {3}\right )}^2}{x-4}+1\right )\,\sqrt {x-4}}\right )}{2}-\frac {5\,\mathrm {atanh}\left (\frac {194400\,\left (\sqrt {x-1}-\sqrt {3}\right )}{\left (\frac {48600\,{\left (\sqrt {x-1}-\sqrt {3}\right )}^2}{x-4}+48600\right )\,\sqrt {x-4}}\right )}{2}-\mathrm {atanh}\left (\sqrt {x-4}\right )+\mathrm {atanh}\left (\frac {\sqrt {x-1}}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 5)/2 + 2*atanh(((x - 1)^(1/2) - 3^(1/2))/(x - 4)^(1/2)) + (7*atanh((4*((x - 1)^(1/2) - 3^(1/2)))/((((x
 - 1)^(1/2) - 3^(1/2))^2/(x - 4) + 1)*(x - 4)^(1/2))))/2 - (5*atanh((194400*((x - 1)^(1/2) - 3^(1/2)))/(((4860
0*((x - 1)^(1/2) - 3^(1/2))^2)/(x - 4) + 48600)*(x - 4)^(1/2))))/2 - atanh((x - 4)^(1/2)) + atanh((x - 1)^(1/2
)/2)

________________________________________________________________________________________