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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {1010, 391, 203, 444, 36, 31} \[ 2 \log \left (x^2+1\right )-2 \log \left (x^2+2\right )+3 \tan ^{-1}(x)-\frac {3 \tan ^{-1}\left (\frac {x}{\sqrt {2}}\right )}{\sqrt {2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

3*ArcTan[x] - (3*ArcTan[x/Sqrt[2]])/Sqrt[2] + 2*Log[1 + x^2] - 2*Log[2 + x^2]

Rule 31

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

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 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 391

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

Rule 444

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 1010

Int[((g_) + (h_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_)*((d_) + (f_.)*(x_)^2)^(q_), x_Symbol] :> Dist[g, Int[(a + c
*x^2)^p*(d + f*x^2)^q, x], x] + Dist[h, Int[x*(a + c*x^2)^p*(d + f*x^2)^q, x], x] /; FreeQ[{a, c, d, f, g, h,
p, q}, x]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

3*ArcTan[x] - (3*ArcTan[x/Sqrt[2]])/Sqrt[2] + 2*Log[1 + x^2] - 2*Log[2 + x^2]

________________________________________________________________________________________

fricas [A]  time = 0.80, size = 33, normalized size = 0.92 \[ -\frac {3}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + 3 \, \arctan \relax (x) - 2 \, \log \left (x^{2} + 2\right ) + 2 \, \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.25, size = 33, normalized size = 0.92 \[ -\frac {3}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + 3 \, \arctan \relax (x) - 2 \, \log \left (x^{2} + 2\right ) + 2 \, \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.00, size = 34, normalized size = 0.94 \[ 3 \arctan \relax (x )-\frac {3 \sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, x}{2}\right )}{2}+2 \ln \left (x^{2}+1\right )-2 \ln \left (x^{2}+2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 2.06, size = 33, normalized size = 0.92 \[ -\frac {3}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) + 3 \, \arctan \relax (x) - 2 \, \log \left (x^{2} + 2\right ) + 2 \, \log \left (x^{2} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.10, size = 56, normalized size = 1.56 \[ \ln \left (x-\mathrm {i}\right )\,\left (2-\frac {3}{2}{}\mathrm {i}\right )+\ln \left (x+1{}\mathrm {i}\right )\,\left (2+\frac {3}{2}{}\mathrm {i}\right )+\ln \left (x-\sqrt {2}\,1{}\mathrm {i}\right )\,\left (-2+\frac {\sqrt {2}\,3{}\mathrm {i}}{4}\right )-\ln \left (x+\sqrt {2}\,1{}\mathrm {i}\right )\,\left (2+\frac {\sqrt {2}\,3{}\mathrm {i}}{4}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x - 1i)*(2 - 3i/2) + log(x + 1i)*(2 + 3i/2) + log(x - 2^(1/2)*1i)*((2^(1/2)*3i)/4 - 2) - log(x + 2^(1/2)*1
i)*((2^(1/2)*3i)/4 + 2)

________________________________________________________________________________________

sympy [A]  time = 0.19, size = 39, normalized size = 1.08 \[ 2 \log {\left (x^{2} + 1 \right )} - 2 \log {\left (x^{2} + 2 \right )} + 3 \operatorname {atan}{\relax (x )} - \frac {3 \sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} x}{2} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*log(x**2 + 1) - 2*log(x**2 + 2) + 3*atan(x) - 3*sqrt(2)*atan(sqrt(2)*x/2)/2

________________________________________________________________________________________