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

   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 = 11, antiderivative size = 3 \[ \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx=\arctan (\sin (x)) \]

[Out]

arctan(sin(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3269, 209} \[ \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx=\arctan (\sin (x)) \]

[In]

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

[Out]

ArcTan[Sin[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 3269

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx=\arctan (\sin (x)) \]

[In]

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

[Out]

ArcTan[Sin[x]]

Maple [A] (verified)

Time = 0.44 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.33

method result size
derivativedivides \(\arctan \left (\sin \left (x \right )\right )\) \(4\)
default \(\arctan \left (\sin \left (x \right )\right )\) \(4\)
parallelrisch \(-\frac {i \left (-\ln \left (-\frac {2 i \left (\sin \left (x \right )+i\right )}{\cos \left (x \right )+1}\right )+\ln \left (\frac {2+2 i \sin \left (x \right )}{\cos \left (x \right )+1}\right )\right )}{2}\) \(37\)
risch \(\frac {i \ln \left ({\mathrm e}^{2 i x}-2 \,{\mathrm e}^{i x}-1\right )}{2}-\frac {i \ln \left ({\mathrm e}^{2 i x}+2 \,{\mathrm e}^{i x}-1\right )}{2}\) \(38\)

[In]

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

[Out]

arctan(sin(x))

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

arctan(sin(x))

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx=\operatorname {atan}{\left (\sin {\left (x \right )} \right )} \]

[In]

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

[Out]

atan(sin(x))

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx=\arctan \left (\sin \left (x\right )\right ) \]

[In]

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

[Out]

arctan(sin(x))

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx=\arctan \left (\sin \left (x\right )\right ) \]

[In]

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

[Out]

arctan(sin(x))

Mupad [B] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx=\mathrm {atan}\left (\sin \left (x\right )\right ) \]

[In]

int(cos(x)/(sin(x)^2 + 1),x)

[Out]

atan(sin(x))