### 3.50 $$\int \frac{x (d+e x^2+f x^4)}{a+b x^2+c x^4} \, dx$$

Optimal. Leaf size=103 $-\frac{\tanh ^{-1}\left (\frac{b+2 c x^2}{\sqrt{b^2-4 a c}}\right ) \left (-2 a c f+b^2 f-b c e+2 c^2 d\right )}{2 c^2 \sqrt{b^2-4 a c}}+\frac{(c e-b f) \log \left (a+b x^2+c x^4\right )}{4 c^2}+\frac{f x^2}{2 c}$

[Out]

(f*x^2)/(2*c) - ((2*c^2*d - b*c*e + b^2*f - 2*a*c*f)*ArcTanh[(b + 2*c*x^2)/Sqrt[b^2 - 4*a*c]])/(2*c^2*Sqrt[b^2
- 4*a*c]) + ((c*e - b*f)*Log[a + b*x^2 + c*x^4])/(4*c^2)

________________________________________________________________________________________

Rubi [A]  time = 0.178958, antiderivative size = 103, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 28, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.214, Rules used = {1663, 1657, 634, 618, 206, 628} $-\frac{\tanh ^{-1}\left (\frac{b+2 c x^2}{\sqrt{b^2-4 a c}}\right ) \left (-2 a c f+b^2 f-b c e+2 c^2 d\right )}{2 c^2 \sqrt{b^2-4 a c}}+\frac{(c e-b f) \log \left (a+b x^2+c x^4\right )}{4 c^2}+\frac{f x^2}{2 c}$

Antiderivative was successfully veriﬁed.

[In]

Int[(x*(d + e*x^2 + f*x^4))/(a + b*x^2 + c*x^4),x]

[Out]

(f*x^2)/(2*c) - ((2*c^2*d - b*c*e + b^2*f - 2*a*c*f)*ArcTanh[(b + 2*c*x^2)/Sqrt[b^2 - 4*a*c]])/(2*c^2*Sqrt[b^2
- 4*a*c]) + ((c*e - b*f)*Log[a + b*x^2 + c*x^4])/(4*c^2)

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 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 634

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

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 206

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

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]

Rubi steps

\begin{align*} \int \frac{x \left (d+e x^2+f x^4\right )}{a+b x^2+c x^4} \, dx &=\frac{1}{2} \operatorname{Subst}\left (\int \frac{d+e x+f x^2}{a+b x+c x^2} \, dx,x,x^2\right )\\ &=\frac{1}{2} \operatorname{Subst}\left (\int \left (\frac{f}{c}+\frac{c d-a f+(c e-b f) x}{c \left (a+b x+c x^2\right )}\right ) \, dx,x,x^2\right )\\ &=\frac{f x^2}{2 c}+\frac{\operatorname{Subst}\left (\int \frac{c d-a f+(c e-b f) x}{a+b x+c x^2} \, dx,x,x^2\right )}{2 c}\\ &=\frac{f x^2}{2 c}+\frac{(c e-b f) \operatorname{Subst}\left (\int \frac{b+2 c x}{a+b x+c x^2} \, dx,x,x^2\right )}{4 c^2}+\frac{\left (2 c^2 d-b c e+b^2 f-2 a c f\right ) \operatorname{Subst}\left (\int \frac{1}{a+b x+c x^2} \, dx,x,x^2\right )}{4 c^2}\\ &=\frac{f x^2}{2 c}+\frac{(c e-b f) \log \left (a+b x^2+c x^4\right )}{4 c^2}-\frac{\left (2 c^2 d-b c e+b^2 f-2 a c f\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x^2\right )}{2 c^2}\\ &=\frac{f x^2}{2 c}-\frac{\left (2 c^2 d-b c e+b^2 f-2 a c f\right ) \tanh ^{-1}\left (\frac{b+2 c x^2}{\sqrt{b^2-4 a c}}\right )}{2 c^2 \sqrt{b^2-4 a c}}+\frac{(c e-b f) \log \left (a+b x^2+c x^4\right )}{4 c^2}\\ \end{align*}

Mathematica [A]  time = 0.068704, size = 100, normalized size = 0.97 $\frac{\frac{2 \tan ^{-1}\left (\frac{b+2 c x^2}{\sqrt{4 a c-b^2}}\right ) \left (-c (2 a f+b e)+b^2 f+2 c^2 d\right )}{\sqrt{4 a c-b^2}}+(c e-b f) \log \left (a+b x^2+c x^4\right )+2 c f x^2}{4 c^2}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(x*(d + e*x^2 + f*x^4))/(a + b*x^2 + c*x^4),x]

[Out]

(2*c*f*x^2 + (2*(2*c^2*d + b^2*f - c*(b*e + 2*a*f))*ArcTan[(b + 2*c*x^2)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*
c] + (c*e - b*f)*Log[a + b*x^2 + c*x^4])/(4*c^2)

________________________________________________________________________________________

Maple [B]  time = 0.005, size = 211, normalized size = 2.1 \begin{align*}{\frac{f{x}^{2}}{2\,c}}-{\frac{\ln \left ( c{x}^{4}+b{x}^{2}+a \right ) bf}{4\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{4}+b{x}^{2}+a \right ) e}{4\,c}}-{\frac{af}{c}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{d\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+{\frac{{b}^{2}f}{2\,{c}^{2}}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{be}{2\,c}\arctan \left ({(2\,c{x}^{2}+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(x*(f*x^4+e*x^2+d)/(c*x^4+b*x^2+a),x)

[Out]

1/2*f*x^2/c-1/4/c^2*ln(c*x^4+b*x^2+a)*b*f+1/4/c*ln(c*x^4+b*x^2+a)*e-1/c/(4*a*c-b^2)^(1/2)*arctan((2*c*x^2+b)/(
4*a*c-b^2)^(1/2))*a*f+1/(4*a*c-b^2)^(1/2)*arctan((2*c*x^2+b)/(4*a*c-b^2)^(1/2))*d+1/2/c^2/(4*a*c-b^2)^(1/2)*ar
ctan((2*c*x^2+b)/(4*a*c-b^2)^(1/2))*b^2*f-1/2/c/(4*a*c-b^2)^(1/2)*arctan((2*c*x^2+b)/(4*a*c-b^2)^(1/2))*b*e

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(f*x^4+e*x^2+d)/(c*x^4+b*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.74658, size = 691, normalized size = 6.71 \begin{align*} \left [\frac{2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} f x^{2} -{\left (2 \, c^{2} d - b c e +{\left (b^{2} - 2 \, a c\right )} f\right )} \sqrt{b^{2} - 4 \, a c} \log \left (\frac{2 \, c^{2} x^{4} + 2 \, b c x^{2} + b^{2} - 2 \, a c +{\left (2 \, c x^{2} + b\right )} \sqrt{b^{2} - 4 \, a c}}{c x^{4} + b x^{2} + a}\right ) +{\left ({\left (b^{2} c - 4 \, a c^{2}\right )} e -{\left (b^{3} - 4 \, a b c\right )} f\right )} \log \left (c x^{4} + b x^{2} + a\right )}{4 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}, \frac{2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} f x^{2} - 2 \,{\left (2 \, c^{2} d - b c e +{\left (b^{2} - 2 \, a c\right )} f\right )} \sqrt{-b^{2} + 4 \, a c} \arctan \left (-\frac{{\left (2 \, c x^{2} + b\right )} \sqrt{-b^{2} + 4 \, a c}}{b^{2} - 4 \, a c}\right ) +{\left ({\left (b^{2} c - 4 \, a c^{2}\right )} e -{\left (b^{3} - 4 \, a b c\right )} f\right )} \log \left (c x^{4} + b x^{2} + a\right )}{4 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}\right ] \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(f*x^4+e*x^2+d)/(c*x^4+b*x^2+a),x, algorithm="fricas")

[Out]

[1/4*(2*(b^2*c - 4*a*c^2)*f*x^2 - (2*c^2*d - b*c*e + (b^2 - 2*a*c)*f)*sqrt(b^2 - 4*a*c)*log((2*c^2*x^4 + 2*b*c
*x^2 + b^2 - 2*a*c + (2*c*x^2 + b)*sqrt(b^2 - 4*a*c))/(c*x^4 + b*x^2 + a)) + ((b^2*c - 4*a*c^2)*e - (b^3 - 4*a
*b*c)*f)*log(c*x^4 + b*x^2 + a))/(b^2*c^2 - 4*a*c^3), 1/4*(2*(b^2*c - 4*a*c^2)*f*x^2 - 2*(2*c^2*d - b*c*e + (b
^2 - 2*a*c)*f)*sqrt(-b^2 + 4*a*c)*arctan(-(2*c*x^2 + b)*sqrt(-b^2 + 4*a*c)/(b^2 - 4*a*c)) + ((b^2*c - 4*a*c^2)
*e - (b^3 - 4*a*b*c)*f)*log(c*x^4 + b*x^2 + a))/(b^2*c^2 - 4*a*c^3)]

________________________________________________________________________________________

Sympy [B]  time = 11.0933, size = 498, normalized size = 4.83 \begin{align*} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c f - b^{2} f + b c e - 2 c^{2} d\right )}{4 c^{2} \left (4 a c - b^{2}\right )} - \frac{b f - c e}{4 c^{2}}\right ) \log{\left (x^{2} + \frac{- a b f - 8 a c^{2} \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c f - b^{2} f + b c e - 2 c^{2} d\right )}{4 c^{2} \left (4 a c - b^{2}\right )} - \frac{b f - c e}{4 c^{2}}\right ) + 2 a c e + 2 b^{2} c \left (- \frac{\sqrt{- 4 a c + b^{2}} \left (2 a c f - b^{2} f + b c e - 2 c^{2} d\right )}{4 c^{2} \left (4 a c - b^{2}\right )} - \frac{b f - c e}{4 c^{2}}\right ) - b c d}{2 a c f - b^{2} f + b c e - 2 c^{2} d} \right )} + \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c f - b^{2} f + b c e - 2 c^{2} d\right )}{4 c^{2} \left (4 a c - b^{2}\right )} - \frac{b f - c e}{4 c^{2}}\right ) \log{\left (x^{2} + \frac{- a b f - 8 a c^{2} \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c f - b^{2} f + b c e - 2 c^{2} d\right )}{4 c^{2} \left (4 a c - b^{2}\right )} - \frac{b f - c e}{4 c^{2}}\right ) + 2 a c e + 2 b^{2} c \left (\frac{\sqrt{- 4 a c + b^{2}} \left (2 a c f - b^{2} f + b c e - 2 c^{2} d\right )}{4 c^{2} \left (4 a c - b^{2}\right )} - \frac{b f - c e}{4 c^{2}}\right ) - b c d}{2 a c f - b^{2} f + b c e - 2 c^{2} d} \right )} + \frac{f x^{2}}{2 c} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(f*x**4+e*x**2+d)/(c*x**4+b*x**2+a),x)

[Out]

(-sqrt(-4*a*c + b**2)*(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)/(4*c**2*(4*a*c - b**2)) - (b*f - c*e)/(4*c**2))*lo
g(x**2 + (-a*b*f - 8*a*c**2*(-sqrt(-4*a*c + b**2)*(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)/(4*c**2*(4*a*c - b**2)
) - (b*f - c*e)/(4*c**2)) + 2*a*c*e + 2*b**2*c*(-sqrt(-4*a*c + b**2)*(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)/(4*
c**2*(4*a*c - b**2)) - (b*f - c*e)/(4*c**2)) - b*c*d)/(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)) + (sqrt(-4*a*c +
b**2)*(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)/(4*c**2*(4*a*c - b**2)) - (b*f - c*e)/(4*c**2))*log(x**2 + (-a*b*f
- 8*a*c**2*(sqrt(-4*a*c + b**2)*(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)/(4*c**2*(4*a*c - b**2)) - (b*f - c*e)/(
4*c**2)) + 2*a*c*e + 2*b**2*c*(sqrt(-4*a*c + b**2)*(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)/(4*c**2*(4*a*c - b**2
)) - (b*f - c*e)/(4*c**2)) - b*c*d)/(2*a*c*f - b**2*f + b*c*e - 2*c**2*d)) + f*x**2/(2*c)

________________________________________________________________________________________

Giac [A]  time = 1.14739, size = 134, normalized size = 1.3 \begin{align*} \frac{f x^{2}}{2 \, c} - \frac{{\left (b f - c e\right )} \log \left (c x^{4} + b x^{2} + a\right )}{4 \, c^{2}} + \frac{{\left (2 \, c^{2} d + b^{2} f - 2 \, a c f - b c e\right )} \arctan \left (\frac{2 \, c x^{2} + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{2 \, \sqrt{-b^{2} + 4 \, a c} c^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(f*x^4+e*x^2+d)/(c*x^4+b*x^2+a),x, algorithm="giac")

[Out]

1/2*f*x^2/c - 1/4*(b*f - c*e)*log(c*x^4 + b*x^2 + a)/c^2 + 1/2*(2*c^2*d + b^2*f - 2*a*c*f - b*c*e)*arctan((2*c
*x^2 + b)/sqrt(-b^2 + 4*a*c))/(sqrt(-b^2 + 4*a*c)*c^2)