3.376 \(\int \frac {15-5 x+x^2+x^3}{(5+x^2) (3+2 x+x^2)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.13, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {6725, 203, 634, 618, 204, 628} \[ \frac {1}{2} \log \left (x^2+2 x+3\right )-\sqrt {5} \tan ^{-1}\left (\frac {x}{\sqrt {5}}\right )+\frac {5 \tan ^{-1}\left (\frac {x+1}{\sqrt {2}}\right )}{\sqrt {2}} \]

Antiderivative was successfully verified.

[In]

Int[(15 - 5*x + x^2 + x^3)/((5 + x^2)*(3 + 2*x + x^2)),x]

[Out]

-(Sqrt[5]*ArcTan[x/Sqrt[5]]) + (5*ArcTan[(1 + x)/Sqrt[2]])/Sqrt[2] + Log[3 + 2*x + x^2]/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 204

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

Rule 618

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

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 634

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

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]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Integrate[(15 - 5*x + x^2 + x^3)/((5 + x^2)*(3 + 2*x + x^2)),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.77, size = 38, normalized size = 0.83 \[ \frac {5}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (x + 1\right )}\right ) - \sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} x\right ) + \frac {1}{2} \, \log \left (x^{2} + 2 \, x + 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3+x^2-5*x+15)/(x^2+5)/(x^2+2*x+3),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.36, size = 38, normalized size = 0.83 \[ \frac {5}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (x + 1\right )}\right ) - \sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} x\right ) + \frac {1}{2} \, \log \left (x^{2} + 2 \, x + 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3+x^2-5*x+15)/(x^2+5)/(x^2+2*x+3),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.00, size = 41, normalized size = 0.89 \[ -\sqrt {5}\, \arctan \left (\frac {\sqrt {5}\, x}{5}\right )+\frac {5 \sqrt {2}\, \arctan \left (\frac {\left (2 x +2\right ) \sqrt {2}}{4}\right )}{2}+\frac {\ln \left (x^{2}+2 x +3\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^3+x^2-5*x+15)/(x^2+5)/(x^2+2*x+3),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.97, size = 38, normalized size = 0.83 \[ \frac {5}{2} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (x + 1\right )}\right ) - \sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} x\right ) + \frac {1}{2} \, \log \left (x^{2} + 2 \, x + 3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^3+x^2-5*x+15)/(x^2+5)/(x^2+2*x+3),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.00, size = 88, normalized size = 1.91 \[ \frac {\ln \left (x+1-\sqrt {2}\,1{}\mathrm {i}\right )}{2}+\frac {\ln \left (x+1+\sqrt {2}\,1{}\mathrm {i}\right )}{2}+\sqrt {5}\,\mathrm {atan}\left (\frac {2000\,\sqrt {5}}{2000\,x+1120}-\frac {224\,\sqrt {5}\,x}{2000\,x+1120}\right )-\frac {\sqrt {2}\,\ln \left (x+1-\sqrt {2}\,1{}\mathrm {i}\right )\,5{}\mathrm {i}}{4}+\frac {\sqrt {2}\,\ln \left (x+1+\sqrt {2}\,1{}\mathrm {i}\right )\,5{}\mathrm {i}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 - 5*x + x^3 + 15)/((x^2 + 5)*(2*x + x^2 + 3)),x)

[Out]

log(x - 2^(1/2)*1i + 1)/2 + log(x + 2^(1/2)*1i + 1)/2 + 5^(1/2)*atan((2000*5^(1/2))/(2000*x + 1120) - (224*5^(
1/2)*x)/(2000*x + 1120)) - (2^(1/2)*log(x - 2^(1/2)*1i + 1)*5i)/4 + (2^(1/2)*log(x + 2^(1/2)*1i + 1)*5i)/4

________________________________________________________________________________________

sympy [A]  time = 0.21, size = 51, normalized size = 1.11 \[ \frac {\log {\left (x^{2} + 2 x + 3 \right )}}{2} - \sqrt {5} \operatorname {atan}{\left (\frac {\sqrt {5} x}{5} \right )} + \frac {5 \sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} x}{2} + \frac {\sqrt {2}}{2} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**3+x**2-5*x+15)/(x**2+5)/(x**2+2*x+3),x)

[Out]

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

________________________________________________________________________________________