3.300 \(\int \frac {x^4}{(-1+x) (2+x^2)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {1629, 635, 203, 260} \[ \frac {x^2}{2}-\frac {2}{3} \log \left (x^2+2\right )+x+\frac {1}{3} \log (1-x)-\frac {2}{3} \sqrt {2} \tan ^{-1}\left (\frac {x}{\sqrt {2}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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]

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 1629

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*
Pq*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 43, normalized size = 0.93 \[ \frac {1}{6} \left (3 x^2-4 \log \left (x^2+2\right )+6 x+2 \log (x-1)-4 \sqrt {2} \tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )-9\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.99, size = 33, normalized size = 0.72 \[ \frac {1}{2} \, x^{2} - \frac {2}{3} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + x - \frac {2}{3} \, \log \left (x^{2} + 2\right ) + \frac {1}{3} \, \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.32, size = 34, normalized size = 0.74 \[ \frac {1}{2} \, x^{2} - \frac {2}{3} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + x - \frac {2}{3} \, \log \left (x^{2} + 2\right ) + \frac {1}{3} \, \log \left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 34, normalized size = 0.74 \[ \frac {x^{2}}{2}+x -\frac {2 \sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, x}{2}\right )}{3}+\frac {\ln \left (x -1\right )}{3}-\frac {2 \ln \left (x^{2}+2\right )}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 2.16, size = 33, normalized size = 0.72 \[ \frac {1}{2} \, x^{2} - \frac {2}{3} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + x - \frac {2}{3} \, \log \left (x^{2} + 2\right ) + \frac {1}{3} \, \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.09, size = 50, normalized size = 1.09 \[ x+\frac {\ln \left (x-1\right )}{3}+\ln \left (x-\sqrt {2}\,1{}\mathrm {i}\right )\,\left (-\frac {2}{3}+\frac {\sqrt {2}\,1{}\mathrm {i}}{3}\right )-\ln \left (x+\sqrt {2}\,1{}\mathrm {i}\right )\,\left (\frac {2}{3}+\frac {\sqrt {2}\,1{}\mathrm {i}}{3}\right )+\frac {x^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + log(x - 1)/3 + log(x - 2^(1/2)*1i)*((2^(1/2)*1i)/3 - 2/3) - log(x + 2^(1/2)*1i)*((2^(1/2)*1i)/3 + 2/3) + x
^2/2

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 41, normalized size = 0.89 \[ \frac {x^{2}}{2} + x + \frac {\log {\left (x - 1 \right )}}{3} - \frac {2 \log {\left (x^{2} + 2 \right )}}{3} - \frac {2 \sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} x}{2} \right )}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________