Integrand size = 36, antiderivative size = 104 \[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=\frac {(A-i B) (c-i d) x}{4 a^2}+\frac {B (c+3 i d)+A (i c+d)}{4 a^2 f (1+i \tan (e+f x))}+\frac {(i A-B) (c+i d)}{4 f (a+i a \tan (e+f x))^2} \] Output:
1/4*(A-I*B)*(c-I*d)*x/a^2+1/4*(B*(c+3*I*d)+A*(I*c+d))/a^2/f/(1+I*tan(f*x+e ))+1/4*(I*A-B)*(c+I*d)/f/(a+I*a*tan(f*x+e))^2
Time = 1.27 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.89 \[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=\frac {(A-i B) (c-i d) \arctan (\tan (e+f x))+\frac {(A+i B) (-i c+d)}{(-i+\tan (e+f x))^2}+\frac {A c-i B c-i A d+3 B d}{-i+\tan (e+f x)}}{4 a^2 f} \] Input:
Integrate[((A + B*Tan[e + f*x])*(c + d*Tan[e + f*x]))/(a + I*a*Tan[e + f*x ])^2,x]
Output:
((A - I*B)*(c - I*d)*ArcTan[Tan[e + f*x]] + ((A + I*B)*((-I)*c + d))/(-I + Tan[e + f*x])^2 + (A*c - I*B*c - I*A*d + 3*B*d)/(-I + Tan[e + f*x]))/(4*a ^2*f)
Time = 0.80 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.05, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.139, Rules used = {3042, 4073, 3042, 4009, 24}
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 {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2}dx\) |
\(\Big \downarrow \) 4073 |
\(\displaystyle \frac {(-B+i A) (c+i d)}{4 f (a+i a \tan (e+f x))^2}-\frac {i \int \frac {a (B (c+i d)+A (i c+d))+2 a B d \tan (e+f x)}{i \tan (e+f x) a+a}dx}{2 a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(-B+i A) (c+i d)}{4 f (a+i a \tan (e+f x))^2}-\frac {i \int \frac {a (B (c+i d)+A (i c+d))+2 a B d \tan (e+f x)}{i \tan (e+f x) a+a}dx}{2 a^2}\) |
\(\Big \downarrow \) 4009 |
\(\displaystyle \frac {(-B+i A) (c+i d)}{4 f (a+i a \tan (e+f x))^2}-\frac {i \left (\frac {1}{2} (B+i A) (c-i d) \int 1dx-\frac {A c-i A d-i B c+3 B d}{2 f (1+i \tan (e+f x))}\right )}{2 a^2}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {(-B+i A) (c+i d)}{4 f (a+i a \tan (e+f x))^2}-\frac {i \left (\frac {1}{2} x (B+i A) (c-i d)-\frac {A c-i A d-i B c+3 B d}{2 f (1+i \tan (e+f x))}\right )}{2 a^2}\) |
Input:
Int[((A + B*Tan[e + f*x])*(c + d*Tan[e + f*x]))/(a + I*a*Tan[e + f*x])^2,x ]
Output:
((-1/2*I)*(((I*A + B)*(c - I*d)*x)/2 - (A*c - I*B*c - I*A*d + 3*B*d)/(2*f* (1 + I*Tan[e + f*x]))))/a^2 + ((I*A - B)*(c + I*d))/(4*f*(a + I*a*Tan[e + f*x])^2)
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(b*c - a*d))*((a + b*Tan[e + f*x])^m/(2*a *f*m)), x] + Simp[(b*c + a*d)/(2*a*b) Int[(a + b*Tan[e + f*x])^(m + 1), x ], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2 , 0] && LtQ[m, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-( A*b - a*B))*(a*c + b*d)*((a + b*Tan[e + f*x])^m/(2*a^2*f*m)), x] + Simp[1/( 2*a*b) Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[A*b*c + a*B*c + a*A*d + b*B* d + 2*a*B*d*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && LtQ[m, -1] && EqQ[a^2 + b^2, 0]
Time = 0.42 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.48
method | result | size |
risch | \(-\frac {i x A d}{4 a^{2}}-\frac {i x B c}{4 a^{2}}+\frac {x c A}{4 a^{2}}-\frac {x B d}{4 a^{2}}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} c A}{4 f \,a^{2}}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} B d}{4 f \,a^{2}}-\frac {{\mathrm e}^{-4 i \left (f x +e \right )} A d}{16 f \,a^{2}}-\frac {{\mathrm e}^{-4 i \left (f x +e \right )} B c}{16 f \,a^{2}}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} c A}{16 f \,a^{2}}-\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} B d}{16 f \,a^{2}}\) | \(154\) |
derivativedivides | \(-\frac {i A d \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}+\frac {A c \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}-\frac {i A c}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {B d \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}-\frac {i B c \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}-\frac {i B c}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {A d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {B c}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {i B d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {i A d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {c A}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {3 B d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}\) | \(244\) |
default | \(-\frac {i A d \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}+\frac {A c \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}-\frac {i A c}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {B d \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}-\frac {i B c \arctan \left (\tan \left (f x +e \right )\right )}{4 f \,a^{2}}-\frac {i B c}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {A d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {B c}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {i B d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {i A d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {c A}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {3 B d}{4 f \,a^{2} \left (-i+\tan \left (f x +e \right )\right )}\) | \(244\) |
Input:
int((A+B*tan(f*x+e))*(c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x,method=_RETUR NVERBOSE)
Output:
-1/4*I*x/a^2*A*d-1/4*I*x/a^2*B*c+1/4*x/a^2*c*A-1/4*x/a^2*B*d+1/4*I/f/a^2*e xp(-2*I*(f*x+e))*c*A+1/4*I/f/a^2*exp(-2*I*(f*x+e))*B*d-1/16/f/a^2*exp(-4*I *(f*x+e))*A*d-1/16/f/a^2*exp(-4*I*(f*x+e))*B*c+1/16*I/f/a^2*exp(-4*I*(f*x+ e))*c*A-1/16*I/f/a^2*exp(-4*I*(f*x+e))*B*d
Time = 0.09 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.81 \[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=\frac {{\left (4 \, {\left ({\left (A - i \, B\right )} c - {\left (i \, A + B\right )} d\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (i \, A - B\right )} c - {\left (A + i \, B\right )} d - 4 \, {\left (-i \, A c - i \, B d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{16 \, a^{2} f} \] Input:
integrate((A+B*tan(f*x+e))*(c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x, algori thm="fricas")
Output:
1/16*(4*((A - I*B)*c - (I*A + B)*d)*f*x*e^(4*I*f*x + 4*I*e) + (I*A - B)*c - (A + I*B)*d - 4*(-I*A*c - I*B*d)*e^(2*I*f*x + 2*I*e))*e^(-4*I*f*x - 4*I* e)/(a^2*f)
Time = 0.32 (sec) , antiderivative size = 296, normalized size of antiderivative = 2.85 \[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=\begin {cases} \frac {\left (\left (16 i A a^{2} c f e^{4 i e} + 16 i B a^{2} d f e^{4 i e}\right ) e^{- 2 i f x} + \left (4 i A a^{2} c f e^{2 i e} - 4 A a^{2} d f e^{2 i e} - 4 B a^{2} c f e^{2 i e} - 4 i B a^{2} d f e^{2 i e}\right ) e^{- 4 i f x}\right ) e^{- 6 i e}}{64 a^{4} f^{2}} & \text {for}\: a^{4} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac {A c - i A d - i B c - B d}{4 a^{2}} + \frac {\left (A c e^{4 i e} + 2 A c e^{2 i e} + A c - i A d e^{4 i e} + i A d - i B c e^{4 i e} + i B c - B d e^{4 i e} + 2 B d e^{2 i e} - B d\right ) e^{- 4 i e}}{4 a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (A c - i A d - i B c - B d\right )}{4 a^{2}} \] Input:
integrate((A+B*tan(f*x+e))*(c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))**2,x)
Output:
Piecewise((((16*I*A*a**2*c*f*exp(4*I*e) + 16*I*B*a**2*d*f*exp(4*I*e))*exp( -2*I*f*x) + (4*I*A*a**2*c*f*exp(2*I*e) - 4*A*a**2*d*f*exp(2*I*e) - 4*B*a** 2*c*f*exp(2*I*e) - 4*I*B*a**2*d*f*exp(2*I*e))*exp(-4*I*f*x))*exp(-6*I*e)/( 64*a**4*f**2), Ne(a**4*f**2*exp(6*I*e), 0)), (x*(-(A*c - I*A*d - I*B*c - B *d)/(4*a**2) + (A*c*exp(4*I*e) + 2*A*c*exp(2*I*e) + A*c - I*A*d*exp(4*I*e) + I*A*d - I*B*c*exp(4*I*e) + I*B*c - B*d*exp(4*I*e) + 2*B*d*exp(2*I*e) - B*d)*exp(-4*I*e)/(4*a**2)), True)) + x*(A*c - I*A*d - I*B*c - B*d)/(4*a**2 )
Exception generated. \[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate((A+B*tan(f*x+e))*(c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x, algori thm="maxima")
Output:
Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati ve exponent.
Time = 0.49 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.12 \[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=-\frac {{\left (-i \, A c - B c - A d + i \, B d\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{8 \, a^{2} f} - \frac {{\left (i \, A c + B c + A d - i \, B d\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{8 \, a^{2} f} - \frac {2 i \, A c + 2 i \, B d + i \, {\left (i \, A c + B c + A d + 3 i \, B d\right )} \tan \left (f x + e\right )}{4 \, a^{2} f {\left (\tan \left (f x + e\right ) - i\right )}^{2}} \] Input:
integrate((A+B*tan(f*x+e))*(c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x, algori thm="giac")
Output:
-1/8*(-I*A*c - B*c - A*d + I*B*d)*log(tan(f*x + e) + I)/(a^2*f) - 1/8*(I*A *c + B*c + A*d - I*B*d)*log(tan(f*x + e) - I)/(a^2*f) - 1/4*(2*I*A*c + 2*I *B*d + I*(I*A*c + B*c + A*d + 3*I*B*d)*tan(f*x + e))/(a^2*f*(tan(f*x + e) - I)^2)
Time = 5.89 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.53 \[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=-\frac {B\,d\,f\,x-A\,c\,f\,x+A\,d\,f\,x\,1{}\mathrm {i}+B\,c\,f\,x\,1{}\mathrm {i}}{4\,a^2\,f}+\frac {\left (A\,c+3\,B\,d-A\,d\,1{}\mathrm {i}-B\,c\,1{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (2\,A\,d+2\,B\,c+B\,d\,4{}\mathrm {i}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^2+\left (3\,A\,c+B\,d+A\,d\,1{}\mathrm {i}+B\,c\,1{}\mathrm {i}\right )\,\mathrm {tan}\left (e+f\,x\right )+A\,c\,2{}\mathrm {i}+B\,d\,2{}\mathrm {i}}{f\,\left (4\,a^2\,{\mathrm {tan}\left (e+f\,x\right )}^4+8\,a^2\,{\mathrm {tan}\left (e+f\,x\right )}^2+4\,a^2\right )} \] Input:
int(((A + B*tan(e + f*x))*(c + d*tan(e + f*x)))/(a + a*tan(e + f*x)*1i)^2, x)
Output:
(A*c*2i + B*d*2i + tan(e + f*x)*(3*A*c + A*d*1i + B*c*1i + B*d) + tan(e + f*x)^2*(2*A*d + 2*B*c + B*d*4i) + tan(e + f*x)^3*(A*c - A*d*1i - B*c*1i + 3*B*d))/(f*(4*a^2 + 8*a^2*tan(e + f*x)^2 + 4*a^2*tan(e + f*x)^4)) - (A*d*f *x*1i - A*c*f*x + B*c*f*x*1i + B*d*f*x)/(4*a^2*f)
\[ \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^2} \, dx=\frac {-\left (\int \frac {\tan \left (f x +e \right )^{2}}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) b d -\left (\int \frac {\tan \left (f x +e \right )}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) a d -\left (\int \frac {\tan \left (f x +e \right )}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) b c -\left (\int \frac {1}{\tan \left (f x +e \right )^{2}-2 \tan \left (f x +e \right ) i -1}d x \right ) a c}{a^{2}} \] Input:
int((A+B*tan(f*x+e))*(c+d*tan(f*x+e))/(a+I*a*tan(f*x+e))^2,x)
Output:
( - (int(tan(e + f*x)**2/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*b*d + int(tan(e + f*x)/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*a*d + int(ta n(e + f*x)/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*b*c + int(1/(tan(e + f*x)**2 - 2*tan(e + f*x)*i - 1),x)*a*c))/a**2