Integrand size = 26, antiderivative size = 110 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=4 a^3 (c-i d) x-\frac {4 a^3 (i c+d) \log (\cos (e+f x))}{f}-\frac {2 a^3 (c-i d) \tan (e+f x)}{f}+\frac {a (i c+d) (a+i a \tan (e+f x))^2}{2 f}+\frac {d (a+i a \tan (e+f x))^3}{3 f} \] Output:
4*a^3*(c-I*d)*x-4*a^3*(I*c+d)*ln(cos(f*x+e))/f-2*a^3*(c-I*d)*tan(f*x+e)/f+ 1/2*a*(I*c+d)*(a+I*a*tan(f*x+e))^2/f+1/3*d*(a+I*a*tan(f*x+e))^3/f
Time = 0.71 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.66 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=\frac {d (a+i a \tan (e+f x))^3+\frac {3}{2} a^3 (i c+d) \left (8 \log (i+\tan (e+f x))+6 i \tan (e+f x)-\tan ^2(e+f x)\right )}{3 f} \] Input:
Integrate[(a + I*a*Tan[e + f*x])^3*(c + d*Tan[e + f*x]),x]
Output:
(d*(a + I*a*Tan[e + f*x])^3 + (3*a^3*(I*c + d)*(8*Log[I + Tan[e + f*x]] + (6*I)*Tan[e + f*x] - Tan[e + f*x]^2))/2)/(3*f)
Time = 0.48 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.90, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3042, 4010, 3042, 3959, 3042, 3958, 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 (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x))dx\) |
\(\Big \downarrow \) 4010 |
\(\displaystyle (c-i d) \int (i \tan (e+f x) a+a)^3dx+\frac {d (a+i a \tan (e+f x))^3}{3 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (c-i d) \int (i \tan (e+f x) a+a)^3dx+\frac {d (a+i a \tan (e+f x))^3}{3 f}\) |
\(\Big \downarrow \) 3959 |
\(\displaystyle (c-i d) \left (2 a \int (i \tan (e+f x) a+a)^2dx+\frac {i a (a+i a \tan (e+f x))^2}{2 f}\right )+\frac {d (a+i a \tan (e+f x))^3}{3 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (c-i d) \left (2 a \int (i \tan (e+f x) a+a)^2dx+\frac {i a (a+i a \tan (e+f x))^2}{2 f}\right )+\frac {d (a+i a \tan (e+f x))^3}{3 f}\) |
\(\Big \downarrow \) 3958 |
\(\displaystyle (c-i d) \left (2 a \left (2 i a^2 \int \tan (e+f x)dx-\frac {a^2 \tan (e+f x)}{f}+2 a^2 x\right )+\frac {i a (a+i a \tan (e+f x))^2}{2 f}\right )+\frac {d (a+i a \tan (e+f x))^3}{3 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (c-i d) \left (2 a \left (2 i a^2 \int \tan (e+f x)dx-\frac {a^2 \tan (e+f x)}{f}+2 a^2 x\right )+\frac {i a (a+i a \tan (e+f x))^2}{2 f}\right )+\frac {d (a+i a \tan (e+f x))^3}{3 f}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle (c-i d) \left (2 a \left (-\frac {a^2 \tan (e+f x)}{f}-\frac {2 i a^2 \log (\cos (e+f x))}{f}+2 a^2 x\right )+\frac {i a (a+i a \tan (e+f x))^2}{2 f}\right )+\frac {d (a+i a \tan (e+f x))^3}{3 f}\) |
Input:
Int[(a + I*a*Tan[e + f*x])^3*(c + d*Tan[e + f*x]),x]
Output:
(d*(a + I*a*Tan[e + f*x])^3)/(3*f) + (c - I*d)*(((I/2)*a*(a + I*a*Tan[e + f*x])^2)/f + 2*a*(2*a^2*x - ((2*I)*a^2*Log[Cos[e + f*x]])/f - (a^2*Tan[e + f*x])/f))
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[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(a^2 - b^2) *x, x] + (Simp[b^2*(Tan[c + d*x]/d), x] + Simp[2*a*b Int[Tan[c + d*x], x] , x]) /; FreeQ[{a, b, c, d}, x]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[2*a Int[(a + b*Tan[c + d* x])^(n - 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && GtQ[n , 1]
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] + Simp [(b*c + a*d)/b Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e , f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && !LtQ[m, 0]
Time = 0.21 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.91
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {i d \tan \left (f x +e \right )^{3}}{3}-\frac {i c \tan \left (f x +e \right )^{2}}{2}+4 i \tan \left (f x +e \right ) d -\frac {3 d \tan \left (f x +e \right )^{2}}{2}-3 c \tan \left (f x +e \right )+\frac {\left (4 i c +4 d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (-4 i d +4 c \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(100\) |
default | \(\frac {a^{3} \left (-\frac {i d \tan \left (f x +e \right )^{3}}{3}-\frac {i c \tan \left (f x +e \right )^{2}}{2}+4 i \tan \left (f x +e \right ) d -\frac {3 d \tan \left (f x +e \right )^{2}}{2}-3 c \tan \left (f x +e \right )+\frac {\left (4 i c +4 d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (-4 i d +4 c \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(100\) |
norman | \(\left (-4 i a^{3} d +4 a^{3} c \right ) x -\frac {\left (i a^{3} c +3 a^{3} d \right ) \tan \left (f x +e \right )^{2}}{2 f}-\frac {\left (-4 i a^{3} d +3 a^{3} c \right ) \tan \left (f x +e \right )}{f}-\frac {i a^{3} d \tan \left (f x +e \right )^{3}}{3 f}+\frac {2 \left (i a^{3} c +a^{3} d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{f}\) | \(117\) |
parallelrisch | \(\frac {-2 i a^{3} d \tan \left (f x +e \right )^{3}-24 i x \,a^{3} d f -3 i \tan \left (f x +e \right )^{2} a^{3} c +12 i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} c +24 i \tan \left (f x +e \right ) a^{3} d +24 x \,a^{3} c f -9 \tan \left (f x +e \right )^{2} a^{3} d +12 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{3} d -18 \tan \left (f x +e \right ) a^{3} c}{6 f}\) | \(128\) |
risch | \(\frac {8 i a^{3} d e}{f}-\frac {8 a^{3} c e}{f}-\frac {2 a^{3} \left (12 i c \,{\mathrm e}^{4 i \left (f x +e \right )}+24 d \,{\mathrm e}^{4 i \left (f x +e \right )}+21 i c \,{\mathrm e}^{2 i \left (f x +e \right )}+33 d \,{\mathrm e}^{2 i \left (f x +e \right )}+9 i c +13 d \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) d}{f}-\frac {4 i a^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c}{f}\) | \(145\) |
parts | \(a^{3} c x +\frac {\left (-i a^{3} c -3 a^{3} d \right ) \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {\left (3 i a^{3} c +a^{3} d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}+\frac {\left (3 i a^{3} d -3 a^{3} c \right ) \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}-\frac {i a^{3} d \left (\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(149\) |
Input:
int((a+I*a*tan(f*x+e))^3*(c+d*tan(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/f*a^3*(-1/3*I*d*tan(f*x+e)^3-1/2*I*c*tan(f*x+e)^2+4*I*tan(f*x+e)*d-3/2*d *tan(f*x+e)^2-3*c*tan(f*x+e)+1/2*(4*I*c+4*d)*ln(1+tan(f*x+e)^2)+(-4*I*d+4* c)*arctan(tan(f*x+e)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 196 vs. \(2 (94) = 188\).
Time = 0.09 (sec) , antiderivative size = 196, normalized size of antiderivative = 1.78 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=-\frac {2 \, {\left (9 i \, a^{3} c + 13 \, a^{3} d + 12 \, {\left (i \, a^{3} c + 2 \, a^{3} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (7 i \, a^{3} c + 11 \, a^{3} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, {\left (i \, a^{3} c + a^{3} d + {\left (i \, a^{3} c + a^{3} d\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (i \, a^{3} c + a^{3} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (i \, a^{3} c + a^{3} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \] Input:
integrate((a+I*a*tan(f*x+e))^3*(c+d*tan(f*x+e)),x, algorithm="fricas")
Output:
-2/3*(9*I*a^3*c + 13*a^3*d + 12*(I*a^3*c + 2*a^3*d)*e^(4*I*f*x + 4*I*e) + 3*(7*I*a^3*c + 11*a^3*d)*e^(2*I*f*x + 2*I*e) + 6*(I*a^3*c + a^3*d + (I*a^3 *c + a^3*d)*e^(6*I*f*x + 6*I*e) + 3*(I*a^3*c + a^3*d)*e^(4*I*f*x + 4*I*e) + 3*(I*a^3*c + a^3*d)*e^(2*I*f*x + 2*I*e))*log(e^(2*I*f*x + 2*I*e) + 1))/( f*e^(6*I*f*x + 6*I*e) + 3*f*e^(4*I*f*x + 4*I*e) + 3*f*e^(2*I*f*x + 2*I*e) + f)
Time = 0.39 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.67 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=- \frac {4 i a^{3} \left (c - i d\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 18 i a^{3} c - 26 a^{3} d + \left (- 42 i a^{3} c e^{2 i e} - 66 a^{3} d e^{2 i e}\right ) e^{2 i f x} + \left (- 24 i a^{3} c e^{4 i e} - 48 a^{3} d e^{4 i e}\right ) e^{4 i f x}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \] Input:
integrate((a+I*a*tan(f*x+e))**3*(c+d*tan(f*x+e)),x)
Output:
-4*I*a**3*(c - I*d)*log(exp(2*I*f*x) + exp(-2*I*e))/f + (-18*I*a**3*c - 26 *a**3*d + (-42*I*a**3*c*exp(2*I*e) - 66*a**3*d*exp(2*I*e))*exp(2*I*f*x) + (-24*I*a**3*c*exp(4*I*e) - 48*a**3*d*exp(4*I*e))*exp(4*I*f*x))/(3*f*exp(6* I*e)*exp(6*I*f*x) + 9*f*exp(4*I*e)*exp(4*I*f*x) + 9*f*exp(2*I*e)*exp(2*I*f *x) + 3*f)
Time = 0.17 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.99 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=-\frac {2 i \, a^{3} d \tan \left (f x + e\right )^{3} + 3 \, {\left (i \, a^{3} c + 3 \, a^{3} d\right )} \tan \left (f x + e\right )^{2} - 24 \, {\left (a^{3} c - i \, a^{3} d\right )} {\left (f x + e\right )} + 12 \, {\left (-i \, a^{3} c - a^{3} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (3 \, a^{3} c - 4 i \, a^{3} d\right )} \tan \left (f x + e\right )}{6 \, f} \] Input:
integrate((a+I*a*tan(f*x+e))^3*(c+d*tan(f*x+e)),x, algorithm="maxima")
Output:
-1/6*(2*I*a^3*d*tan(f*x + e)^3 + 3*(I*a^3*c + 3*a^3*d)*tan(f*x + e)^2 - 24 *(a^3*c - I*a^3*d)*(f*x + e) + 12*(-I*a^3*c - a^3*d)*log(tan(f*x + e)^2 + 1) + 6*(3*a^3*c - 4*I*a^3*d)*tan(f*x + e))/f
Time = 0.51 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.05 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=-\frac {4 \, {\left (-i \, a^{3} c - a^{3} d\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{f} - \frac {2 i \, a^{3} d f^{2} \tan \left (f x + e\right )^{3} + 3 i \, a^{3} c f^{2} \tan \left (f x + e\right )^{2} + 9 \, a^{3} d f^{2} \tan \left (f x + e\right )^{2} + 18 \, a^{3} c f^{2} \tan \left (f x + e\right ) - 24 i \, a^{3} d f^{2} \tan \left (f x + e\right )}{6 \, f^{3}} \] Input:
integrate((a+I*a*tan(f*x+e))^3*(c+d*tan(f*x+e)),x, algorithm="giac")
Output:
-4*(-I*a^3*c - a^3*d)*log(tan(f*x + e) + I)/f - 1/6*(2*I*a^3*d*f^2*tan(f*x + e)^3 + 3*I*a^3*c*f^2*tan(f*x + e)^2 + 9*a^3*d*f^2*tan(f*x + e)^2 + 18*a ^3*c*f^2*tan(f*x + e) - 24*I*a^3*d*f^2*tan(f*x + e))/f^3
Time = 2.03 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.14 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-a^3\,\left (2\,c-d\,1{}\mathrm {i}\right )+a^3\,\left (2\,d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+a^3\,d\,1{}\mathrm {i}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (4\,a^3\,d+a^3\,c\,4{}\mathrm {i}\right )}{f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^3\,\left (2\,d+c\,1{}\mathrm {i}\right )}{2}+\frac {a^3\,d}{2}\right )}{f}-\frac {a^3\,d\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,f} \] Input:
int((a + a*tan(e + f*x)*1i)^3*(c + d*tan(e + f*x)),x)
Output:
(tan(e + f*x)*(a^3*(c*1i + 2*d)*1i - a^3*(2*c - d*1i) + a^3*d*1i))/f + (lo g(tan(e + f*x) + 1i)*(a^3*c*4i + 4*a^3*d))/f - (tan(e + f*x)^2*((a^3*(c*1i + 2*d))/2 + (a^3*d)/2))/f - (a^3*d*tan(e + f*x)^3*1i)/(3*f)
Time = 0.23 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.94 \[ \int (a+i a \tan (e+f x))^3 (c+d \tan (e+f x)) \, dx=\frac {a^{3} \left (12 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) c i +12 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) d -2 \tan \left (f x +e \right )^{3} d i -3 \tan \left (f x +e \right )^{2} c i -9 \tan \left (f x +e \right )^{2} d -18 c \tan \left (f x +e \right )+24 \tan \left (f x +e \right ) d i +24 c f x -24 d f i x \right )}{6 f} \] Input:
int((a+I*a*tan(f*x+e))^3*(c+d*tan(f*x+e)),x)
Output:
(a**3*(12*log(tan(e + f*x)**2 + 1)*c*i + 12*log(tan(e + f*x)**2 + 1)*d - 2 *tan(e + f*x)**3*d*i - 3*tan(e + f*x)**2*c*i - 9*tan(e + f*x)**2*d - 18*ta n(e + f*x)*c + 24*tan(e + f*x)*d*i + 24*c*f*x - 24*d*f*i*x))/(6*f)