\(\int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx\) [12]

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 = 19, antiderivative size = 73 \[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=a x+\frac {3 a \text {arctanh}(\sin (c+d x))}{8 d}-\frac {(8 a+3 a \sec (c+d x)) \tan (c+d x)}{8 d}+\frac {(4 a+3 a \sec (c+d x)) \tan ^3(c+d x)}{12 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.60 \[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {a \arctan (\tan (c+d x))}{d}+\frac {3 a \text {arctanh}(\sin (c+d x))}{8 d}-\frac {a \tan (c+d x)}{d}+\frac {3 a \sec (c+d x) \tan (c+d x)}{8 d}-\frac {3 a \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}+\frac {a \sec (c+d x) \tan ^3(c+d x)}{d} \] Input:

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

Output:

(a*ArcTan[Tan[c + d*x]])/d + (3*a*ArcTanh[Sin[c + d*x]])/(8*d) - (a*Tan[c 
+ d*x])/d + (3*a*Sec[c + d*x]*Tan[c + d*x])/(8*d) - (3*a*Sec[c + d*x]^3*Ta 
n[c + d*x])/(4*d) + (a*Tan[c + d*x]^3)/(3*d) + (a*Sec[c + d*x]*Tan[c + d*x 
]^3)/d
 

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.12, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 4369, 3042, 4369, 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 ^4(c+d x) (a \sec (c+d x)+a) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4369

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4369

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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 4369
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_)), x_Symbol] :> Simp[(-e)*(e*Cot[c + d*x])^(m - 1)*((a*m + b*(m - 1)*Csc 
[c + d*x])/(d*m*(m - 1))), x] - Simp[e^2/m   Int[(e*Cot[c + d*x])^(m - 2)*( 
a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m 
, 1]
 
Maple [A] (verified)

Time = 0.24 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.42

method result size
derivativedivides \(\frac {a \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) \(104\)
default \(\frac {a \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) \(104\)
parts \(\frac {a \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {a \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(109\)
risch \(a x +\frac {i a \left (15 \,{\mathrm e}^{7 i \left (d x +c \right )}-48 \,{\mathrm e}^{6 i \left (d x +c \right )}-9 \,{\mathrm e}^{5 i \left (d x +c \right )}-96 \,{\mathrm e}^{4 i \left (d x +c \right )}+9 \,{\mathrm e}^{3 i \left (d x +c \right )}-80 \,{\mathrm e}^{2 i \left (d x +c \right )}-15 \,{\mathrm e}^{i \left (d x +c \right )}-32\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}\) \(142\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.53 \[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {48 \, a d x \cos \left (d x + c\right )^{4} + 9 \, a \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 9 \, a \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (32 \, a \cos \left (d x + c\right )^{3} + 15 \, a \cos \left (d x + c\right )^{2} - 8 \, a \cos \left (d x + c\right ) - 6 \, a\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \] Input:

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

Output:

1/48*(48*a*d*x*cos(d*x + c)^4 + 9*a*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 
 9*a*cos(d*x + c)^4*log(-sin(d*x + c) + 1) - 2*(32*a*cos(d*x + c)^3 + 15*a 
*cos(d*x + c)^2 - 8*a*cos(d*x + c) - 6*a)*sin(d*x + c))/(d*cos(d*x + c)^4)
 

Sympy [F]

\[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=a \left (\int \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \tan ^{4}{\left (c + d x \right )}\, dx\right ) \] Input:

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

Output:

a*(Integral(tan(c + d*x)**4*sec(c + d*x), x) + Integral(tan(c + d*x)**4, x 
))
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.40 \[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a + 3 \, a {\left (\frac {2 \, {\left (5 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \] Input:

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

Output:

1/48*(16*(tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d*x + c))*a + 3*a*(2*(5*sin 
(d*x + c)^3 - 3*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) + 3* 
log(sin(d*x + c) + 1) - 3*log(sin(d*x + c) - 1)))/d
 

Giac [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.62 \[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {24 \, {\left (d x + c\right )} a + 9 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 9 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 71 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 137 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 33 \, a \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 )}^{4}}}{24 \, d} \] Input:

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

Output:

1/24*(24*(d*x + c)*a + 9*a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 9*a*log(ab 
s(tan(1/2*d*x + 1/2*c) - 1)) + 2*(15*a*tan(1/2*d*x + 1/2*c)^7 - 71*a*tan(1 
/2*d*x + 1/2*c)^5 + 137*a*tan(1/2*d*x + 1/2*c)^3 - 33*a*tan(1/2*d*x + 1/2* 
c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d
 

Mupad [B] (verification not implemented)

Time = 13.06 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.84 \[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=a\,x-\frac {-\frac {5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+\frac {71\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{12}-\frac {137\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12}+\frac {11\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {3\,a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d} \] Input:

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

Output:

a*x - ((11*a*tan(c/2 + (d*x)/2))/4 - (137*a*tan(c/2 + (d*x)/2)^3)/12 + (71 
*a*tan(c/2 + (d*x)/2)^5)/12 - (5*a*tan(c/2 + (d*x)/2)^7)/4)/(d*(6*tan(c/2 
+ (d*x)/2)^4 - 4*tan(c/2 + (d*x)/2)^2 - 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + 
 (d*x)/2)^8 + 1)) + (3*a*atanh(tan(c/2 + (d*x)/2)))/(4*d)
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 277, normalized size of antiderivative = 3.79 \[ \int (a+a \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {a \left (-9 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{4}+18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2}-9 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+9 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{4}-18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2}+9 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+8 \sin \left (d x +c \right )^{4} \tan \left (d x +c \right )^{3}-24 \sin \left (d x +c \right )^{4} \tan \left (d x +c \right )+24 \sin \left (d x +c \right )^{4} d x +15 \sin \left (d x +c \right )^{3}-16 \sin \left (d x +c \right )^{2} \tan \left (d x +c \right )^{3}+48 \sin \left (d x +c \right )^{2} \tan \left (d x +c \right )-48 \sin \left (d x +c \right )^{2} d x -9 \sin \left (d x +c \right )+8 \tan \left (d x +c \right )^{3}-24 \tan \left (d x +c \right )+24 d x \right )}{24 d \left (\sin \left (d x +c \right )^{4}-2 \sin \left (d x +c \right )^{2}+1\right )} \] Input:

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

Output:

(a*( - 9*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**4 + 18*log(tan((c + d*x)/ 
2) - 1)*sin(c + d*x)**2 - 9*log(tan((c + d*x)/2) - 1) + 9*log(tan((c + d*x 
)/2) + 1)*sin(c + d*x)**4 - 18*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2 + 
 9*log(tan((c + d*x)/2) + 1) + 8*sin(c + d*x)**4*tan(c + d*x)**3 - 24*sin( 
c + d*x)**4*tan(c + d*x) + 24*sin(c + d*x)**4*d*x + 15*sin(c + d*x)**3 - 1 
6*sin(c + d*x)**2*tan(c + d*x)**3 + 48*sin(c + d*x)**2*tan(c + d*x) - 48*s 
in(c + d*x)**2*d*x - 9*sin(c + d*x) + 8*tan(c + d*x)**3 - 24*tan(c + d*x) 
+ 24*d*x))/(24*d*(sin(c + d*x)**4 - 2*sin(c + d*x)**2 + 1))