\(\int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\) [160]

Optimal result
Mathematica [B] (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 [F]

Optimal result

Integrand size = 24, antiderivative size = 82 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {\text {arctanh}(\sin (c+d x))}{a^4 d}+\frac {2 i \sec ^3(c+d x)}{3 a d (a+i a \tan (c+d x))^3}-\frac {2 i \sec (c+d x)}{d \left (a^4+i a^4 \tan (c+d x)\right )} \] Output:

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

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(247\) vs. \(2(82)=164\).

Time = 0.56 (sec) , antiderivative size = 247, normalized size of antiderivative = 3.01 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {\sec ^4(c+d x) (\cos (d x)+i \sin (d x))^4 \left (-3 \cos (4 c) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+3 \cos (4 c) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 \cos (3 d x) \sin (c)+6 \cos (d x) \sin (3 c)-3 i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 c)+3 i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (4 c)+\cos (3 c) (-6 i \cos (d x)-6 \sin (d x))-6 i \sin (3 c) \sin (d x)+2 i \sin (c) \sin (3 d x)+2 \cos (c) (i \cos (3 d x)+\sin (3 d x))\right )}{3 a^4 d (-i+\tan (c+d x))^4} \] Input:

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

Output:

(Sec[c + d*x]^4*(Cos[d*x] + I*Sin[d*x])^4*(-3*Cos[4*c]*Log[Cos[(c + d*x)/2 
] - Sin[(c + d*x)/2]] + 3*Cos[4*c]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2] 
] - 2*Cos[3*d*x]*Sin[c] + 6*Cos[d*x]*Sin[3*c] - (3*I)*Log[Cos[(c + d*x)/2] 
 - Sin[(c + d*x)/2]]*Sin[4*c] + (3*I)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x) 
/2]]*Sin[4*c] + Cos[3*c]*((-6*I)*Cos[d*x] - 6*Sin[d*x]) - (6*I)*Sin[3*c]*S 
in[d*x] + (2*I)*Sin[c]*Sin[3*d*x] + 2*Cos[c]*(I*Cos[3*d*x] + Sin[3*d*x]))) 
/(3*a^4*d*(-I + Tan[c + d*x])^4)
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.09, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3042, 3981, 3042, 3981, 3042, 4257}

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 \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sec (c+d x)^5}{(a+i a \tan (c+d x))^4}dx\)

\(\Big \downarrow \) 3981

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3981

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 3981
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x 
_)])^(n_), x_Symbol] :> Simp[2*d^2*(d*Sec[e + f*x])^(m - 2)*((a + b*Tan[e + 
 f*x])^(n + 1)/(b*f*(m + 2*n))), x] - Simp[d^2*((m - 2)/(b^2*(m + 2*n))) 
Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 2), x], x] /; FreeQ[ 
{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n, -1] && ((ILtQ[n/2, 0] 
 && IGtQ[m - 1/2, 0]) || EqQ[n, -2] || IGtQ[m + n, 0] || (IntegersQ[n, m + 
1/2] && GtQ[2*m + n + 1, 0])) && IntegerQ[2*m]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 1.00 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.87

method result size
derivativedivides \(\frac {-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {8 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {16}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}}{a^{4} d}\) \(71\)
default \(\frac {-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {8 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {16}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}}{a^{4} d}\) \(71\)
risch \(-\frac {2 i {\mathrm e}^{-i \left (d x +c \right )}}{a^{4} d}+\frac {2 i {\mathrm e}^{-3 i \left (d x +c \right )}}{3 a^{4} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a^{4} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{4} d}\) \(79\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.93 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {{\left (3 \, e^{\left (3 i \, d x + 3 i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 3 \, e^{\left (3 i \, d x + 3 i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 6 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} e^{\left (-3 i \, d x - 3 i \, c\right )}}{3 \, a^{4} d} \] Input:

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

Output:

1/3*(3*e^(3*I*d*x + 3*I*c)*log(e^(I*d*x + I*c) + I) - 3*e^(3*I*d*x + 3*I*c 
)*log(e^(I*d*x + I*c) - I) - 6*I*e^(2*I*d*x + 2*I*c) + 2*I)*e^(-3*I*d*x - 
3*I*c)/(a^4*d)
 

Sympy [F]

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

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

Output:

Integral(sec(c + d*x)**5/(tan(c + d*x)**4 - 4*I*tan(c + d*x)**3 - 6*tan(c 
+ d*x)**2 + 4*I*tan(c + d*x) + 1), x)/a**4
 

Maxima [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.72 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {-6 i \, \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) - 6 i \, \arctan \left (\cos \left (d x + c\right ), -\sin \left (d x + c\right ) + 1\right ) + 4 i \, \cos \left (3 \, d x + 3 \, c\right ) - 12 i \, \cos \left (d x + c\right ) + 3 \, \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right ) + 4 \, \sin \left (3 \, d x + 3 \, c\right ) - 12 \, \sin \left (d x + c\right )}{6 \, a^{4} d} \] Input:

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

Output:

1/6*(-6*I*arctan2(cos(d*x + c), sin(d*x + c) + 1) - 6*I*arctan2(cos(d*x + 
c), -sin(d*x + c) + 1) + 4*I*cos(3*d*x + 3*c) - 12*I*cos(d*x + c) + 3*log( 
cos(d*x + c)^2 + sin(d*x + c)^2 + 2*sin(d*x + c) + 1) - 3*log(cos(d*x + c) 
^2 + sin(d*x + c)^2 - 2*sin(d*x + c) + 1) + 4*sin(3*d*x + 3*c) - 12*sin(d* 
x + c))/(a^4*d)
 

Giac [A] (verification not implemented)

Time = 0.33 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.87 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {\frac {3 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{4}} - \frac {3 \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{4}} + \frac {8 \, {\left (3 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}}{a^{4} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{3}}}{3 \, d} \] Input:

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

Output:

1/3*(3*log(tan(1/2*d*x + 1/2*c) + 1)/a^4 - 3*log(tan(1/2*d*x + 1/2*c) - 1) 
/a^4 + 8*(3*I*tan(1/2*d*x + 1/2*c) + 1)/(a^4*(tan(1/2*d*x + 1/2*c) - I)^3) 
)/d
 

Mupad [B] (verification not implemented)

Time = 0.80 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.07 \[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^4\,d}-\frac {-\frac {8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^4}+\frac {8{}\mathrm {i}}{3\,a^4}}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,3{}\mathrm {i}+1\right )} \] Input:

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

Output:

(2*atanh(tan(c/2 + (d*x)/2)))/(a^4*d) - (8i/(3*a^4) - (8*tan(c/2 + (d*x)/2 
))/a^4)/(d*(tan(c/2 + (d*x)/2)*3i - 3*tan(c/2 + (d*x)/2)^2 - tan(c/2 + (d* 
x)/2)^3*1i + 1))
 

Reduce [F]

\[ \int \frac {\sec ^5(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\text {too large to display} \] Input:

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

Output:

(496*int(cos(c + d*x)/(8*cos(c + d*x)*sin(c + d*x)**4*i - 8*cos(c + d*x)*s 
in(c + d*x)**2*i + cos(c + d*x)*i - 8*sin(c + d*x)**5 + 12*sin(c + d*x)**3 
 - 4*sin(c + d*x)),x)*d*i - 3552*int(sin(c + d*x)**5/(8*cos(c + d*x)*sin(c 
 + d*x)**4*i - 8*cos(c + d*x)*sin(c + d*x)**2*i + cos(c + d*x)*i - 8*sin(c 
 + d*x)**5 + 12*sin(c + d*x)**3 - 4*sin(c + d*x)),x)*d + 3960*int(sin(c + 
d*x)**4/(8*cos(c + d*x)*sin(c + d*x)**4*i - 8*cos(c + d*x)*sin(c + d*x)**2 
*i + cos(c + d*x)*i - 8*sin(c + d*x)**5 + 12*sin(c + d*x)**3 - 4*sin(c + d 
*x)),x)*d*i - 96*int(sin(c + d*x)**4/(8*cos(c + d*x)*sin(c + d*x)**3*i - 4 
*cos(c + d*x)*sin(c + d*x)*i - 8*sin(c + d*x)**4 + 8*sin(c + d*x)**2 - 1), 
x)*d + 5600*int(sin(c + d*x)**3/(8*cos(c + d*x)*sin(c + d*x)**4*i - 8*cos( 
c + d*x)*sin(c + d*x)**2*i + cos(c + d*x)*i - 8*sin(c + d*x)**5 + 12*sin(c 
 + d*x)**3 - 4*sin(c + d*x)),x)*d - 3960*int(sin(c + d*x)**2/(8*cos(c + d* 
x)*sin(c + d*x)**4*i - 8*cos(c + d*x)*sin(c + d*x)**2*i + cos(c + d*x)*i - 
 8*sin(c + d*x)**5 + 12*sin(c + d*x)**3 - 4*sin(c + d*x)),x)*d*i - 480*int 
(( - cos(c + d*x))/(8*cos(c + d*x)*sin(c + d*x)**4 - 8*cos(c + d*x)*sin(c 
+ d*x)**2 + cos(c + d*x) + 8*sin(c + d*x)**5*i - 12*sin(c + d*x)**3*i + 4* 
sin(c + d*x)*i),x)*d - 3232*int(( - sin(c + d*x)**5)/(8*cos(c + d*x)*sin(c 
 + d*x)**4 - 8*cos(c + d*x)*sin(c + d*x)**2 + cos(c + d*x) + 8*sin(c + d*x 
)**5*i - 12*sin(c + d*x)**3*i + 4*sin(c + d*x)*i),x)*d*i - 3840*int(( - si 
n(c + d*x)**4)/(8*cos(c + d*x)*sin(c + d*x)**4 - 8*cos(c + d*x)*sin(c +...