3.4.63 \(\int (1+\cot ^3(x)) (a \sec ^2(x)-\sin (2 x))^2 \, dx\) [363]

3.4.63.1 Optimal result
3.4.63.2 Mathematica [A] (verified)
3.4.63.3 Rubi [A] (verified)
3.4.63.4 Maple [A] (verified)
3.4.63.5 Fricas [B] (verification not implemented)
3.4.63.6 Sympy [A] (verification not implemented)
3.4.63.7 Maxima [A] (verification not implemented)
3.4.63.8 Giac [A] (verification not implemented)
3.4.63.9 Mupad [B] (verification not implemented)
3.4.63.10 Reduce [F]

3.4.63.1 Optimal result

Integrand size = 22, antiderivative size = 88 \[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx=\frac {x}{2}+4 a x+2 \cos ^2(x)+\cos ^4(x)+4 a \cot (x)-\frac {1}{2} a^2 \cot ^2(x)+(4-a) a \log (\cos (x))+\left (4+a^2\right ) \log (\sin (x))+\frac {1}{2} \cos (x) \sin (x)-\cos ^3(x) \sin (x)+a^2 \tan (x)+\frac {1}{3} a^2 \tan ^3(x) \]

output
1/2*x+4*a*x+2*cos(x)^2+cos(x)^4+4*a*cot(x)-1/2*a^2*cot(x)^2+(4-a)*a*ln(cos 
(x))+(a^2+4)*ln(sin(x))+1/2*cos(x)*sin(x)-cos(x)^3*sin(x)+a^2*tan(x)+1/3*a 
^2*tan(x)^3
 
3.4.63.2 Mathematica [A] (verified)

Time = 3.58 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.44 \[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx=-\frac {2 \cos ^3(x) \sin (x) \left (-a \sec ^2(x)+\sin (2 x)\right )^2 \left (-96 a \cot ^2(x)-8 a^2 (2+\cos (2 x)) \sec ^2(x)-3 \cot (x) \left (4 x+32 a x+12 \cos (2 x)+\cos (4 x)-4 a^2 \csc ^2(x)+32 a \log (\cos (x))-8 a^2 \log (\cos (x))+32 \log (\sin (x))+8 a^2 \log (\sin (x))-\sin (4 x)\right )\right )}{3 (-4 a+2 \sin (2 x)+\sin (4 x))^2} \]

input
Integrate[(1 + Cot[x]^3)*(a*Sec[x]^2 - Sin[2*x])^2,x]
 
output
(-2*Cos[x]^3*Sin[x]*(-(a*Sec[x]^2) + Sin[2*x])^2*(-96*a*Cot[x]^2 - 8*a^2*( 
2 + Cos[2*x])*Sec[x]^2 - 3*Cot[x]*(4*x + 32*a*x + 12*Cos[2*x] + Cos[4*x] - 
 4*a^2*Csc[x]^2 + 32*a*Log[Cos[x]] - 8*a^2*Log[Cos[x]] + 32*Log[Sin[x]] + 
8*a^2*Log[Sin[x]] - Sin[4*x])))/(3*(-4*a + 2*Sin[2*x] + Sin[4*x])^2)
 
3.4.63.3 Rubi [A] (verified)

Time = 0.75 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.14, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {3042, 4889, 2336, 27, 2336, 25, 2333, 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 \left (\cot ^3(x)+1\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (\cot (x)^3+1\right ) \left (a \sec (x)^2-\sin (2 x)\right )^2dx\)

\(\Big \downarrow \) 4889

\(\displaystyle \int \frac {\left (\tan ^3(x)+1\right ) \cot ^3(x) \left (a \tan ^4(x)+2 a \tan ^2(x)+a-2 \tan (x)\right )^2}{\left (\tan ^2(x)+1\right )^3}d\tan (x)\)

\(\Big \downarrow \) 2336

\(\displaystyle \frac {1-\tan (x)}{\left (\tan ^2(x)+1\right )^2}-\frac {1}{4} \int -\frac {4 \cot ^3(x) \left (a^2 \tan ^9(x)+3 a^2 \tan ^7(x)-(4-a) a \tan ^6(x)+3 a^2 \tan ^5(x)-(4-3 a) a \tan ^4(x)+\left (a^2-4 a+1\right ) \tan ^3(x)+\left (3 a^2+4\right ) \tan ^2(x)-4 a \tan (x)+a^2\right )}{\left (\tan ^2(x)+1\right )^2}d\tan (x)\)

\(\Big \downarrow \) 27

\(\displaystyle \int \frac {\cot ^3(x) \left (a^2 \tan ^9(x)+3 a^2 \tan ^7(x)-(4-a) a \tan ^6(x)+3 a^2 \tan ^5(x)-(4-3 a) a \tan ^4(x)+\left (a^2-4 a+1\right ) \tan ^3(x)+\left (3 a^2+4\right ) \tan ^2(x)-4 a \tan (x)+a^2\right )}{\left (\tan ^2(x)+1\right )^2}d\tan (x)+\frac {1-\tan (x)}{\left (\tan ^2(x)+1\right )^2}\)

\(\Big \downarrow \) 2336

\(\displaystyle -\frac {1}{2} \int -\frac {\cot ^3(x) \left (2 a^2 \tan ^7(x)+4 a^2 \tan ^5(x)-2 (4-a) a \tan ^4(x)+\left (2 a^2+1\right ) \tan ^3(x)+4 \left (a^2+2\right ) \tan ^2(x)-8 a \tan (x)+2 a^2\right )}{\tan ^2(x)+1}d\tan (x)+\frac {1-\tan (x)}{\left (\tan ^2(x)+1\right )^2}+\frac {\tan (x)+4}{2 \left (\tan ^2(x)+1\right )}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{2} \int \frac {\cot ^3(x) \left (2 a^2 \tan ^7(x)+4 a^2 \tan ^5(x)-2 (4-a) a \tan ^4(x)+\left (2 a^2+1\right ) \tan ^3(x)+4 \left (a^2+2\right ) \tan ^2(x)-8 a \tan (x)+2 a^2\right )}{\tan ^2(x)+1}d\tan (x)+\frac {1-\tan (x)}{\left (\tan ^2(x)+1\right )^2}+\frac {\tan (x)+4}{2 \left (\tan ^2(x)+1\right )}\)

\(\Big \downarrow \) 2333

\(\displaystyle \frac {1}{2} \int \left (2 a^2 \cot ^3(x)-8 a \cot ^2(x)+2 \left (a^2+4\right ) \cot (x)+2 a^2+2 a^2 \tan ^2(x)+\frac {8 a-8 (a+1) \tan (x)+1}{\tan ^2(x)+1}\right )d\tan (x)+\frac {1-\tan (x)}{\left (\tan ^2(x)+1\right )^2}+\frac {\tan (x)+4}{2 \left (\tan ^2(x)+1\right )}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (\frac {2}{3} a^2 \tan ^3(x)+2 a^2 \tan (x)-a^2 \cot ^2(x)+2 \left (a^2+4\right ) \log (\tan (x))+(8 a+1) \arctan (\tan (x))+8 a \cot (x)-4 (a+1) \log \left (\tan ^2(x)+1\right )\right )+\frac {1-\tan (x)}{\left (\tan ^2(x)+1\right )^2}+\frac {\tan (x)+4}{2 \left (\tan ^2(x)+1\right )}\)

input
Int[(1 + Cot[x]^3)*(a*Sec[x]^2 - Sin[2*x])^2,x]
 
output
(1 - Tan[x])/(1 + Tan[x]^2)^2 + (4 + Tan[x])/(2*(1 + Tan[x]^2)) + ((1 + 8* 
a)*ArcTan[Tan[x]] + 8*a*Cot[x] - a^2*Cot[x]^2 + 2*(4 + a^2)*Log[Tan[x]] - 
4*(1 + a)*Log[1 + Tan[x]^2] + 2*a^2*Tan[x] + (2*a^2*Tan[x]^3)/3)/2
 

3.4.63.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 2336
Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[ 
{Q = PolynomialQuotient[(c*x)^m*Pq, a + b*x^2, x], f = Coeff[PolynomialRema 
inder[(c*x)^m*Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[(c*x) 
^m*Pq, a + b*x^2, x], x, 1]}, Simp[(a*g - b*f*x)*((a + b*x^2)^(p + 1)/(2*a* 
b*(p + 1))), x] + Simp[1/(2*a*(p + 1))   Int[(c*x)^m*(a + b*x^2)^(p + 1)*Ex 
pandToSum[(2*a*(p + 1)*Q)/(c*x)^m + (f*(2*p + 3))/(c*x)^m, x], x], x]] /; F 
reeQ[{a, b, c}, x] && PolyQ[Pq, x] && LtQ[p, -1] && ILtQ[m, 0]
 

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

rule 4889
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors 
[Tan[v], x]}, Simp[d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1/(1 + d^2*x 
^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /;  !FalseQ[v] && FunctionOfQ[N 
onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] &&  !MatchQ[ 
u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I 
ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
 
3.4.63.4 Maple [A] (verified)

Time = 59.22 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.86

method result size
parts \(-\frac {\sin \left (2 x \right ) \cos \left (2 x \right )}{4}+\frac {x}{2}+\cos ^{4}\left (x \right )+2 \left (\cos ^{2}\left (x \right )\right )+4 \ln \left (\sin \left (x \right )\right )-4 a \left (-x -\cot \left (x \right )\right )+a^{2} \left (-\frac {1}{2 \sin \left (x \right )^{2}}+\ln \left (\tan \left (x \right )\right )\right )-a^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (x \right )\right )}{3}\right ) \tan \left (x \right )-4 a \ln \left (\sec \left (x \right )\right )\) \(76\)
default \(\cos ^{4}\left (x \right )+2 \left (\cos ^{2}\left (x \right )\right )+4 \ln \left (\sin \left (x \right )\right )-4 a \left (-x -\cot \left (x \right )\right )+a^{2} \left (-\frac {1}{2 \sin \left (x \right )^{2}}+\ln \left (\tan \left (x \right )\right )\right )+\frac {x}{2}+\frac {\cos \left (x \right ) \sin \left (x \right )}{2}-\left (\cos ^{3}\left (x \right )\right ) \sin \left (x \right )+4 a \ln \left (\cos \left (x \right )\right )-a^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (x \right )\right )}{3}\right ) \tan \left (x \right )\) \(80\)
risch \(\frac {x}{2}-\frac {i {\mathrm e}^{-4 i x}}{16}+4 a x -4 i x +\frac {{\mathrm e}^{4 i x}}{16}-4 i a x +\frac {3 \,{\mathrm e}^{2 i x}}{4}+\frac {3 \,{\mathrm e}^{-2 i x}}{4}+\frac {{\mathrm e}^{-4 i x}}{16}+\frac {i {\mathrm e}^{4 i x}}{16}+\frac {2 a \left (12 i {\mathrm e}^{8 i x}+3 a \,{\mathrm e}^{8 i x}+6 i a \,{\mathrm e}^{6 i x}+24 i {\mathrm e}^{6 i x}+9 a \,{\mathrm e}^{6 i x}-10 i a \,{\mathrm e}^{4 i x}+9 a \,{\mathrm e}^{4 i x}+2 i a \,{\mathrm e}^{2 i x}-24 i {\mathrm e}^{2 i x}+3 a \,{\mathrm e}^{2 i x}+2 i a -12 i\right )}{3 \left ({\mathrm e}^{2 i x}-1\right )^{2} \left ({\mathrm e}^{2 i x}+1\right )^{3}}+\ln \left ({\mathrm e}^{2 i x}-1\right ) a^{2}+4 \ln \left ({\mathrm e}^{2 i x}-1\right )-\ln \left ({\mathrm e}^{2 i x}+1\right ) a^{2}+4 a \ln \left ({\mathrm e}^{2 i x}+1\right )\) \(219\)

input
int((1+cot(x)^3)*(a*sec(x)^2-sin(2*x))^2,x,method=_RETURNVERBOSE)
 
output
-1/4*sin(2*x)*cos(2*x)+1/2*x+cos(x)^4+2*cos(x)^2+4*ln(sin(x))-4*a*(-x-cot( 
x))+a^2*(-1/2/sin(x)^2+ln(tan(x)))-a^2*(-2/3-1/3*sec(x)^2)*tan(x)-4*a*ln(s 
ec(x))
 
3.4.63.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 178 vs. \(2 (79) = 158\).

Time = 0.29 (sec) , antiderivative size = 178, normalized size of antiderivative = 2.02 \[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx=\frac {24 \, \cos \left (x\right )^{9} + 24 \, \cos \left (x\right )^{7} + 3 \, {\left (4 \, {\left (8 \, a + 1\right )} x - 27\right )} \cos \left (x\right )^{5} + 3 \, {\left (4 \, a^{2} - 4 \, {\left (8 \, a + 1\right )} x + 11\right )} \cos \left (x\right )^{3} - 12 \, {\left ({\left (a^{2} - 4 \, a\right )} \cos \left (x\right )^{5} - {\left (a^{2} - 4 \, a\right )} \cos \left (x\right )^{3}\right )} \log \left (\cos \left (x\right )^{2}\right ) + 12 \, {\left ({\left (a^{2} + 4\right )} \cos \left (x\right )^{5} - {\left (a^{2} + 4\right )} \cos \left (x\right )^{3}\right )} \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right ) - 4 \, {\left (6 \, \cos \left (x\right )^{8} - 9 \, \cos \left (x\right )^{6} - {\left (4 \, a^{2} - 24 \, a - 3\right )} \cos \left (x\right )^{4} + 2 \, a^{2} \cos \left (x\right )^{2} + 2 \, a^{2}\right )} \sin \left (x\right )}{24 \, {\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )}} \]

input
integrate((1+cot(x)^3)*(a*sec(x)^2-sin(2*x))^2,x, algorithm="fricas")
 
output
1/24*(24*cos(x)^9 + 24*cos(x)^7 + 3*(4*(8*a + 1)*x - 27)*cos(x)^5 + 3*(4*a 
^2 - 4*(8*a + 1)*x + 11)*cos(x)^3 - 12*((a^2 - 4*a)*cos(x)^5 - (a^2 - 4*a) 
*cos(x)^3)*log(cos(x)^2) + 12*((a^2 + 4)*cos(x)^5 - (a^2 + 4)*cos(x)^3)*lo 
g(-1/4*cos(x)^2 + 1/4) - 4*(6*cos(x)^8 - 9*cos(x)^6 - (4*a^2 - 24*a - 3)*c 
os(x)^4 + 2*a^2*cos(x)^2 + 2*a^2)*sin(x))/(cos(x)^5 - cos(x)^3)
 
3.4.63.6 Sympy [A] (verification not implemented)

Time = 158.34 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.14 \[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx=- \frac {a^{2} \log {\left (\sin ^{2}{\left (x \right )} - 1 \right )}}{2} + a^{2} \log {\left (\sin {\left (x \right )} \right )} + \frac {a^{2} \tan ^{3}{\left (x \right )}}{3} + a^{2} \tan {\left (x \right )} - \frac {a^{2}}{2 \sin ^{2}{\left (x \right )}} + 4 a x + 4 a \log {\left (\cos {\left (x \right )} \right )} + \frac {4 a \cos {\left (x \right )}}{\sin {\left (x \right )}} + \frac {x}{2} + 4 \log {\left (\sin {\left (x \right )} \right )} + \sin ^{4}{\left (x \right )} - 4 \sin ^{2}{\left (x \right )} - \frac {\sin {\left (4 x \right )}}{8} \]

input
integrate((1+cot(x)**3)*(a*sec(x)**2-sin(2*x))**2,x)
 
output
-a**2*log(sin(x)**2 - 1)/2 + a**2*log(sin(x)) + a**2*tan(x)**3/3 + a**2*ta 
n(x) - a**2/(2*sin(x)**2) + 4*a*x + 4*a*log(cos(x)) + 4*a*cos(x)/sin(x) + 
x/2 + 4*log(sin(x)) + sin(x)**4 - 4*sin(x)**2 - sin(4*x)/8
 
3.4.63.7 Maxima [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.31 \[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx=\frac {1}{3} \, {\left (\tan \left (x\right )^{3} + 3 \, \tan \left (x\right )\right )} a^{2} - \frac {1}{2} \, a^{2} {\left (\frac {1}{\sin \left (x\right )^{2}} + \log \left (\sin \left (x\right )^{2} - 1\right ) - \log \left (\sin \left (x\right )^{2}\right )\right )} + 4 \, a {\left (x + \frac {1}{\tan \left (x\right )}\right )} + 2 \, a \log \left (-\sin \left (x\right )^{2} + 1\right ) + \frac {1}{2} \, x + \frac {1}{8} \, \cos \left (4 \, x\right ) + \frac {3}{2} \, \cos \left (2 \, x\right ) + 2 \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + 2 \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) - \frac {1}{8} \, \sin \left (4 \, x\right ) \]

input
integrate((1+cot(x)^3)*(a*sec(x)^2-sin(2*x))^2,x, algorithm="maxima")
 
output
1/3*(tan(x)^3 + 3*tan(x))*a^2 - 1/2*a^2*(1/sin(x)^2 + log(sin(x)^2 - 1) - 
log(sin(x)^2)) + 4*a*(x + 1/tan(x)) + 2*a*log(-sin(x)^2 + 1) + 1/2*x + 1/8 
*cos(4*x) + 3/2*cos(2*x) + 2*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + 2*l 
og(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1) - 1/8*sin(4*x)
 
3.4.63.8 Giac [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.69 \[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx=\frac {1}{3} \, a^{2} \tan \left (x\right )^{3} + a^{2} \tan \left (x\right ) + \frac {1}{2} \, {\left (8 \, a + 1\right )} x - 2 \, {\left (a + 1\right )} \log \left (\tan \left (x\right )^{2} + 1\right ) + {\left (a^{2} + 4\right )} \log \left ({\left | \tan \left (x\right ) \right |}\right ) - \frac {a^{2} \tan \left (x\right )^{6} - 4 \, a \tan \left (x\right )^{6} + 3 \, a^{2} \tan \left (x\right )^{4} - 8 \, a \tan \left (x\right )^{5} - 8 \, a \tan \left (x\right )^{4} - \tan \left (x\right )^{5} + 3 \, a^{2} \tan \left (x\right )^{2} - 16 \, a \tan \left (x\right )^{3} - 4 \, \tan \left (x\right )^{4} - 4 \, a \tan \left (x\right )^{2} + \tan \left (x\right )^{3} + a^{2} - 8 \, a \tan \left (x\right ) - 6 \, \tan \left (x\right )^{2}}{2 \, {\left (\tan \left (x\right )^{3} + \tan \left (x\right )\right )}^{2}} \]

input
integrate((1+cot(x)^3)*(a*sec(x)^2-sin(2*x))^2,x, algorithm="giac")
 
output
1/3*a^2*tan(x)^3 + a^2*tan(x) + 1/2*(8*a + 1)*x - 2*(a + 1)*log(tan(x)^2 + 
 1) + (a^2 + 4)*log(abs(tan(x))) - 1/2*(a^2*tan(x)^6 - 4*a*tan(x)^6 + 3*a^ 
2*tan(x)^4 - 8*a*tan(x)^5 - 8*a*tan(x)^4 - tan(x)^5 + 3*a^2*tan(x)^2 - 16* 
a*tan(x)^3 - 4*tan(x)^4 - 4*a*tan(x)^2 + tan(x)^3 + a^2 - 8*a*tan(x) - 6*t 
an(x)^2)/(tan(x)^3 + tan(x))^2
 
3.4.63.9 Mupad [B] (verification not implemented)

Time = 0.41 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.51 \[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx=a^2\,\mathrm {tan}\left (x\right )-\frac {{\mathrm {tan}\left (x\right )}^4\,\left (\frac {a^2}{2}-2\right )-4\,a\,\mathrm {tan}\left (x\right )+\frac {a^2}{2}-{\mathrm {tan}\left (x\right )}^5\,\left (4\,a+\frac {1}{2}\right )-{\mathrm {tan}\left (x\right )}^3\,\left (8\,a-\frac {1}{2}\right )+{\mathrm {tan}\left (x\right )}^2\,\left (a^2-3\right )}{{\mathrm {tan}\left (x\right )}^6+2\,{\mathrm {tan}\left (x\right )}^4+{\mathrm {tan}\left (x\right )}^2}-\ln \left (\mathrm {tan}\left (x\right )-\mathrm {i}\right )\,\left (a\,\left (2+2{}\mathrm {i}\right )+2+\frac {1}{4}{}\mathrm {i}\right )-\ln \left (\mathrm {tan}\left (x\right )+1{}\mathrm {i}\right )\,\left (a\,\left (2-2{}\mathrm {i}\right )+2-\frac {1}{4}{}\mathrm {i}\right )+\frac {a^2\,{\mathrm {tan}\left (x\right )}^3}{3}+\ln \left (\mathrm {tan}\left (x\right )\right )\,\left (a^2+4\right ) \]

input
int((cot(x)^3 + 1)*(sin(2*x) - a/cos(x)^2)^2,x)
 
output
a^2*tan(x) - (tan(x)^4*(a^2/2 - 2) - 4*a*tan(x) + a^2/2 - tan(x)^5*(4*a + 
1/2) - tan(x)^3*(8*a - 1/2) + tan(x)^2*(a^2 - 3))/(tan(x)^2 + 2*tan(x)^4 + 
 tan(x)^6) - log(tan(x) - 1i)*(a*(2 + 2i) + (2 + 1i/4)) - log(tan(x) + 1i) 
*(a*(2 - 2i) + (2 - 1i/4)) + (a^2*tan(x)^3)/3 + log(tan(x))*(a^2 + 4)
 
3.4.63.10 Reduce [F]

\[ \int \left (1+\cot ^3(x)\right ) \left (a \sec ^2(x)-\sin (2 x)\right )^2 \, dx =\text {Too large to display} \]

input
int(cot(x)**3*sec(x)**4*a**2 - 2*cot(x)**3*sec(x)**2*sin(2*x)*a + cot(x)** 
3*sin(2*x)**2 + sec(x)**4*a**2 - 2*sec(x)**2*sin(2*x)*a + sin(2*x)**2,x)
 
output
( - 3*cos(2*x)*cos(x)*sin(2*x)*sin(x)**4 + 3*cos(2*x)*cos(x)*sin(2*x)*sin( 
x)**2 + 18*cos(2*x)*cos(x)*sin(x)**4 - 18*cos(2*x)*cos(x)*sin(x)**2 - 24*c 
os(x)*int(cot(x)**3*sec(x)**2*sin(2*x),x)*sin(x)**4*a + 24*cos(x)*int(cot( 
x)**3*sec(x)**2*sin(2*x),x)*sin(x)**2*a - 24*cos(x)*int(sec(x)**2*sin(2*x) 
,x)*sin(x)**4*a + 24*cos(x)*int(sec(x)**2*sin(2*x),x)*sin(x)**2*a - 24*cos 
(x)*log(tan(x)**2 + 1)*sin(x)**4 + 24*cos(x)*log(tan(x)**2 + 1)*sin(x)**2 
- 12*cos(x)*log(tan(x/2) - 1)*sin(x)**4*a**2 + 12*cos(x)*log(tan(x/2) - 1) 
*sin(x)**2*a**2 - 12*cos(x)*log(tan(x/2) + 1)*sin(x)**4*a**2 + 12*cos(x)*l 
og(tan(x/2) + 1)*sin(x)**2*a**2 + 12*cos(x)*log(tan(x/2))*sin(x)**4*a**2 - 
 12*cos(x)*log(tan(x/2))*sin(x)**2*a**2 + 48*cos(x)*log(tan(x))*sin(x)**4 
- 48*cos(x)*log(tan(x))*sin(x)**2 - 3*cos(x)*sin(2*x)**2*sin(x)**4 + 3*cos 
(x)*sin(2*x)**2*sin(x)**2 + 3*cos(x)*sin(x)**4*a**2 + 6*cos(x)*sin(x)**4*x 
 - 18*cos(x)*sin(x)**4 - 9*cos(x)*sin(x)**2*a**2 - 6*cos(x)*sin(x)**2*x + 
18*cos(x)*sin(x)**2 + 6*cos(x)*a**2 + 8*sin(x)**5*a**2 - 12*sin(x)**3*a**2 
)/(12*cos(x)*sin(x)**2*(sin(x)**2 - 1))