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

   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 = 16, antiderivative size = 42 \[ \int \frac {e^x (1-\sin (x))}{1+\cos (x)} \, dx=(2-2 i) e^{(1+i) x} \operatorname {Hypergeometric2F1}\left (1-i,2,2-i,-e^{i x}\right )-\frac {e^x \sin (x)}{1+\cos (x)} \]

[Out]

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

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.05, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {4551, 4548, 4527, 2225, 2283, 2326} \[ \int \frac {e^x (1-\sin (x))}{1+\cos (x)} \, dx=-4 i e^x \operatorname {Hypergeometric2F1}\left (-i,1,1-i,-e^{i x}\right )+2 i e^x+\frac {e^x \sin (x)}{\cos (x)+1} \]

[In]

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

[Out]

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

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2283

Int[((a_) + (b_.)*(F_)^((e_.)*((c_.) + (d_.)*(x_))))^(p_)*(G_)^((h_.)*((f_.) + (g_.)*(x_))), x_Symbol] :> Simp
[a^p*(G^(h*(f + g*x))/(g*h*Log[G]))*Hypergeometric2F1[-p, g*h*(Log[G]/(d*e*Log[F])), g*h*(Log[G]/(d*e*Log[F]))
 + 1, Simplify[(-b/a)*F^(e*(c + d*x))]], x] /; FreeQ[{F, G, a, b, c, d, e, f, g, h, p}, x] && (ILtQ[p, 0] || G
tQ[a, 0])

Rule 2326

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 4527

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*Tan[(d_.) + (e_.)*(x_)]^(n_.), x_Symbol] :> Dist[I^n, Int[ExpandIntegran
d[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 4548

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

Rule 4551

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_)))*((h_) + (i_.)*Sin[(d_.) + (e_.)*(x_)]))/(Cos[(d_.) + (e_.)*(x_)]*(g_.)
+ (f_)), x_Symbol] :> Dist[2*i, Int[F^(c*(a + b*x))*(Sin[d + e*x]/(f + g*Cos[d + e*x])), x], x] + Int[F^(c*(a
+ b*x))*((h - i*Sin[d + e*x])/(f + g*Cos[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]

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

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(87\) vs. \(2(42)=84\).

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

[In]

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

[Out]

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

Maple [F]

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

[In]

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

[Out]

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

Fricas [F]

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

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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