Integrand size = 21, antiderivative size = 99 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=-4 a b \left (a^2-b^2\right ) x-\frac {3 a^3 b \cot (c+d x)}{d}-\frac {b^4 \log (\cos (c+d x))}{d}-\frac {a^2 \left (a^2-6 b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d} \] Output:
-4*a*b*(a^2-b^2)*x-3*a^3*b*cot(d*x+c)/d-b^4*ln(cos(d*x+c))/d-a^2*(a^2-6*b^ 2)*ln(sin(d*x+c))/d-1/2*a^2*cot(d*x+c)^2*(a+b*tan(d*x+c))^2/d
Result contains complex when optimal does not.
Time = 0.21 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.91 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {8 a^3 b \cot (c+d x)+a^4 \cot ^2(c+d x)-(a-i b)^4 \log (i-\cot (c+d x))-(a+i b)^4 \log (i+\cot (c+d x))-2 b^4 \log (\tan (c+d x))}{2 d} \] Input:
Integrate[Cot[c + d*x]^3*(a + b*Tan[c + d*x])^4,x]
Output:
-1/2*(8*a^3*b*Cot[c + d*x] + a^4*Cot[c + d*x]^2 - (a - I*b)^4*Log[I - Cot[ c + d*x]] - (a + I*b)^4*Log[I + Cot[c + d*x]] - 2*b^4*Log[Tan[c + d*x]])/d
Time = 0.69 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.02, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.524, Rules used = {3042, 4048, 27, 3042, 4118, 25, 3042, 4107, 3042, 25, 3956}
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 \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x))^4}{\tan (c+d x)^3}dx\) |
\(\Big \downarrow \) 4048 |
\(\displaystyle \frac {1}{2} \int 2 \cot ^2(c+d x) (a+b \tan (c+d x)) \left (\tan ^2(c+d x) b^3+3 a^2 b-a \left (a^2-3 b^2\right ) \tan (c+d x)\right )dx-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \int \cot ^2(c+d x) (a+b \tan (c+d x)) \left (\tan ^2(c+d x) b^3+3 a^2 b-a \left (a^2-3 b^2\right ) \tan (c+d x)\right )dx-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \tan (c+d x)) \left (\tan (c+d x)^2 b^3+3 a^2 b-a \left (a^2-3 b^2\right ) \tan (c+d x)\right )}{\tan (c+d x)^2}dx-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 4118 |
\(\displaystyle \int -\cot (c+d x) \left (-\tan ^2(c+d x) b^4+4 a \left (a^2-b^2\right ) \tan (c+d x) b+a^2 \left (a^2-6 b^2\right )\right )dx-\frac {3 a^3 b \cot (c+d x)}{d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \cot (c+d x) \left (-\tan ^2(c+d x) b^4+4 a \left (a^2-b^2\right ) \tan (c+d x) b+a^2 \left (a^2-6 b^2\right )\right )dx-\frac {3 a^3 b \cot (c+d x)}{d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\int \frac {-\tan (c+d x)^2 b^4+4 a \left (a^2-b^2\right ) \tan (c+d x) b+a^2 \left (a^2-6 b^2\right )}{\tan (c+d x)}dx-\frac {3 a^3 b \cot (c+d x)}{d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 4107 |
\(\displaystyle -a^2 \left (a^2-6 b^2\right ) \int \cot (c+d x)dx+b^4 \int \tan (c+d x)dx-\frac {3 a^3 b \cot (c+d x)}{d}-4 a b x \left (a^2-b^2\right )-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -a^2 \left (a^2-6 b^2\right ) \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx+b^4 \int \tan (c+d x)dx-\frac {3 a^3 b \cot (c+d x)}{d}-4 a b x \left (a^2-b^2\right )-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle a^2 \left (a^2-6 b^2\right ) \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx+b^4 \int \tan (c+d x)dx-\frac {3 a^3 b \cot (c+d x)}{d}-4 a b x \left (a^2-b^2\right )-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle -\frac {3 a^3 b \cot (c+d x)}{d}-\frac {a^2 \left (a^2-6 b^2\right ) \log (-\sin (c+d x))}{d}-4 a b x \left (a^2-b^2\right )-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))^2}{2 d}-\frac {b^4 \log (\cos (c+d x))}{d}\) |
Input:
Int[Cot[c + d*x]^3*(a + b*Tan[c + d*x])^4,x]
Output:
-4*a*b*(a^2 - b^2)*x - (3*a^3*b*Cot[c + d*x])/d - (b^4*Log[Cos[c + d*x]])/ d - (a^2*(a^2 - 6*b^2)*Log[-Sin[c + d*x]])/d - (a^2*Cot[c + d*x]^2*(a + b* Tan[c + d*x])^2)/(2*d)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*c - a*d)^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 + d^2))), x] - Simp[1 /(d*(n + 1)*(c^2 + d^2)) Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^(n + 1)*Simp[a^2*d*(b*d*(m - 2) - a*c*(n + 1)) + b*(b*c - 2*a*d)*(b*c *(m - 2) + a*d*(n + 1)) - d*(n + 1)*(3*a^2*b*c - b^3*c - a^3*d + 3*a*b^2*d) *Tan[e + f*x] - b*(a*d*(2*b*c - a*d)*(m + n - 1) - b^2*(c^2*(m - 2) - d^2*( n + 1)))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[ b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 2] && LtQ [n, -1] && IntegerQ[2*m]
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2 )/tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[B*x, x] + (Simp[A Int[1/Tan[ e + f*x], x], x] + Simp[C Int[Tan[e + f*x], x], x]) /; FreeQ[{e, f, A, B, C}, x] && NeQ[A, C]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_. )*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f _.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(c^2*C - B*c*d + A*d^2)*((c + d*Tan[e + f*x])^(n + 1)/(d^2*f*(n + 1)*(c^2 + d^2))), x] + Simp[1/(d*(c^2 + d^2)) Int[(c + d*Tan[e + f*x])^(n + 1)*Simp[a*d*(A*c - c*C + B*d) + b* (c^2*C - B*c*d + A*d^2) + d*(A*b*c + a*B*c - b*c*C - a*A*d + b*B*d + a*C*d) *Tan[e + f*x] + b*C*(c^2 + d^2)*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && LtQ[n , -1]
Time = 1.03 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.94
method | result | size |
parallelrisch | \(\frac {\left (a^{4}-6 b^{2} a^{2}+b^{4}\right ) \ln \left (\sec \left (d x +c \right )^{2}\right )+\left (-2 a^{4}+12 b^{2} a^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-\cot \left (d x +c \right )^{2} a^{4}-8 \cot \left (d x +c \right ) a^{3} b -8 a b d x \left (a -b \right ) \left (a +b \right )}{2 d}\) | \(93\) |
derivativedivides | \(\frac {\frac {\left (a^{4}-6 b^{2} a^{2}+b^{4}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-4 a^{3} b +4 a \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )-\frac {a^{4}}{2 \tan \left (d x +c \right )^{2}}-a^{2} \left (a^{2}-6 b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {4 a^{3} b}{\tan \left (d x +c \right )}}{d}\) | \(103\) |
default | \(\frac {\frac {\left (a^{4}-6 b^{2} a^{2}+b^{4}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-4 a^{3} b +4 a \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )-\frac {a^{4}}{2 \tan \left (d x +c \right )^{2}}-a^{2} \left (a^{2}-6 b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-\frac {4 a^{3} b}{\tan \left (d x +c \right )}}{d}\) | \(103\) |
norman | \(\frac {\left (-4 a^{3} b +4 a \,b^{3}\right ) x \tan \left (d x +c \right )^{2}-\frac {a^{4}}{2 d}-\frac {4 a^{3} b \tan \left (d x +c \right )}{d}}{\tan \left (d x +c \right )^{2}}+\frac {\left (a^{4}-6 b^{2} a^{2}+b^{4}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}-\frac {a^{2} \left (a^{2}-6 b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{d}\) | \(113\) |
risch | \(-4 a^{3} b x +4 a \,b^{3} x +i a^{4} x -6 i a^{2} b^{2} x +i b^{4} x +\frac {2 i a^{4} c}{d}-\frac {12 i a^{2} b^{2} c}{d}+\frac {2 i b^{4} c}{d}+\frac {2 a^{3} \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}-4 i b \,{\mathrm e}^{2 i \left (d x +c \right )}+4 i b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {a^{4} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}+\frac {6 a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) b^{4}}{d}\) | \(186\) |
Input:
int(cot(d*x+c)^3*(a+b*tan(d*x+c))^4,x,method=_RETURNVERBOSE)
Output:
1/2*((a^4-6*a^2*b^2+b^4)*ln(sec(d*x+c)^2)+(-2*a^4+12*a^2*b^2)*ln(tan(d*x+c ))-cot(d*x+c)^2*a^4-8*cot(d*x+c)*a^3*b-8*a*b*d*x*(a-b)*(a+b))/d
Time = 0.09 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.27 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {b^{4} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{2} + 8 \, a^{3} b \tan \left (d x + c\right ) + a^{4} + {\left (a^{4} - 6 \, a^{2} b^{2}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{2} + {\left (a^{4} + 8 \, {\left (a^{3} b - a b^{3}\right )} d x\right )} \tan \left (d x + c\right )^{2}}{2 \, d \tan \left (d x + c\right )^{2}} \] Input:
integrate(cot(d*x+c)^3*(a+b*tan(d*x+c))^4,x, algorithm="fricas")
Output:
-1/2*(b^4*log(1/(tan(d*x + c)^2 + 1))*tan(d*x + c)^2 + 8*a^3*b*tan(d*x + c ) + a^4 + (a^4 - 6*a^2*b^2)*log(tan(d*x + c)^2/(tan(d*x + c)^2 + 1))*tan(d *x + c)^2 + (a^4 + 8*(a^3*b - a*b^3)*d*x)*tan(d*x + c)^2)/(d*tan(d*x + c)^ 2)
Time = 1.02 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.70 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=\begin {cases} \tilde {\infty } a^{4} x & \text {for}\: c = 0 \wedge d = 0 \\x \left (a + b \tan {\left (c \right )}\right )^{4} \cot ^{3}{\left (c \right )} & \text {for}\: d = 0 \\\tilde {\infty } a^{4} x & \text {for}\: c = - d x \\\frac {a^{4} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - \frac {a^{4} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {a^{4}}{2 d \tan ^{2}{\left (c + d x \right )}} - 4 a^{3} b x - \frac {4 a^{3} b}{d \tan {\left (c + d x \right )}} - \frac {3 a^{2} b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {6 a^{2} b^{2} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + 4 a b^{3} x + \frac {b^{4} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text {otherwise} \end {cases} \] Input:
integrate(cot(d*x+c)**3*(a+b*tan(d*x+c))**4,x)
Output:
Piecewise((zoo*a**4*x, Eq(c, 0) & Eq(d, 0)), (x*(a + b*tan(c))**4*cot(c)** 3, Eq(d, 0)), (zoo*a**4*x, Eq(c, -d*x)), (a**4*log(tan(c + d*x)**2 + 1)/(2 *d) - a**4*log(tan(c + d*x))/d - a**4/(2*d*tan(c + d*x)**2) - 4*a**3*b*x - 4*a**3*b/(d*tan(c + d*x)) - 3*a**2*b**2*log(tan(c + d*x)**2 + 1)/d + 6*a* *2*b**2*log(tan(c + d*x))/d + 4*a*b**3*x + b**4*log(tan(c + d*x)**2 + 1)/( 2*d), True))
Time = 0.11 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.00 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {8 \, {\left (a^{3} b - a b^{3}\right )} {\left (d x + c\right )} - {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \, {\left (a^{4} - 6 \, a^{2} b^{2}\right )} \log \left (\tan \left (d x + c\right )\right ) + \frac {8 \, a^{3} b \tan \left (d x + c\right ) + a^{4}}{\tan \left (d x + c\right )^{2}}}{2 \, d} \] Input:
integrate(cot(d*x+c)^3*(a+b*tan(d*x+c))^4,x, algorithm="maxima")
Output:
-1/2*(8*(a^3*b - a*b^3)*(d*x + c) - (a^4 - 6*a^2*b^2 + b^4)*log(tan(d*x + c)^2 + 1) + 2*(a^4 - 6*a^2*b^2)*log(tan(d*x + c)) + (8*a^3*b*tan(d*x + c) + a^4)/tan(d*x + c)^2)/d
Time = 0.41 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.09 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {4 \, {\left (a^{3} b - a b^{3}\right )} {\left (d x + c\right )}}{d} + \frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} - \frac {{\left (a^{4} - 6 \, a^{2} b^{2}\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{d} - \frac {8 \, a^{3} b \tan \left (d x + c\right ) + a^{4}}{2 \, d \tan \left (d x + c\right )^{2}} \] Input:
integrate(cot(d*x+c)^3*(a+b*tan(d*x+c))^4,x, algorithm="giac")
Output:
-4*(a^3*b - a*b^3)*(d*x + c)/d + 1/2*(a^4 - 6*a^2*b^2 + b^4)*log(tan(d*x + c)^2 + 1)/d - (a^4 - 6*a^2*b^2)*log(abs(tan(d*x + c)))/d - 1/2*(8*a^3*b*t an(d*x + c) + a^4)/(d*tan(d*x + c)^2)
Time = 1.16 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.03 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a^4-6\,a^2\,b^2\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,{\left (a+b\,1{}\mathrm {i}\right )}^4}{2\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^4}{2\,d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^2\,\left (\frac {a^4}{2}+4\,b\,\mathrm {tan}\left (c+d\,x\right )\,a^3\right )}{d} \] Input:
int(cot(c + d*x)^3*(a + b*tan(c + d*x))^4,x)
Output:
(log(tan(c + d*x) - 1i)*(a + b*1i)^4)/(2*d) - (log(tan(c + d*x))*(a^4 - 6* a^2*b^2))/d + (log(tan(c + d*x) + 1i)*(a*1i + b)^4)/(2*d) - (cot(c + d*x)^ 2*(a^4/2 + 4*a^3*b*tan(c + d*x)))/d
Time = 12.30 (sec) , antiderivative size = 264, normalized size of antiderivative = 2.67 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {-16 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{3} b +4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right )^{2} a^{4}-24 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right )^{2} a^{2} b^{2}+4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right )^{2} b^{4}-4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b^{4}-4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b^{4}-4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2} a^{4}+24 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2} a^{2} b^{2}+\sin \left (d x +c \right )^{2} a^{4}-16 \sin \left (d x +c \right )^{2} a^{3} b d x +16 \sin \left (d x +c \right )^{2} a \,b^{3} d x -2 a^{4}}{4 \sin \left (d x +c \right )^{2} d} \] Input:
int(cot(d*x+c)^3*(a+b*tan(d*x+c))^4,x)
Output:
( - 16*cos(c + d*x)*sin(c + d*x)*a**3*b + 4*log(tan((c + d*x)/2)**2 + 1)*s in(c + d*x)**2*a**4 - 24*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)**2*a**2 *b**2 + 4*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)**2*b**4 - 4*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*b**4 - 4*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b**4 - 4*log(tan((c + d*x)/2))*sin(c + d*x)**2*a**4 + 24*log(tan( (c + d*x)/2))*sin(c + d*x)**2*a**2*b**2 + sin(c + d*x)**2*a**4 - 16*sin(c + d*x)**2*a**3*b*d*x + 16*sin(c + d*x)**2*a*b**3*d*x - 2*a**4)/(4*sin(c + d*x)**2*d)