\(\int \frac {e^x}{1+\sin (x)} \, dx\) [554]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 10, antiderivative size = 30 \[ \int \frac {e^x}{1+\sin (x)} \, dx=(-1+i) e^{(1-i) x} \operatorname {Hypergeometric2F1}\left (1+i,2,2+i,-i e^{-i x}\right ) \]

[Out]

(-1+I)*exp((1-I)*x)*hypergeom([2, 1+I],[2+I],-I/exp(I*x))

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 30, 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.200, Rules used = {4541, 4535} \[ \int \frac {e^x}{1+\sin (x)} \, dx=(-1+i) e^{(1-i) x} \operatorname {Hypergeometric2F1}\left (1+i,2,2+i,-i e^{-i x}\right ) \]

[In]

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

[Out]

(-1 + I)*E^((1 - I)*x)*Hypergeometric2F1[1 + I, 2, 2 + I, (-I)/E^(I*x)]

Rule 4535

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*Sec[(d_.) + Pi*(k_.) + (e_.)*(x_)]^(n_.), x_Symbol] :> Simp[2^n*E^(I*k*n
*Pi)*E^(I*n*(d + e*x))*(F^(c*(a + b*x))/(I*e*n + b*c*Log[F]))*Hypergeometric2F1[n, n/2 - I*b*c*(Log[F]/(2*e)),
 1 + n/2 - I*b*c*(Log[F]/(2*e)), (-E^(2*I*k*Pi))*E^(2*I*(d + e*x))], x] /; FreeQ[{F, a, b, c, d, e}, x] && Int
egerQ[4*k] && IntegerQ[n]

Rule 4541

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*((f_) + (g_.)*Sin[(d_.) + (e_.)*(x_)])^(n_.), x_Symbol] :> Dist[2^n*f^n,
 Int[F^(c*(a + b*x))*Cos[d/2 - f*(Pi/(4*g)) + e*(x/2)]^(2*n), x], x] /; FreeQ[{F, a, b, c, d, e, f, g}, x] &&
EqQ[f^2 - g^2, 0] && ILtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \int e^x \sec ^2\left (\frac {\pi }{4}-\frac {x}{2}\right ) \, dx \\ & = (-1+i) e^{(1-i) x} \operatorname {Hypergeometric2F1}\left (1+i,2,2+i,-i e^{-i x}\right ) \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(61\) vs. \(2(30)=60\).

Time = 0.61 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.03 \[ \int \frac {e^x}{1+\sin (x)} \, dx=\frac {2 e^x \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}-(1-i) (1-(1-i) \operatorname {Hypergeometric2F1}(-i,1,1-i,i \cos (x)-\sin (x))) (\cosh (x)+\sinh (x)) \]

[In]

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

[Out]

(2*E^x*Sin[x/2])/(Cos[x/2] + Sin[x/2]) - (1 - I)*(1 - (1 - I)*Hypergeometric2F1[-I, 1, 1 - I, I*Cos[x] - Sin[x
]])*(Cosh[x] + Sinh[x])

Maple [F]

\[\int \frac {{\mathrm e}^{x}}{\sin \left (x \right )+1}d x\]

[In]

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

[Out]

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

Fricas [F]

\[ \int \frac {e^x}{1+\sin (x)} \, dx=\int { \frac {e^{x}}{\sin \left (x\right ) + 1} \,d x } \]

[In]

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

[Out]

integral(e^x/(sin(x) + 1), x)

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

\[ \int \frac {e^x}{1+\sin (x)} \, dx=\int { \frac {e^{x}}{\sin \left (x\right ) + 1} \,d x } \]

[In]

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

[Out]

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

Giac [F]

\[ \int \frac {e^x}{1+\sin (x)} \, dx=\int { \frac {e^{x}}{\sin \left (x\right ) + 1} \,d x } \]

[In]

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

[Out]

integrate(e^x/(sin(x) + 1), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {e^x}{1+\sin (x)} \, dx=\int \frac {{\mathrm {e}}^x}{\sin \left (x\right )+1} \,d x \]

[In]

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

[Out]

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