### 3.104 $$\int \log (-1+4 x+4 \sqrt{(-1+x) x}) \, dx$$

Optimal. Leaf size=95 $-\frac{\sqrt{x^2-x}}{2}+x \log \left (4 \sqrt{x^2-x}+4 x-1\right )-\frac{1}{16} \tanh ^{-1}\left (\frac{1-10 x}{6 \sqrt{x^2-x}}\right )-\frac{7}{8} \tanh ^{-1}\left (\frac{x}{\sqrt{x^2-x}}\right )-\frac{x}{2}+\frac{1}{16} \log (8 x+1)$

[Out]

-x/2 - Sqrt[-x + x^2]/2 - ArcTanh[(1 - 10*x)/(6*Sqrt[-x + x^2])]/16 - (7*ArcTanh[x/Sqrt[-x + x^2]])/8 + Log[1
+ 8*x]/16 + x*Log[-1 + 4*x + 4*Sqrt[-x + x^2]]

________________________________________________________________________________________

Rubi [A]  time = 0.162303, antiderivative size = 95, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 9, integrand size = 17, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.529, Rules used = {2537, 2533, 6742, 640, 620, 206, 734, 843, 724} $-\frac{\sqrt{x^2-x}}{2}+x \log \left (4 \sqrt{x^2-x}+4 x-1\right )-\frac{1}{16} \tanh ^{-1}\left (\frac{1-10 x}{6 \sqrt{x^2-x}}\right )-\frac{7}{8} \tanh ^{-1}\left (\frac{x}{\sqrt{x^2-x}}\right )-\frac{x}{2}+\frac{1}{16} \log (8 x+1)$

Antiderivative was successfully veriﬁed.

[In]

Int[Log[-1 + 4*x + 4*Sqrt[(-1 + x)*x]],x]

[Out]

-x/2 - Sqrt[-x + x^2]/2 - ArcTanh[(1 - 10*x)/(6*Sqrt[-x + x^2])]/16 - (7*ArcTanh[x/Sqrt[-x + x^2]])/8 + Log[1
+ 8*x]/16 + x*Log[-1 + 4*x + 4*Sqrt[-x + x^2]]

Rule 2537

Int[Log[(d_.) + (f_.)*Sqrt[u_] + (e_.)*(x_)]*(v_.), x_Symbol] :> Int[v*Log[d + e*x + f*Sqrt[ExpandToSum[u, x]]
], x] /; FreeQ[{d, e, f}, x] && QuadraticQ[u, x] &&  !QuadraticMatchQ[u, x] && (EqQ[v, 1] || MatchQ[v, ((g_.)*
x)^(m_.) /; FreeQ[{g, m}, x]])

Rule 2533

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

Rule 6742

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

Rule 640

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

Rule 620

Int[1/Sqrt[(b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(1 - c*x^2), x], x, x/Sqrt[b*x + c*x^2
]], x] /; FreeQ[{b, c}, 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 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 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 \log \left (-1+4 x+4 \sqrt{(-1+x) x}\right ) \, dx &=\int \log \left (-1+4 x+4 \sqrt{-x+x^2}\right ) \, dx\\ &=x \log \left (-1+4 x+4 \sqrt{-x+x^2}\right )+8 \int \frac{x}{-4 (1+2 x) \sqrt{-x+x^2}+8 \left (-x+x^2\right )} \, dx\\ &=x \log \left (-1+4 x+4 \sqrt{-x+x^2}\right )+8 \int \left (-\frac{1}{16}+\frac{1}{16 (1+8 x)}-\frac{x}{12 \sqrt{-x+x^2}}+\frac{\sqrt{-x+x^2}}{6 (1+8 x)}\right ) \, dx\\ &=-\frac{x}{2}+\frac{1}{16} \log (1+8 x)+x \log \left (-1+4 x+4 \sqrt{-x+x^2}\right )-\frac{2}{3} \int \frac{x}{\sqrt{-x+x^2}} \, dx+\frac{4}{3} \int \frac{\sqrt{-x+x^2}}{1+8 x} \, dx\\ &=-\frac{x}{2}-\frac{1}{2} \sqrt{-x+x^2}+\frac{1}{16} \log (1+8 x)+x \log \left (-1+4 x+4 \sqrt{-x+x^2}\right )-\frac{1}{12} \int \frac{-1+10 x}{(1+8 x) \sqrt{-x+x^2}} \, dx-\frac{1}{3} \int \frac{1}{\sqrt{-x+x^2}} \, dx\\ &=-\frac{x}{2}-\frac{1}{2} \sqrt{-x+x^2}+\frac{1}{16} \log (1+8 x)+x \log \left (-1+4 x+4 \sqrt{-x+x^2}\right )-\frac{5}{48} \int \frac{1}{\sqrt{-x+x^2}} \, dx+\frac{3}{16} \int \frac{1}{(1+8 x) \sqrt{-x+x^2}} \, dx-\frac{2}{3} \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\frac{x}{\sqrt{-x+x^2}}\right )\\ &=-\frac{x}{2}-\frac{1}{2} \sqrt{-x+x^2}-\frac{2}{3} \tanh ^{-1}\left (\frac{x}{\sqrt{-x+x^2}}\right )+\frac{1}{16} \log (1+8 x)+x \log \left (-1+4 x+4 \sqrt{-x+x^2}\right )-\frac{5}{24} \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\frac{x}{\sqrt{-x+x^2}}\right )-\frac{3}{8} \operatorname{Subst}\left (\int \frac{1}{36-x^2} \, dx,x,\frac{1-10 x}{\sqrt{-x+x^2}}\right )\\ &=-\frac{x}{2}-\frac{1}{2} \sqrt{-x+x^2}-\frac{1}{16} \tanh ^{-1}\left (\frac{1-10 x}{6 \sqrt{-x+x^2}}\right )-\frac{7}{8} \tanh ^{-1}\left (\frac{x}{\sqrt{-x+x^2}}\right )+\frac{1}{16} \log (1+8 x)+x \log \left (-1+4 x+4 \sqrt{-x+x^2}\right )\\ \end{align*}

Mathematica [A]  time = 0.0282042, size = 85, normalized size = 0.89 $\frac{1}{16} \left (-8 x-8 \sqrt{(x-1) x}+16 x \log \left (4 x+4 \sqrt{(x-1) x}-1\right )+2 \log (8 x+1)-7 \log \left (-2 x-2 \sqrt{(x-1) x}+1\right )-\log \left (-10 x+6 \sqrt{(x-1) x}+1\right )\right )$

Antiderivative was successfully veriﬁed.

[In]

Integrate[Log[-1 + 4*x + 4*Sqrt[(-1 + x)*x]],x]

[Out]

(-8*x - 8*Sqrt[(-1 + x)*x] + 2*Log[1 + 8*x] - 7*Log[1 - 2*x - 2*Sqrt[(-1 + x)*x]] + 16*x*Log[-1 + 4*x + 4*Sqrt
[(-1 + x)*x]] - Log[1 - 10*x + 6*Sqrt[(-1 + x)*x]])/16

________________________________________________________________________________________

Maple [A]  time = 0.031, size = 80, normalized size = 0.8 \begin{align*} x\ln \left ( -1+4\,x+4\,\sqrt{ \left ( -1+x \right ) x} \right ) -{\frac{7}{16}\ln \left ( -{\frac{1}{2}}+x+\sqrt{{x}^{2}-x} \right ) }-{\frac{1}{16}{\it Artanh} \left ({\frac{32}{3} \left ({\frac{1}{8}}-{\frac{5\,x}{4}} \right ){\frac{1}{\sqrt{64\, \left ( x+1/8 \right ) ^{2}-80\,x-1}}}} \right ) }-{\frac{1}{2}\sqrt{{x}^{2}-x}}-{\frac{x}{2}}+{\frac{\ln \left ( 1+8\,x \right ) }{16}} \end{align*}

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

[In]

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

[Out]

x*ln(-1+4*x+4*((-1+x)*x)^(1/2))-7/16*ln(-1/2+x+(x^2-x)^(1/2))-1/16*arctanh(32/3*(1/8-5/4*x)/(64*(x+1/8)^2-80*x
-1)^(1/2))-1/2*(x^2-x)^(1/2)-1/2*x+1/16*ln(1+8*x)

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.61002, size = 278, normalized size = 2.93 \begin{align*}{\left (x + 1\right )} \log \left (4 \, x + 4 \, \sqrt{x^{2} - x} - 1\right ) - \frac{1}{2} \, x - \frac{1}{2} \, \sqrt{x^{2} - x} - \frac{7}{16} \, \log \left (8 \, x + 1\right ) + \frac{15}{16} \, \log \left (-2 \, x + 2 \, \sqrt{x^{2} - x} + 1\right ) - \frac{7}{16} \, \log \left (-2 \, x + 2 \, \sqrt{x^{2} - x} - 1\right ) + \frac{7}{16} \, \log \left (-4 \, x + 4 \, \sqrt{x^{2} - x} + 1\right ) \end{align*}

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

[In]

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

[Out]

(x + 1)*log(4*x + 4*sqrt(x^2 - x) - 1) - 1/2*x - 1/2*sqrt(x^2 - x) - 7/16*log(8*x + 1) + 15/16*log(-2*x + 2*sq
rt(x^2 - x) + 1) - 7/16*log(-2*x + 2*sqrt(x^2 - x) - 1) + 7/16*log(-4*x + 4*sqrt(x^2 - x) + 1)

________________________________________________________________________________________

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

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

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.32307, size = 136, normalized size = 1.43 \begin{align*} x \log \left (4 \, x + 4 \, \sqrt{{\left (x - 1\right )} x} - 1\right ) - \frac{1}{2} \, x - \frac{1}{2} \, \sqrt{x^{2} - x} + \frac{1}{16} \, \log \left ({\left | 8 \, x + 1 \right |}\right ) + \frac{7}{16} \, \log \left ({\left | -2 \, x + 2 \, \sqrt{x^{2} - x} + 1 \right |}\right ) + \frac{1}{16} \, \log \left ({\left | -2 \, x + 2 \, \sqrt{x^{2} - x} - 1 \right |}\right ) - \frac{1}{16} \, \log \left ({\left | -4 \, x + 4 \, \sqrt{x^{2} - x} + 1 \right |}\right ) \end{align*}

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

[In]

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

[Out]

x*log(4*x + 4*sqrt((x - 1)*x) - 1) - 1/2*x - 1/2*sqrt(x^2 - x) + 1/16*log(abs(8*x + 1)) + 7/16*log(abs(-2*x +
2*sqrt(x^2 - x) + 1)) + 1/16*log(abs(-2*x + 2*sqrt(x^2 - x) - 1)) - 1/16*log(abs(-4*x + 4*sqrt(x^2 - x) + 1))