\(\int \frac {1}{\sec (x)+\sin (x) \tan (x)} \, dx\) [919]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 3 \[ \int \frac {1}{\sec (x)+\sin (x) \tan (x)} \, dx=\arctan (\sin (x)) \]

[Out]

arctan(sin(x))

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 3, 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.300, Rules used = {4482, 3269, 209} \[ \int \frac {1}{\sec (x)+\sin (x) \tan (x)} \, dx=\arctan (\sin (x)) \]

[In]

Int[(Sec[x] + Sin[x]*Tan[x])^(-1),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]

Rule 4482

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos (x)}{1+\sin ^2(x)} \, dx \\ & = \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 {1}{\sec (x)+\sin (x) \tan (x)} \, dx=\arctan (\sin (x)) \]

[In]

Integrate[(Sec[x] + Sin[x]*Tan[x])^(-1),x]

[Out]

ArcTan[Sin[x]]

Maple [A] (verified)

Time = 0.65 (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\)
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(1/(sec(x)+sin(x)*tan(x)),x,method=_RETURNVERBOSE)

[Out]

arctan(sin(x))

Fricas [A] (verification not implemented)

none

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

[In]

integrate(1/(sec(x)+sin(x)*tan(x)),x, algorithm="fricas")

[Out]

arctan(sin(x))

Sympy [F]

\[ \int \frac {1}{\sec (x)+\sin (x) \tan (x)} \, dx=\int \frac {1}{\sin {\left (x \right )} \tan {\left (x \right )} + \sec {\left (x \right )}}\, dx \]

[In]

integrate(1/(sec(x)+sin(x)*tan(x)),x)

[Out]

Integral(1/(sin(x)*tan(x) + sec(x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (3) = 6\).

Time = 0.22 (sec) , antiderivative size = 45, normalized size of antiderivative = 15.00 \[ \int \frac {1}{\sec (x)+\sin (x) \tan (x)} \, dx=\frac {1}{2} \, \arctan \left (\sin \left (2 \, x\right ) + 2 \, \sin \left (x\right ), \cos \left (2 \, x\right ) + 2 \, \cos \left (x\right ) - 1\right ) - \frac {1}{2} \, \arctan \left (\sin \left (2 \, x\right ) - 2 \, \sin \left (x\right ), \cos \left (2 \, x\right ) - 2 \, \cos \left (x\right ) - 1\right ) \]

[In]

integrate(1/(sec(x)+sin(x)*tan(x)),x, algorithm="maxima")

[Out]

1/2*arctan2(sin(2*x) + 2*sin(x), cos(2*x) + 2*cos(x) - 1) - 1/2*arctan2(sin(2*x) - 2*sin(x), cos(2*x) - 2*cos(
x) - 1)

Giac [A] (verification not implemented)

none

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

[In]

integrate(1/(sec(x)+sin(x)*tan(x)),x, algorithm="giac")

[Out]

arctan(sin(x))

Mupad [B] (verification not implemented)

Time = 27.04 (sec) , antiderivative size = 26, normalized size of antiderivative = 8.67 \[ \int \frac {1}{\sec (x)+\sin (x) \tan (x)} \, dx=\mathrm {atan}\left (\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{2}+\frac {5\,\mathrm {tan}\left (\frac {x}{2}\right )}{2}\right )-\mathrm {atan}\left (\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{2}\right ) \]

[In]

int(1/(sin(x)*tan(x) + 1/cos(x)),x)

[Out]

atan((5*tan(x/2))/2 + tan(x/2)^3/2) - atan(tan(x/2)/2)