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

Optimal. Leaf size=45 \[ \frac{5-7 x^2}{8 \left (x^4+2 x^2+3\right )}+\frac{9 \tan ^{-1}\left (\frac{x^2+1}{\sqrt{2}}\right )}{8 \sqrt{2}} \]

[Out]

(5 - 7*x^2)/(8*(3 + 2*x^2 + x^4)) + (9*ArcTan[(1 + x^2)/Sqrt[2]])/(8*Sqrt[2])

________________________________________________________________________________________

Rubi [A]  time = 0.0669286, antiderivative size = 45, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {1594, 1663, 1660, 12, 618, 204} \[ \frac{5-7 x^2}{8 \left (x^4+2 x^2+3\right )}+\frac{9 \tan ^{-1}\left (\frac{x^2+1}{\sqrt{2}}\right )}{8 \sqrt{2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(5 - 7*x^2)/(8*(3 + 2*x^2 + x^4)) + (9*ArcTan[(1 + x^2)/Sqrt[2]])/(8*Sqrt[2])

Rule 1594

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^
(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] && PosQ[r - p]

Rule 1663

Int[(Pq_)*(x_)^(m_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Dist[1/2, Subst[Int[x^((m - 1)/2)
*SubstFor[x^2, Pq, x]*(a + b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x^2] && Inte
gerQ[(m - 1)/2]

Rule 1660

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

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

Rubi steps

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

Mathematica [A]  time = 0.0254557, size = 45, normalized size = 1. \[ \frac{5-7 x^2}{8 \left (x^4+2 x^2+3\right )}+\frac{9 \tan ^{-1}\left (\frac{x^2+1}{\sqrt{2}}\right )}{8 \sqrt{2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(5 - 7*x^2)/(8*(3 + 2*x^2 + x^4)) + (9*ArcTan[(1 + x^2)/Sqrt[2]])/(8*Sqrt[2])

________________________________________________________________________________________

Maple [A]  time = 0.008, size = 41, normalized size = 0.9 \begin{align*}{\frac{1}{2\,{x}^{4}+4\,{x}^{2}+6} \left ( -{\frac{7\,{x}^{2}}{4}}+{\frac{5}{4}} \right ) }+{\frac{9\,\sqrt{2}}{16}\arctan \left ({\frac{ \left ( 2\,{x}^{2}+2 \right ) \sqrt{2}}{4}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(-7/4*x^2+5/4)/(x^4+2*x^2+3)+9/16*2^(1/2)*arctan(1/4*(2*x^2+2)*2^(1/2))

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} -\frac{7 \, x^{2} - 5}{8 \,{\left (x^{4} + 2 \, x^{2} + 3\right )}} + \frac{9}{4} \, \int \frac{x}{x^{4} + 2 \, x^{2} + 3}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/8*(7*x^2 - 5)/(x^4 + 2*x^2 + 3) + 9/4*integrate(x/(x^4 + 2*x^2 + 3), x)

________________________________________________________________________________________

Fricas [A]  time = 1.48295, size = 132, normalized size = 2.93 \begin{align*} \frac{9 \, \sqrt{2}{\left (x^{4} + 2 \, x^{2} + 3\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (x^{2} + 1\right )}\right ) - 14 \, x^{2} + 10}{16 \,{\left (x^{4} + 2 \, x^{2} + 3\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/16*(9*sqrt(2)*(x^4 + 2*x^2 + 3)*arctan(1/2*sqrt(2)*(x^2 + 1)) - 14*x^2 + 10)/(x^4 + 2*x^2 + 3)

________________________________________________________________________________________

Sympy [A]  time = 0.147528, size = 44, normalized size = 0.98 \begin{align*} - \frac{7 x^{2} - 5}{8 x^{4} + 16 x^{2} + 24} + \frac{9 \sqrt{2} \operatorname{atan}{\left (\frac{\sqrt{2} x^{2}}{2} + \frac{\sqrt{2}}{2} \right )}}{16} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(7*x**2 - 5)/(8*x**4 + 16*x**2 + 24) + 9*sqrt(2)*atan(sqrt(2)*x**2/2 + sqrt(2)/2)/16

________________________________________________________________________________________

Giac [A]  time = 1.11674, size = 51, normalized size = 1.13 \begin{align*} \frac{9}{16} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (x^{2} + 1\right )}\right ) - \frac{7 \, x^{2} - 5}{8 \,{\left (x^{4} + 2 \, x^{2} + 3\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

9/16*sqrt(2)*arctan(1/2*sqrt(2)*(x^2 + 1)) - 1/8*(7*x^2 - 5)/(x^4 + 2*x^2 + 3)