3.304 \(\int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx\)

Optimal. Leaf size=72 \[ -\frac {\cot ^3(c+d x)}{3 a d}-\frac {\cot (c+d x)}{a d}+\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \]

[Out]

1/2*arctanh(cos(d*x+c))/a/d-cot(d*x+c)/a/d-1/3*cot(d*x+c)^3/a/d+1/2*cot(d*x+c)*csc(d*x+c)/a/d

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2839, 3767, 3768, 3770} \[ -\frac {\cot ^3(c+d x)}{3 a d}-\frac {\cot (c+d x)}{a d}+\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \]

Antiderivative was successfully verified.

[In]

Int[(Cot[c + d*x]^2*Csc[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

ArcTanh[Cos[c + d*x]]/(2*a*d) - Cot[c + d*x]/(a*d) - Cot[c + d*x]^3/(3*a*d) + (Cot[c + d*x]*Csc[c + d*x])/(2*a
*d)

Rule 2839

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3768

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Csc[c + d*x])^(n - 1))/(d*(n -
 1)), x] + Dist[(b^2*(n - 2))/(n - 1), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1
] && IntegerQ[2*n]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\cot ^2(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac {\int \csc ^3(c+d x) \, dx}{a}+\frac {\int \csc ^4(c+d x) \, dx}{a}\\ &=\frac {\cot (c+d x) \csc (c+d x)}{2 a d}-\frac {\int \csc (c+d x) \, dx}{2 a}-\frac {\operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{a d}\\ &=\frac {\tanh ^{-1}(\cos (c+d x))}{2 a d}-\frac {\cot (c+d x)}{a d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {\cot (c+d x) \csc (c+d x)}{2 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.60, size = 126, normalized size = 1.75 \[ -\frac {\csc \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (\csc \left (\frac {1}{2} (c+d x)\right )+\sec \left (\frac {1}{2} (c+d x)\right )\right )^2 \left (-12 (\sin (c+d x)-1) \cos (c+d x)-4 \left (\cos (3 (c+d x))+3 \sin ^3(c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )\right )\right )}{192 a d (\sin (c+d x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cot[c + d*x]^2*Csc[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

-1/192*(Csc[(c + d*x)/2]*Sec[(c + d*x)/2]*(Csc[(c + d*x)/2] + Sec[(c + d*x)/2])^2*(-12*Cos[c + d*x]*(-1 + Sin[
c + d*x]) - 4*(Cos[3*(c + d*x)] + 3*(Log[Cos[(c + d*x)/2]] - Log[Sin[(c + d*x)/2]])*Sin[c + d*x]^3)))/(a*d*(1
+ Sin[c + d*x]))

________________________________________________________________________________________

fricas [A]  time = 0.50, size = 119, normalized size = 1.65 \[ -\frac {8 \, \cos \left (d x + c\right )^{3} - 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 6 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 12 \, \cos \left (d x + c\right )}{12 \, {\left (a d \cos \left (d x + c\right )^{2} - a d\right )} \sin \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^4/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/12*(8*cos(d*x + c)^3 - 3*(cos(d*x + c)^2 - 1)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 3*(cos(d*x + c)^2
- 1)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 6*cos(d*x + c)*sin(d*x + c) - 12*cos(d*x + c))/((a*d*cos(d*x
+ c)^2 - a*d)*sin(d*x + c))

________________________________________________________________________________________

giac [A]  time = 0.17, size = 128, normalized size = 1.78 \[ -\frac {\frac {12 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} - \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{3}} - \frac {22 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}{a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^4/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/24*(12*log(abs(tan(1/2*d*x + 1/2*c)))/a - (a^2*tan(1/2*d*x + 1/2*c)^3 - 3*a^2*tan(1/2*d*x + 1/2*c)^2 + 9*a^
2*tan(1/2*d*x + 1/2*c))/a^3 - (22*tan(1/2*d*x + 1/2*c)^3 - 9*tan(1/2*d*x + 1/2*c)^2 + 3*tan(1/2*d*x + 1/2*c) -
 1)/(a*tan(1/2*d*x + 1/2*c)^3))/d

________________________________________________________________________________________

maple [A]  time = 0.45, size = 132, normalized size = 1.83 \[ \frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{24 a d}-\frac {\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a d}+\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a d}-\frac {3}{8 a d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a d}+\frac {1}{8 a d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {1}{24 a d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*csc(d*x+c)^4/(a+a*sin(d*x+c)),x)

[Out]

1/24/a/d*tan(1/2*d*x+1/2*c)^3-1/8/a/d*tan(1/2*d*x+1/2*c)^2+3/8/a/d*tan(1/2*d*x+1/2*c)-3/8/a/d/tan(1/2*d*x+1/2*
c)-1/2/a/d*ln(tan(1/2*d*x+1/2*c))+1/8/a/d/tan(1/2*d*x+1/2*c)^2-1/24/a/d/tan(1/2*d*x+1/2*c)^3

________________________________________________________________________________________

maxima [B]  time = 0.32, size = 153, normalized size = 2.12 \[ \frac {\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a} - \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {{\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {9 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{3}}{a \sin \left (d x + c\right )^{3}}}{24 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^4/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/24*((9*sin(d*x + c)/(cos(d*x + c) + 1) - 3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + sin(d*x + c)^3/(cos(d*x + c
) + 1)^3)/a - 12*log(sin(d*x + c)/(cos(d*x + c) + 1))/a + (3*sin(d*x + c)/(cos(d*x + c) + 1) - 9*sin(d*x + c)^
2/(cos(d*x + c) + 1)^2 - 1)*(cos(d*x + c) + 1)^3/(a*sin(d*x + c)^3))/d

________________________________________________________________________________________

mupad [B]  time = 8.62, size = 119, normalized size = 1.65 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,a\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,a\,d}+\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,a\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {1}{3}\right )}{8\,a\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2/(sin(c + d*x)^4*(a + a*sin(c + d*x))),x)

[Out]

tan(c/2 + (d*x)/2)^3/(24*a*d) - tan(c/2 + (d*x)/2)^2/(8*a*d) - log(tan(c/2 + (d*x)/2))/(2*a*d) + (3*tan(c/2 +
(d*x)/2))/(8*a*d) - (cot(c/2 + (d*x)/2)^3*(3*tan(c/2 + (d*x)/2)^2 - tan(c/2 + (d*x)/2) + 1/3))/(8*a*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\cos ^{2}{\left (c + d x \right )} \csc ^{4}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*csc(d*x+c)**4/(a+a*sin(d*x+c)),x)

[Out]

Integral(cos(c + d*x)**2*csc(c + d*x)**4/(sin(c + d*x) + 1), x)/a

________________________________________________________________________________________