3.366 \(\int \frac {-32+36 x-42 x^2+21 x^3-10 x^4+3 x^5}{x (1+x^2) (4+x^2)^2} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.25, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.116, Rules used = {6725, 203, 261, 635, 260} \[ \frac {1}{x^2+4}+\log \left (x^2+4\right )-2 \log (x)+\frac {1}{2} \tan ^{-1}\left (\frac {x}{2}\right )+2 \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Int[(-32 + 36*x - 42*x^2 + 21*x^3 - 10*x^4 + 3*x^5)/(x*(1 + x^2)*(4 + x^2)^2),x]

[Out]

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

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

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {-32+36 x-42 x^2+21 x^3-10 x^4+3 x^5}{x \left (1+x^2\right ) \left (4+x^2\right )^2} \, dx &=\int \left (-\frac {2}{x}+\frac {2}{1+x^2}-\frac {2 x}{\left (4+x^2\right )^2}+\frac {1+2 x}{4+x^2}\right ) \, dx\\ &=-2 \log (x)+2 \int \frac {1}{1+x^2} \, dx-2 \int \frac {x}{\left (4+x^2\right )^2} \, dx+\int \frac {1+2 x}{4+x^2} \, dx\\ &=\frac {1}{4+x^2}+2 \tan ^{-1}(x)-2 \log (x)+2 \int \frac {x}{4+x^2} \, dx+\int \frac {1}{4+x^2} \, dx\\ &=\frac {1}{4+x^2}+\frac {1}{2} \tan ^{-1}\left (\frac {x}{2}\right )+2 \tan ^{-1}(x)-2 \log (x)+\log \left (4+x^2\right )\\ \end {align*}

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Integrate[(-32 + 36*x - 42*x^2 + 21*x^3 - 10*x^4 + 3*x^5)/(x*(1 + x^2)*(4 + x^2)^2),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.63, size = 52, normalized size = 1.62 \[ \frac {{\left (x^{2} + 4\right )} \arctan \left (\frac {1}{2} \, x\right ) + 4 \, {\left (x^{2} + 4\right )} \arctan \relax (x) + 2 \, {\left (x^{2} + 4\right )} \log \left (x^{2} + 4\right ) - 4 \, {\left (x^{2} + 4\right )} \log \relax (x) + 2}{2 \, {\left (x^{2} + 4\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^5-10*x^4+21*x^3-42*x^2+36*x-32)/x/(x^2+1)/(x^2+4)^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.32, size = 29, normalized size = 0.91 \[ \frac {1}{x^{2} + 4} + \frac {1}{2} \, \arctan \left (\frac {1}{2} \, x\right ) + 2 \, \arctan \relax (x) + \log \left (x^{2} + 4\right ) - 2 \, \log \left ({\left | x \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^5-10*x^4+21*x^3-42*x^2+36*x-32)/x/(x^2+1)/(x^2+4)^2,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 29, normalized size = 0.91 \[ 2 \arctan \relax (x )+\frac {\arctan \left (\frac {x}{2}\right )}{2}-2 \ln \relax (x )+\ln \left (x^{2}+4\right )+\frac {1}{x^{2}+4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3*x^5-10*x^4+21*x^3-42*x^2+36*x-32)/x/(x^2+1)/(x^2+4)^2,x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 2.02, size = 28, normalized size = 0.88 \[ \frac {1}{x^{2} + 4} + \frac {1}{2} \, \arctan \left (\frac {1}{2} \, x\right ) + 2 \, \arctan \relax (x) + \log \left (x^{2} + 4\right ) - 2 \, \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^5-10*x^4+21*x^3-42*x^2+36*x-32)/x/(x^2+1)/(x^2+4)^2,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 44, normalized size = 1.38 \[ \frac {1}{x^2+4}-2\,\ln \relax (x)-2\,\mathrm {atan}\left (\frac {328000}{7\,\left (36288\,x-19584\right )}+\frac {34}{63}\right )+\ln \left (x-2{}\mathrm {i}\right )\,\left (1-\frac {1}{4}{}\mathrm {i}\right )+\ln \left (x+2{}\mathrm {i}\right )\,\left (1+\frac {1}{4}{}\mathrm {i}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((36*x - 42*x^2 + 21*x^3 - 10*x^4 + 3*x^5 - 32)/(x*(x^2 + 1)*(x^2 + 4)^2),x)

[Out]

log(x - 2i)*(1 - 1i/4) + log(x + 2i)*(1 + 1i/4) - 2*atan(328000/(7*(36288*x - 19584)) + 34/63) - 2*log(x) + 1/
(x^2 + 4)

________________________________________________________________________________________

sympy [A]  time = 0.26, size = 29, normalized size = 0.91 \[ - 2 \log {\relax (x )} + \log {\left (x^{2} + 4 \right )} + \frac {\operatorname {atan}{\left (\frac {x}{2} \right )}}{2} + 2 \operatorname {atan}{\relax (x )} + \frac {1}{x^{2} + 4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x**5-10*x**4+21*x**3-42*x**2+36*x-32)/x/(x**2+1)/(x**2+4)**2,x)

[Out]

-2*log(x) + log(x**2 + 4) + atan(x/2)/2 + 2*atan(x) + 1/(x**2 + 4)

________________________________________________________________________________________