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

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

[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] (verified)

Time = 0.09 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {6857, 209, 648, 632, 210, 642} \[ \int \frac {15-5 x+x^2+x^3}{\left (5+x^2\right ) \left (3+2 x+x^2\right )} \, dx=-\sqrt {5} \arctan \left (\frac {x}{\sqrt {5}}\right )+\frac {5 \arctan \left (\frac {x+1}{\sqrt {2}}\right )}{\sqrt {2}}+\frac {1}{2} \log \left (x^2+2 x+3\right ) \]

[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 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 210

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

Rule 632

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 642

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 648

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 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 {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 \text {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] (verified)

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

[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

Maple [A] (verified)

Time = 0.98 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.85

method result size
risch \(\frac {\ln \left (x^{2}+2 x +3\right )}{2}+\frac {5 \arctan \left (\frac {\left (x +1\right ) \sqrt {2}}{2}\right ) \sqrt {2}}{2}-\arctan \left (\frac {x \sqrt {5}}{5}\right ) \sqrt {5}\) \(39\)
default \(-\arctan \left (\frac {x \sqrt {5}}{5}\right ) \sqrt {5}+\frac {\ln \left (x^{2}+2 x +3\right )}{2}+\frac {5 \sqrt {2}\, \arctan \left (\frac {\left (2 x +2\right ) \sqrt {2}}{4}\right )}{2}\) \(41\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.83 \[ \int \frac {15-5 x+x^2+x^3}{\left (5+x^2\right ) \left (3+2 x+x^2\right )} \, dx=\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 ) \]

[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)

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.11 \[ \int \frac {15-5 x+x^2+x^3}{\left (5+x^2\right ) \left (3+2 x+x^2\right )} \, dx=\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} \]

[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

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.83 \[ \int \frac {15-5 x+x^2+x^3}{\left (5+x^2\right ) \left (3+2 x+x^2\right )} \, dx=\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 ) \]

[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)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.83 \[ \int \frac {15-5 x+x^2+x^3}{\left (5+x^2\right ) \left (3+2 x+x^2\right )} \, dx=\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 ) \]

[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)

Mupad [B] (verification not implemented)

Time = 0.00 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.91 \[ \int \frac {15-5 x+x^2+x^3}{\left (5+x^2\right ) \left (3+2 x+x^2\right )} \, dx=\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} \]

[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