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

Optimal. Leaf size=56 \[ -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) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.14, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 11, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.407, Rules used = {6874, 36, 29, 31, 132, 55, 633, 222, 12, 95, 213} \begin {gather*} 12 \text {ArcSin}\left (\frac {1-x}{2}\right )-4 x+21 \log (x)-9 \log (x+1)-24 \sqrt {3} \tanh ^{-1}\left (\frac {\sqrt {3} \sqrt {x+1}}{\sqrt {3-x}}\right ) \end {gather*}

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 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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 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 55

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 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 213

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

Rule 222

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 633

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 6874

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

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 \text {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 \text {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 [B] Leaf count is larger than twice the leaf count of optimal. \(257\) vs. \(2(56)=112\).
time = 0.62, size = 257, normalized size = 4.59 \begin {gather*} -4-4 x-48 \tan ^{-1}\left (\frac {\sqrt {1+x}}{-2+\sqrt {3-x}}\right )-42 \log \left (-2+\sqrt {3-x}\right )-30 \log (1+x)+21 \log \left (-\left ((-3+x) \sqrt {1+x}\right )+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)-2 \sqrt {-((-3+x) (1+x))}\right )-12 \sqrt {3} \log \left (-\left ((-3+x) \sqrt {1+x}\right )+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)-2 \sqrt {-((-3+x) (1+x))}\right )+21 \log \left ((-3+x) \sqrt {1+x}+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)+2 \sqrt {-((-3+x) (1+x))}\right )+12 \sqrt {3} \log \left ((-3+x) \sqrt {1+x}+\sqrt {3} \left (-2+\sqrt {3-x}\right ) (1+x)+2 \sqrt {-((-3+x) (1+x))}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-4 - 4*x - 48*ArcTan[Sqrt[1 + x]/(-2 + Sqrt[3 - x])] - 42*Log[-2 + Sqrt[3 - x]] - 30*Log[1 + x] + 21*Log[-((-3
 + x)*Sqrt[1 + x]) + Sqrt[3]*(-2 + Sqrt[3 - x])*(1 + x) - 2*Sqrt[-((-3 + x)*(1 + x))]] - 12*Sqrt[3]*Log[-((-3
+ x)*Sqrt[1 + x]) + Sqrt[3]*(-2 + Sqrt[3 - x])*(1 + x) - 2*Sqrt[-((-3 + x)*(1 + x))]] + 21*Log[(-3 + x)*Sqrt[1
 + x] + Sqrt[3]*(-2 + Sqrt[3 - x])*(1 + x) + 2*Sqrt[-((-3 + x)*(1 + x))]] + 12*Sqrt[3]*Log[(-3 + x)*Sqrt[1 + x
] + Sqrt[3]*(-2 + Sqrt[3 - x])*(1 + x) + 2*Sqrt[-((-3 + x)*(1 + x))]]

________________________________________________________________________________________

Maple [A]
time = 0.47, size = 76, normalized size = 1.36

method result size
default \(21 \ln \left (x \right )-9 \ln \left (1+x \right )+\frac {12 \sqrt {-x +3}\, \sqrt {1+x}\, \left (-\arcsin \left (-\frac {1}{2}+\frac {x}{2}\right )-\sqrt {3}\, \arctanh \left (\frac {\left (3+x \right ) \sqrt {3}}{3 \sqrt {-x^{2}+2 x +3}}\right )\right )}{\sqrt {-x^{2}+2 x +3}}-4 x\) \(76\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

21*ln(x)-9*ln(1+x)+12*(-x+3)^(1/2)*(1+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)))-4*x

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 57, normalized size = 1.02 \begin {gather*} -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 {gather*}

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 = 0.36, size = 81, normalized size = 1.45 \begin {gather*} 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 {gather*}

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.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (2 \sqrt {3 - x} \sqrt {x + 1} + 3\right )^{2}}{x \left (x + 1\right )}\, dx \end {gather*}

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.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}

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 >> Unable to parse Giac output: Warning, choosing root of [1,0,-8,0,%%%{
4,[2]%%%}+%%%{-8,[1]%%%}+%%%{4,[0]%%%}] at parameters values [5.38357630698]Warning, choosing root of [1,0,-8,
0,%%%{4,[2]%%%}+%%%{-

________________________________________________________________________________________

Mupad [B]
time = 7.91, size = 158, normalized size = 2.82 \begin {gather*} 48\,\mathrm {atan}\left (\frac {\sqrt {3-x}-4\,\sqrt {3}+3\,\sqrt {3}\,\sqrt {x+1}}{\sqrt {x+1}-3\,\sqrt {3}\,\sqrt {3-x}+8}\right )-9\,\ln \left (x+1\right )-4\,x+21\,\ln \left (x\right )+12\,\sqrt {3}\,\ln \left (\frac {6\,x-12\,\sqrt {x+1}+4\,\sqrt {3}\,\sqrt {3-x}+2\,\sqrt {3}\,\sqrt {x+1}\,\sqrt {3-x}-6}{3\,x+6\,\sqrt {3}\,\sqrt {3-x}-18}\right )-12\,\sqrt {3}\,\ln \left (\frac {\sqrt {x+1}-1}{\sqrt {3}-\sqrt {3-x}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

48*atan(((3 - x)^(1/2) - 4*3^(1/2) + 3*3^(1/2)*(x + 1)^(1/2))/((x + 1)^(1/2) - 3*3^(1/2)*(3 - x)^(1/2) + 8)) -
 9*log(x + 1) - 4*x + 21*log(x) + 12*3^(1/2)*log((6*x - 12*(x + 1)^(1/2) + 4*3^(1/2)*(3 - x)^(1/2) + 2*3^(1/2)
*(x + 1)^(1/2)*(3 - x)^(1/2) - 6)/(3*x + 6*3^(1/2)*(3 - x)^(1/2) - 18)) - 12*3^(1/2)*log(((x + 1)^(1/2) - 1)/(
3^(1/2) - (3 - x)^(1/2)))

________________________________________________________________________________________