### 3.213 $$\int \frac{1}{-3+2 x+x^2} \, dx$$

Optimal. Leaf size=19 $\frac{1}{4} \log (1-x)-\frac{1}{4} \log (x+3)$

[Out]

Log[1 - x]/4 - Log[3 + x]/4

________________________________________________________________________________________

Rubi [A]  time = 0.0037085, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 10, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.2, Rules used = {616, 31} $\frac{1}{4} \log (1-x)-\frac{1}{4} \log (x+3)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

Log[1 - x]/4 - Log[3 + x]/4

Rule 616

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

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{1}{-3+2 x+x^2} \, dx &=\frac{1}{4} \int \frac{1}{-1+x} \, dx-\frac{1}{4} \int \frac{1}{3+x} \, dx\\ &=\frac{1}{4} \log (1-x)-\frac{1}{4} \log (3+x)\\ \end{align*}

Mathematica [A]  time = 0.0023606, size = 19, normalized size = 1. $\frac{1}{4} \log (1-x)-\frac{1}{4} \log (x+3)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

Log[1 - x]/4 - Log[3 + x]/4

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 14, normalized size = 0.7 \begin{align*} -{\frac{\ln \left ( 3+x \right ) }{4}}+{\frac{\ln \left ( -1+x \right ) }{4}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*ln(3+x)+1/4*ln(-1+x)

________________________________________________________________________________________

Maxima [A]  time = 0.926453, size = 18, normalized size = 0.95 \begin{align*} -\frac{1}{4} \, \log \left (x + 3\right ) + \frac{1}{4} \, \log \left (x - 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*log(x + 3) + 1/4*log(x - 1)

________________________________________________________________________________________

Fricas [A]  time = 1.80742, size = 46, normalized size = 2.42 \begin{align*} -\frac{1}{4} \, \log \left (x + 3\right ) + \frac{1}{4} \, \log \left (x - 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*log(x + 3) + 1/4*log(x - 1)

________________________________________________________________________________________

Sympy [A]  time = 0.088556, size = 12, normalized size = 0.63 \begin{align*} \frac{\log{\left (x - 1 \right )}}{4} - \frac{\log{\left (x + 3 \right )}}{4} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1)/4 - log(x + 3)/4

________________________________________________________________________________________

Giac [A]  time = 1.05974, size = 20, normalized size = 1.05 \begin{align*} -\frac{1}{4} \, \log \left ({\left | x + 3 \right |}\right ) + \frac{1}{4} \, \log \left ({\left | x - 1 \right |}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*log(abs(x + 3)) + 1/4*log(abs(x - 1))