\(\int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx\) [807]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (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 = 15, antiderivative size = 20 \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=\sqrt {5} \arctan \left (\frac {\cos (x)}{\sqrt {5}}\right )-\cos (x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4420, 327, 209} \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=\sqrt {5} \arctan \left (\frac {\cos (x)}{\sqrt {5}}\right )-\cos (x) \]

[In]

Int[(Cos[x]^2*Sin[x])/(5 + Cos[x]^2),x]

[Out]

Sqrt[5]*ArcTan[Cos[x]/Sqrt[5]] - Cos[x]

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 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 4420

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Cos[c*(a + b*x)], x]}, Dist[-d/(
b*c), Subst[Int[SubstFor[1, Cos[c*(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[c*(a
+ b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Sin] || EqQ[F, sin])

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {x^2}{5+x^2} \, dx,x,\cos (x)\right ) \\ & = -\cos (x)+5 \text {Subst}\left (\int \frac {1}{5+x^2} \, dx,x,\cos (x)\right ) \\ & = \sqrt {5} \arctan \left (\frac {\cos (x)}{\sqrt {5}}\right )-\cos (x) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(82\) vs. \(2(20)=40\).

Time = 0.17 (sec) , antiderivative size = 82, normalized size of antiderivative = 4.10 \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=\frac {1}{20} \left (-\sqrt {5} \arctan \left (\frac {\cos (x)}{\sqrt {5}}\right )+21 \sqrt {5} \arctan \left (\frac {1}{\sqrt {5}}-\sqrt {\frac {6}{5}} \tan \left (\frac {x}{2}\right )\right )+21 \sqrt {5} \arctan \left (\frac {1}{\sqrt {5}}+\sqrt {\frac {6}{5}} \tan \left (\frac {x}{2}\right )\right )-20 \cos (x)\right ) \]

[In]

Integrate[(Cos[x]^2*Sin[x])/(5 + Cos[x]^2),x]

[Out]

(-(Sqrt[5]*ArcTan[Cos[x]/Sqrt[5]]) + 21*Sqrt[5]*ArcTan[1/Sqrt[5] - Sqrt[6/5]*Tan[x/2]] + 21*Sqrt[5]*ArcTan[1/S
qrt[5] + Sqrt[6/5]*Tan[x/2]] - 20*Cos[x])/20

Maple [A] (verified)

Time = 1.13 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.90

method result size
derivativedivides \(-\cos \left (x \right )+\arctan \left (\frac {\cos \left (x \right ) \sqrt {5}}{5}\right ) \sqrt {5}\) \(18\)
default \(-\cos \left (x \right )+\arctan \left (\frac {\cos \left (x \right ) \sqrt {5}}{5}\right ) \sqrt {5}\) \(18\)
risch \(-\frac {{\mathrm e}^{i x}}{2}-\frac {{\mathrm e}^{-i x}}{2}-\frac {i \sqrt {5}\, \ln \left ({\mathrm e}^{2 i x}-2 i \sqrt {5}\, {\mathrm e}^{i x}+1\right )}{2}+\frac {i \sqrt {5}\, \ln \left ({\mathrm e}^{2 i x}+2 i \sqrt {5}\, {\mathrm e}^{i x}+1\right )}{2}\) \(66\)

[In]

int(cos(x)^2*sin(x)/(5+cos(x)^2),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.85 \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=\sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} \cos \left (x\right )\right ) - \cos \left (x\right ) \]

[In]

integrate(cos(x)^2*sin(x)/(5+cos(x)^2),x, algorithm="fricas")

[Out]

sqrt(5)*arctan(1/5*sqrt(5)*cos(x)) - cos(x)

Sympy [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.95 \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=- \cos {\left (x \right )} + \sqrt {5} \operatorname {atan}{\left (\frac {\sqrt {5} \cos {\left (x \right )}}{5} \right )} \]

[In]

integrate(cos(x)**2*sin(x)/(5+cos(x)**2),x)

[Out]

-cos(x) + sqrt(5)*atan(sqrt(5)*cos(x)/5)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.85 \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=\sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} \cos \left (x\right )\right ) - \cos \left (x\right ) \]

[In]

integrate(cos(x)^2*sin(x)/(5+cos(x)^2),x, algorithm="maxima")

[Out]

sqrt(5)*arctan(1/5*sqrt(5)*cos(x)) - cos(x)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.85 \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=\sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} \cos \left (x\right )\right ) - \cos \left (x\right ) \]

[In]

integrate(cos(x)^2*sin(x)/(5+cos(x)^2),x, algorithm="giac")

[Out]

sqrt(5)*arctan(1/5*sqrt(5)*cos(x)) - cos(x)

Mupad [B] (verification not implemented)

Time = 26.86 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.85 \[ \int \frac {\cos ^2(x) \sin (x)}{5+\cos ^2(x)} \, dx=\sqrt {5}\,\mathrm {atan}\left (\frac {\sqrt {5}\,\cos \left (x\right )}{5}\right )-\cos \left (x\right ) \]

[In]

int((cos(x)^2*sin(x))/(cos(x)^2 + 5),x)

[Out]

5^(1/2)*atan((5^(1/2)*cos(x))/5) - cos(x)