3.277 \(\int \frac {-3+25 x+23 x^2+32 x^3+15 x^4+7 x^5+x^6}{(1+x^2)^2 (2+x+x^2)^2} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 44, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {6742, 261, 260, 629, 628} \[ -\frac {3}{x^2+1}+\frac {1}{x^2+x+2}+\log \left (x^2+1\right )-\log \left (x^2+x+2\right ) \]

Antiderivative was successfully verified.

[In]

Int[(-3 + 25*x + 23*x^2 + 32*x^3 + 15*x^4 + 7*x^5 + x^6)/((1 + x^2)^2*(2 + x + x^2)^2),x]

[Out]

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

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 261

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

Rule 628

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

Rule 629

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

Rule 6742

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

Rubi steps

\begin {align*} \int \frac {-3+25 x+23 x^2+32 x^3+15 x^4+7 x^5+x^6}{\left (1+x^2\right )^2 \left (2+x+x^2\right )^2} \, dx &=\int \left (\frac {6 x}{\left (1+x^2\right )^2}+\frac {2 x}{1+x^2}+\frac {-1-2 x}{\left (2+x+x^2\right )^2}+\frac {-1-2 x}{2+x+x^2}\right ) \, dx\\ &=2 \int \frac {x}{1+x^2} \, dx+6 \int \frac {x}{\left (1+x^2\right )^2} \, dx+\int \frac {-1-2 x}{\left (2+x+x^2\right )^2} \, dx+\int \frac {-1-2 x}{2+x+x^2} \, dx\\ &=-\frac {3}{1+x^2}+\frac {1}{2+x+x^2}+\log \left (1+x^2\right )-\log \left (2+x+x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 33, normalized size = 1.00 \[ -\frac {3}{x^2+1}+\frac {1}{x^2+x+2}+\log \left (x^2+1\right )-\log \left (x^2+x+2\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(-3 + 25*x + 23*x^2 + 32*x^3 + 15*x^4 + 7*x^5 + x^6)/((1 + x^2)^2*(2 + x + x^2)^2),x]

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.85, size = 72, normalized size = 2.18 \[ -\frac {2 \, x^{2} + {\left (x^{4} + x^{3} + 3 \, x^{2} + x + 2\right )} \log \left (x^{2} + x + 2\right ) - {\left (x^{4} + x^{3} + 3 \, x^{2} + x + 2\right )} \log \left (x^{2} + 1\right ) + 3 \, x + 5}{x^{4} + x^{3} + 3 \, x^{2} + x + 2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^6+7*x^5+15*x^4+32*x^3+23*x^2+25*x-3)/(x^2+1)^2/(x^2+x+2)^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.30, size = 44, normalized size = 1.33 \[ -\frac {2 \, x^{2} + 3 \, x + 5}{x^{4} + x^{3} + 3 \, x^{2} + x + 2} - \log \left (x^{2} + x + 2\right ) + \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^6+7*x^5+15*x^4+32*x^3+23*x^2+25*x-3)/(x^2+1)^2/(x^2+x+2)^2,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^6+7*x^5+15*x^4+32*x^3+23*x^2+25*x-3)/(x^2+1)^2/(x^2+x+2)^2,x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.16, size = 44, normalized size = 1.33 \[ -\frac {2 \, x^{2} + 3 \, x + 5}{x^{4} + x^{3} + 3 \, x^{2} + x + 2} - \log \left (x^{2} + x + 2\right ) + \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^6+7*x^5+15*x^4+32*x^3+23*x^2+25*x-3)/(x^2+1)^2/(x^2+x+2)^2,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.16, size = 56, normalized size = 1.70 \[ -\frac {2\,x^2+3\,x+5}{x^4+x^3+3\,x^2+x+2}+\mathrm {atan}\left (\frac {\frac {x\,224{}\mathrm {i}}{11}+\frac {224}{11}{}\mathrm {i}}{44\,x^2+16\,x+60}-\frac {3}{11}{}\mathrm {i}\right )\,2{}\mathrm {i} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((25*x + 23*x^2 + 32*x^3 + 15*x^4 + 7*x^5 + x^6 - 3)/((x^2 + 1)^2*(x + x^2 + 2)^2),x)

[Out]

atan(((x*224i)/11 + 224i/11)/(16*x + 44*x^2 + 60) - 3i/11)*2i - (3*x + 2*x^2 + 5)/(x + 3*x^2 + x^3 + x^4 + 2)

________________________________________________________________________________________

sympy [A]  time = 0.19, size = 41, normalized size = 1.24 \[ \frac {- 2 x^{2} - 3 x - 5}{x^{4} + x^{3} + 3 x^{2} + x + 2} + \log {\left (x^{2} + 1 \right )} - \log {\left (x^{2} + x + 2 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**6+7*x**5+15*x**4+32*x**3+23*x**2+25*x-3)/(x**2+1)**2/(x**2+x+2)**2,x)

[Out]

(-2*x**2 - 3*x - 5)/(x**4 + x**3 + 3*x**2 + x + 2) + log(x**2 + 1) - log(x**2 + x + 2)

________________________________________________________________________________________