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

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.70 \[ \int \frac {e^x (1+\cos (x))}{1+\sin (x)} \, dx=\frac {1}{2} (1+\cos (x)) \sec ^2\left (\frac {x}{2}\right ) \left (-4 i \operatorname {Hypergeometric2F1}(-i,1,1-i,i \cos (x)-\sin (x)) (\cosh (x)+\sinh (x))+\frac {e^x \left ((-1+2 i)+(1+2 i) \tan \left (\frac {x}{2}\right )\right )}{1+\tan \left (\frac {x}{2}\right )}\right ) \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.12, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {4965, 2726, 4962, 4943, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {e^x (\cos (x)+1)}{\sin (x)+1} \, dx\)

\(\Big \downarrow \) 4965

\(\displaystyle \int \frac {e^x (1-\cos (x))}{\sin (x)+1}dx+2 \int \frac {e^x \cos (x)}{\sin (x)+1}dx\)

\(\Big \downarrow \) 2726

\(\displaystyle 2 \int \frac {e^x \cos (x)}{\sin (x)+1}dx-\frac {e^x \cos (x)}{\sin (x)+1}\)

\(\Big \downarrow \) 4962

\(\displaystyle 2 \int e^x \cot \left (\frac {x}{2}+\frac {\pi }{4}\right )dx-\frac {e^x \cos (x)}{\sin (x)+1}\)

\(\Big \downarrow \) 4943

\(\displaystyle -\frac {e^x \cos (x)}{\sin (x)+1}-2 i \int \left (\frac {2 e^x}{1-e^{\frac {1}{2} i (2 x+\pi )}}-e^x\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {e^x \cos (x)}{\sin (x)+1}-2 i \left (-e^x+2 e^x \operatorname {Hypergeometric2F1}\left (-i,1,1-i,i e^{i x}\right )\right )\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2726
Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, 
 x]))}, Simp[F^u*z, x] /; EqQ[D[z, x], w*y]] /; FreeQ[F, x]
 

rule 4943
Int[Cot[(d_.) + (e_.)*(x_)]^(n_.)*(F_)^((c_.)*((a_.) + (b_.)*(x_))), x_Symb 
ol] :> Simp[(-I)^n   Int[ExpandIntegrand[F^(c*(a + b*x))*((1 + E^(2*I*(d + 
e*x)))^n/(1 - E^(2*I*(d + e*x)))^n), x], x], x] /; FreeQ[{F, a, b, c, d, e} 
, x] && IntegerQ[n]
 

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

rule 4965
Int[((F_)^((c_.)*((a_.) + (b_.)*(x_)))*(Cos[(d_.) + (e_.)*(x_)]*(i_.) + (h_ 
)))/((f_) + (g_.)*Sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[2*i   Int[F^( 
c*(a + b*x))*(Cos[d + e*x]/(f + g*Sin[d + e*x])), x], x] + Int[F^(c*(a + b* 
x))*((h - i*Cos[d + e*x])/(f + g*Sin[d + e*x])), x] /; FreeQ[{F, a, b, c, d 
, e, f, g, h, i}, x] && EqQ[f^2 - g^2, 0] && EqQ[h^2 - i^2, 0] && EqQ[g*h - 
 f*i, 0]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

-2*(cos(x)*e^x - 2*(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+\cos (x))}{1+\sin (x)} \, dx=\int { \frac {{\left (\cos \left (x\right ) + 1\right )} e^{x}}{\sin \left (x\right ) + 1} \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {e^x (1+\cos (x))}{1+\sin (x)} \, dx=-e^{x}+\int \frac {e^{x}}{\sin \left (x \right )+1}d x +2 \left (\int \frac {e^{x}}{\tan \left (\frac {x}{2}\right )+1}d x \right ) \] Input:

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

Output:

 - e**x + int(e**x/(sin(x) + 1),x) + 2*int(e**x/(tan(x/2) + 1),x)