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

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

Optimal result

Integrand size = 21, antiderivative size = 78 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=-\frac {b (b c-a d)^2 \cot (x)}{d^3}+\frac {(b c-a d) (a+b \cot (x))^2}{2 d^2}-\frac {(a+b \cot (x))^3}{3 d}+\frac {(b c-a d)^3 \log (c+d \cot (x))}{d^4} \] Output:

-b*(-a*d+b*c)^2*cot(x)/d^3+1/2*(-a*d+b*c)*(a+b*cot(x))^2/d^2-1/3*(a+b*cot( 
x))^3/d+(-a*d+b*c)^3*ln(c+d*cot(x))/d^4
 

Mathematica [A] (verified)

Time = 2.79 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.73 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {(a+b \cot (x))^3 (d \cos (x)+c \sin (x)) \left (-2 b^3 d^3 \cot (x)-6 (b c-a d)^3 (\log (\sin (x))-\log (d \cos (x)+c \sin (x))) \sin ^2(x)+b d \left (3 b d (b c-3 a d)+\left (9 a b c d-9 a^2 d^2+b^2 \left (-3 c^2+d^2\right )\right ) \sin (2 x)\right )\right )}{6 d^4 (c+d \cot (x)) (b \cos (x)+a \sin (x))^3} \] Input:

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

Output:

((a + b*Cot[x])^3*(d*Cos[x] + c*Sin[x])*(-2*b^3*d^3*Cot[x] - 6*(b*c - a*d) 
^3*(Log[Sin[x]] - Log[d*Cos[x] + c*Sin[x]])*Sin[x]^2 + b*d*(3*b*d*(b*c - 3 
*a*d) + (9*a*b*c*d - 9*a^2*d^2 + b^2*(-3*c^2 + d^2))*Sin[2*x])))/(6*d^4*(c 
 + d*Cot[x])*(b*Cos[x] + a*Sin[x])^3)
 

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 4844, 49, 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 {\csc ^2(x) (a+b \cot (x))^3}{c+d \cot (x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4844

\(\displaystyle -\int \frac {(a+b \cot (x))^3}{c+d \cot (x)}d\cot (x)\)

\(\Big \downarrow \) 49

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {(b c-a d)^3 \log (c+d \cot (x))}{d^4}-\frac {b \cot (x) (b c-a d)^2}{d^3}+\frac {(b c-a d) (a+b \cot (x))^2}{2 d^2}-\frac {(a+b \cot (x))^3}{3 d}\)

Input:

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

Output:

-((b*(b*c - a*d)^2*Cot[x])/d^3) + ((b*c - a*d)*(a + b*Cot[x])^2)/(2*d^2) - 
 (a + b*Cot[x])^3/(3*d) + ((b*c - a*d)^3*Log[c + d*Cot[x]])/d^4
 

Defintions of rubi rules used

rule 49
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] 
&& IGtQ[m, 0] && IGtQ[m + n + 2, 0]
 

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 4844
Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFac 
tors[Cot[c*(a + b*x)], x]}, Simp[-d/(b*c)   Subst[Int[SubstFor[1, Cot[c*(a 
+ b*x)]/d, u, x], x], x, Cot[c*(a + b*x)]/d], x] /; FunctionOfQ[Cot[c*(a + 
b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && NonsumQ[u] && (EqQ[F, Csc] 
|| EqQ[F, csc])
 
Maple [A] (verified)

Time = 0.88 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.51

method result size
derivativedivides \(-\frac {b \left (\frac {\cot \left (x \right )^{3} b^{2} d^{2}}{3}+\frac {3 a b \,d^{2} \cot \left (x \right )^{2}}{2}-\frac {\cot \left (x \right )^{2} b^{2} c d}{2}+3 \cot \left (x \right ) a^{2} d^{2}-3 \cot \left (x \right ) a b c d +\cot \left (x \right ) b^{2} c^{2}\right )}{d^{3}}-\frac {\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \ln \left (c +d \cot \left (x \right )\right )}{d^{4}}\) \(118\)
default \(-\frac {b \left (\frac {\cot \left (x \right )^{3} b^{2} d^{2}}{3}+\frac {3 a b \,d^{2} \cot \left (x \right )^{2}}{2}-\frac {\cot \left (x \right )^{2} b^{2} c d}{2}+3 \cot \left (x \right ) a^{2} d^{2}-3 \cot \left (x \right ) a b c d +\cot \left (x \right ) b^{2} c^{2}\right )}{d^{3}}-\frac {\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \ln \left (c +d \cot \left (x \right )\right )}{d^{4}}\) \(118\)
risch \(-\frac {2 i b \left (9 a^{2} d^{2} {\mathrm e}^{4 i x}-9 a b c d \,{\mathrm e}^{4 i x}+3 b^{2} c^{2} {\mathrm e}^{4 i x}-3 b^{2} d^{2} {\mathrm e}^{4 i x}+9 i a b \,d^{2} {\mathrm e}^{4 i x}-3 i b^{2} c d \,{\mathrm e}^{4 i x}-18 a^{2} d^{2} {\mathrm e}^{2 i x}+18 a b c d \,{\mathrm e}^{2 i x}-6 b^{2} c^{2} {\mathrm e}^{2 i x}-9 i a b \,d^{2} {\mathrm e}^{2 i x}+3 i b^{2} c d \,{\mathrm e}^{2 i x}+9 a^{2} d^{2}-9 a b c d +3 b^{2} c^{2}-b^{2} d^{2}\right )}{3 d^{3} \left ({\mathrm e}^{2 i x}-1\right )^{3}}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right ) a^{3}}{d}-\frac {3 \ln \left ({\mathrm e}^{2 i x}-1\right ) a^{2} b c}{d^{2}}+\frac {3 \ln \left ({\mathrm e}^{2 i x}-1\right ) a \,b^{2} c^{2}}{d^{3}}-\frac {\ln \left ({\mathrm e}^{2 i x}-1\right ) b^{3} c^{3}}{d^{4}}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i d -c}{i d +c}\right ) a^{3}}{d}+\frac {3 \ln \left ({\mathrm e}^{2 i x}+\frac {i d -c}{i d +c}\right ) a^{2} b c}{d^{2}}-\frac {3 \ln \left ({\mathrm e}^{2 i x}+\frac {i d -c}{i d +c}\right ) a \,b^{2} c^{2}}{d^{3}}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i d -c}{i d +c}\right ) b^{3} c^{3}}{d^{4}}\) \(396\)

Input:

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

Output:

-b/d^3*(1/3*cot(x)^3*b^2*d^2+3/2*a*b*d^2*cot(x)^2-1/2*cot(x)^2*b^2*c*d+3*c 
ot(x)*a^2*d^2-3*cot(x)*a*b*c*d+cot(x)*b^2*c^2)-(a^3*d^3-3*a^2*b*c*d^2+3*a* 
b^2*c^2*d-b^3*c^3)/d^4*ln(c+d*cot(x))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 320 vs. \(2 (74) = 148\).

Time = 0.12 (sec) , antiderivative size = 320, normalized size of antiderivative = 4.10 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=-\frac {2 \, {\left (3 \, b^{3} c^{2} d - 9 \, a b^{2} c d^{2} + {\left (9 \, a^{2} b - b^{3}\right )} d^{3}\right )} \cos \left (x\right )^{3} + 3 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3} - {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \cos \left (x\right )^{2}\right )} \log \left (2 \, c d \cos \left (x\right ) \sin \left (x\right ) - {\left (c^{2} - d^{2}\right )} \cos \left (x\right )^{2} + c^{2}\right ) \sin \left (x\right ) - 3 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3} - {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \cos \left (x\right )^{2}\right )} \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right ) \sin \left (x\right ) - 6 \, {\left (b^{3} c^{2} d - 3 \, a b^{2} c d^{2} + 3 \, a^{2} b d^{3}\right )} \cos \left (x\right ) + 3 \, {\left (b^{3} c d^{2} - 3 \, a b^{2} d^{3}\right )} \sin \left (x\right )}{6 \, {\left (d^{4} \cos \left (x\right )^{2} - d^{4}\right )} \sin \left (x\right )} \] Input:

integrate((a+b*cot(x))^3*csc(x)^2/(c+d*cot(x)),x, algorithm="fricas")
 

Output:

-1/6*(2*(3*b^3*c^2*d - 9*a*b^2*c*d^2 + (9*a^2*b - b^3)*d^3)*cos(x)^3 + 3*( 
b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3 - (b^3*c^3 - 3*a*b^2*c^2 
*d + 3*a^2*b*c*d^2 - a^3*d^3)*cos(x)^2)*log(2*c*d*cos(x)*sin(x) - (c^2 - d 
^2)*cos(x)^2 + c^2)*sin(x) - 3*(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - 
a^3*d^3 - (b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)*cos(x)^2)*lo 
g(-1/4*cos(x)^2 + 1/4)*sin(x) - 6*(b^3*c^2*d - 3*a*b^2*c*d^2 + 3*a^2*b*d^3 
)*cos(x) + 3*(b^3*c*d^2 - 3*a*b^2*d^3)*sin(x))/((d^4*cos(x)^2 - d^4)*sin(x 
))
 

Sympy [A] (verification not implemented)

Time = 10.99 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.24 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=- \frac {b^{3} \cot ^{3}{\left (x \right )}}{3 d} - \frac {\left (3 a b^{2} d - b^{3} c\right ) \cot ^{2}{\left (x \right )}}{2 d^{2}} - \frac {\left (a d - b c\right )^{3} \left (\begin {cases} \frac {\cot {\left (x \right )}}{c} & \text {for}\: d = 0 \\\frac {\log {\left (c + d \cot {\left (x \right )} \right )}}{d} & \text {otherwise} \end {cases}\right )}{d^{3}} - \frac {\left (3 a^{2} b d^{2} - 3 a b^{2} c d + b^{3} c^{2}\right ) \cot {\left (x \right )}}{d^{3}} \] Input:

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

Output:

-b**3*cot(x)**3/(3*d) - (3*a*b**2*d - b**3*c)*cot(x)**2/(2*d**2) - (a*d - 
b*c)**3*Piecewise((cot(x)/c, Eq(d, 0)), (log(c + d*cot(x))/d, True))/d**3 
- (3*a**2*b*d**2 - 3*a*b**2*c*d + b**3*c**2)*cot(x)/d**3
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (74) = 148\).

Time = 0.13 (sec) , antiderivative size = 161, normalized size of antiderivative = 2.06 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (c \tan \left (x\right ) + d\right )}{d^{4}} - \frac {{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (\tan \left (x\right )\right )}{d^{4}} - \frac {2 \, b^{3} d^{2} + 6 \, {\left (b^{3} c^{2} - 3 \, a b^{2} c d + 3 \, a^{2} b d^{2}\right )} \tan \left (x\right )^{2} - 3 \, {\left (b^{3} c d - 3 \, a b^{2} d^{2}\right )} \tan \left (x\right )}{6 \, d^{3} \tan \left (x\right )^{3}} \] Input:

integrate((a+b*cot(x))^3*csc(x)^2/(c+d*cot(x)),x, algorithm="maxima")
 

Output:

(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)*log(c*tan(x) + d)/d^4 
- (b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)*log(tan(x))/d^4 - 1/ 
6*(2*b^3*d^2 + 6*(b^3*c^2 - 3*a*b^2*c*d + 3*a^2*b*d^2)*tan(x)^2 - 3*(b^3*c 
*d - 3*a*b^2*d^2)*tan(x))/(d^3*tan(x)^3)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 232 vs. \(2 (74) = 148\).

Time = 0.17 (sec) , antiderivative size = 232, normalized size of antiderivative = 2.97 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=-\frac {{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left ({\left | \tan \left (x\right ) \right |}\right )}{d^{4}} + \frac {{\left (b^{3} c^{4} - 3 \, a b^{2} c^{3} d + 3 \, a^{2} b c^{2} d^{2} - a^{3} c d^{3}\right )} \log \left ({\left | c \tan \left (x\right ) + d \right |}\right )}{c d^{4}} + \frac {11 \, b^{3} c^{3} \tan \left (x\right )^{3} - 33 \, a b^{2} c^{2} d \tan \left (x\right )^{3} + 33 \, a^{2} b c d^{2} \tan \left (x\right )^{3} - 11 \, a^{3} d^{3} \tan \left (x\right )^{3} - 6 \, b^{3} c^{2} d \tan \left (x\right )^{2} + 18 \, a b^{2} c d^{2} \tan \left (x\right )^{2} - 18 \, a^{2} b d^{3} \tan \left (x\right )^{2} + 3 \, b^{3} c d^{2} \tan \left (x\right ) - 9 \, a b^{2} d^{3} \tan \left (x\right ) - 2 \, b^{3} d^{3}}{6 \, d^{4} \tan \left (x\right )^{3}} \] Input:

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

Output:

-(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)*log(abs(tan(x)))/d^4 
+ (b^3*c^4 - 3*a*b^2*c^3*d + 3*a^2*b*c^2*d^2 - a^3*c*d^3)*log(abs(c*tan(x) 
 + d))/(c*d^4) + 1/6*(11*b^3*c^3*tan(x)^3 - 33*a*b^2*c^2*d*tan(x)^3 + 33*a 
^2*b*c*d^2*tan(x)^3 - 11*a^3*d^3*tan(x)^3 - 6*b^3*c^2*d*tan(x)^2 + 18*a*b^ 
2*c*d^2*tan(x)^2 - 18*a^2*b*d^3*tan(x)^2 + 3*b^3*c*d^2*tan(x) - 9*a*b^2*d^ 
3*tan(x) - 2*b^3*d^3)/(d^4*tan(x)^3)
 

Mupad [B] (verification not implemented)

Time = 15.75 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.81 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=-\frac {\frac {b^3}{3\,d}+\frac {b^2\,\mathrm {tan}\left (x\right )\,\left (3\,a\,d-b\,c\right )}{2\,d^2}+\frac {b\,{\mathrm {tan}\left (x\right )}^2\,\left (3\,a^2\,d^2-3\,a\,b\,c\,d+b^2\,c^2\right )}{d^3}}{{\mathrm {tan}\left (x\right )}^3}-\frac {2\,\mathrm {atanh}\left (\frac {\left (d+2\,c\,\mathrm {tan}\left (x\right )\right )\,{\left (a\,d-b\,c\right )}^3}{d\,\left (a^3\,d^3-3\,a^2\,b\,c\,d^2+3\,a\,b^2\,c^2\,d-b^3\,c^3\right )}\right )\,{\left (a\,d-b\,c\right )}^3}{d^4} \] Input:

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

Output:

- (b^3/(3*d) + (b^2*tan(x)*(3*a*d - b*c))/(2*d^2) + (b*tan(x)^2*(3*a^2*d^2 
 + b^2*c^2 - 3*a*b*c*d))/d^3)/tan(x)^3 - (2*atanh(((d + 2*c*tan(x))*(a*d - 
 b*c)^3)/(d*(a^3*d^3 - b^3*c^3 + 3*a*b^2*c^2*d - 3*a^2*b*c*d^2)))*(a*d - b 
*c)^3)/d^4
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 332, normalized size of antiderivative = 4.26 \[ \int \frac {(a+b \cot (x))^3 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {-36 \cos \left (x \right ) \sin \left (x \right )^{2} a^{2} b \,d^{3}+36 \cos \left (x \right ) \sin \left (x \right )^{2} a \,b^{2} c \,d^{2}-12 \cos \left (x \right ) \sin \left (x \right )^{2} b^{3} c^{2} d +4 \cos \left (x \right ) \sin \left (x \right )^{2} b^{3} d^{3}-4 \cos \left (x \right ) b^{3} d^{3}-12 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} d -2 \tan \left (\frac {x}{2}\right ) c -d \right ) \sin \left (x \right )^{3} a^{3} d^{3}+36 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} d -2 \tan \left (\frac {x}{2}\right ) c -d \right ) \sin \left (x \right )^{3} a^{2} b c \,d^{2}-36 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} d -2 \tan \left (\frac {x}{2}\right ) c -d \right ) \sin \left (x \right )^{3} a \,b^{2} c^{2} d +12 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} d -2 \tan \left (\frac {x}{2}\right ) c -d \right ) \sin \left (x \right )^{3} b^{3} c^{3}+12 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )\right ) \sin \left (x \right )^{3} a^{3} d^{3}-36 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )\right ) \sin \left (x \right )^{3} a^{2} b c \,d^{2}+36 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )\right ) \sin \left (x \right )^{3} a \,b^{2} c^{2} d -12 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )\right ) \sin \left (x \right )^{3} b^{3} c^{3}+9 \sin \left (x \right )^{3} a \,b^{2} d^{3}-3 \sin \left (x \right )^{3} b^{3} c \,d^{2}-18 \sin \left (x \right ) a \,b^{2} d^{3}+6 \sin \left (x \right ) b^{3} c \,d^{2}}{12 \sin \left (x \right )^{3} d^{4}} \] Input:

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

Output:

( - 36*cos(x)*sin(x)**2*a**2*b*d**3 + 36*cos(x)*sin(x)**2*a*b**2*c*d**2 - 
12*cos(x)*sin(x)**2*b**3*c**2*d + 4*cos(x)*sin(x)**2*b**3*d**3 - 4*cos(x)* 
b**3*d**3 - 12*log(tan(x/2)**2*d - 2*tan(x/2)*c - d)*sin(x)**3*a**3*d**3 + 
 36*log(tan(x/2)**2*d - 2*tan(x/2)*c - d)*sin(x)**3*a**2*b*c*d**2 - 36*log 
(tan(x/2)**2*d - 2*tan(x/2)*c - d)*sin(x)**3*a*b**2*c**2*d + 12*log(tan(x/ 
2)**2*d - 2*tan(x/2)*c - d)*sin(x)**3*b**3*c**3 + 12*log(tan(x/2))*sin(x)* 
*3*a**3*d**3 - 36*log(tan(x/2))*sin(x)**3*a**2*b*c*d**2 + 36*log(tan(x/2)) 
*sin(x)**3*a*b**2*c**2*d - 12*log(tan(x/2))*sin(x)**3*b**3*c**3 + 9*sin(x) 
**3*a*b**2*d**3 - 3*sin(x)**3*b**3*c*d**2 - 18*sin(x)*a*b**2*d**3 + 6*sin( 
x)*b**3*c*d**2)/(12*sin(x)**3*d**4)