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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (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 = 15, antiderivative size = 74 \[ \int \left (a-a \sec ^2(c+d x)\right )^4 \, dx=a^4 x-\frac {a^4 \tan (c+d x)}{d}+\frac {a^4 \tan ^3(c+d x)}{3 d}-\frac {a^4 \tan ^5(c+d x)}{5 d}+\frac {a^4 \tan ^7(c+d x)}{7 d} \] Output:

a^4*x-a^4*tan(d*x+c)/d+1/3*a^4*tan(d*x+c)^3/d-1/5*a^4*tan(d*x+c)^5/d+1/7*a 
^4*tan(d*x+c)^7/d
 

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.97 \[ \int \left (a-a \sec ^2(c+d x)\right )^4 \, dx=a^4 \left (\frac {\arctan (\tan (c+d x))}{d}-\frac {\tan (c+d x)}{d}+\frac {\tan ^3(c+d x)}{3 d}-\frac {\tan ^5(c+d x)}{5 d}+\frac {\tan ^7(c+d x)}{7 d}\right ) \] Input:

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

Output:

a^4*(ArcTan[Tan[c + d*x]]/d - Tan[c + d*x]/d + Tan[c + d*x]^3/(3*d) - Tan[ 
c + d*x]^5/(5*d) + Tan[c + d*x]^7/(7*d))
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.84, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.733, Rules used = {3042, 4608, 3042, 3954, 3042, 3954, 3042, 3954, 3042, 3954, 24}

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 (a-a \sec ^2(c+d x)\right )^4 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4608

\(\displaystyle a^4 \int \tan ^8(c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a^4 \int \tan (c+d x)^8dx\)

\(\Big \downarrow \) 3954

\(\displaystyle a^4 \left (\frac {\tan ^7(c+d x)}{7 d}-\int \tan ^6(c+d x)dx\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle a^4 \left (\frac {\tan ^7(c+d x)}{7 d}-\int \tan (c+d x)^6dx\right )\)

\(\Big \downarrow \) 3954

\(\displaystyle a^4 \left (\int \tan ^4(c+d x)dx+\frac {\tan ^7(c+d x)}{7 d}-\frac {\tan ^5(c+d x)}{5 d}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle a^4 \left (\int \tan (c+d x)^4dx+\frac {\tan ^7(c+d x)}{7 d}-\frac {\tan ^5(c+d x)}{5 d}\right )\)

\(\Big \downarrow \) 3954

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3954

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

\(\Big \downarrow \) 24

\(\displaystyle a^4 \left (\frac {\tan ^7(c+d x)}{7 d}-\frac {\tan ^5(c+d x)}{5 d}+\frac {\tan ^3(c+d x)}{3 d}-\frac {\tan (c+d x)}{d}+x\right )\)

Input:

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

Output:

a^4*(x - Tan[c + d*x]/d + Tan[c + d*x]^3/(3*d) - Tan[c + d*x]^5/(5*d) + Ta 
n[c + d*x]^7/(7*d))
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

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

rule 3954
Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d 
*x])^(n - 1)/(d*(n - 1))), x] - Simp[b^2   Int[(b*Tan[c + d*x])^(n - 2), x] 
, x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]
 

rule 4608
Int[(u_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Simp[ 
b^p   Int[ActivateTrig[u*tan[e + f*x]^(2*p)], x], x] /; FreeQ[{a, b, e, f, 
p}, x] && EqQ[a + b, 0] && IntegerQ[p]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 2.79 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.31

method result size
risch \(a^{4} x -\frac {8 i a^{4} \left (105 \,{\mathrm e}^{12 i \left (d x +c \right )}+315 \,{\mathrm e}^{10 i \left (d x +c \right )}+770 \,{\mathrm e}^{8 i \left (d x +c \right )}+770 \,{\mathrm e}^{6 i \left (d x +c \right )}+609 \,{\mathrm e}^{4 i \left (d x +c \right )}+203 \,{\mathrm e}^{2 i \left (d x +c \right )}+44\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{7}}\) \(97\)
derivativedivides \(\frac {a^{4} \left (d x +c \right )-4 a^{4} \tan \left (d x +c \right )-6 a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+4 a^{4} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )-a^{4} \left (-\frac {16}{35}-\frac {\sec \left (d x +c \right )^{6}}{7}-\frac {6 \sec \left (d x +c \right )^{4}}{35}-\frac {8 \sec \left (d x +c \right )^{2}}{35}\right ) \tan \left (d x +c \right )}{d}\) \(125\)
default \(\frac {a^{4} \left (d x +c \right )-4 a^{4} \tan \left (d x +c \right )-6 a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+4 a^{4} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )-a^{4} \left (-\frac {16}{35}-\frac {\sec \left (d x +c \right )^{6}}{7}-\frac {6 \sec \left (d x +c \right )^{4}}{35}-\frac {8 \sec \left (d x +c \right )^{2}}{35}\right ) \tan \left (d x +c \right )}{d}\) \(125\)
parts \(a^{4} x -\frac {a^{4} \left (-\frac {16}{35}-\frac {\sec \left (d x +c \right )^{6}}{7}-\frac {6 \sec \left (d x +c \right )^{4}}{35}-\frac {8 \sec \left (d x +c \right )^{2}}{35}\right ) \tan \left (d x +c \right )}{d}+\frac {4 a^{4} \left (-\frac {8}{15}-\frac {\sec \left (d x +c \right )^{4}}{5}-\frac {4 \sec \left (d x +c \right )^{2}}{15}\right ) \tan \left (d x +c \right )}{d}-\frac {4 a^{4} \tan \left (d x +c \right )}{d}-\frac {6 a^{4} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) \(129\)
parallelrisch \(\frac {a^{4} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14} x d -7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12} x d +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}+21 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10} x d -\frac {44 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{3}-35 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8} x d +\frac {706 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{15}+35 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} x d -\frac {3048 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{35}-21 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} x d +\frac {706 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{15}+7 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} x d -\frac {44 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-d x +2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{7}}\) \(221\)
norman \(\frac {a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}-a^{4} x +\frac {2 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {44 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}+\frac {706 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{15 d}-\frac {3048 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{35 d}+\frac {706 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{15 d}-\frac {44 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{3 d}+\frac {2 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{d}+7 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-21 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+35 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-35 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+21 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}-7 a^{4} x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{7}}\) \(273\)

Input:

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

Output:

a^4*x-8/105*I*a^4*(105*exp(12*I*(d*x+c))+315*exp(10*I*(d*x+c))+770*exp(8*I 
*(d*x+c))+770*exp(6*I*(d*x+c))+609*exp(4*I*(d*x+c))+203*exp(2*I*(d*x+c))+4 
4)/d/(exp(2*I*(d*x+c))+1)^7
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.11 \[ \int \left (a-a \sec ^2(c+d x)\right )^4 \, dx=\frac {105 \, a^{4} d x \cos \left (d x + c\right )^{7} - {\left (176 \, a^{4} \cos \left (d x + c\right )^{6} - 122 \, a^{4} \cos \left (d x + c\right )^{4} + 66 \, a^{4} \cos \left (d x + c\right )^{2} - 15 \, a^{4}\right )} \sin \left (d x + c\right )}{105 \, d \cos \left (d x + c\right )^{7}} \] Input:

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

Output:

1/105*(105*a^4*d*x*cos(d*x + c)^7 - (176*a^4*cos(d*x + c)^6 - 122*a^4*cos( 
d*x + c)^4 + 66*a^4*cos(d*x + c)^2 - 15*a^4)*sin(d*x + c))/(d*cos(d*x + c) 
^7)
 

Sympy [F]

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

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

Output:

a**4*(Integral(1, x) + Integral(-4*sec(c + d*x)**2, x) + Integral(6*sec(c 
+ d*x)**4, x) + Integral(-4*sec(c + d*x)**6, x) + Integral(sec(c + d*x)**8 
, x))
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.74 \[ \int \left (a-a \sec ^2(c+d x)\right )^4 \, dx=a^{4} x + \frac {{\left (5 \, \tan \left (d x + c\right )^{7} + 21 \, \tan \left (d x + c\right )^{5} + 35 \, \tan \left (d x + c\right )^{3} + 35 \, \tan \left (d x + c\right )\right )} a^{4}}{35 \, d} - \frac {4 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} a^{4}}{15 \, d} + \frac {2 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{4}}{d} - \frac {4 \, a^{4} \tan \left (d x + c\right )}{d} \] Input:

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

Output:

a^4*x + 1/35*(5*tan(d*x + c)^7 + 21*tan(d*x + c)^5 + 35*tan(d*x + c)^3 + 3 
5*tan(d*x + c))*a^4/d - 4/15*(3*tan(d*x + c)^5 + 10*tan(d*x + c)^3 + 15*ta 
n(d*x + c))*a^4/d + 2*(tan(d*x + c)^3 + 3*tan(d*x + c))*a^4/d - 4*a^4*tan( 
d*x + c)/d
 

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.89 \[ \int \left (a-a \sec ^2(c+d x)\right )^4 \, dx=\frac {15 \, a^{4} \tan \left (d x + c\right )^{7} - 21 \, a^{4} \tan \left (d x + c\right )^{5} + 35 \, a^{4} \tan \left (d x + c\right )^{3} + 105 \, {\left (d x + c\right )} a^{4} - 105 \, a^{4} \tan \left (d x + c\right )}{105 \, d} \] Input:

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

Output:

1/105*(15*a^4*tan(d*x + c)^7 - 21*a^4*tan(d*x + c)^5 + 35*a^4*tan(d*x + c) 
^3 + 105*(d*x + c)*a^4 - 105*a^4*tan(d*x + c))/d
 

Mupad [B] (verification not implemented)

Time = 14.92 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.82 \[ \int \left (a-a \sec ^2(c+d x)\right )^4 \, dx=\frac {\frac {a^4\,{\mathrm {tan}\left (c+d\,x\right )}^7}{7}-\frac {a^4\,{\mathrm {tan}\left (c+d\,x\right )}^5}{5}+\frac {a^4\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3}-a^4\,\mathrm {tan}\left (c+d\,x\right )+d\,x\,a^4}{d} \] Input:

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

Output:

((a^4*tan(c + d*x)^3)/3 - a^4*tan(c + d*x) - (a^4*tan(c + d*x)^5)/5 + (a^4 
*tan(c + d*x)^7)/7 + a^4*d*x)/d
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 151, normalized size of antiderivative = 2.04 \[ \int \left (a-a \sec ^2(c+d x)\right )^4 \, dx=\frac {a^{4} \left (105 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{6} d x -315 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} d x +315 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} d x -105 \cos \left (d x +c \right ) d x -176 \sin \left (d x +c \right )^{7}+406 \sin \left (d x +c \right )^{5}-350 \sin \left (d x +c \right )^{3}+105 \sin \left (d x +c \right )\right )}{105 \cos \left (d x +c \right ) d \left (\sin \left (d x +c \right )^{6}-3 \sin \left (d x +c \right )^{4}+3 \sin \left (d x +c \right )^{2}-1\right )} \] Input:

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

Output:

(a**4*(105*cos(c + d*x)*sin(c + d*x)**6*d*x - 315*cos(c + d*x)*sin(c + d*x 
)**4*d*x + 315*cos(c + d*x)*sin(c + d*x)**2*d*x - 105*cos(c + d*x)*d*x - 1 
76*sin(c + d*x)**7 + 406*sin(c + d*x)**5 - 350*sin(c + d*x)**3 + 105*sin(c 
 + d*x)))/(105*cos(c + d*x)*d*(sin(c + d*x)**6 - 3*sin(c + d*x)**4 + 3*sin 
(c + d*x)**2 - 1))