Integrand size = 22, antiderivative size = 83 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=a x-\frac {i a \log (\cos (c+d x))}{d}-\frac {a \tan (c+d x)}{d}-\frac {i a \tan ^2(c+d x)}{2 d}+\frac {a \tan ^3(c+d x)}{3 d}+\frac {i a \tan ^4(c+d x)}{4 d} \] Output:
a*x-I*a*ln(cos(d*x+c))/d-a*tan(d*x+c)/d-1/2*I*a*tan(d*x+c)^2/d+1/3*a*tan(d *x+c)^3/d+1/4*I*a*tan(d*x+c)^4/d
Time = 0.02 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.08 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {a \arctan (\tan (c+d x))}{d}-\frac {i a \log (\cos (c+d x))}{d}-\frac {i a \sec ^2(c+d x)}{d}+\frac {i a \sec ^4(c+d x)}{4 d}-\frac {a \tan (c+d x)}{d}+\frac {a \tan ^3(c+d x)}{3 d} \] Input:
Integrate[Tan[c + d*x]^4*(a + I*a*Tan[c + d*x]),x]
Output:
(a*ArcTan[Tan[c + d*x]])/d - (I*a*Log[Cos[c + d*x]])/d - (I*a*Sec[c + d*x] ^2)/d + ((I/4)*a*Sec[c + d*x]^4)/d - (a*Tan[c + d*x])/d + (a*Tan[c + d*x]^ 3)/(3*d)
Time = 0.51 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {3042, 4011, 3042, 4011, 3042, 4011, 3042, 4008, 3042, 3956}
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+i a \tan (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^4 (a+i a \tan (c+d x))dx\) |
\(\Big \downarrow \) 4011 |
\(\displaystyle \int \tan ^3(c+d x) (a \tan (c+d x)-i a)dx+\frac {i a \tan ^4(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^3 (a \tan (c+d x)-i a)dx+\frac {i a \tan ^4(c+d x)}{4 d}\) |
\(\Big \downarrow \) 4011 |
\(\displaystyle \int \tan ^2(c+d x) (-i \tan (c+d x) a-a)dx+\frac {i a \tan ^4(c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^2 (-i \tan (c+d x) a-a)dx+\frac {i a \tan ^4(c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}\) |
\(\Big \downarrow \) 4011 |
\(\displaystyle \int \tan (c+d x) (i a-a \tan (c+d x))dx+\frac {i a \tan ^4(c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}-\frac {i a \tan ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x) (i a-a \tan (c+d x))dx+\frac {i a \tan ^4(c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}-\frac {i a \tan ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 4008 |
\(\displaystyle i a \int \tan (c+d x)dx+\frac {i a \tan ^4(c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}-\frac {i a \tan ^2(c+d x)}{2 d}-\frac {a \tan (c+d x)}{d}+a x\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle i a \int \tan (c+d x)dx+\frac {i a \tan ^4(c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}-\frac {i a \tan ^2(c+d x)}{2 d}-\frac {a \tan (c+d x)}{d}+a x\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {i a \tan ^4(c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}-\frac {i a \tan ^2(c+d x)}{2 d}-\frac {a \tan (c+d x)}{d}-\frac {i a \log (\cos (c+d x))}{d}+a x\) |
Input:
Int[Tan[c + d*x]^4*(a + I*a*Tan[c + d*x]),x]
Output:
a*x - (I*a*Log[Cos[c + d*x]])/d - (a*Tan[c + d*x])/d - ((I/2)*a*Tan[c + d* x]^2)/d + (a*Tan[c + d*x]^3)/(3*d) + ((I/4)*a*Tan[c + d*x]^4)/d
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), x] + Simp[(b*c + a*d) Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int [(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x], x] , x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]
Time = 0.37 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.82
method | result | size |
derivativedivides | \(\frac {a \left (-\tan \left (d x +c \right )+\frac {i \tan \left (d x +c \right )^{4}}{4}+\frac {\tan \left (d x +c \right )^{3}}{3}-\frac {i \tan \left (d x +c \right )^{2}}{2}+\frac {i \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) | \(68\) |
default | \(\frac {a \left (-\tan \left (d x +c \right )+\frac {i \tan \left (d x +c \right )^{4}}{4}+\frac {\tan \left (d x +c \right )^{3}}{3}-\frac {i \tan \left (d x +c \right )^{2}}{2}+\frac {i \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) | \(68\) |
parallelrisch | \(\frac {3 i a \tan \left (d x +c \right )^{4}-6 i a \tan \left (d x +c \right )^{2}+4 \tan \left (d x +c \right )^{3} a +6 i a \ln \left (1+\tan \left (d x +c \right )^{2}\right )+12 a x d -12 a \tan \left (d x +c \right )}{12 d}\) | \(71\) |
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 {i a \left (\frac {\tan \left (d x +c \right )^{4}}{4}-\frac {\tan \left (d x +c \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}\) | \(74\) |
norman | \(a x -\frac {a \tan \left (d x +c \right )}{d}+\frac {a \tan \left (d x +c \right )^{3}}{3 d}-\frac {i a \tan \left (d x +c \right )^{2}}{2 d}+\frac {i a \tan \left (d x +c \right )^{4}}{4 d}+\frac {i a \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(79\) |
risch | \(-\frac {2 a c}{d}-\frac {4 i a \left (6 \,{\mathrm e}^{6 i \left (d x +c \right )}+9 \,{\mathrm e}^{4 i \left (d x +c \right )}+8 \,{\mathrm e}^{2 i \left (d x +c \right )}+2\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {i a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(83\) |
Input:
int(tan(d*x+c)^4*(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)
Output:
1/d*a*(-tan(d*x+c)+1/4*I*tan(d*x+c)^4+1/3*tan(d*x+c)^3-1/2*I*tan(d*x+c)^2+ 1/2*I*ln(1+tan(d*x+c)^2)+arctan(tan(d*x+c)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 159 vs. \(2 (71) = 142\).
Time = 0.08 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.92 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {-24 i \, a e^{\left (6 i \, d x + 6 i \, c\right )} - 36 i \, a e^{\left (4 i \, d x + 4 i \, c\right )} - 32 i \, a e^{\left (2 i \, d x + 2 i \, c\right )} - 3 \, {\left (i \, a e^{\left (8 i \, d x + 8 i \, c\right )} + 4 i \, a e^{\left (6 i \, d x + 6 i \, c\right )} + 6 i \, a e^{\left (4 i \, d x + 4 i \, c\right )} + 4 i \, a e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 8 i \, a}{3 \, {\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(tan(d*x+c)^4*(a+I*a*tan(d*x+c)),x, algorithm="fricas")
Output:
1/3*(-24*I*a*e^(6*I*d*x + 6*I*c) - 36*I*a*e^(4*I*d*x + 4*I*c) - 32*I*a*e^( 2*I*d*x + 2*I*c) - 3*(I*a*e^(8*I*d*x + 8*I*c) + 4*I*a*e^(6*I*d*x + 6*I*c) + 6*I*a*e^(4*I*d*x + 4*I*c) + 4*I*a*e^(2*I*d*x + 2*I*c) + I*a)*log(e^(2*I* d*x + 2*I*c) + 1) - 8*I*a)/(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)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 168 vs. \(2 (70) = 140\).
Time = 0.24 (sec) , antiderivative size = 168, normalized size of antiderivative = 2.02 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=- \frac {i a \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 24 i a e^{6 i c} e^{6 i d x} - 36 i a e^{4 i c} e^{4 i d x} - 32 i a e^{2 i c} e^{2 i d x} - 8 i a}{3 d e^{8 i c} e^{8 i d x} + 12 d e^{6 i c} e^{6 i d x} + 18 d e^{4 i c} e^{4 i d x} + 12 d e^{2 i c} e^{2 i d x} + 3 d} \] Input:
integrate(tan(d*x+c)**4*(a+I*a*tan(d*x+c)),x)
Output:
-I*a*log(exp(2*I*d*x) + exp(-2*I*c))/d + (-24*I*a*exp(6*I*c)*exp(6*I*d*x) - 36*I*a*exp(4*I*c)*exp(4*I*d*x) - 32*I*a*exp(2*I*c)*exp(2*I*d*x) - 8*I*a) /(3*d*exp(8*I*c)*exp(8*I*d*x) + 12*d*exp(6*I*c)*exp(6*I*d*x) + 18*d*exp(4* I*c)*exp(4*I*d*x) + 12*d*exp(2*I*c)*exp(2*I*d*x) + 3*d)
Time = 0.12 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.84 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=-\frac {-3 i \, a \tan \left (d x + c\right )^{4} - 4 \, a \tan \left (d x + c\right )^{3} + 6 i \, a \tan \left (d x + c\right )^{2} - 12 \, {\left (d x + c\right )} a - 6 i \, a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 12 \, a \tan \left (d x + c\right )}{12 \, d} \] Input:
integrate(tan(d*x+c)^4*(a+I*a*tan(d*x+c)),x, algorithm="maxima")
Output:
-1/12*(-3*I*a*tan(d*x + c)^4 - 4*a*tan(d*x + c)^3 + 6*I*a*tan(d*x + c)^2 - 12*(d*x + c)*a - 6*I*a*log(tan(d*x + c)^2 + 1) + 12*a*tan(d*x + c))/d
Time = 0.16 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.88 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {1}{12} i \, a {\left (\frac {12 \, \log \left (\tan \left (d x + c\right ) + i\right )}{d} + \frac {3 \, d^{3} \tan \left (d x + c\right )^{4} - 4 i \, d^{3} \tan \left (d x + c\right )^{3} - 6 \, d^{3} \tan \left (d x + c\right )^{2} + 12 i \, d^{3} \tan \left (d x + c\right )}{d^{4}}\right )} \] Input:
integrate(tan(d*x+c)^4*(a+I*a*tan(d*x+c)),x, algorithm="giac")
Output:
1/12*I*a*(12*log(tan(d*x + c) + I)/d + (3*d^3*tan(d*x + c)^4 - 4*I*d^3*tan (d*x + c)^3 - 6*d^3*tan(d*x + c)^2 + 12*I*d^3*tan(d*x + c))/d^4)
Time = 0.81 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.76 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {\frac {a\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3}-\frac {a\,{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{2}-a\,\mathrm {tan}\left (c+d\,x\right )+\frac {a\,{\mathrm {tan}\left (c+d\,x\right )}^4\,1{}\mathrm {i}}{4}+a\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{d} \] Input:
int(tan(c + d*x)^4*(a + a*tan(c + d*x)*1i),x)
Output:
((a*tan(c + d*x)^3)/3 - (a*tan(c + d*x)^2*1i)/2 - a*tan(c + d*x) + (a*tan( c + d*x)^4*1i)/4 + a*log(tan(c + d*x) + 1i)*1i)/d
Time = 0.15 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.78 \[ \int \tan ^4(c+d x) (a+i a \tan (c+d x)) \, dx=\frac {a \left (6 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) i +3 \tan \left (d x +c \right )^{4} i +4 \tan \left (d x +c \right )^{3}-6 \tan \left (d x +c \right )^{2} i -12 \tan \left (d x +c \right )+12 d x \right )}{12 d} \] Input:
int(tan(d*x+c)^4*(a+I*a*tan(d*x+c)),x)
Output:
(a*(6*log(tan(c + d*x)**2 + 1)*i + 3*tan(c + d*x)**4*i + 4*tan(c + d*x)**3 - 6*tan(c + d*x)**2*i - 12*tan(c + d*x) + 12*d*x))/(12*d)