\(\int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx\) [60]

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

Optimal result

Integrand size = 17, antiderivative size = 28 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=-\text {arctanh}(\cos (x))-\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)} \]

[Out]

-arctanh(cos(x))-1/(1-cos(x))-3*sin(x)/(1-cos(x))

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {4486, 2727, 2746, 46, 213} \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=-\text {arctanh}(\cos (x))-\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)} \]

[In]

Int[(Csc[x]*(2 + 3*Sin[x]))/(1 - Cos[x]),x]

[Out]

-ArcTanh[Cos[x]] - (1 - Cos[x])^(-1) - (3*Sin[x])/(1 - Cos[x])

Rule 46

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] && Lt
Q[m + n + 2, 0])

Rule 213

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

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2746

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 4486

Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /;  !InertTrigFreeQ[u]

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {3}{-1+\cos (x)}-\frac {2 \csc (x)}{-1+\cos (x)}\right ) \, dx \\ & = -\left (2 \int \frac {\csc (x)}{-1+\cos (x)} \, dx\right )-3 \int \frac {1}{-1+\cos (x)} \, dx \\ & = -\frac {3 \sin (x)}{1-\cos (x)}+2 \text {Subst}\left (\int \frac {1}{(-1-x) (-1+x)^2} \, dx,x,\cos (x)\right ) \\ & = -\frac {3 \sin (x)}{1-\cos (x)}+2 \text {Subst}\left (\int \left (-\frac {1}{2 (-1+x)^2}+\frac {1}{2 \left (-1+x^2\right )}\right ) \, dx,x,\cos (x)\right ) \\ & = -\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)}+\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\cos (x)\right ) \\ & = -\text {arctanh}(\cos (x))-\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.16 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.93 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=\frac {1}{2} \csc ^2\left (\frac {x}{2}\right ) \left (-1-\log \left (\cos \left (\frac {x}{2}\right )\right )+\cos (x) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )-3 \sin (x)\right ) \]

[In]

Integrate[(Csc[x]*(2 + 3*Sin[x]))/(1 - Cos[x]),x]

[Out]

(Csc[x/2]^2*(-1 - Log[Cos[x/2]] + Cos[x]*(Log[Cos[x/2]] - Log[Sin[x/2]]) + Log[Sin[x/2]] - 3*Sin[x]))/2

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.75

method result size
parallelrisch \(\ln \left (\tan \left (\frac {x}{2}\right )\right )-\frac {\left (\cot ^{2}\left (\frac {x}{2}\right )\right )}{2}-3 \cot \left (\frac {x}{2}\right )\) \(21\)
default \(-\frac {3}{\tan \left (\frac {x}{2}\right )}+\ln \left (\tan \left (\frac {x}{2}\right )\right )-\frac {1}{2 \tan \left (\frac {x}{2}\right )^{2}}\) \(23\)
risch \(\frac {\left (\frac {1}{5}-\frac {3 i}{5}\right ) \left (10 \,{\mathrm e}^{i x}-9+3 i\right )}{\left ({\mathrm e}^{i x}-1\right )^{2}}-\ln \left ({\mathrm e}^{i x}+1\right )+\ln \left ({\mathrm e}^{i x}-1\right )\) \(44\)
norman \(\frac {-\frac {1}{2}-\frac {\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-3 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )-3 \tan \left (\frac {x}{2}\right )}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {x}{2}\right )^{2}}+\ln \left (\tan \left (\frac {x}{2}\right )\right )\) \(48\)

[In]

int((2+3*sin(x))/(1-cos(x))/sin(x),x,method=_RETURNVERBOSE)

[Out]

ln(tan(1/2*x))-1/2*cot(1/2*x)^2-3*cot(1/2*x)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.39 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=-\frac {{\left (\cos \left (x\right ) - 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right ) - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 6 \, \sin \left (x\right ) - 2}{2 \, {\left (\cos \left (x\right ) - 1\right )}} \]

[In]

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

[Out]

-1/2*((cos(x) - 1)*log(1/2*cos(x) + 1/2) - (cos(x) - 1)*log(-1/2*cos(x) + 1/2) - 6*sin(x) - 2)/(cos(x) - 1)

Sympy [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.79 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=\log {\left (\tan {\left (\frac {x}{2} \right )} \right )} - \frac {3}{\tan {\left (\frac {x}{2} \right )}} - \frac {1}{2 \tan ^{2}{\left (\frac {x}{2} \right )}} \]

[In]

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

[Out]

log(tan(x/2)) - 3/tan(x/2) - 1/(2*tan(x/2)**2)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.18 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=-\frac {{\left (\cos \left (x\right ) + 1\right )}^{2}}{2 \, \sin \left (x\right )^{2}} - \frac {3 \, {\left (\cos \left (x\right ) + 1\right )}}{\sin \left (x\right )} + \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

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

[Out]

-1/2*(cos(x) + 1)^2/sin(x)^2 - 3*(cos(x) + 1)/sin(x) + log(sin(x)/(cos(x) + 1))

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.11 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=-\frac {3 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 6 \, \tan \left (\frac {1}{2} \, x\right ) + 1}{2 \, \tan \left (\frac {1}{2} \, x\right )^{2}} + \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right ) \]

[In]

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

[Out]

-1/2*(3*tan(1/2*x)^2 + 6*tan(1/2*x) + 1)/tan(1/2*x)^2 + log(abs(tan(1/2*x)))

Mupad [B] (verification not implemented)

Time = 0.36 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.79 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx=\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-\frac {3\,\mathrm {tan}\left (\frac {x}{2}\right )+\frac {1}{2}}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2} \]

[In]

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

[Out]

log(tan(x/2)) - (3*tan(x/2) + 1/2)/tan(x/2)^2