3.249 \(\int \frac{\sec (x)}{1+\sin (x)} \, dx\)

Optimal. Leaf size=18 \[ \frac{1}{2} \tanh ^{-1}(\sin (x))-\frac{1}{2 (\sin (x)+1)} \]

[Out]

ArcTanh[Sin[x]]/2 - 1/(2*(1 + Sin[x]))

________________________________________________________________________________________

Rubi [A]  time = 0.030173, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {2667, 44, 207} \[ \frac{1}{2} \tanh ^{-1}(\sin (x))-\frac{1}{2 (\sin (x)+1)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]/(1 + Sin[x]),x]

[Out]

ArcTanh[Sin[x]]/2 - 1/(2*(1 + Sin[x]))

Rule 2667

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 207

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

Rubi steps

\begin{align*} \int \frac{\sec (x)}{1+\sin (x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{(1-x) (1+x)^2} \, dx,x,\sin (x)\right )\\ &=\operatorname{Subst}\left (\int \left (\frac{1}{2 (1+x)^2}-\frac{1}{2 \left (-1+x^2\right )}\right ) \, dx,x,\sin (x)\right )\\ &=-\frac{1}{2 (1+\sin (x))}-\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sin (x)\right )\\ &=\frac{1}{2} \tanh ^{-1}(\sin (x))-\frac{1}{2 (1+\sin (x))}\\ \end{align*}

Mathematica [A]  time = 0.0173726, size = 18, normalized size = 1. \[ \frac{1}{2} \tanh ^{-1}(\sin (x))-\frac{1}{2 (\sin (x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/(1 + Sin[x]),x]

[Out]

ArcTanh[Sin[x]]/2 - 1/(2*(1 + Sin[x]))

________________________________________________________________________________________

Maple [A]  time = 0.03, size = 24, normalized size = 1.3 \begin{align*} -{\frac{1}{2+2\,\sin \left ( x \right ) }}+{\frac{\ln \left ( 1+\sin \left ( x \right ) \right ) }{4}}-{\frac{\ln \left ( -1+\sin \left ( x \right ) \right ) }{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)/(1+sin(x)),x)

[Out]

-1/2/(1+sin(x))+1/4*ln(1+sin(x))-1/4*ln(-1+sin(x))

________________________________________________________________________________________

Maxima [A]  time = 0.930043, size = 31, normalized size = 1.72 \begin{align*} -\frac{1}{2 \,{\left (\sin \left (x\right ) + 1\right )}} + \frac{1}{4} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{4} \, \log \left (\sin \left (x\right ) - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2/(sin(x) + 1) + 1/4*log(sin(x) + 1) - 1/4*log(sin(x) - 1)

________________________________________________________________________________________

Fricas [B]  time = 2.35832, size = 115, normalized size = 6.39 \begin{align*} \frac{{\left (\sin \left (x\right ) + 1\right )} \log \left (\sin \left (x\right ) + 1\right ) -{\left (\sin \left (x\right ) + 1\right )} \log \left (-\sin \left (x\right ) + 1\right ) - 2}{4 \,{\left (\sin \left (x\right ) + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*((sin(x) + 1)*log(sin(x) + 1) - (sin(x) + 1)*log(-sin(x) + 1) - 2)/(sin(x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (x \right )}}{\sin{\left (x \right )} + 1}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.05734, size = 34, normalized size = 1.89 \begin{align*} -\frac{1}{2 \,{\left (\sin \left (x\right ) + 1\right )}} + \frac{1}{4} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{4} \, \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2/(sin(x) + 1) + 1/4*log(sin(x) + 1) - 1/4*log(-sin(x) + 1)