Integrand size = 28, antiderivative size = 202 \[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=\frac {\left (c^3+3 i c^2 d+3 c d^2-3 i d^3\right ) x}{2 a (c-i d)^2 (c+i d)^3}+\frac {(3 c-i d) d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{a (i c-d)^3 (c-i d)^2 f}+\frac {(c-3 i d) d}{2 a (c-i d) (c+i d)^2 f (c+d \tan (e+f x))}-\frac {1}{2 (i c-d) f (a+i a \tan (e+f x)) (c+d \tan (e+f x))} \] Output:
1/2*(c^3+3*I*c^2*d+3*c*d^2-3*I*d^3)*x/a/(c-I*d)^2/(c+I*d)^3+(3*c-I*d)*d^2* ln(c*cos(f*x+e)+d*sin(f*x+e))/a/(I*c-d)^3/(c-I*d)^2/f+1/2*(c-3*I*d)*d/a/(c -I*d)/(c+I*d)^2/f/(c+d*tan(f*x+e))-1/2/(I*c-d)/f/(a+I*a*tan(f*x+e))/(c+d*t an(f*x+e))
Time = 3.46 (sec) , antiderivative size = 223, normalized size of antiderivative = 1.10 \[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=\frac {\frac {2 \log (i-\tan (e+f x))}{i c-d}-\frac {2 \log (i+\tan (e+f x))}{i c+d}+\frac {4 d \log (c+d \tan (e+f x))}{c^2+d^2}+\frac {2}{(-i+\tan (e+f x)) (c+d \tan (e+f x))}+(c-3 i d) \left (\frac {i \log (i-\tan (e+f x))}{(c+i d)^2}-\frac {i \log (i+\tan (e+f x))}{(c-i d)^2}+\frac {2 d \left (-2 c \log (c+d \tan (e+f x))+\frac {c^2+d^2}{c+d \tan (e+f x)}\right )}{\left (c^2+d^2\right )^2}\right )}{4 a (c+i d) f} \] Input:
Integrate[1/((a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])^2),x]
Output:
((2*Log[I - Tan[e + f*x]])/(I*c - d) - (2*Log[I + Tan[e + f*x]])/(I*c + d) + (4*d*Log[c + d*Tan[e + f*x]])/(c^2 + d^2) + 2/((-I + Tan[e + f*x])*(c + d*Tan[e + f*x])) + (c - (3*I)*d)*((I*Log[I - Tan[e + f*x]])/(c + I*d)^2 - (I*Log[I + Tan[e + f*x]])/(c - I*d)^2 + (2*d*(-2*c*Log[c + d*Tan[e + f*x] ] + (c^2 + d^2)/(c + d*Tan[e + f*x])))/(c^2 + d^2)^2))/(4*a*(c + I*d)*f)
Time = 0.86 (sec) , antiderivative size = 198, normalized size of antiderivative = 0.98, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.321, Rules used = {3042, 4035, 3042, 4012, 25, 3042, 4014, 3042, 4013}
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 {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2}dx\) |
\(\Big \downarrow \) 4035 |
\(\displaystyle \frac {\int \frac {a (i c-3 d)+2 i a d \tan (e+f x)}{(c+d \tan (e+f x))^2}dx}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (i c-3 d)+2 i a d \tan (e+f x)}{(c+d \tan (e+f x))^2}dx}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
\(\Big \downarrow \) 4012 |
\(\displaystyle \frac {\frac {\int -\frac {a \left (3 c d-i \left (c^2+2 d^2\right )\right )-a d (i c+3 d) \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}+\frac {a d (3 d+i c)}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\frac {a d (3 d+i c)}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}-\frac {\int \frac {a \left (3 c d-i \left (c^2+2 d^2\right )\right )-a d (i c+3 d) \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a d (3 d+i c)}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}-\frac {\int \frac {a \left (3 c d-i \left (c^2+2 d^2\right )\right )-a d (i c+3 d) \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle \frac {\frac {a d (3 d+i c)}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}-\frac {\frac {2 a d^2 (3 c-i d) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}-\frac {a x \left (i c^3-3 c^2 d+3 i c d^2+3 d^3\right )}{c^2+d^2}}{c^2+d^2}}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a d (3 d+i c)}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}-\frac {\frac {2 a d^2 (3 c-i d) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{c^2+d^2}-\frac {a x \left (i c^3-3 c^2 d+3 i c d^2+3 d^3\right )}{c^2+d^2}}{c^2+d^2}}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle \frac {\frac {a d (3 d+i c)}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}-\frac {\frac {2 a d^2 (3 c-i d) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )}-\frac {a x \left (i c^3-3 c^2 d+3 i c d^2+3 d^3\right )}{c^2+d^2}}{c^2+d^2}}{2 a^2 (-d+i c)}-\frac {1}{2 f (-d+i c) (a+i a \tan (e+f x)) (c+d \tan (e+f x))}\) |
Input:
Int[1/((a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])^2),x]
Output:
-1/2*1/((I*c - d)*f*(a + I*a*Tan[e + f*x])*(c + d*Tan[e + f*x])) + (-((-(( a*(I*c^3 - 3*c^2*d + (3*I)*c*d^2 + 3*d^3)*x)/(c^2 + d^2)) + (2*a*(3*c - I* d)*d^2*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((c^2 + d^2)*f))/(c^2 + d^2)) + (a*d*(I*c + 3*d))/((c^2 + d^2)*f*(c + d*Tan[e + f*x])))/(2*a^2*(I*c - d ))
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 + 1)/ (f*(m + 1)*(a^2 + b^2))), x] + Simp[1/(a^2 + b^2) Int[(a + b*Tan[e + f*x] )^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a , b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1 ]
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* (x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si n[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] && EqQ[a*c + b*d, 0]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a *d)/(a^2 + b^2) Int[(b - a*Tan[e + f*x])/(a + b*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] && N eQ[a*c + b*d, 0]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-a)*((c + d*Tan[e + f*x])^(n + 1)/(2*f*(b* c - a*d)*(a + b*Tan[e + f*x]))), x] + Simp[1/(2*a*(b*c - a*d)) Int[(c + d *Tan[e + f*x])^n*Simp[b*c + a*d*(n - 1) - b*d*n*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && !GtQ[n, 0]
Time = 0.38 (sec) , antiderivative size = 358, normalized size of antiderivative = 1.77
method | result | size |
derivativedivides | \(-\frac {i d^{2} c^{2}}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3} \left (c +d \tan \left (f x +e \right )\right )}-\frac {i d^{4}}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3} \left (c +d \tan \left (f x +e \right )\right )}+\frac {3 i d^{2} \ln \left (c +d \tan \left (f x +e \right )\right ) c}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3}}+\frac {d^{3} \ln \left (c +d \tan \left (f x +e \right )\right )}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3}}+\frac {1}{2 f a \left (i d +c \right )^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) c}{8 f a \left (i d +c \right )^{3}}+\frac {5 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) d}{8 f a \left (i d +c \right )^{3}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c}{4 f a \left (i d +c \right )^{3}}+\frac {5 i \arctan \left (\tan \left (f x +e \right )\right ) d}{4 f a \left (i d +c \right )^{3}}+\frac {i \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{8 f a \left (i d -c \right )^{2}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{4 f a \left (i d -c \right )^{2}}\) | \(358\) |
default | \(-\frac {i d^{2} c^{2}}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3} \left (c +d \tan \left (f x +e \right )\right )}-\frac {i d^{4}}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3} \left (c +d \tan \left (f x +e \right )\right )}+\frac {3 i d^{2} \ln \left (c +d \tan \left (f x +e \right )\right ) c}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3}}+\frac {d^{3} \ln \left (c +d \tan \left (f x +e \right )\right )}{f a \left (i d -c \right )^{2} \left (i d +c \right )^{3}}+\frac {1}{2 f a \left (i d +c \right )^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {i \ln \left (1+\tan \left (f x +e \right )^{2}\right ) c}{8 f a \left (i d +c \right )^{3}}+\frac {5 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) d}{8 f a \left (i d +c \right )^{3}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c}{4 f a \left (i d +c \right )^{3}}+\frac {5 i \arctan \left (\tan \left (f x +e \right )\right ) d}{4 f a \left (i d +c \right )^{3}}+\frac {i \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{8 f a \left (i d -c \right )^{2}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{4 f a \left (i d -c \right )^{2}}\) | \(358\) |
norman | \(\frac {\frac {1}{2 a f \left (-i c +d \right )}+\frac {c \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {c \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x \tan \left (f x +e \right )^{2}}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {d \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x \tan \left (f x +e \right )}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {d \left (3 i c^{2} d -3 i d^{3}+c^{3}+3 c \,d^{2}\right ) x \tan \left (f x +e \right )^{3}}{2 \left (-i d +c \right )^{2} \left (i d +c \right )^{3} a}+\frac {\left (3 i d^{3}+c^{3}\right ) \tan \left (f x +e \right )}{2 a f \left (-i d +c \right ) \left (i d +c \right )^{2} c}+\frac {d \left (i c d +3 d^{2}\right ) \tan \left (f x +e \right )^{3}}{2 a \left (i c +d \right ) \left (-i c +d \right )^{2} f c}}{\left (c +d \tan \left (f x +e \right )\right ) \left (1+\tan \left (f x +e \right )^{2}\right )}+\frac {i d^{2} \left (3 i c +d \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 a f \left (-i c^{5}-2 i c^{3} d^{2}-i c \,d^{4}+c^{4} d +2 c^{2} d^{3}+d^{5}\right )}-\frac {i d^{2} \left (3 i c +d \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{a f \left (-i c^{5}-2 i c^{3} d^{2}-i c \,d^{4}+c^{4} d +2 c^{2} d^{3}+d^{5}\right )}\) | \(480\) |
risch | \(-\frac {x}{2 a \left (2 i c d -c^{2}+d^{2}\right )}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )}}{4 a \left (2 i c d +c^{2}-d^{2}\right ) f}+\frac {6 d^{2} c x}{a \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}+\frac {6 d^{2} c e}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}-\frac {2 i d^{3} x}{a \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}-\frac {2 i d^{3} e}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}-\frac {2 i d^{3}}{\left (-i c +d \right )^{2} f a \left (i c +d \right )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )} d -d +i {\mathrm e}^{2 i \left (f x +e \right )} c +i c \right )}+\frac {3 i d^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) c}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}+\frac {d^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right )}{a f \left (i c^{4} d +2 i c^{2} d^{3}+i d^{5}+c^{5}+2 c^{3} d^{2}+c \,d^{4}\right )}\) | \(493\) |
Input:
int(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^2,x,method=_RETURNVERBOSE)
Output:
-I/f/a*d^2/(I*d-c)^2/(c+I*d)^3/(c+d*tan(f*x+e))*c^2-I/f/a*d^4/(I*d-c)^2/(c +I*d)^3/(c+d*tan(f*x+e))+3*I/f/a*d^2/(I*d-c)^2/(c+I*d)^3*ln(c+d*tan(f*x+e) )*c+1/f/a*d^3/(I*d-c)^2/(c+I*d)^3*ln(c+d*tan(f*x+e))+1/2/f/a/(c+I*d)^2/(-I +tan(f*x+e))-1/8*I/f/a/(c+I*d)^3*ln(1+tan(f*x+e)^2)*c+5/8/f/a/(c+I*d)^3*ln (1+tan(f*x+e)^2)*d+1/4/f/a/(c+I*d)^3*arctan(tan(f*x+e))*c+5/4*I/f/a/(c+I*d )^3*arctan(tan(f*x+e))*d+1/8*I/f/a/(I*d-c)^2*ln(1+tan(f*x+e)^2)+1/4/f/a/(I *d-c)^2*arctan(tan(f*x+e))
Time = 0.09 (sec) , antiderivative size = 329, normalized size of antiderivative = 1.63 \[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=\frac {i \, c^{4} + 2 i \, c^{2} d^{2} + i \, d^{4} + 2 \, {\left (c^{4} + 2 i \, c^{3} d + 12 \, c^{2} d^{2} - 14 i \, c d^{3} - 5 \, d^{4}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (i \, c^{4} + 2 \, c^{3} d - 6 \, c d^{3} - 9 i \, d^{4} + 2 \, {\left (c^{4} + 4 i \, c^{3} d + 6 \, c^{2} d^{2} + 4 i \, c d^{3} + 5 \, d^{4}\right )} f x\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 4 \, {\left ({\left (-3 i \, c^{2} d^{2} - 4 \, c d^{3} + i \, d^{4}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-3 i \, c^{2} d^{2} + 2 \, c d^{3} - i \, d^{4}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{4 \, {\left ({\left (a c^{6} + 3 \, a c^{4} d^{2} + 3 \, a c^{2} d^{4} + a d^{6}\right )} f e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (a c^{6} + 2 i \, a c^{5} d + a c^{4} d^{2} + 4 i \, a c^{3} d^{3} - a c^{2} d^{4} + 2 i \, a c d^{5} - a d^{6}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \] Input:
integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^2,x, algorithm="fricas")
Output:
1/4*(I*c^4 + 2*I*c^2*d^2 + I*d^4 + 2*(c^4 + 2*I*c^3*d + 12*c^2*d^2 - 14*I* c*d^3 - 5*d^4)*f*x*e^(4*I*f*x + 4*I*e) + (I*c^4 + 2*c^3*d - 6*c*d^3 - 9*I* d^4 + 2*(c^4 + 4*I*c^3*d + 6*c^2*d^2 + 4*I*c*d^3 + 5*d^4)*f*x)*e^(2*I*f*x + 2*I*e) - 4*((-3*I*c^2*d^2 - 4*c*d^3 + I*d^4)*e^(4*I*f*x + 4*I*e) + (-3*I *c^2*d^2 + 2*c*d^3 - I*d^4)*e^(2*I*f*x + 2*I*e))*log(((I*c + d)*e^(2*I*f*x + 2*I*e) + I*c - d)/(I*c + d)))/((a*c^6 + 3*a*c^4*d^2 + 3*a*c^2*d^4 + a*d ^6)*f*e^(4*I*f*x + 4*I*e) + (a*c^6 + 2*I*a*c^5*d + a*c^4*d^2 + 4*I*a*c^3*d ^3 - a*c^2*d^4 + 2*I*a*c*d^5 - a*d^6)*f*e^(2*I*f*x + 2*I*e))
Time = 13.78 (sec) , antiderivative size = 510, normalized size of antiderivative = 2.52 \[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=- \frac {2 d^{3}}{a c^{5} f + i a c^{4} d f + 2 a c^{3} d^{2} f + 2 i a c^{2} d^{3} f + a c d^{4} f + i a d^{5} f + \left (a c^{5} f e^{2 i e} - i a c^{4} d f e^{2 i e} + 2 a c^{3} d^{2} f e^{2 i e} - 2 i a c^{2} d^{3} f e^{2 i e} + a c d^{4} f e^{2 i e} - i a d^{5} f e^{2 i e}\right ) e^{2 i f x}} + \frac {x \left (c + 5 i d\right )}{2 a c^{3} + 6 i a c^{2} d - 6 a c d^{2} - 2 i a d^{3}} + \begin {cases} \frac {i e^{- 2 i f x}}{4 a c^{2} f e^{2 i e} + 8 i a c d f e^{2 i e} - 4 a d^{2} f e^{2 i e}} & \text {for}\: 4 a c^{2} f e^{2 i e} + 8 i a c d f e^{2 i e} - 4 a d^{2} f e^{2 i e} \neq 0 \\x \left (- \frac {c + 5 i d}{2 a c^{3} + 6 i a c^{2} d - 6 a c d^{2} - 2 i a d^{3}} + \frac {c e^{2 i e} + c + 5 i d e^{2 i e} + i d}{2 a c^{3} e^{2 i e} + 6 i a c^{2} d e^{2 i e} - 6 a c d^{2} e^{2 i e} - 2 i a d^{3} e^{2 i e}}\right ) & \text {otherwise} \end {cases} + \frac {i d^{2} \cdot \left (3 c - i d\right ) \log {\left (\frac {c + i d}{c e^{2 i e} - i d e^{2 i e}} + e^{2 i f x} \right )}}{a f \left (c - i d\right )^{2} \left (c + i d\right )^{3}} \] Input:
integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))**2,x)
Output:
-2*d**3/(a*c**5*f + I*a*c**4*d*f + 2*a*c**3*d**2*f + 2*I*a*c**2*d**3*f + a *c*d**4*f + I*a*d**5*f + (a*c**5*f*exp(2*I*e) - I*a*c**4*d*f*exp(2*I*e) + 2*a*c**3*d**2*f*exp(2*I*e) - 2*I*a*c**2*d**3*f*exp(2*I*e) + a*c*d**4*f*exp (2*I*e) - I*a*d**5*f*exp(2*I*e))*exp(2*I*f*x)) + x*(c + 5*I*d)/(2*a*c**3 + 6*I*a*c**2*d - 6*a*c*d**2 - 2*I*a*d**3) + Piecewise((I*exp(-2*I*f*x)/(4*a *c**2*f*exp(2*I*e) + 8*I*a*c*d*f*exp(2*I*e) - 4*a*d**2*f*exp(2*I*e)), Ne(4 *a*c**2*f*exp(2*I*e) + 8*I*a*c*d*f*exp(2*I*e) - 4*a*d**2*f*exp(2*I*e), 0)) , (x*(-(c + 5*I*d)/(2*a*c**3 + 6*I*a*c**2*d - 6*a*c*d**2 - 2*I*a*d**3) + ( c*exp(2*I*e) + c + 5*I*d*exp(2*I*e) + I*d)/(2*a*c**3*exp(2*I*e) + 6*I*a*c* *2*d*exp(2*I*e) - 6*a*c*d**2*exp(2*I*e) - 2*I*a*d**3*exp(2*I*e))), True)) + I*d**2*(3*c - I*d)*log((c + I*d)/(c*exp(2*I*e) - I*d*exp(2*I*e)) + exp(2 *I*f*x))/(a*f*(c - I*d)**2*(c + I*d)**3)
Exception generated. \[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^2,x, algorithm="maxima")
Output:
Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati ve exponent.
Time = 0.54 (sec) , antiderivative size = 249, normalized size of antiderivative = 1.23 \[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=-\frac {i \, {\left (c + 5 i \, d\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{4 \, {\left (a c^{3} f + 3 i \, a c^{2} d f - 3 \, a c d^{2} f - i \, a d^{3} f\right )}} + \frac {i \, {\left (3 \, c d^{3} - i \, d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{a c^{5} d f + i \, a c^{4} d^{2} f + 2 \, a c^{3} d^{3} f + 2 i \, a c^{2} d^{4} f + a c d^{5} f + i \, a d^{6} f} + \frac {i \, \log \left (\tan \left (f x + e\right ) + i\right )}{4 \, {\left (a c^{2} f - 2 i \, a c d f - a d^{2} f\right )}} + \frac {i \, {\left (-i \, c^{3} - 2 \, c^{2} d + 3 i \, c d^{2} + 2 \, d^{3} + {\left (-i \, c^{2} d - 4 \, c d^{2} + 3 i \, d^{3}\right )} \tan \left (f x + e\right )\right )}}{2 \, {\left (c^{2} + d^{2}\right )}^{2} {\left (d \tan \left (f x + e\right ) + c\right )} a f {\left (\tan \left (f x + e\right ) - i\right )}} \] Input:
integrate(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^2,x, algorithm="giac")
Output:
-1/4*I*(c + 5*I*d)*log(tan(f*x + e) - I)/(a*c^3*f + 3*I*a*c^2*d*f - 3*a*c* d^2*f - I*a*d^3*f) + I*(3*c*d^3 - I*d^4)*log(abs(d*tan(f*x + e) + c))/(a*c ^5*d*f + I*a*c^4*d^2*f + 2*a*c^3*d^3*f + 2*I*a*c^2*d^4*f + a*c*d^5*f + I*a *d^6*f) + 1/4*I*log(tan(f*x + e) + I)/(a*c^2*f - 2*I*a*c*d*f - a*d^2*f) + 1/2*I*(-I*c^3 - 2*c^2*d + 3*I*c*d^2 + 2*d^3 + (-I*c^2*d - 4*c*d^2 + 3*I*d^ 3)*tan(f*x + e))/((c^2 + d^2)^2*(d*tan(f*x + e) + c)*a*f*(tan(f*x + e) - I ))
Time = 6.09 (sec) , antiderivative size = 1334, normalized size of antiderivative = 6.60 \[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=\text {Too large to display} \] Input:
int(1/((a + a*tan(e + f*x)*1i)*(c + d*tan(e + f*x))^2),x)
Output:
symsum(log(tan(e + f*x)*(a*d^4 - a*c^2*d^2 + a*c*d^3*2i)*(c*d^3*6i + 9*d^4 - c^2*d^2) - (a*d^4 - a*c^2*d^2 + a*c*d^3*2i)*(11*c*d^3 + c^3*d - d^4*6i) - root(a^3*c^5*d^5*e^3*192i + a^3*c^7*d^3*e^3*128i + a^3*c^3*d^7*e^3*128i + 48*a^3*c^8*d^2*e^3 - 48*a^3*c^2*d^8*e^3 + 32*a^3*c^6*d^4*e^3 - 32*a^3*c ^4*d^6*e^3 + a^3*c^9*d*e^3*32i + a^3*c*d^9*e^3*32i - 16*a^3*d^10*e^3 + 16* a^3*c^10*e^3 + 135*a*c^2*d^4*e + a*c^3*d^3*e*12i - 3*a*c^4*d^2*e - a*c*d^5 *e*90i + a*c^5*d*e*6i - 21*a*d^6*e + a*c^6*e - c^2*d^2*3i + 14*c*d^3 - d^4 *5i, e, k)*((a*d^4 - a*c^2*d^2 + a*c*d^3*2i)*(2*a*c^6 - 6*a*d^6 - 10*a*c^2 *d^4 + a*c^3*d^3*16i - 2*a*c^4*d^2 + a*c*d^5*8i + a*c^5*d*8i) + root(a^3*c ^5*d^5*e^3*192i + a^3*c^7*d^3*e^3*128i + a^3*c^3*d^7*e^3*128i + 48*a^3*c^8 *d^2*e^3 - 48*a^3*c^2*d^8*e^3 + 32*a^3*c^6*d^4*e^3 - 32*a^3*c^4*d^6*e^3 + a^3*c^9*d*e^3*32i + a^3*c*d^9*e^3*32i - 16*a^3*d^10*e^3 + 16*a^3*c^10*e^3 + 135*a*c^2*d^4*e + a*c^3*d^3*e*12i - 3*a*c^4*d^2*e - a*c*d^5*e*90i + a*c^ 5*d*e*6i - 21*a*d^6*e + a*c^6*e - c^2*d^2*3i + 14*c*d^3 - d^4*5i, e, k)*(( a*d^4 - a*c^2*d^2 + a*c*d^3*2i)*(32*a^2*c^7*d - 32*a^2*c*d^7 + a^2*c^2*d^6 *64i - 32*a^2*c^3*d^5 + a^2*c^4*d^4*128i + 32*a^2*c^5*d^3 + a^2*c^6*d^2*64 i) + tan(e + f*x)*(a*d^4 - a*c^2*d^2 + a*c*d^3*2i)*(a^2*c*d^7*48i - 24*a^2 *d^8 - 8*a^2*c^8 - a^2*c^7*d*16i - 16*a^2*c^2*d^6 + a^2*c^3*d^5*80i + 32*a ^2*c^4*d^4 + a^2*c^5*d^3*16i + 16*a^2*c^6*d^2)) + tan(e + f*x)*(a*d^4 - a* c^2*d^2 + a*c*d^3*2i)*(a*d^6*12i + a*c^2*d^4*40i - 8*a*c^3*d^3 + a*c^4*...
\[ \int \frac {1}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^2} \, dx=\frac {\int \frac {1}{\tan \left (f x +e \right )^{3} d^{2} i +2 \tan \left (f x +e \right )^{2} c d i +\tan \left (f x +e \right )^{2} d^{2}+\tan \left (f x +e \right ) c^{2} i +2 \tan \left (f x +e \right ) c d +c^{2}}d x}{a} \] Input:
int(1/(a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^2,x)
Output:
int(1/(tan(e + f*x)**3*d**2*i + 2*tan(e + f*x)**2*c*d*i + tan(e + f*x)**2* d**2 + tan(e + f*x)*c**2*i + 2*tan(e + f*x)*c*d + c**2),x)/a