3.346 \(\int \frac{9+x+3 x^2+x^3}{(1+x^2) (3+x^2)} \, dx\)

Optimal. Leaf size=15 \[ \frac{1}{2} \log \left (x^2+3\right )+3 \tan ^{-1}(x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.106478, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {6725, 203, 260} \[ \frac{1}{2} \log \left (x^2+3\right )+3 \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 6725

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]

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

Mathematica [A]  time = 0.0077366, size = 15, normalized size = 1. \[ \frac{1}{2} \log \left (x^2+3\right )+3 \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 14, normalized size = 0.9 \begin{align*} 3\,\arctan \left ( x \right ) +{\frac{\ln \left ({x}^{2}+3 \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.9195, size = 18, normalized size = 1.2 \begin{align*} 3 \, \arctan \left (x\right ) + \frac{1}{2} \, \log \left (x^{2} + 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.47228, size = 43, normalized size = 2.87 \begin{align*} 3 \, \arctan \left (x\right ) + \frac{1}{2} \, \log \left (x^{2} + 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.109246, size = 12, normalized size = 0.8 \begin{align*} \frac{\log{\left (x^{2} + 3 \right )}}{2} + 3 \operatorname{atan}{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.14973, size = 18, normalized size = 1.2 \begin{align*} 3 \, \arctan \left (x\right ) + \frac{1}{2} \, \log \left (x^{2} + 3\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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