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)+ln(x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 10, normalized size of antiderivative = 1.00, 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 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]))

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]

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.00, size = 10, normalized size = 1.00 \[ \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]

________________________________________________________________________________________

fricas [A]  time = 0.78, size = 14, normalized size = 1.40 \[ \frac {{\left (x + 1\right )} \log \relax (x) + 2}{x + 1} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.36, size = 11, normalized size = 1.10 \[ \frac {2}{x + 1} + \log \left ({\left | x \right |}\right ) \]

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))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 11, normalized size = 1.10 \[ \ln \relax (x )+\frac {2}{x +1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.89, size = 10, normalized size = 1.00 \[ \frac {2}{x + 1} + \log \relax (x) \]

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)

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 10, normalized size = 1.00 \[ \ln \relax (x)+\frac {2}{x+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 7, normalized size = 0.70 \[ \log {\relax (x )} + \frac {2}{x + 1} \]

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)

________________________________________________________________________________________