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

   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 = 24, antiderivative size = 13 \[ \int \frac {3+x+x^2+x^3}{\left (1+x^2\right ) \left (3+x^2\right )} \, dx=\arctan (x)+\frac {1}{2} \log \left (3+x^2\right ) \]

[Out]

arctan(x)+1/2*ln(x^2+3)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {6857, 209, 266} \[ \int \frac {3+x+x^2+x^3}{\left (1+x^2\right ) \left (3+x^2\right )} \, dx=\arctan (x)+\frac {1}{2} \log \left (x^2+3\right ) \]

[In]

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

[Out]

ArcTan[x] + Log[3 + x^2]/2

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 6857

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

ArcTan[x] + Log[3 + x^2]/2

Maple [A] (verified)

Time = 0.78 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.92

method result size
default \(\arctan \left (x \right )+\frac {\ln \left (x^{2}+3\right )}{2}\) \(12\)
risch \(\arctan \left (x \right )+\frac {\ln \left (x^{2}+3\right )}{2}\) \(12\)
parallelrisch \(\frac {i \ln \left (x +i\right )}{2}-\frac {i \ln \left (x -i\right )}{2}+\frac {\ln \left (x^{2}+3\right )}{2}\) \(26\)

[In]

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

[Out]

arctan(x)+1/2*ln(x^2+3)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.85 \[ \int \frac {3+x+x^2+x^3}{\left (1+x^2\right ) \left (3+x^2\right )} \, dx=\arctan \left (x\right ) + \frac {1}{2} \, \log \left (x^{2} + 3\right ) \]

[In]

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

[Out]

arctan(x) + 1/2*log(x^2 + 3)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.77 \[ \int \frac {3+x+x^2+x^3}{\left (1+x^2\right ) \left (3+x^2\right )} \, dx=\frac {\log {\left (x^{2} + 3 \right )}}{2} + \operatorname {atan}{\left (x \right )} \]

[In]

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

[Out]

log(x**2 + 3)/2 + atan(x)

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.85 \[ \int \frac {3+x+x^2+x^3}{\left (1+x^2\right ) \left (3+x^2\right )} \, dx=\arctan \left (x\right ) + \frac {1}{2} \, \log \left (x^{2} + 3\right ) \]

[In]

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

[Out]

arctan(x) + 1/2*log(x^2 + 3)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.85 \[ \int \frac {3+x+x^2+x^3}{\left (1+x^2\right ) \left (3+x^2\right )} \, dx=\arctan \left (x\right ) + \frac {1}{2} \, \log \left (x^{2} + 3\right ) \]

[In]

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

[Out]

arctan(x) + 1/2*log(x^2 + 3)

Mupad [B] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.85 \[ \int \frac {3+x+x^2+x^3}{\left (1+x^2\right ) \left (3+x^2\right )} \, dx=\frac {\ln \left (x^2+3\right )}{2}+\mathrm {atan}\left (x\right ) \]

[In]

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

[Out]

log(x^2 + 3)/2 + atan(x)