3.447 \(\int \frac{2 x}{(-1+x) (5+x^2)} \, dx\)

Optimal. Leaf size=38 \[ -\frac{1}{6} \log \left (x^2+5\right )+\frac{1}{3} \log (1-x)+\frac{1}{3} \sqrt{5} \tan ^{-1}\left (\frac{x}{\sqrt{5}}\right ) \]

[Out]

(Sqrt[5]*ArcTan[x/Sqrt[5]])/3 + Log[1 - x]/3 - Log[5 + x^2]/6

________________________________________________________________________________________

Rubi [A]  time = 0.0254795, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {12, 801, 635, 203, 260} \[ -\frac{1}{6} \log \left (x^2+5\right )+\frac{1}{3} \log (1-x)+\frac{1}{3} \sqrt{5} \tan ^{-1}\left (\frac{x}{\sqrt{5}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(Sqrt[5]*ArcTan[x/Sqrt[5]])/3 + Log[1 - x]/3 - Log[5 + x^2]/6

Rule 12

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

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

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

Rule 260

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

Rubi steps

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

Mathematica [A]  time = 0.0098961, size = 40, normalized size = 1.05 \[ 2 \left (-\frac{1}{12} \log \left (x^2+5\right )+\frac{1}{6} \log (1-x)+\frac{1}{6} \sqrt{5} \tan ^{-1}\left (\frac{x}{\sqrt{5}}\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2*((Sqrt[5]*ArcTan[x/Sqrt[5]])/6 + Log[1 - x]/6 - Log[5 + x^2]/12)

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 28, normalized size = 0.7 \begin{align*}{\frac{\ln \left ( x-1 \right ) }{3}}-{\frac{\ln \left ({x}^{2}+5 \right ) }{6}}+{\frac{\sqrt{5}}{3}\arctan \left ({\frac{x\sqrt{5}}{5}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*ln(x-1)-1/6*ln(x^2+5)+1/3*arctan(1/5*x*5^(1/2))*5^(1/2)

________________________________________________________________________________________

Maxima [A]  time = 1.48105, size = 36, normalized size = 0.95 \begin{align*} \frac{1}{3} \, \sqrt{5} \arctan \left (\frac{1}{5} \, \sqrt{5} x\right ) - \frac{1}{6} \, \log \left (x^{2} + 5\right ) + \frac{1}{3} \, \log \left (x - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 0.98477, size = 96, normalized size = 2.53 \begin{align*} \frac{1}{3} \, \sqrt{5} \arctan \left (\frac{1}{5} \, \sqrt{5} x\right ) - \frac{1}{6} \, \log \left (x^{2} + 5\right ) + \frac{1}{3} \, \log \left (x - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.12578, size = 31, normalized size = 0.82 \begin{align*} \frac{\log{\left (x - 1 \right )}}{3} - \frac{\log{\left (x^{2} + 5 \right )}}{6} + \frac{\sqrt{5} \operatorname{atan}{\left (\frac{\sqrt{5} x}{5} \right )}}{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1)/3 - log(x**2 + 5)/6 + sqrt(5)*atan(sqrt(5)*x/5)/3

________________________________________________________________________________________

Giac [A]  time = 1.12193, size = 38, normalized size = 1. \begin{align*} \frac{1}{3} \, \sqrt{5} \arctan \left (\frac{1}{5} \, \sqrt{5} x\right ) - \frac{1}{6} \, \log \left (x^{2} + 5\right ) + \frac{1}{3} \, \log \left ({\left | x - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*sqrt(5)*arctan(1/5*sqrt(5)*x) - 1/6*log(x^2 + 5) + 1/3*log(abs(x - 1))