\(\int \frac {1}{(-3+x) (4+x^2)} \, dx\) [449]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 31 \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=-\frac {3}{26} \arctan \left (\frac {x}{2}\right )+\frac {1}{13} \log (3-x)-\frac {1}{26} \log \left (4+x^2\right ) \]

[Out]

-3/26*arctan(1/2*x)+1/13*ln(3-x)-1/26*ln(x^2+4)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {720, 31, 649, 209, 266} \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=-\frac {3}{26} \arctan \left (\frac {x}{2}\right )-\frac {1}{26} \log \left (x^2+4\right )+\frac {1}{13} \log (3-x) \]

[In]

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

[Out]

(-3*ArcTan[x/2])/26 + Log[3 - x]/13 - Log[4 + x^2]/26

Rule 31

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

Rule 209

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

Rule 266

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]

Rule 649

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 720

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

Rubi steps \begin{align*} \text {integral}& = \frac {1}{13} \int \frac {1}{-3+x} \, dx+\frac {1}{13} \int \frac {-3-x}{4+x^2} \, dx \\ & = \frac {1}{13} \log (3-x)-\frac {1}{13} \int \frac {x}{4+x^2} \, dx-\frac {3}{13} \int \frac {1}{4+x^2} \, dx \\ & = -\frac {3}{26} \tan ^{-1}\left (\frac {x}{2}\right )+\frac {1}{13} \log (3-x)-\frac {1}{26} \log \left (4+x^2\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.16 \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=-\frac {3}{26} \arctan \left (\frac {x}{2}\right )-\frac {1}{26} \log \left (13+6 (-3+x)+(-3+x)^2\right )+\frac {1}{13} \log (-3+x) \]

[In]

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

[Out]

(-3*ArcTan[x/2])/26 - Log[13 + 6*(-3 + x) + (-3 + x)^2]/26 + Log[-3 + x]/13

Maple [A] (verified)

Time = 0.84 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.71

method result size
default \(-\frac {\ln \left (x^{2}+4\right )}{26}-\frac {3 \arctan \left (\frac {x}{2}\right )}{26}+\frac {\ln \left (-3+x \right )}{13}\) \(22\)
risch \(\frac {\ln \left (-3+x \right )}{13}-\frac {\ln \left (9 x^{2}+36\right )}{26}-\frac {3 \arctan \left (\frac {x}{2}\right )}{26}\) \(24\)
parallelrisch \(\frac {\ln \left (-3+x \right )}{13}-\frac {\ln \left (x -2 i\right )}{26}+\frac {3 i \ln \left (x -2 i\right )}{52}-\frac {\ln \left (x +2 i\right )}{26}-\frac {3 i \ln \left (x +2 i\right )}{52}\) \(38\)

[In]

int(1/(-3+x)/(x^2+4),x,method=_RETURNVERBOSE)

[Out]

-1/26*ln(x^2+4)-3/26*arctan(1/2*x)+1/13*ln(-3+x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.68 \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=-\frac {3}{26} \, \arctan \left (\frac {1}{2} \, x\right ) - \frac {1}{26} \, \log \left (x^{2} + 4\right ) + \frac {1}{13} \, \log \left (x - 3\right ) \]

[In]

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

[Out]

-3/26*arctan(1/2*x) - 1/26*log(x^2 + 4) + 1/13*log(x - 3)

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.71 \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=\frac {\log {\left (x - 3 \right )}}{13} - \frac {\log {\left (x^{2} + 4 \right )}}{26} - \frac {3 \operatorname {atan}{\left (\frac {x}{2} \right )}}{26} \]

[In]

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

[Out]

log(x - 3)/13 - log(x**2 + 4)/26 - 3*atan(x/2)/26

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.68 \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=-\frac {3}{26} \, \arctan \left (\frac {1}{2} \, x\right ) - \frac {1}{26} \, \log \left (x^{2} + 4\right ) + \frac {1}{13} \, \log \left (x - 3\right ) \]

[In]

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

[Out]

-3/26*arctan(1/2*x) - 1/26*log(x^2 + 4) + 1/13*log(x - 3)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.71 \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=-\frac {3}{26} \, \arctan \left (\frac {1}{2} \, x\right ) - \frac {1}{26} \, \log \left (x^{2} + 4\right ) + \frac {1}{13} \, \log \left ({\left | x - 3 \right |}\right ) \]

[In]

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

[Out]

-3/26*arctan(1/2*x) - 1/26*log(x^2 + 4) + 1/13*log(abs(x - 3))

Mupad [B] (verification not implemented)

Time = 9.32 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.81 \[ \int \frac {1}{(-3+x) \left (4+x^2\right )} \, dx=\frac {\ln \left (x-3\right )}{13}+\ln \left (x-2{}\mathrm {i}\right )\,\left (-\frac {1}{26}+\frac {3}{52}{}\mathrm {i}\right )+\ln \left (x+2{}\mathrm {i}\right )\,\left (-\frac {1}{26}-\frac {3}{52}{}\mathrm {i}\right ) \]

[In]

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

[Out]

log(x - 3)/13 - log(x - 2i)*(1/26 - 3i/52) - log(x + 2i)*(1/26 + 3i/52)