3.374 \(\int \frac{1+x^2}{x+2 x^2+x^3} \, dx\)

Optimal. Leaf size=10 \[ \frac{2}{x+1}+\log (x) \]

[Out]

2/(1 + x) + Log[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0186148, antiderivative size = 10, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {1594, 27, 894} \[ \frac{2}{x+1}+\log (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2/(1 + x) + Log[x]

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 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rubi steps

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

Mathematica [A]  time = 0.0048352, size = 10, normalized size = 1. \[ \frac{2}{x+1}+\log (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

2/(1 + x) + Log[x]

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 11, normalized size = 1.1 \begin{align*} 2\, \left ( 1+x \right ) ^{-1}+\ln \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/(1+x)+ln(x)

________________________________________________________________________________________

Maxima [A]  time = 1.09606, size = 14, normalized size = 1.4 \begin{align*} \frac{2}{x + 1} + \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/(x + 1) + log(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.081395, size = 7, normalized size = 0.7 \begin{align*} \log{\left (x \right )} + \frac{2}{x + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x) + 2/(x + 1)

________________________________________________________________________________________

Giac [A]  time = 1.14539, size = 15, normalized size = 1.5 \begin{align*} \frac{2}{x + 1} + \log \left ({\left | x \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/(x + 1) + log(abs(x))