3.4.87 \(\int \cos (x) \csc (3 x) \, dx\) [387]

Optimal. Leaf size=21 \[ \frac {1}{3} \log (\sin (x))-\frac {1}{6} \log \left (3-4 \sin ^2(x)\right ) \]

[Out]

1/3*ln(sin(x))-1/6*ln(3-4*sin(x)^2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.714, Rules used = {4441, 272, 36, 31, 29} \begin {gather*} \frac {1}{3} \log (\sin (x))-\frac {1}{6} \log \left (3-4 \sin ^2(x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]*Csc[3*x],x]

[Out]

Log[Sin[x]]/3 - Log[3 - 4*Sin[x]^2]/6

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4441

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Sin[c*(a + b*x)], x]}, Dist[d/(b
*c), Subst[Int[SubstFor[1, Sin[c*(a + b*x)]/d, u, x], x], x, Sin[c*(a + b*x)]/d], x] /; FunctionOfQ[Sin[c*(a +
 b*x)]/d, u, x]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Cos] || EqQ[F, cos])

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 21, normalized size = 1.00 \begin {gather*} \frac {1}{3} \log (\sin (x))-\frac {1}{6} \log \left (3-4 \sin ^2(x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]*Csc[3*x],x]

[Out]

Log[Sin[x]]/3 - Log[3 - 4*Sin[x]^2]/6

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 34, normalized size = 1.62

method result size
risch \(\frac {\ln \left ({\mathrm e}^{2 i x}-1\right )}{3}-\frac {\ln \left ({\mathrm e}^{4 i x}+{\mathrm e}^{2 i x}+1\right )}{6}\) \(27\)
default \(\frac {\ln \left (\cos \left (x \right )-1\right )}{6}-\frac {\ln \left (1+2 \cos \left (x \right )\right )}{6}-\frac {\ln \left (2 \cos \left (x \right )-1\right )}{6}+\frac {\ln \left (1+\cos \left (x \right )\right )}{6}\) \(34\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/sin(3*x),x,method=_RETURNVERBOSE)

[Out]

1/6*ln(cos(x)-1)-1/6*ln(1+2*cos(x))-1/6*ln(2*cos(x)-1)+1/6*ln(1+cos(x))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (17) = 34\).
time = 1.77, size = 129, normalized size = 6.14 \begin {gather*} -\frac {1}{12} \, \log \left (2 \, {\left (\cos \left (x\right ) + 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \sin \left (2 \, x\right ) \sin \left (x\right ) + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) - \frac {1}{12} \, \log \left (-2 \, {\left (\cos \left (x\right ) - 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} - 2 \, \sin \left (2 \, x\right ) \sin \left (x\right ) + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) + \frac {1}{6} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + \frac {1}{6} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/sin(3*x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 1.32, size = 19, normalized size = 0.90 \begin {gather*} -\frac {1}{6} \, \log \left (4 \, \cos \left (x\right )^{2} - 1\right ) + \frac {1}{3} \, \log \left (\frac {1}{2} \, \sin \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/sin(3*x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.54, size = 17, normalized size = 0.81 \begin {gather*} - \frac {\log {\left (4 \sin ^{2}{\left (x \right )} - 3 \right )}}{6} + \frac {\log {\left (\sin {\left (x \right )} \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/sin(3*x),x)

[Out]

-log(4*sin(x)**2 - 3)/6 + log(sin(x))/3

________________________________________________________________________________________

Giac [A]
time = 0.87, size = 24, normalized size = 1.14 \begin {gather*} \frac {1}{6} \, \log \left (-\cos \left (x\right )^{2} + 1\right ) - \frac {1}{6} \, \log \left ({\left | 4 \, \cos \left (x\right )^{2} - 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/sin(3*x),x, algorithm="giac")

[Out]

1/6*log(-cos(x)^2 + 1) - 1/6*log(abs(4*cos(x)^2 - 1))

________________________________________________________________________________________

Mupad [B]
time = 0.26, size = 17, normalized size = 0.81 \begin {gather*} \frac {\ln \left (\sin \left (x\right )\right )}{3}-\frac {\ln \left (\frac {1}{4}-{\cos \left (x\right )}^2\right )}{6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/sin(3*x),x)

[Out]

log(sin(x))/3 - log(1/4 - cos(x)^2)/6

________________________________________________________________________________________