\(\int \frac {1-3 x^4}{(-2+x) (1+x^2)^2} \, dx\) [258]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 43 \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=-\frac {1-2 x}{5 \left (1+x^2\right )}-\frac {46 \arctan (x)}{25}-\frac {47}{25} \log (2-x)-\frac {14}{25} \log \left (1+x^2\right ) \]

[Out]

1/5*(-1+2*x)/(x^2+1)-46/25*arctan(x)-47/25*ln(2-x)-14/25*ln(x^2+1)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {1661, 1643, 649, 209, 266} \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=-\frac {46 \arctan (x)}{25}-\frac {1-2 x}{5 \left (x^2+1\right )}-\frac {14}{25} \log \left (x^2+1\right )-\frac {47}{25} \log (2-x) \]

[In]

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

[Out]

-1/5*(1 - 2*x)/(1 + x^2) - (46*ArcTan[x])/25 - (47*Log[2 - x])/25 - (14*Log[1 + x^2])/25

Rule 209

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

Rule 266

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 649

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 1643

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]

Rule 1661

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[(d +
 e*x)^m*Pq, a + c*x^2, x], f = Coeff[PolynomialRemainder[(d + e*x)^m*Pq, a + c*x^2, x], x, 0], g = Coeff[Polyn
omialRemainder[(d + e*x)^m*Pq, a + c*x^2, x], x, 1]}, Simp[(a*g - c*f*x)*((a + c*x^2)^(p + 1)/(2*a*c*(p + 1)))
, x] + Dist[1/(2*a*c*(p + 1)), Int[(d + e*x)^m*(a + c*x^2)^(p + 1)*ExpandToSum[(2*a*c*(p + 1)*Q)/(d + e*x)^m +
 (c*f*(2*p + 3))/(d + e*x)^m, x], x], x]] /; FreeQ[{a, c, d, e}, x] && PolyQ[Pq, x] && NeQ[c*d^2 + a*e^2, 0] &
& LtQ[p, -1] && ILtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {1-2 x}{5 \left (1+x^2\right )}-\frac {1}{2} \int \frac {-\frac {18}{5}-\frac {4 x}{5}+6 x^2}{(-2+x) \left (1+x^2\right )} \, dx \\ & = -\frac {1-2 x}{5 \left (1+x^2\right )}-\frac {1}{2} \int \left (\frac {94}{25 (-2+x)}+\frac {4 (23+14 x)}{25 \left (1+x^2\right )}\right ) \, dx \\ & = -\frac {1-2 x}{5 \left (1+x^2\right )}-\frac {47}{25} \log (2-x)-\frac {2}{25} \int \frac {23+14 x}{1+x^2} \, dx \\ & = -\frac {1-2 x}{5 \left (1+x^2\right )}-\frac {47}{25} \log (2-x)-\frac {28}{25} \int \frac {x}{1+x^2} \, dx-\frac {46}{25} \int \frac {1}{1+x^2} \, dx \\ & = -\frac {1-2 x}{5 \left (1+x^2\right )}-\frac {46}{25} \tan ^{-1}(x)-\frac {47}{25} \log (2-x)-\frac {14}{25} \log \left (1+x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.33 \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=\frac {3+2 (-2+x)}{5 \left (5+4 (-2+x)+(-2+x)^2\right )}-\frac {46 \arctan (x)}{25}-\frac {14}{25} \log \left (5+4 (-2+x)+(-2+x)^2\right )-\frac {47}{25} \log (-2+x) \]

[In]

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

[Out]

(3 + 2*(-2 + x))/(5*(5 + 4*(-2 + x) + (-2 + x)^2)) - (46*ArcTan[x])/25 - (14*Log[5 + 4*(-2 + x) + (-2 + x)^2])
/25 - (47*Log[-2 + x])/25

Maple [A] (verified)

Time = 0.84 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.77

method result size
risch \(\frac {\frac {2 x}{5}-\frac {1}{5}}{x^{2}+1}-\frac {14 \ln \left (x^{2}+1\right )}{25}-\frac {46 \arctan \left (x \right )}{25}-\frac {47 \ln \left (x -2\right )}{25}\) \(33\)
default \(-\frac {2 \left (-5 x +\frac {5}{2}\right )}{25 \left (x^{2}+1\right )}-\frac {14 \ln \left (x^{2}+1\right )}{25}-\frac {46 \arctan \left (x \right )}{25}-\frac {47 \ln \left (x -2\right )}{25}\) \(34\)
parallelrisch \(-\frac {-23 i \ln \left (x -i\right ) x^{2}+23 i \ln \left (x +i\right ) x^{2}+47 \ln \left (x -2\right ) x^{2}+14 \ln \left (x -i\right ) x^{2}+14 \ln \left (x +i\right ) x^{2}+5-23 i \ln \left (x -i\right )+23 i \ln \left (x +i\right )+47 \ln \left (x -2\right )+14 \ln \left (x -i\right )+14 \ln \left (x +i\right )-10 x}{25 \left (x^{2}+1\right )}\) \(102\)

[In]

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

[Out]

(2/5*x-1/5)/(x^2+1)-14/25*ln(x^2+1)-46/25*arctan(x)-47/25*ln(x-2)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.09 \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=-\frac {46 \, {\left (x^{2} + 1\right )} \arctan \left (x\right ) + 14 \, {\left (x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 47 \, {\left (x^{2} + 1\right )} \log \left (x - 2\right ) - 10 \, x + 5}{25 \, {\left (x^{2} + 1\right )}} \]

[In]

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

[Out]

-1/25*(46*(x^2 + 1)*arctan(x) + 14*(x^2 + 1)*log(x^2 + 1) + 47*(x^2 + 1)*log(x - 2) - 10*x + 5)/(x^2 + 1)

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.86 \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=- \frac {1 - 2 x}{5 x^{2} + 5} - \frac {47 \log {\left (x - 2 \right )}}{25} - \frac {14 \log {\left (x^{2} + 1 \right )}}{25} - \frac {46 \operatorname {atan}{\left (x \right )}}{25} \]

[In]

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

[Out]

-(1 - 2*x)/(5*x**2 + 5) - 47*log(x - 2)/25 - 14*log(x**2 + 1)/25 - 46*atan(x)/25

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.77 \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=\frac {2 \, x - 1}{5 \, {\left (x^{2} + 1\right )}} - \frac {46}{25} \, \arctan \left (x\right ) - \frac {14}{25} \, \log \left (x^{2} + 1\right ) - \frac {47}{25} \, \log \left (x - 2\right ) \]

[In]

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

[Out]

1/5*(2*x - 1)/(x^2 + 1) - 46/25*arctan(x) - 14/25*log(x^2 + 1) - 47/25*log(x - 2)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.79 \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=\frac {2 \, x - 1}{5 \, {\left (x^{2} + 1\right )}} - \frac {46}{25} \, \arctan \left (x\right ) - \frac {14}{25} \, \log \left (x^{2} + 1\right ) - \frac {47}{25} \, \log \left ({\left | x - 2 \right |}\right ) \]

[In]

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

[Out]

1/5*(2*x - 1)/(x^2 + 1) - 46/25*arctan(x) - 14/25*log(x^2 + 1) - 47/25*log(abs(x - 2))

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.88 \[ \int \frac {1-3 x^4}{(-2+x) \left (1+x^2\right )^2} \, dx=\frac {\frac {2\,x}{5}-\frac {1}{5}}{x^2+1}-\frac {47\,\ln \left (x-2\right )}{25}+\ln \left (x-\mathrm {i}\right )\,\left (-\frac {14}{25}+\frac {23}{25}{}\mathrm {i}\right )+\ln \left (x+1{}\mathrm {i}\right )\,\left (-\frac {14}{25}-\frac {23}{25}{}\mathrm {i}\right ) \]

[In]

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

[Out]

((2*x)/5 - 1/5)/(x^2 + 1) - log(x - 1i)*(14/25 - 23i/25) - log(x + 1i)*(14/25 + 23i/25) - (47*log(x - 2))/25