3.270 \(\int \frac{2+x+x^2+x^3}{2+3 x^2+x^4} \, dx\)

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

[Out]

ArcTan[x] + Log[2 + x^2]/2

________________________________________________________________________________________

Rubi [A]  time = 0.0283439, antiderivative size = 13, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {1673, 1149, 203, 1247, 626, 31} \[ \frac{1}{2} \log \left (x^2+2\right )+\tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[x] + Log[2 + x^2]/2

Rule 1673

Int[(Pq_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{q = Expon[Pq, x], k}, Int[Sum[Coeff[
Pq, x, 2*k]*x^(2*k), {k, 0, q/2}]*(a + b*x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pq, x, 2*k + 1]*x^(2*k), {k, 0,
(q - 1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] &&  !PolyQ[Pq, x^2]

Rule 1149

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

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 1247

Int[(x_)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[
Int[(d + e*x)^q*(a + b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, d, e, p, q}, x]

Rule 626

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

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

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

Mathematica [A]  time = 0.0074211, size = 13, normalized size = 1. \[ \frac{1}{2} \log \left (x^2+2\right )+\tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[x] + Log[2 + x^2]/2

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 12, normalized size = 0.9 \begin{align*} \arctan \left ( x \right ) +{\frac{\ln \left ({x}^{2}+2 \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.5041, size = 15, normalized size = 1.15 \begin{align*} \arctan \left (x\right ) + \frac{1}{2} \, \log \left (x^{2} + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.34474, size = 41, normalized size = 3.15 \begin{align*} \arctan \left (x\right ) + \frac{1}{2} \, \log \left (x^{2} + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.104464, size = 10, normalized size = 0.77 \begin{align*} \frac{\log{\left (x^{2} + 2 \right )}}{2} + \operatorname{atan}{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x**2 + 2)/2 + atan(x)

________________________________________________________________________________________

Giac [A]  time = 1.11024, size = 15, normalized size = 1.15 \begin{align*} \arctan \left (x\right ) + \frac{1}{2} \, \log \left (x^{2} + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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