\(\int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx\) [150]

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

Optimal result

Integrand size = 21, antiderivative size = 111 \[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=\frac {(a+b) (a+2 b) \log (1-\sin (c+d x))}{2 d}+\frac {(a-2 b) (a-b) \log (1+\sin (c+d x))}{2 d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x))^2}{2 d} \] Output:

1/2*(a+b)*(a+2*b)*ln(1-sin(d*x+c))/d+1/2*(a-2*b)*(a-b)*ln(1+sin(d*x+c))/d+ 
2*a*b*sin(d*x+c)/d+1/2*b^2*sin(d*x+c)^2/d+1/2*sec(d*x+c)^2*(a+b*sin(d*x+c) 
)^2/d
 

Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.97 \[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=\frac {2 (a+b) (a+2 b) \log (1-\sin (c+d x))+2 (a-2 b) (a-b) \log (1+\sin (c+d x))-\frac {(a+b)^2}{-1+\sin (c+d x)}+8 a b \sin (c+d x)+2 b^2 \sin ^2(c+d x)+\frac {(a-b)^2}{1+\sin (c+d x)}}{4 d} \] Input:

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

Output:

(2*(a + b)*(a + 2*b)*Log[1 - Sin[c + d*x]] + 2*(a - 2*b)*(a - b)*Log[1 + S 
in[c + d*x]] - (a + b)^2/(-1 + Sin[c + d*x]) + 8*a*b*Sin[c + d*x] + 2*b^2* 
Sin[c + d*x]^2 + (a - b)^2/(1 + Sin[c + d*x]))/(4*d)
 

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.11, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3200, 531, 27, 2160, 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 \tan ^3(c+d x) (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \tan (c+d x)^3 (a+b \sin (c+d x))^2dx\)

\(\Big \downarrow \) 3200

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

\(\Big \downarrow \) 531

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 2160

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {b^2 (a+b \sin (c+d x))^2}{2 \left (b^2-b^2 \sin ^2(c+d x)\right )}-\frac {-\frac {1}{2} b^2 \left (a^2+2 b^2\right ) \log \left (b^2-b^2 \sin ^2(c+d x)\right )+3 a b^3 \text {arctanh}(\sin (c+d x))-2 a b^3 \sin (c+d x)-\frac {1}{2} b^4 \sin ^2(c+d x)}{b^2}}{d}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 531
Int[(x_)^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symb 
ol] :> With[{Qx = PolynomialQuotient[x^m, a + b*x^2, x], e = Coeff[Polynomi 
alRemainder[x^m, a + b*x^2, x], x, 0], f = Coeff[PolynomialRemainder[x^m, a 
 + b*x^2, x], x, 1]}, Simp[(c + d*x)^n*(a*f - b*e*x)*((a + b*x^2)^(p + 1)/( 
2*a*b*(p + 1))), x] + Simp[1/(2*a*b*(p + 1))   Int[(c + d*x)^(n - 1)*(a + b 
*x^2)^(p + 1)*ExpandToSum[2*a*b*(p + 1)*(c + d*x)*Qx - a*d*f*n + b*c*e*(2*p 
 + 3) + b*d*e*(n + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGt 
Q[n, 0] && IGtQ[m, 0] && LtQ[p, -1] && GtQ[n, 1] && IntegerQ[2*p]
 

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

rule 2160
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] 
:> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, 
 d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 

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

rule 3200
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p 
_.), x_Symbol] :> Simp[1/f   Subst[Int[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1) 
/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2 - b 
^2, 0] && IntegerQ[(p + 1)/2]
 
Maple [A] (verified)

Time = 1.88 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.22

method result size
derivativedivides \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )+2 a b \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{2} \left (\frac {\sin \left (d x +c \right )^{6}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{4}}{2}+\sin \left (d x +c \right )^{2}+2 \ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(135\)
default \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{2}}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )+2 a b \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{2} \left (\frac {\sin \left (d x +c \right )^{6}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{4}}{2}+\sin \left (d x +c \right )^{2}+2 \ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) \(135\)
parts \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}+\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{6}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{4}}{2}+\sin \left (d x +c \right )^{2}+2 \ln \left (\cos \left (d x +c \right )\right )\right )}{d}+\frac {2 a b \left (\frac {\sin \left (d x +c \right )^{5}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{3}}{2}+\frac {3 \sin \left (d x +c \right )}{2}-\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(146\)
risch \(-\frac {i a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}-2 i b^{2} x -\frac {b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {2 i \left (i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+a b \,{\mathrm e}^{3 i \left (d x +c \right )}-a b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {2 i a^{2} c}{d}-\frac {b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-i a^{2} x +\frac {i a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}-\frac {4 i b^{2} c}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a b}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a b}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{d}\) \(301\)

Input:

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

Output:

1/d*(a^2*(1/2*tan(d*x+c)^2+ln(cos(d*x+c)))+2*a*b*(1/2*sin(d*x+c)^5/cos(d*x 
+c)^2+1/2*sin(d*x+c)^3+3/2*sin(d*x+c)-3/2*ln(sec(d*x+c)+tan(d*x+c)))+b^2*( 
1/2*sin(d*x+c)^6/cos(d*x+c)^2+1/2*sin(d*x+c)^4+sin(d*x+c)^2+2*ln(cos(d*x+c 
))))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.26 \[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=-\frac {2 \, b^{2} \cos \left (d x + c\right )^{4} - b^{2} \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{2} - 3 \, a b + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, a^{2} - 2 \, b^{2} - 4 \, {\left (2 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \] Input:

integrate((a+b*sin(d*x+c))^2*tan(d*x+c)^3,x, algorithm="fricas")
 

Output:

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

Sympy [F]

\[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \tan ^{3}{\left (c + d x \right )}\, dx \] Input:

integrate((a+b*sin(d*x+c))**2*tan(d*x+c)**3,x)
 

Output:

Integral((a + b*sin(c + d*x))**2*tan(c + d*x)**3, x)
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.95 \[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=\frac {b^{2} \sin \left (d x + c\right )^{2} + 4 \, a b \sin \left (d x + c\right ) + {\left (a^{2} - 3 \, a b + 2 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, a b \sin \left (d x + c\right ) + a^{2} + b^{2}}{\sin \left (d x + c\right )^{2} - 1}}{2 \, d} \] Input:

integrate((a+b*sin(d*x+c))^2*tan(d*x+c)^3,x, algorithm="maxima")
 

Output:

1/2*(b^2*sin(d*x + c)^2 + 4*a*b*sin(d*x + c) + (a^2 - 3*a*b + 2*b^2)*log(s 
in(d*x + c) + 1) + (a^2 + 3*a*b + 2*b^2)*log(sin(d*x + c) - 1) - (2*a*b*si 
n(d*x + c) + a^2 + b^2)/(sin(d*x + c)^2 - 1))/d
 

Giac [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.16 \[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=\frac {{\left (a^{2} - 3 \, a b + 2 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{2 \, d} + \frac {{\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{2 \, d} + \frac {b^{2} d \sin \left (d x + c\right )^{2} + 4 \, a b d \sin \left (d x + c\right )}{2 \, d^{2}} - \frac {2 \, a b \sin \left (d x + c\right ) + a^{2} + b^{2}}{2 \, d {\left (\sin \left (d x + c\right ) + 1\right )} {\left (\sin \left (d x + c\right ) - 1\right )}} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 17.76 (sec) , antiderivative size = 232, normalized size of antiderivative = 2.09 \[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (2\,a^2+4\,b^2\right )+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+2\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+6\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+1\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^2+2\,b^2\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left (a+b\right )\,\left (a+2\,b\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,\left (a-b\right )\,\left (a-2\,b\right )}{d} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 347, normalized size of antiderivative = 3.13 \[ \int (a+b \sin (c+d x))^2 \tan ^3(c+d x) \, dx=\frac {-\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) \sin \left (d x +c \right )^{2} a^{2}+\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a^{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^{2}+4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) b^{2}+6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a b +4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b^{2}-6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a b -4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b^{2}-6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a b +4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b^{2}+6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a b -4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b^{2}+\sin \left (d x +c \right )^{4} b^{2}+4 \sin \left (d x +c \right )^{3} a b +\sin \left (d x +c \right )^{2} \tan \left (d x +c \right )^{2} a^{2}-2 \sin \left (d x +c \right )^{2} b^{2}-6 \sin \left (d x +c \right ) a b -\tan \left (d x +c \right )^{2} a^{2}}{2 d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:

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

Output:

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