3.271 \(\int \frac {-4+8 x-4 x^2+4 x^3-x^4+x^5}{(2+x^2)^3} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {1814, 1586, 635, 203, 260} \[ -\frac {1}{\left (x^2+2\right )^2}+\frac {1}{2} \log \left (x^2+2\right )-\frac {\tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )}{\sqrt {2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(2 + x^2)^(-2) - ArcTan[x/Sqrt[2]]/Sqrt[2] + Log[2 + x^2]/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 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 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 1814

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[((a
*g - b*f*x)*(a + b*x^2)^(p + 1))/(2*a*b*(p + 1)), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.78, size = 55, normalized size = 1.57 \[ -\frac {\sqrt {2} {\left (x^{4} + 4 \, x^{2} + 4\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) - {\left (x^{4} + 4 \, x^{2} + 4\right )} \log \left (x^{2} + 2\right ) + 2}{2 \, {\left (x^{4} + 4 \, x^{2} + 4\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.33, size = 30, normalized size = 0.86 \[ -\frac {1}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) - \frac {1}{{\left (x^{2} + 2\right )}^{2}} + \frac {1}{2} \, \log \left (x^{2} + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 2.22, size = 35, normalized size = 1.00 \[ -\frac {1}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) - \frac {1}{x^{4} + 4 \, x^{2} + 4} + \frac {1}{2} \, \log \left (x^{2} + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.12, size = 35, normalized size = 1.00 \[ \frac {\ln \left (x^2+2\right )}{2}-\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,x}{2}\right )}{2}-\frac {1}{x^4+4\,x^2+4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 36, normalized size = 1.03 \[ \frac {\log {\left (x^{2} + 2 \right )}}{2} - \frac {\sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} x}{2} \right )}}{2} - \frac {1}{x^{4} + 4 x^{2} + 4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________