\(\int (a+b \sec (c+d x))^2 (a^2-b^2 \sec ^2(c+d x)) \, dx\) [674]

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 = 30, antiderivative size = 106 \[ \int (a+b \sec (c+d x))^2 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=a^4 x+\frac {a b \left (2 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{d}+\frac {b^2 \left (a^2-2 b^2\right ) \tan (c+d x)}{3 d}-\frac {a b^3 \sec (c+d x) \tan (c+d x)}{3 d}-\frac {b^2 (a+b \sec (c+d x))^2 \tan (c+d x)}{3 d} \] Output:

a^4*x+a*b*(2*a^2-b^2)*arctanh(sin(d*x+c))/d+1/3*b^2*(a^2-2*b^2)*tan(d*x+c) 
/d-1/3*a*b^3*sec(d*x+c)*tan(d*x+c)/d-1/3*b^2*(a+b*sec(d*x+c))^2*tan(d*x+c) 
/d
 

Mathematica [A] (verified)

Time = 0.23 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.81 \[ \int (a+b \sec (c+d x))^2 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=a^4 x+\frac {2 a^3 b \coth ^{-1}(\sin (c+d x))}{d}-\frac {a b^3 \text {arctanh}(\sin (c+d x))}{d}-\frac {a b^3 \sec (c+d x) \tan (c+d x)}{d}-\frac {b^4 \left (\tan (c+d x)+\frac {1}{3} \tan ^3(c+d x)\right )}{d} \] Input:

Integrate[(a + b*Sec[c + d*x])^2*(a^2 - b^2*Sec[c + d*x]^2),x]
 

Output:

a^4*x + (2*a^3*b*ArcCoth[Sin[c + d*x]])/d - (a*b^3*ArcTanh[Sin[c + d*x]])/ 
d - (a*b^3*Sec[c + d*x]*Tan[c + d*x])/d - (b^4*(Tan[c + d*x] + Tan[c + d*x 
]^3/3))/d
 

Rubi [A] (verified)

Time = 0.53 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.08, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3042, 4530, 25, 3042, 4406, 3042, 4536, 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 (a+b \sec (c+d x))^2 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4530

\(\displaystyle -\int -\left ((a-b \sec (c+d x)) (a+b \sec (c+d x))^3\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int (a-b \sec (c+d x)) (a+b \sec (c+d x))^3dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4406

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{3} \int \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (3 a^3-2 b^2 \csc \left (c+d x+\frac {\pi }{2}\right )^2 a+b \left (3 a^2-2 b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\)

\(\Big \downarrow \) 4536

\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \left (6 a^4+6 b \left (2 a^2-b^2\right ) \sec (c+d x) a+2 b^2 \left (a^2-2 b^2\right ) \sec ^2(c+d x)\right )dx-\frac {a b^3 \tan (c+d x) \sec (c+d x)}{d}\right )-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))^2}{3 d}\)

\(\Big \downarrow \) 2009

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

Input:

Int[(a + b*Sec[c + d*x])^2*(a^2 - b^2*Sec[c + d*x]^2),x]
 

Output:

-1/3*(b^2*(a + b*Sec[c + d*x])^2*Tan[c + d*x])/d + (-((a*b^3*Sec[c + d*x]* 
Tan[c + d*x])/d) + (6*a^4*x + (6*a*b*(2*a^2 - b^2)*ArcTanh[Sin[c + d*x]])/ 
d + (2*b^2*(a^2 - 2*b^2)*Tan[c + d*x])/d)/2)/3
 

Defintions of rubi rules used

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

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 4406
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d 
_.) + (c_)), x_Symbol] :> Simp[(-b)*d*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m 
 - 1)/(f*m)), x] + Simp[1/m   Int[(a + b*Csc[e + f*x])^(m - 2)*Simp[a^2*c*m 
 + (b^2*d*(m - 1) + 2*a*b*c*m + a^2*d*m)*Csc[e + f*x] + b*(b*c*m + a*d*(2*m 
 - 1))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b* 
c - a*d, 0] && GtQ[m, 1] && NeQ[a^2 - b^2, 0] && IntegerQ[2*m]
 

rule 4530
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_. 
) + (a_))^(m_.), x_Symbol] :> Simp[C/b^2   Int[(a + b*Csc[e + f*x])^(m + 1) 
*Simp[-a + b*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && 
 EqQ[A*b^2 + a^2*C, 0]
 

rule 4536
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + 
 f*x]*(Cot[e + f*x]/(2*f)), x] + Simp[1/2   Int[Simp[2*A*a + (2*B*a + b*(2* 
A + C))*Csc[e + f*x] + 2*(a*C + B*b)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a 
, b, e, f, A, B, C}, x]
 
Maple [A] (verified)

Time = 1.04 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\frac {a^{4} \left (d x +c \right )+2 a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-2 a \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) \(94\)
default \(\frac {a^{4} \left (d x +c \right )+2 a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-2 a \,b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) \(94\)
parts \(a^{4} x +\frac {b^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {2 a^{3} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {a \,b^{3} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}-\frac {a \,b^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(99\)
risch \(a^{4} x +\frac {2 i b^{3} \left (3 a \,{\mathrm e}^{5 i \left (d x +c \right )}-6 b \,{\mathrm e}^{2 i \left (d x +c \right )}-3 a \,{\mathrm e}^{i \left (d x +c \right )}-2 b \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {2 a^{3} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a \,b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {2 a^{3} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {a \,b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) \(156\)
parallelrisch \(\frac {-18 \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \left (a^{2}-\frac {b^{2}}{2}\right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+18 \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \left (a^{2}-\frac {b^{2}}{2}\right ) a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+9 a^{4} x d \cos \left (d x +c \right )+3 a^{4} x d \cos \left (3 d x +3 c \right )-6 a \,b^{3} \sin \left (2 d x +2 c \right )-2 b^{4} \sin \left (3 d x +3 c \right )-6 b^{4} \sin \left (d x +c \right )}{3 d \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}\) \(182\)
norman \(\frac {a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-a^{4} x +3 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-3 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}-\frac {4 b^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {2 b^{3} \left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {2 b^{3} \left (a +b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}+\frac {a b \left (2 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a b \left (2 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(197\)

Input:

int((a+b*sec(d*x+c))^2*(a^2-b^2*sec(d*x+c)^2),x,method=_RETURNVERBOSE)
 

Output:

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

Fricas [A] (verification not implemented)

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

integrate((a+b*sec(d*x+c))^2*(a^2-b^2*sec(d*x+c)^2),x, algorithm="fricas")
 

Output:

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

Sympy [F]

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

integrate((a+b*sec(d*x+c))**2*(a**2-b**2*sec(d*x+c)**2),x)
 

Output:

Integral((a - b*sec(c + d*x))*(a + b*sec(c + d*x))**3, x)
 

Maxima [A] (verification not implemented)

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

integrate((a+b*sec(d*x+c))^2*(a^2-b^2*sec(d*x+c)^2),x, algorithm="maxima")
 

Output:

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

Giac [A] (verification not implemented)

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

integrate((a+b*sec(d*x+c))^2*(a^2-b^2*sec(d*x+c)^2),x, algorithm="giac")
 

Output:

1/3*(3*(d*x + c)*a^4 + 3*(2*a^3*b - a*b^3)*log(abs(tan(1/2*d*x + 1/2*c) + 
1)) - 3*(2*a^3*b - a*b^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(3*a*b^3* 
tan(1/2*d*x + 1/2*c)^5 - 3*b^4*tan(1/2*d*x + 1/2*c)^5 + 2*b^4*tan(1/2*d*x 
+ 1/2*c)^3 - 3*a*b^3*tan(1/2*d*x + 1/2*c) - 3*b^4*tan(1/2*d*x + 1/2*c))/(t 
an(1/2*d*x + 1/2*c)^2 - 1)^3)/d
 

Mupad [B] (verification not implemented)

Time = 11.88 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.51 \[ \int (a+b \sec (c+d x))^2 \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx=\frac {2\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {2\,b^4\,\sin \left (c+d\,x\right )}{3\,d\,\cos \left (c+d\,x\right )}-\frac {b^4\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3}-\frac {2\,a\,b^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,a^3\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a\,b^3\,\sin \left (c+d\,x\right )}{d\,{\cos \left (c+d\,x\right )}^2} \] Input:

int((a^2 - b^2/cos(c + d*x)^2)*(a + b/cos(c + d*x))^2,x)
 

Output:

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

Reduce [B] (verification not implemented)

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

int((a+b*sec(d*x+c))^2*(a^2-b^2*sec(d*x+c)^2),x)
 

Output:

( - 6*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a**3*b + 3*co 
s(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a*b**3 + 6*cos(c + d* 
x)*log(tan((c + d*x)/2) - 1)*a**3*b - 3*cos(c + d*x)*log(tan((c + d*x)/2) 
- 1)*a*b**3 + 6*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a** 
3*b - 3*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a*b**3 - 6* 
cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a**3*b + 3*cos(c + d*x)*log(tan((c 
+ d*x)/2) + 1)*a*b**3 + 3*cos(c + d*x)*sin(c + d*x)**2*a**4*d*x + 3*cos(c 
+ d*x)*sin(c + d*x)*a*b**3 - 3*cos(c + d*x)*a**4*d*x - 2*sin(c + d*x)**3*b 
**4 + 3*sin(c + d*x)*b**4)/(3*cos(c + d*x)*d*(sin(c + d*x)**2 - 1))