3.805 \(\int \frac{(2 \sqrt{3-x}+\frac{3}{\sqrt{1+x}})^2}{x} \, dx\)

Optimal. Leaf size=56 \[ -4 x+21 \log (x)-9 \log (x+1)+12 \sin ^{-1}\left (\frac{1-x}{2}\right )-24 \sqrt{3} \tanh ^{-1}\left (\frac{\sqrt{3} \sqrt{x+1}}{\sqrt{3-x}}\right ) \]

[Out]

-4*x + 12*ArcSin[(1 - x)/2] - 24*Sqrt[3]*ArcTanh[(Sqrt[3]*Sqrt[1 + x])/Sqrt[3 - x]] + 21*Log[x] - 9*Log[1 + x]

________________________________________________________________________________________

Rubi [A]  time = 0.210606, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 10, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.37, Rules used = {6742, 36, 29, 31, 105, 53, 619, 216, 93, 207} \[ -4 x+21 \log (x)-9 \log (x+1)+12 \sin ^{-1}\left (\frac{1-x}{2}\right )-24 \sqrt{3} \tanh ^{-1}\left (\frac{\sqrt{3} \sqrt{x+1}}{\sqrt{3-x}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-4*x + 12*ArcSin[(1 - x)/2] - 24*Sqrt[3]*ArcTanh[(Sqrt[3]*Sqrt[1 + x])/Sqrt[3 - x]] + 21*Log[x] - 9*Log[1 + x]

Rule 6742

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

Rule 36

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

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 105

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

Rule 53

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

Rule 619

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

Rule 216

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

Rule 93

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 207

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

Rubi steps

\begin{align*} \int \frac{\left (2 \sqrt{3-x}+\frac{3}{\sqrt{1+x}}\right )^2}{x} \, dx &=\int \left (-4+\frac{12}{x}+\frac{9}{x (1+x)}+\frac{12 \sqrt{3-x}}{x \sqrt{1+x}}\right ) \, dx\\ &=-4 x+12 \log (x)+9 \int \frac{1}{x (1+x)} \, dx+12 \int \frac{\sqrt{3-x}}{x \sqrt{1+x}} \, dx\\ &=-4 x+12 \log (x)+9 \int \frac{1}{x} \, dx-9 \int \frac{1}{1+x} \, dx-12 \int \frac{1}{\sqrt{3-x} \sqrt{1+x}} \, dx+36 \int \frac{1}{\sqrt{3-x} x \sqrt{1+x}} \, dx\\ &=-4 x+21 \log (x)-9 \log (1+x)-12 \int \frac{1}{\sqrt{3+2 x-x^2}} \, dx+72 \operatorname{Subst}\left (\int \frac{1}{-1+3 x^2} \, dx,x,\frac{\sqrt{1+x}}{\sqrt{3-x}}\right )\\ &=-4 x-24 \sqrt{3} \tanh ^{-1}\left (\frac{\sqrt{3} \sqrt{1+x}}{\sqrt{3-x}}\right )+21 \log (x)-9 \log (1+x)+3 \operatorname{Subst}\left (\int \frac{1}{\sqrt{1-\frac{x^2}{16}}} \, dx,x,2-2 x\right )\\ &=-4 x+12 \sin ^{-1}\left (\frac{1-x}{2}\right )-24 \sqrt{3} \tanh ^{-1}\left (\frac{\sqrt{3} \sqrt{1+x}}{\sqrt{3-x}}\right )+21 \log (x)-9 \log (1+x)\\ \end{align*}

Mathematica [A]  time = 0.102528, size = 57, normalized size = 1.02 \[ -4 x+21 \log (x)-9 \log (x+1)+24 \sin ^{-1}\left (\frac{\sqrt{3-x}}{2}\right )-24 \sqrt{3} \tanh ^{-1}\left (\frac{\sqrt{1-\frac{x}{3}}}{\sqrt{x+1}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-4*x + 24*ArcSin[Sqrt[3 - x]/2] - 24*Sqrt[3]*ArcTanh[Sqrt[1 - x/3]/Sqrt[1 + x]] + 21*Log[x] - 9*Log[1 + x]

________________________________________________________________________________________

Maple [A]  time = 0.019, size = 76, normalized size = 1.4 \begin{align*} -4\,x+21\,\ln \left ( x \right ) +12\,{\frac{\sqrt{3-x}\sqrt{1+x}}{\sqrt{-{x}^{2}+2\,x+3}} \left ( -\arcsin \left ( -1/2+x/2 \right ) -\sqrt{3}{\it Artanh} \left ( 1/3\,{\frac{ \left ( 3+x \right ) \sqrt{3}}{\sqrt{-{x}^{2}+2\,x+3}}} \right ) \right ) }-9\,\ln \left ( 1+x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-4*x+21*ln(x)+12*(1+x)^(1/2)*(3-x)^(1/2)/(-x^2+2*x+3)^(1/2)*(-arcsin(-1/2+1/2*x)-3^(1/2)*arctanh(1/3*(3+x)*3^(
1/2)/(-x^2+2*x+3)^(1/2)))-9*ln(1+x)

________________________________________________________________________________________

Maxima [A]  time = 1.60881, size = 77, normalized size = 1.38 \begin{align*} -12 \, \sqrt{3} \log \left (\frac{2 \, \sqrt{3} \sqrt{-x^{2} + 2 \, x + 3}}{{\left | x \right |}} + \frac{6}{{\left | x \right |}} + 2\right ) - 4 \, x + 12 \, \arcsin \left (-\frac{1}{2} \, x + \frac{1}{2}\right ) - 9 \, \log \left (x + 1\right ) + 21 \, \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-12*sqrt(3)*log(2*sqrt(3)*sqrt(-x^2 + 2*x + 3)/abs(x) + 6/abs(x) + 2) - 4*x + 12*arcsin(-1/2*x + 1/2) - 9*log(
x + 1) + 21*log(x)

________________________________________________________________________________________

Fricas [A]  time = 1.84008, size = 236, normalized size = 4.21 \begin{align*} 6 \, \sqrt{3} \log \left (-\frac{\sqrt{3}{\left (x + 3\right )} \sqrt{x + 1} \sqrt{-x + 3} + x^{2} - 6 \, x - 9}{x^{2}}\right ) - 4 \, x + 12 \, \arctan \left (\frac{\sqrt{x + 1}{\left (x - 1\right )} \sqrt{-x + 3}}{x^{2} - 2 \, x - 3}\right ) - 9 \, \log \left (x + 1\right ) + 21 \, \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

6*sqrt(3)*log(-(sqrt(3)*(x + 3)*sqrt(x + 1)*sqrt(-x + 3) + x^2 - 6*x - 9)/x^2) - 4*x + 12*arctan(sqrt(x + 1)*(
x - 1)*sqrt(-x + 3)/(x^2 - 2*x - 3)) - 9*log(x + 1) + 21*log(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: NotImplementedError