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

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

[Out]

3*arctan(x)-arctan(1/2*x*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {522, 203} \[ 3 \tan ^{-1}(x)-\sqrt {2} \tan ^{-1}\left (\frac {x}{\sqrt {2}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

3*ArcTan[x] - Sqrt[2]*ArcTan[x/Sqrt[2]]

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 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rubi steps

\begin {align*} \int \frac {4+x^2}{\left (1+x^2\right ) \left (2+x^2\right )} \, dx &=-\left (2 \int \frac {1}{2+x^2} \, dx\right )+3 \int \frac {1}{1+x^2} \, dx\\ &=3 \tan ^{-1}(x)-\sqrt {2} \tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 20, normalized size = 1.00 \[ 3 \tan ^{-1}(x)-\sqrt {2} \tan ^{-1}\left (\frac {x}{\sqrt {2}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

3*ArcTan[x] - Sqrt[2]*ArcTan[x/Sqrt[2]]

________________________________________________________________________________________

fricas [A]  time = 0.87, size = 17, normalized size = 0.85 \[ -\sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + 3 \, \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-sqrt(2)*arctan(1/2*sqrt(2)*x) + 3*arctan(x)

________________________________________________________________________________________

giac [A]  time = 0.38, size = 17, normalized size = 0.85 \[ -\sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + 3 \, \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-sqrt(2)*arctan(1/2*sqrt(2)*x) + 3*arctan(x)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 18, normalized size = 0.90 \[ 3 \arctan \relax (x )-\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, x}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3*arctan(x)-2^(1/2)*arctan(1/2*2^(1/2)*x)

________________________________________________________________________________________

maxima [A]  time = 2.40, size = 17, normalized size = 0.85 \[ -\sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + 3 \, \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-sqrt(2)*arctan(1/2*sqrt(2)*x) + 3*arctan(x)

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 17, normalized size = 0.85 \[ 3\,\mathrm {atan}\relax (x)-\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,x}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3*atan(x) - 2^(1/2)*atan((2^(1/2)*x)/2)

________________________________________________________________________________________

sympy [A]  time = 0.15, size = 19, normalized size = 0.95 \[ 3 \operatorname {atan}{\relax (x )} - \sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} x}{2} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3*atan(x) - sqrt(2)*atan(sqrt(2)*x/2)

________________________________________________________________________________________