3.99 \(\int \frac{x^2}{1+(-1+x)^2} \, dx\)

Optimal. Leaf size=10 \[ x+\log \left ((x-1)^2+1\right ) \]

[Out]

x + Log[1 + (-1 + x)^2]

________________________________________________________________________________________

Rubi [A]  time = 0.0112678, antiderivative size = 10, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {371, 702, 260} \[ x+\log \left ((x-1)^2+1\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Log[1 + (-1 + x)^2]

Rule 371

Int[((a_) + (b_.)*(v_)^(n_))^(p_.)*(x_)^(m_.), x_Symbol] :> With[{c = Coefficient[v, x, 0], d = Coefficient[v,
 x, 1]}, Dist[1/d^(m + 1), Subst[Int[SimplifyIntegrand[(x - c)^m*(a + b*x^n)^p, x], x], x, v], x] /; NeQ[c, 0]
] /; FreeQ[{a, b, n, p}, x] && LinearQ[v, x] && IntegerQ[m]

Rule 702

Int[((d_) + (e_.)*(x_))^(m_)/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[(d + e*x)^m, a + c*x^2,
x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[m, 1] && (NeQ[d, 0] || GtQ[m, 2])

Rule 260

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

Rubi steps

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

Mathematica [A]  time = 0.0062418, size = 11, normalized size = 1.1 \[ \log \left (x^2-2 x+2\right )+x \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Log[2 - 2*x + x^2]

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 12, normalized size = 1.2 \begin{align*} x+\ln \left ({x}^{2}-2\,x+2 \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2/(1+(x-1)^2),x)

[Out]

x+ln(x^2-2*x+2)

________________________________________________________________________________________

Maxima [A]  time = 1.1136, size = 15, normalized size = 1.5 \begin{align*} x + \log \left (x^{2} - 2 \, x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + log(x^2 - 2*x + 2)

________________________________________________________________________________________

Fricas [A]  time = 1.64335, size = 32, normalized size = 3.2 \begin{align*} x + \log \left (x^{2} - 2 \, x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + log(x^2 - 2*x + 2)

________________________________________________________________________________________

Sympy [A]  time = 0.081725, size = 10, normalized size = 1. \begin{align*} x + \log{\left (x^{2} - 2 x + 2 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + log(x**2 - 2*x + 2)

________________________________________________________________________________________

Giac [A]  time = 1.13048, size = 15, normalized size = 1.5 \begin{align*} x + \log \left (x^{2} - 2 \, x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + log(x^2 - 2*x + 2)