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

Optimal. Leaf size=27 \[ \frac{6}{17} \log \left (x^2+1\right )-\frac{7}{34} \log (1-4 x)+\frac{3}{17} \tan ^{-1}(x) \]

[Out]

(3*ArcTan[x])/17 - (7*Log[1 - 4*x])/34 + (6*Log[1 + x^2])/17

________________________________________________________________________________________

Rubi [A]  time = 0.0389818, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {1629, 635, 203, 260} \[ \frac{6}{17} \log \left (x^2+1\right )-\frac{7}{34} \log (1-4 x)+\frac{3}{17} \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(3*ArcTan[x])/17 - (7*Log[1 - 4*x])/34 + (6*Log[1 + x^2])/17

Rule 1629

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*
Pq*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

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

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{-1+2 x^2}{(-1+4 x) \left (1+x^2\right )} \, dx &=\int \left (-\frac{14}{17 (-1+4 x)}+\frac{3 (1+4 x)}{17 \left (1+x^2\right )}\right ) \, dx\\ &=-\frac{7}{34} \log (1-4 x)+\frac{3}{17} \int \frac{1+4 x}{1+x^2} \, dx\\ &=-\frac{7}{34} \log (1-4 x)+\frac{3}{17} \int \frac{1}{1+x^2} \, dx+\frac{12}{17} \int \frac{x}{1+x^2} \, dx\\ &=\frac{3}{17} \tan ^{-1}(x)-\frac{7}{34} \log (1-4 x)+\frac{6}{17} \log \left (1+x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.0107369, size = 38, normalized size = 1.41 \[ -\frac{7}{34} \log (4 x-1)+\frac{6}{17} \log \left ((4 x-1)^2+2 (4 x-1)+17\right )+\frac{3}{17} \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(3*ArcTan[x])/17 - (7*Log[-1 + 4*x])/34 + (6*Log[17 + 2*(-1 + 4*x) + (-1 + 4*x)^2])/17

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 22, normalized size = 0.8 \begin{align*}{\frac{6\,\ln \left ({x}^{2}+1 \right ) }{17}}+{\frac{3\,\arctan \left ( x \right ) }{17}}-{\frac{7\,\ln \left ( -1+4\,x \right ) }{34}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

6/17*ln(x^2+1)+3/17*arctan(x)-7/34*ln(-1+4*x)

________________________________________________________________________________________

Maxima [A]  time = 1.51865, size = 28, normalized size = 1.04 \begin{align*} \frac{3}{17} \, \arctan \left (x\right ) + \frac{6}{17} \, \log \left (x^{2} + 1\right ) - \frac{7}{34} \, \log \left (4 \, x - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/17*arctan(x) + 6/17*log(x^2 + 1) - 7/34*log(4*x - 1)

________________________________________________________________________________________

Fricas [A]  time = 1.51583, size = 76, normalized size = 2.81 \begin{align*} \frac{3}{17} \, \arctan \left (x\right ) + \frac{6}{17} \, \log \left (x^{2} + 1\right ) - \frac{7}{34} \, \log \left (4 \, x - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/17*arctan(x) + 6/17*log(x^2 + 1) - 7/34*log(4*x - 1)

________________________________________________________________________________________

Sympy [A]  time = 0.126118, size = 26, normalized size = 0.96 \begin{align*} - \frac{7 \log{\left (x - \frac{1}{4} \right )}}{34} + \frac{6 \log{\left (x^{2} + 1 \right )}}{17} + \frac{3 \operatorname{atan}{\left (x \right )}}{17} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-7*log(x - 1/4)/34 + 6*log(x**2 + 1)/17 + 3*atan(x)/17

________________________________________________________________________________________

Giac [A]  time = 1.1492, size = 30, normalized size = 1.11 \begin{align*} \frac{3}{17} \, \arctan \left (x\right ) + \frac{6}{17} \, \log \left (x^{2} + 1\right ) - \frac{7}{34} \, \log \left ({\left | 4 \, x - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/17*arctan(x) + 6/17*log(x^2 + 1) - 7/34*log(abs(4*x - 1))