3.254 \(\int \frac{1-x+x^2}{(1+x^2)^{3/2}} \, dx\)

Optimal. Leaf size=12 \[ \frac{1}{\sqrt{x^2+1}}+\sinh ^{-1}(x) \]

[Out]

1/Sqrt[1 + x^2] + ArcSinh[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0127955, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {1814, 215} \[ \frac{1}{\sqrt{x^2+1}}+\sinh ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

1/Sqrt[1 + x^2] + ArcSinh[x]

Rule 1814

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[((a
*g - b*f*x)*(a + b*x^2)^(p + 1))/(2*a*b*(p + 1)), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rule 215

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[(Rt[b, 2]*x)/Sqrt[a]]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rubi steps

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

Mathematica [A]  time = 0.0114939, size = 12, normalized size = 1. \[ \frac{1}{\sqrt{x^2+1}}+\sinh ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

1/Sqrt[1 + x^2] + ArcSinh[x]

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 11, normalized size = 0.9 \begin{align*}{\it Arcsinh} \left ( x \right ) +{\frac{1}{\sqrt{{x}^{2}+1}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arcsinh(x)+1/(x^2+1)^(1/2)

________________________________________________________________________________________

Maxima [A]  time = 1.42586, size = 14, normalized size = 1.17 \begin{align*} \frac{1}{\sqrt{x^{2} + 1}} + \operatorname{arsinh}\left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/sqrt(x^2 + 1) + arcsinh(x)

________________________________________________________________________________________

Fricas [B]  time = 1.82708, size = 86, normalized size = 7.17 \begin{align*} -\frac{{\left (x^{2} + 1\right )} \log \left (-x + \sqrt{x^{2} + 1}\right ) - \sqrt{x^{2} + 1}}{x^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-((x^2 + 1)*log(-x + sqrt(x^2 + 1)) - sqrt(x^2 + 1))/(x^2 + 1)

________________________________________________________________________________________

Sympy [B]  time = 6.48993, size = 29, normalized size = 2.42 \begin{align*} \frac{x^{2} \operatorname{asinh}{\left (x \right )}}{x^{2} + 1} + \frac{\operatorname{asinh}{\left (x \right )}}{x^{2} + 1} + \frac{1}{\sqrt{x^{2} + 1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**2*asinh(x)/(x**2 + 1) + asinh(x)/(x**2 + 1) + 1/sqrt(x**2 + 1)

________________________________________________________________________________________

Giac [B]  time = 1.08002, size = 30, normalized size = 2.5 \begin{align*} \frac{1}{\sqrt{x^{2} + 1}} - \log \left (-x + \sqrt{x^{2} + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/sqrt(x^2 + 1) - log(-x + sqrt(x^2 + 1))