Integrand size = 22, antiderivative size = 133 \[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=\frac {35 a^4 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {35 i a^4 \sec (c+d x)}{8 d}+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}+\frac {7 i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {35 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{24 d} \] Output:
35/8*a^4*arctanh(sin(d*x+c))/d+35/8*I*a^4*sec(d*x+c)/d+1/4*I*a*sec(d*x+c)* (a+I*a*tan(d*x+c))^3/d+7/12*I*sec(d*x+c)*(a^2+I*a^2*tan(d*x+c))^2/d+35/24* I*sec(d*x+c)*(a^4+I*a^4*tan(d*x+c))/d
Time = 1.36 (sec) , antiderivative size = 237, normalized size of antiderivative = 1.78 \[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=-\frac {a^4 \sec ^4(c+d x) \left (-896 i \cos (c+d x)+3 \left (-128 i \cos (3 (c+d x))+105 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+35 \cos (4 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+140 \cos (2 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-105 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-35 \cos (4 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+42 \sin (c+d x)+58 \sin (3 (c+d x))\right )\right )}{192 d} \] Input:
Integrate[Sec[c + d*x]*(a + I*a*Tan[c + d*x])^4,x]
Output:
-1/192*(a^4*Sec[c + d*x]^4*((-896*I)*Cos[c + d*x] + 3*((-128*I)*Cos[3*(c + d*x)] + 105*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 35*Cos[4*(c + d*x) ]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 140*Cos[2*(c + d*x)]*(Log[Cos [(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2 ]]) - 105*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] - 35*Cos[4*(c + d*x)]*L og[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 42*Sin[c + d*x] + 58*Sin[3*(c + d*x)])))/d
Time = 0.65 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.05, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {3042, 3979, 3042, 3979, 3042, 3979, 3042, 3967, 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 \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sec (c+d x) (a+i a \tan (c+d x))^4dx\) |
\(\Big \downarrow \) 3979 |
\(\displaystyle \frac {7}{4} a \int \sec (c+d x) (i \tan (c+d x) a+a)^3dx+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {7}{4} a \int \sec (c+d x) (i \tan (c+d x) a+a)^3dx+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3979 |
\(\displaystyle \frac {7}{4} a \left (\frac {5}{3} a \int \sec (c+d x) (i \tan (c+d x) a+a)^2dx+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^2}{3 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {7}{4} a \left (\frac {5}{3} a \int \sec (c+d x) (i \tan (c+d x) a+a)^2dx+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^2}{3 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3979 |
\(\displaystyle \frac {7}{4} a \left (\frac {5}{3} a \left (\frac {3}{2} a \int \sec (c+d x) (i \tan (c+d x) a+a)dx+\frac {i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{2 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^2}{3 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {7}{4} a \left (\frac {5}{3} a \left (\frac {3}{2} a \int \sec (c+d x) (i \tan (c+d x) a+a)dx+\frac {i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{2 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^2}{3 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3967 |
\(\displaystyle \frac {7}{4} a \left (\frac {5}{3} a \left (\frac {3}{2} a \left (a \int \sec (c+d x)dx+\frac {i a \sec (c+d x)}{d}\right )+\frac {i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{2 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^2}{3 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {7}{4} a \left (\frac {5}{3} a \left (\frac {3}{2} a \left (a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {i a \sec (c+d x)}{d}\right )+\frac {i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{2 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^2}{3 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {7}{4} a \left (\frac {5}{3} a \left (\frac {i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{2 d}+\frac {3}{2} a \left (\frac {a \text {arctanh}(\sin (c+d x))}{d}+\frac {i a \sec (c+d x)}{d}\right )\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^2}{3 d}\right )+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}\) |
Input:
Int[Sec[c + d*x]*(a + I*a*Tan[c + d*x])^4,x]
Output:
((I/4)*a*Sec[c + d*x]*(a + I*a*Tan[c + d*x])^3)/d + (7*a*(((I/3)*a*Sec[c + d*x]*(a + I*a*Tan[c + d*x])^2)/d + (5*a*((3*a*((a*ArcTanh[Sin[c + d*x]])/ d + (I*a*Sec[c + d*x])/d))/2 + ((I/2)*Sec[c + d*x]*(a^2 + I*a^2*Tan[c + d* x]))/d))/3))/4
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a Int[(d *Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] || NeQ[a^2 + b^2, 0])
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)])^(n_), x_Symbol] :> Simp[b*(d*Sec[e + f*x])^m*((a + b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] + Simp[a*((m + 2*n - 2)/(m + n - 1)) Int[(d*Se c[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && GtQ[n, 0] && NeQ[m + n - 1, 0] && IntegersQ [2*m, 2*n]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 3.46 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.83
method | result | size |
risch | \(\frac {i a^{4} \left (279 \,{\mathrm e}^{7 i \left (d x +c \right )}+511 \,{\mathrm e}^{5 i \left (d x +c \right )}+385 \,{\mathrm e}^{3 i \left (d x +c \right )}+105 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}\) | \(111\) |
derivativedivides | \(\frac {a^{4} \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 )-4 i a^{4} \left (\frac {\sin \left (d x +c \right )^{4}}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{3}\right )-6 a^{4} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {4 i a^{4}}{\cos \left (d x +c \right )}+a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(222\) |
default | \(\frac {a^{4} \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 )-4 i a^{4} \left (\frac {\sin \left (d x +c \right )^{4}}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin \left (d x +c \right )^{4}}{3 \cos \left (d x +c \right )}-\frac {\left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{3}\right )-6 a^{4} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {4 i a^{4}}{\cos \left (d x +c \right )}+a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(222\) |
Input:
int(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x,method=_RETURNVERBOSE)
Output:
1/12*I*a^4/d/(exp(2*I*(d*x+c))+1)^4*(279*exp(7*I*(d*x+c))+511*exp(5*I*(d*x +c))+385*exp(3*I*(d*x+c))+105*exp(I*(d*x+c)))+35/8*a^4/d*ln(exp(I*(d*x+c)) +I)-35/8*a^4/d*ln(exp(I*(d*x+c))-I)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 256 vs. \(2 (109) = 218\).
Time = 0.09 (sec) , antiderivative size = 256, normalized size of antiderivative = 1.92 \[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=\frac {558 i \, a^{4} e^{\left (7 i \, d x + 7 i \, c\right )} + 1022 i \, a^{4} e^{\left (5 i \, d x + 5 i \, c\right )} + 770 i \, a^{4} e^{\left (3 i \, d x + 3 i \, c\right )} + 210 i \, a^{4} e^{\left (i \, d x + i \, c\right )} + 105 \, {\left (a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{4}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 105 \, {\left (a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{4}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{24 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \] Input:
integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")
Output:
1/24*(558*I*a^4*e^(7*I*d*x + 7*I*c) + 1022*I*a^4*e^(5*I*d*x + 5*I*c) + 770 *I*a^4*e^(3*I*d*x + 3*I*c) + 210*I*a^4*e^(I*d*x + I*c) + 105*(a^4*e^(8*I*d *x + 8*I*c) + 4*a^4*e^(6*I*d*x + 6*I*c) + 6*a^4*e^(4*I*d*x + 4*I*c) + 4*a^ 4*e^(2*I*d*x + 2*I*c) + a^4)*log(e^(I*d*x + I*c) + I) - 105*(a^4*e^(8*I*d* x + 8*I*c) + 4*a^4*e^(6*I*d*x + 6*I*c) + 6*a^4*e^(4*I*d*x + 4*I*c) + 4*a^4 *e^(2*I*d*x + 2*I*c) + a^4)*log(e^(I*d*x + I*c) - I))/(d*e^(8*I*d*x + 8*I* c) + 4*d*e^(6*I*d*x + 6*I*c) + 6*d*e^(4*I*d*x + 4*I*c) + 4*d*e^(2*I*d*x + 2*I*c) + d)
\[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=a^{4} \left (\int \left (- 6 \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\right )\, dx + \int \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 4 i \tan {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \left (- 4 i \tan ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}\right )\, dx + \int \sec {\left (c + d x \right )}\, dx\right ) \] Input:
integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))**4,x)
Output:
a**4*(Integral(-6*tan(c + d*x)**2*sec(c + d*x), x) + Integral(tan(c + d*x) **4*sec(c + d*x), x) + Integral(4*I*tan(c + d*x)*sec(c + d*x), x) + Integr al(-4*I*tan(c + d*x)**3*sec(c + d*x), x) + Integral(sec(c + d*x), x))
Time = 0.06 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.35 \[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=\frac {3 \, a^{4} {\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 )} + 72 \, a^{4} {\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 )} + 48 \, a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + \frac {192 i \, a^{4}}{\cos \left (d x + c\right )} + \frac {64 i \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} a^{4}}{\cos \left (d x + c\right )^{3}}}{48 \, d} \] Input:
integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")
Output:
1/48*(3*a^4*(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)) + 72 *a^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - log(si n(d*x + c) - 1)) + 48*a^4*log(sec(d*x + c) + tan(d*x + c)) + 192*I*a^4/cos (d*x + c) + 64*I*(3*cos(d*x + c)^2 - 1)*a^4/cos(d*x + c)^3)/d
Time = 0.30 (sec) , antiderivative size = 173, normalized size of antiderivative = 1.30 \[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=\frac {105 \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - 105 \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) - \frac {2 \, {\left (81 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 96 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 105 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 480 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 105 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 544 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 81 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 160 i \, a^{4}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \] Input:
integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x, algorithm="giac")
Output:
1/24*(105*a^4*log(tan(1/2*d*x + 1/2*c) + 1) - 105*a^4*log(tan(1/2*d*x + 1/ 2*c) - 1) - 2*(81*a^4*tan(1/2*d*x + 1/2*c)^7 + 96*I*a^4*tan(1/2*d*x + 1/2* c)^6 - 105*a^4*tan(1/2*d*x + 1/2*c)^5 - 480*I*a^4*tan(1/2*d*x + 1/2*c)^4 - 105*a^4*tan(1/2*d*x + 1/2*c)^3 + 544*I*a^4*tan(1/2*d*x + 1/2*c)^2 + 81*a^ 4*tan(1/2*d*x + 1/2*c) - 160*I*a^4)/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d
Time = 3.95 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.49 \[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=\frac {35\,a^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d}-\frac {\frac {27\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,8{}\mathrm {i}-\frac {35\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}-a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,40{}\mathrm {i}-\frac {35\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{4}+\frac {a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,136{}\mathrm {i}}{3}+\frac {27\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}-\frac {a^4\,40{}\mathrm {i}}{3}}{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 )} \] Input:
int((a + a*tan(c + d*x)*1i)^4/cos(c + d*x),x)
Output:
(35*a^4*atanh(tan(c/2 + (d*x)/2)))/(4*d) - ((a^4*tan(c/2 + (d*x)/2)^2*136i )/3 - (35*a^4*tan(c/2 + (d*x)/2)^3)/4 - a^4*tan(c/2 + (d*x)/2)^4*40i - (35 *a^4*tan(c/2 + (d*x)/2)^5)/4 + a^4*tan(c/2 + (d*x)/2)^6*8i + (27*a^4*tan(c /2 + (d*x)/2)^7)/4 - (a^4*40i)/3 + (27*a^4*tan(c/2 + (d*x)/2))/4)/(d*(6*ta n(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))
Time = 0.16 (sec) , antiderivative size = 216, normalized size of antiderivative = 1.62 \[ \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx=\frac {a^{4} \left (-192 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} i +160 \cos \left (d x +c \right ) i -105 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{4}+210 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2}-105 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+105 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{4}-210 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2}+105 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-160 \sin \left (d x +c \right )^{4} i +87 \sin \left (d x +c \right )^{3}+320 \sin \left (d x +c \right )^{2} i -81 \sin \left (d x +c \right )-160 i \right )}{24 d \left (\sin \left (d x +c \right )^{4}-2 \sin \left (d x +c \right )^{2}+1\right )} \] Input:
int(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x)
Output:
(a**4*( - 192*cos(c + d*x)*sin(c + d*x)**2*i + 160*cos(c + d*x)*i - 105*lo g(tan((c + d*x)/2) - 1)*sin(c + d*x)**4 + 210*log(tan((c + d*x)/2) - 1)*si n(c + d*x)**2 - 105*log(tan((c + d*x)/2) - 1) + 105*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**4 - 210*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2 + 105* log(tan((c + d*x)/2) + 1) - 160*sin(c + d*x)**4*i + 87*sin(c + d*x)**3 + 3 20*sin(c + d*x)**2*i - 81*sin(c + d*x) - 160*i))/(24*d*(sin(c + d*x)**4 - 2*sin(c + d*x)**2 + 1))