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

Optimal. Leaf size=28 \[ -\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)}-\tanh ^{-1}(\cos (x)) \]

________________________________________________________________________________________

Rubi [A]  time = 0.13, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {4401, 2648, 2667, 44, 207} \[ -\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)}-\tanh ^{-1}(\cos (x)) \]

Antiderivative was successfully verified.

[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 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])

Rule 2648

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 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 4401

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

Rubi steps

\begin {align*} \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx &=\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 \operatorname {Subst}\left (\int \frac {1}{(-1-x) (-1+x)^2} \, dx,x,\cos (x)\right )\\ &=-\frac {3 \sin (x)}{1-\cos (x)}+2 \operatorname {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)}+\operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\cos (x)\right )\\ &=-\tanh ^{-1}(\cos (x))-\frac {1}{1-\cos (x)}-\frac {3 \sin (x)}{1-\cos (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 54, normalized size = 1.93 \[ \frac {1}{2} \csc ^2\left (\frac {x}{2}\right ) \left (-3 \sin (x)+\log \left (\sin \left (\frac {x}{2}\right )\right )-\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 )-1\right ) \]

Antiderivative was successfully verified.

[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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\csc (x) (2+3 \sin (x))}{1-\cos (x)} \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 0.93, size = 39, normalized size = 1.39 \[ -\frac {{\left (\cos \relax (x) - 1\right )} \log \left (\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) - {\left (\cos \relax (x) - 1\right )} \log \left (-\frac {1}{2} \, \cos \relax (x) + \frac {1}{2}\right ) - 6 \, \sin \relax (x) - 2}{2 \, {\left (\cos \relax (x) - 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

giac [A]  time = 1.06, size = 31, normalized size = 1.11 \[ -\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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[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)))

________________________________________________________________________________________

maple [A]  time = 0.14, size = 23, normalized size = 0.82




method result size



default \(\ln \left (\tan \left (\frac {x}{2}\right )\right )-\frac {3}{\tan \left (\frac {x}{2}\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\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 33, normalized size = 1.18 \[ -\frac {{\left (\cos \relax (x) + 1\right )}^{2}}{2 \, \sin \relax (x)^{2}} - \frac {3 \, {\left (\cos \relax (x) + 1\right )}}{\sin \relax (x)} + \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[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))

________________________________________________________________________________________

mupad [B]  time = 0.28, size = 22, normalized size = 0.79 \[ \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} \]

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

sympy [A]  time = 0.82, size = 22, normalized size = 0.79 \[ \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 )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________