\(\int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx\) [1257]

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

Optimal result

Integrand size = 29, antiderivative size = 251 \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {2 a x}{b^3}+\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^2 b^3 d}-\frac {6 \left (a^2-b^2\right )^{3/2} \left (a^2+b^2\right ) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^4 b^3 d}-\frac {\text {arctanh}(\cos (c+d x))}{2 a^2 d}+\frac {3 \left (a^2-b^2\right ) \text {arctanh}(\cos (c+d x))}{a^4 d}+\frac {\cos (c+d x)}{b^2 d}+\frac {2 b \cot (c+d x)}{a^3 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a^2 d}+\frac {\left (a^2-b^2\right )^2 \cos (c+d x)}{a^3 b^2 d (a+b \sin (c+d x))} \] Output:

2*a*x/b^3+2*(a^2-b^2)^(3/2)*arctan((b+a*tan(1/2*d*x+1/2*c))/(a^2-b^2)^(1/2 
))/a^2/b^3/d-6*(a^2-b^2)^(3/2)*(a^2+b^2)*arctan((b+a*tan(1/2*d*x+1/2*c))/( 
a^2-b^2)^(1/2))/a^4/b^3/d-1/2*arctanh(cos(d*x+c))/a^2/d+3*(a^2-b^2)*arctan 
h(cos(d*x+c))/a^4/d+cos(d*x+c)/b^2/d+2*b*cot(d*x+c)/a^3/d-1/2*cot(d*x+c)*c 
sc(d*x+c)/a^2/d+(a^2-b^2)^2*cos(d*x+c)/a^3/b^2/d/(a+b*sin(d*x+c))
 

Mathematica [A] (verified)

Time = 6.77 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.25 \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {2 a (c+d x)}{b^3 d}-\frac {2 \left (a^2-b^2\right )^{3/2} \left (2 a^2+3 b^2\right ) \arctan \left (\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \left (b \cos \left (\frac {1}{2} (c+d x)\right )+a \sin \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {a^2-b^2}}\right )}{a^4 b^3 d}+\frac {\cos (c+d x)}{b^2 d}+\frac {b \cot \left (\frac {1}{2} (c+d x)\right )}{a^3 d}-\frac {\csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 a^2 d}+\frac {\left (5 a^2-6 b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 a^4 d}+\frac {\left (-5 a^2+6 b^2\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 a^4 d}+\frac {\sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 a^2 d}+\frac {a^4 \cos (c+d x)-2 a^2 b^2 \cos (c+d x)+b^4 \cos (c+d x)}{a^3 b^2 d (a+b \sin (c+d x))}-\frac {b \tan \left (\frac {1}{2} (c+d x)\right )}{a^3 d} \] Input:

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

Output:

(2*a*(c + d*x))/(b^3*d) - (2*(a^2 - b^2)^(3/2)*(2*a^2 + 3*b^2)*ArcTan[(Sec 
[(c + d*x)/2]*(b*Cos[(c + d*x)/2] + a*Sin[(c + d*x)/2]))/Sqrt[a^2 - b^2]]) 
/(a^4*b^3*d) + Cos[c + d*x]/(b^2*d) + (b*Cot[(c + d*x)/2])/(a^3*d) - Csc[( 
c + d*x)/2]^2/(8*a^2*d) + ((5*a^2 - 6*b^2)*Log[Cos[(c + d*x)/2]])/(2*a^4*d 
) + ((-5*a^2 + 6*b^2)*Log[Sin[(c + d*x)/2]])/(2*a^4*d) + Sec[(c + d*x)/2]^ 
2/(8*a^2*d) + (a^4*Cos[c + d*x] - 2*a^2*b^2*Cos[c + d*x] + b^4*Cos[c + d*x 
])/(a^3*b^2*d*(a + b*Sin[c + d*x])) - (b*Tan[(c + d*x)/2])/(a^3*d)
 

Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 251, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3042, 3376, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\cos (c+d x)^6}{\sin (c+d x)^3 (a+b \sin (c+d x))^2}dx\)

\(\Big \downarrow \) 3376

\(\displaystyle \int \left (-\frac {2 b \csc ^2(c+d x)}{a^3}+\frac {\csc ^3(c+d x)}{a^2}-\frac {3 \left (a^2-b^2\right ) \csc (c+d x)}{a^4}-\frac {3 \left (a^2+b^2\right ) \left (a^2-b^2\right )^2}{a^4 b^3 (a+b \sin (c+d x))}+\frac {\left (a^2-b^2\right )^3}{a^3 b^3 (a+b \sin (c+d x))^2}+\frac {2 a}{b^3}-\frac {\sin (c+d x)}{b^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {2 b \cot (c+d x)}{a^3 d}+\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^2 b^3 d}-\frac {\text {arctanh}(\cos (c+d x))}{2 a^2 d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a^2 d}-\frac {6 \left (a^2+b^2\right ) \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^4 b^3 d}+\frac {3 \left (a^2-b^2\right ) \text {arctanh}(\cos (c+d x))}{a^4 d}+\frac {\left (a^2-b^2\right )^2 \cos (c+d x)}{a^3 b^2 d (a+b \sin (c+d x))}+\frac {2 a x}{b^3}+\frac {\cos (c+d x)}{b^2 d}\)

Input:

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

Output:

(2*a*x)/b^3 + (2*(a^2 - b^2)^(3/2)*ArcTan[(b + a*Tan[(c + d*x)/2])/Sqrt[a^ 
2 - b^2]])/(a^2*b^3*d) - (6*(a^2 - b^2)^(3/2)*(a^2 + b^2)*ArcTan[(b + a*Ta 
n[(c + d*x)/2])/Sqrt[a^2 - b^2]])/(a^4*b^3*d) - ArcTanh[Cos[c + d*x]]/(2*a 
^2*d) + (3*(a^2 - b^2)*ArcTanh[Cos[c + d*x]])/(a^4*d) + Cos[c + d*x]/(b^2* 
d) + (2*b*Cot[c + d*x])/(a^3*d) - (Cot[c + d*x]*Csc[c + d*x])/(2*a^2*d) + 
((a^2 - b^2)^2*Cos[c + d*x])/(a^3*b^2*d*(a + b*Sin[c + d*x]))
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3376
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) 
 + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(d*sin[ 
e + f*x])^n*(a + b*sin[e + f*x])^m*(1 - sin[e + f*x]^2)^(p/2), x], x] /; Fr 
eeQ[{a, b, d, e, f}, x] && NeQ[a^2 - b^2, 0] && IntegersQ[m, 2*n, p/2] && ( 
LtQ[m, -1] || (EqQ[m, -1] && GtQ[p, 0]))
 
Maple [A] (verified)

Time = 7.92 (sec) , antiderivative size = 290, normalized size of antiderivative = 1.16

method result size
derivativedivides \(\frac {\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a}{2}-4 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a^{3}}-\frac {1}{8 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {\left (-10 a^{2}+12 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a^{4}}+\frac {b}{a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {\frac {4 b}{2+2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+4 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{3}}-\frac {4 \left (\frac {-\frac {b^{2} \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-\frac {a^{5} b}{2}+a^{3} b^{3}-\frac {a \,b^{5}}{2}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a}+\frac {\left (2 a^{6}-a^{4} b^{2}-4 a^{2} b^{4}+3 b^{6}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{2 \sqrt {a^{2}-b^{2}}}\right )}{a^{4} b^{3}}}{d}\) \(290\)
default \(\frac {\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a}{2}-4 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a^{3}}-\frac {1}{8 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {\left (-10 a^{2}+12 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a^{4}}+\frac {b}{a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {\frac {4 b}{2+2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+4 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{3}}-\frac {4 \left (\frac {-\frac {b^{2} \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-\frac {a^{5} b}{2}+a^{3} b^{3}-\frac {a \,b^{5}}{2}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a}+\frac {\left (2 a^{6}-a^{4} b^{2}-4 a^{2} b^{4}+3 b^{6}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{2 \sqrt {a^{2}-b^{2}}}\right )}{a^{4} b^{3}}}{d}\) \(290\)
risch \(\frac {2 a x}{b^{3}}+\frac {{\mathrm e}^{i \left (d x +c \right )}}{2 b^{2} d}+\frac {{\mathrm e}^{-i \left (d x +c \right )}}{2 b^{2} d}+\frac {i \left (6 b^{5}-8 i a^{3} b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-9 i a \,b^{4} {\mathrm e}^{i \left (d x +c \right )}+4 i a^{3} b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+4 i a^{3} b^{2} {\mathrm e}^{i \left (d x +c \right )}+12 i a \,b^{4} {\mathrm e}^{3 i \left (d x +c \right )}-3 i a \,b^{4} {\mathrm e}^{5 i \left (d x +c \right )}+2 a^{4} b \,{\mathrm e}^{4 i \left (d x +c \right )}-4 a^{4} b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 i a^{5} {\mathrm e}^{5 i \left (d x +c \right )}-2 i a^{5} {\mathrm e}^{i \left (d x +c \right )}+4 i a^{5} {\mathrm e}^{3 i \left (d x +c \right )}-4 a^{2} b^{3}+2 a^{4} b +6 b^{5} {\mathrm e}^{4 i \left (d x +c \right )}-12 b^{5} {\mathrm e}^{2 i \left (d x +c \right )}-2 a^{2} b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+10 a^{2} b^{3} {\mathrm e}^{2 i \left (d x +c \right )}\right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} b^{3} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}-b +2 i a \,{\mathrm e}^{i \left (d x +c \right )}\right ) d \,a^{3}}-\frac {2 i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d \,b^{3}}-\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d b \,a^{2}}+\frac {3 i \sqrt {a^{2}-b^{2}}\, b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d \,a^{4}}+\frac {2 i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d \,b^{3}}+\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d b \,a^{2}}-\frac {3 i \sqrt {a^{2}-b^{2}}\, b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d \,a^{4}}-\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d \,a^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{a^{4} d}+\frac {5 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d \,a^{2}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{a^{4} d}\) \(757\)

Input:

int(cos(d*x+c)^3*cot(d*x+c)^3/(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

1/d*(1/4/a^3*(1/2*tan(1/2*d*x+1/2*c)^2*a-4*b*tan(1/2*d*x+1/2*c))-1/8/a^2/t 
an(1/2*d*x+1/2*c)^2+1/4/a^4*(-10*a^2+12*b^2)*ln(tan(1/2*d*x+1/2*c))+b/a^3/ 
tan(1/2*d*x+1/2*c)+4/b^3*(1/2*b/(1+tan(1/2*d*x+1/2*c)^2)+a*arctan(tan(1/2* 
d*x+1/2*c)))-4/a^4/b^3*((-1/2*b^2*(a^4-2*a^2*b^2+b^4)*tan(1/2*d*x+1/2*c)-1 
/2*a^5*b+a^3*b^3-1/2*a*b^5)/(tan(1/2*d*x+1/2*c)^2*a+2*b*tan(1/2*d*x+1/2*c) 
+a)+1/2*(2*a^6-a^4*b^2-4*a^2*b^4+3*b^6)/(a^2-b^2)^(1/2)*arctan(1/2*(2*a*ta 
n(1/2*d*x+1/2*c)+2*b)/(a^2-b^2)^(1/2))))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 563 vs. \(2 (237) = 474\).

Time = 0.41 (sec) , antiderivative size = 1210, normalized size of antiderivative = 4.82 \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Too large to display} \] Input:

integrate(cos(d*x+c)^3*cot(d*x+c)^3/(a+b*sin(d*x+c))^2,x, algorithm="frica 
s")
 

Output:

[1/4*(8*a^6*d*x*cos(d*x + c)^2 - 8*a^6*d*x + 4*(2*a^5*b - 2*a^3*b^3 + 3*a* 
b^5)*cos(d*x + c)^3 + 2*(2*a^5 + a^3*b^2 - 3*a*b^4 - (2*a^5 + a^3*b^2 - 3* 
a*b^4)*cos(d*x + c)^2 + (2*a^4*b + a^2*b^3 - 3*b^5 - (2*a^4*b + a^2*b^3 - 
3*b^5)*cos(d*x + c)^2)*sin(d*x + c))*sqrt(-a^2 + b^2)*log(-((2*a^2 - b^2)* 
cos(d*x + c)^2 - 2*a*b*sin(d*x + c) - a^2 - b^2 - 2*(a*cos(d*x + c)*sin(d* 
x + c) + b*cos(d*x + c))*sqrt(-a^2 + b^2))/(b^2*cos(d*x + c)^2 - 2*a*b*sin 
(d*x + c) - a^2 - b^2)) - 2*(4*a^5*b - 5*a^3*b^3 + 6*a*b^5)*cos(d*x + c) - 
 (5*a^3*b^3 - 6*a*b^5 - (5*a^3*b^3 - 6*a*b^5)*cos(d*x + c)^2 + (5*a^2*b^4 
- 6*b^6 - (5*a^2*b^4 - 6*b^6)*cos(d*x + c)^2)*sin(d*x + c))*log(1/2*cos(d* 
x + c) + 1/2) + (5*a^3*b^3 - 6*a*b^5 - (5*a^3*b^3 - 6*a*b^5)*cos(d*x + c)^ 
2 + (5*a^2*b^4 - 6*b^6 - (5*a^2*b^4 - 6*b^6)*cos(d*x + c)^2)*sin(d*x + c)) 
*log(-1/2*cos(d*x + c) + 1/2) + 2*(4*a^5*b*d*x*cos(d*x + c)^2 + 2*a^4*b^2* 
cos(d*x + c)^3 - 4*a^5*b*d*x - (2*a^4*b^2 + 3*a^2*b^4)*cos(d*x + c))*sin(d 
*x + c))/(a^5*b^3*d*cos(d*x + c)^2 - a^5*b^3*d + (a^4*b^4*d*cos(d*x + c)^2 
 - a^4*b^4*d)*sin(d*x + c)), 1/4*(8*a^6*d*x*cos(d*x + c)^2 - 8*a^6*d*x + 4 
*(2*a^5*b - 2*a^3*b^3 + 3*a*b^5)*cos(d*x + c)^3 - 4*(2*a^5 + a^3*b^2 - 3*a 
*b^4 - (2*a^5 + a^3*b^2 - 3*a*b^4)*cos(d*x + c)^2 + (2*a^4*b + a^2*b^3 - 3 
*b^5 - (2*a^4*b + a^2*b^3 - 3*b^5)*cos(d*x + c)^2)*sin(d*x + c))*sqrt(a^2 
- b^2)*arctan(-(a*sin(d*x + c) + b)/(sqrt(a^2 - b^2)*cos(d*x + c))) - 2*(4 
*a^5*b - 5*a^3*b^3 + 6*a*b^5)*cos(d*x + c) - (5*a^3*b^3 - 6*a*b^5 - (5*...
 

Sympy [F(-1)]

Timed out. \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Timed out} \] Input:

integrate(cos(d*x+c)**3*cot(d*x+c)**3/(a+b*sin(d*x+c))**2,x)
 

Output:

Timed out
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Exception raised: ValueError} \] Input:

integrate(cos(d*x+c)^3*cot(d*x+c)^3/(a+b*sin(d*x+c))^2,x, algorithm="maxim 
a")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f 
or more de
 

Giac [A] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 463, normalized size of antiderivative = 1.84 \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\frac {16 \, {\left (d x + c\right )} a}{b^{3}} - \frac {4 \, {\left (5 \, a^{2} - 6 \, b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{4}} + \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{4}} + \frac {30 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 36 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}}{a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}} - \frac {16 \, {\left (2 \, a^{6} - a^{4} b^{2} - 4 \, a^{2} b^{4} + 3 \, b^{6}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{4} b^{3}} + \frac {16 \, {\left (a^{4} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a^{4} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )} a^{4} b^{2}}}{8 \, d} \] Input:

integrate(cos(d*x+c)^3*cot(d*x+c)^3/(a+b*sin(d*x+c))^2,x, algorithm="giac" 
)
 

Output:

1/8*(16*(d*x + c)*a/b^3 - 4*(5*a^2 - 6*b^2)*log(abs(tan(1/2*d*x + 1/2*c))) 
/a^4 + (a^2*tan(1/2*d*x + 1/2*c)^2 - 8*a*b*tan(1/2*d*x + 1/2*c))/a^4 + (30 
*a^2*tan(1/2*d*x + 1/2*c)^2 - 36*b^2*tan(1/2*d*x + 1/2*c)^2 + 8*a*b*tan(1/ 
2*d*x + 1/2*c) - a^2)/(a^4*tan(1/2*d*x + 1/2*c)^2) - 16*(2*a^6 - a^4*b^2 - 
 4*a^2*b^4 + 3*b^6)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(a) + arctan((a*t 
an(1/2*d*x + 1/2*c) + b)/sqrt(a^2 - b^2)))/(sqrt(a^2 - b^2)*a^4*b^3) + 16* 
(a^4*b*tan(1/2*d*x + 1/2*c)^3 - 2*a^2*b^3*tan(1/2*d*x + 1/2*c)^3 + b^5*tan 
(1/2*d*x + 1/2*c)^3 + 2*a^5*tan(1/2*d*x + 1/2*c)^2 - 2*a^3*b^2*tan(1/2*d*x 
 + 1/2*c)^2 + a*b^4*tan(1/2*d*x + 1/2*c)^2 + 3*a^4*b*tan(1/2*d*x + 1/2*c) 
- 2*a^2*b^3*tan(1/2*d*x + 1/2*c) + b^5*tan(1/2*d*x + 1/2*c) + 2*a^5 - 2*a^ 
3*b^2 + a*b^4)/((a*tan(1/2*d*x + 1/2*c)^4 + 2*b*tan(1/2*d*x + 1/2*c)^3 + 2 
*a*tan(1/2*d*x + 1/2*c)^2 + 2*b*tan(1/2*d*x + 1/2*c) + a)*a^4*b^2))/d
 

Mupad [B] (verification not implemented)

Time = 22.44 (sec) , antiderivative size = 4294, normalized size of antiderivative = 17.11 \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Too large to display} \] Input:

int((cos(c + d*x)^3*cot(c + d*x)^3)/(a + b*sin(c + d*x))^2,x)
 

Output:

tan(c/2 + (d*x)/2)^2/(8*a^2*d) + ((tan(c/2 + (d*x)/2)^2*(16*a^4 + 16*b^4 - 
 17*a^2*b^2))/b^2 - a^2/2 + (tan(c/2 + (d*x)/2)^4*(32*a^4 + 32*b^4 - 33*a^ 
2*b^2))/(2*b^2) + 3*a*b*tan(c/2 + (d*x)/2) + (4*tan(c/2 + (d*x)/2)^5*(2*a^ 
4 + 2*b^4 - 3*a^2*b^2))/(a*b) + (tan(c/2 + (d*x)/2)^3*(24*a^4 + 8*b^4 - 9* 
a^2*b^2))/(a*b))/(d*(4*a^4*tan(c/2 + (d*x)/2)^2 + 8*a^4*tan(c/2 + (d*x)/2) 
^4 + 4*a^4*tan(c/2 + (d*x)/2)^6 + 8*a^3*b*tan(c/2 + (d*x)/2)^3 + 8*a^3*b*t 
an(c/2 + (d*x)/2)^5)) - (b*tan(c/2 + (d*x)/2))/(a^3*d) - (log(tan(c/2 + (d 
*x)/2))*(5*a^2 - 6*b^2))/(2*a^4*d) + (4*a*atan((2560*a)/((4800*a^2)/b - 25 
60*a*tan(c/2 + (d*x)/2) - 12160*b + (4480*b^3)/a^2 + (11520*b^5)/a^4 - (12 
096*b^7)/a^6 + (3456*b^9)/a^8 + (6144*b^2*tan(c/2 + (d*x)/2))/a - (5120*a^ 
3*tan(c/2 + (d*x)/2))/b^2 - (2304*b^4*tan(c/2 + (d*x)/2))/a^3 + (3840*a^5* 
tan(c/2 + (d*x)/2))/b^4) - (12160*tan(c/2 + (d*x)/2))/((4480*b^2)/a^2 + (4 
800*a^2)/b^2 + (11520*b^4)/a^4 - (12096*b^6)/a^6 + (3456*b^8)/a^8 - (2560* 
a*tan(c/2 + (d*x)/2))/b + (6144*b*tan(c/2 + (d*x)/2))/a - (2304*b^3*tan(c/ 
2 + (d*x)/2))/a^3 - (5120*a^3*tan(c/2 + (d*x)/2))/b^3 + (3840*a^5*tan(c/2 
+ (d*x)/2))/b^5 - 12160) - 6144/(6144*tan(c/2 + (d*x)/2) - (12160*a)/b + ( 
4480*b)/a + (11520*b^3)/a^3 + (4800*a^3)/b^3 - (12096*b^5)/a^5 + (3456*b^7 
)/a^7 - (2304*b^2*tan(c/2 + (d*x)/2))/a^2 - (2560*a^2*tan(c/2 + (d*x)/2))/ 
b^2 - (5120*a^4*tan(c/2 + (d*x)/2))/b^4 + (3840*a^6*tan(c/2 + (d*x)/2))/b^ 
6) + (5120*a^3)/(4800*a^2*b - 12160*b^3 + (4480*b^5)/a^2 + (11520*b^7)/...
 

Reduce [B] (verification not implemented)

Time = 0.51 (sec) , antiderivative size = 650, normalized size of antiderivative = 2.59 \[ \int \frac {\cos ^3(c+d x) \cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx =\text {Too large to display} \] Input:

int(cos(d*x+c)^3*cot(d*x+c)^3/(a+b*sin(d*x+c))^2,x)
 

Output:

( - 32*sqrt(a**2 - b**2)*atan((tan((c + d*x)/2)*a + b)/sqrt(a**2 - b**2))* 
sin(c + d*x)**3*a**4*b - 16*sqrt(a**2 - b**2)*atan((tan((c + d*x)/2)*a + b 
)/sqrt(a**2 - b**2))*sin(c + d*x)**3*a**2*b**3 + 48*sqrt(a**2 - b**2)*atan 
((tan((c + d*x)/2)*a + b)/sqrt(a**2 - b**2))*sin(c + d*x)**3*b**5 - 32*sqr 
t(a**2 - b**2)*atan((tan((c + d*x)/2)*a + b)/sqrt(a**2 - b**2))*sin(c + d* 
x)**2*a**5 - 16*sqrt(a**2 - b**2)*atan((tan((c + d*x)/2)*a + b)/sqrt(a**2 
- b**2))*sin(c + d*x)**2*a**3*b**2 + 48*sqrt(a**2 - b**2)*atan((tan((c + d 
*x)/2)*a + b)/sqrt(a**2 - b**2))*sin(c + d*x)**2*a*b**4 + 8*cos(c + d*x)*s 
in(c + d*x)**3*a**4*b**2 + 16*cos(c + d*x)*sin(c + d*x)**2*a**5*b - 16*cos 
(c + d*x)*sin(c + d*x)**2*a**3*b**3 + 24*cos(c + d*x)*sin(c + d*x)**2*a*b* 
*5 + 12*cos(c + d*x)*sin(c + d*x)*a**2*b**4 - 4*cos(c + d*x)*a**3*b**3 - 2 
0*log(tan((c + d*x)/2))*sin(c + d*x)**3*a**2*b**4 + 24*log(tan((c + d*x)/2 
))*sin(c + d*x)**3*b**6 - 20*log(tan((c + d*x)/2))*sin(c + d*x)**2*a**3*b* 
*3 + 24*log(tan((c + d*x)/2))*sin(c + d*x)**2*a*b**5 + 16*sin(c + d*x)**3* 
a**5*b*d*x + 8*sin(c + d*x)**3*a**4*b**2 + 3*sin(c + d*x)**3*a**2*b**4 + 1 
6*sin(c + d*x)**2*a**6*d*x + 8*sin(c + d*x)**2*a**5*b + 3*sin(c + d*x)**2* 
a**3*b**3)/(8*sin(c + d*x)**2*a**4*b**3*d*(sin(c + d*x)*b + a))