Integrand size = 25, antiderivative size = 118 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=\frac {(a c-b d) x}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}+\frac {b^2 \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right ) (b c-a d) f}-\frac {d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{(b c-a d) \left (c^2+d^2\right ) f} \] Output:
(a*c-b*d)*x/(a^2+b^2)/(c^2+d^2)+b^2*ln(a*cos(f*x+e)+b*sin(f*x+e))/(a^2+b^2 )/(-a*d+b*c)/f-d^2*ln(c*cos(f*x+e)+d*sin(f*x+e))/(-a*d+b*c)/(c^2+d^2)/f
Result contains complex when optimal does not.
Time = 0.29 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.21 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=\frac {\frac {\log (i-\tan (e+f x))}{(a+i b) (i c-d)}-\frac {\log (i+\tan (e+f x))}{(i a+b) (c-i d)}+\frac {2 b^2 \log (a+b \tan (e+f x))}{\left (a^2+b^2\right ) (b c-a d)}+\frac {2 d^2 \log (c+d \tan (e+f x))}{(-b c+a d) \left (c^2+d^2\right )}}{2 f} \] Input:
Integrate[1/((a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])),x]
Output:
(Log[I - Tan[e + f*x]]/((a + I*b)*(I*c - d)) - Log[I + Tan[e + f*x]]/((I*a + b)*(c - I*d)) + (2*b^2*Log[a + b*Tan[e + f*x]])/((a^2 + b^2)*(b*c - a*d )) + (2*d^2*Log[c + d*Tan[e + f*x]])/((-(b*c) + a*d)*(c^2 + d^2)))/(2*f)
Time = 0.47 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3042, 4054, 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+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))}dx\) |
\(\Big \downarrow \) 4054 |
\(\displaystyle \frac {b^2 \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {d^2 \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{\left (c^2+d^2\right ) (b c-a d)}+\frac {x (a c-b d)}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {b^2 \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {d^2 \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{\left (c^2+d^2\right ) (b c-a d)}+\frac {x (a c-b d)}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle \frac {x (a c-b d)}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}+\frac {b^2 \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right ) (b c-a d)}-\frac {d^2 \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right ) (b c-a d)}\) |
Input:
Int[1/((a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])),x]
Output:
((a*c - b*d)*x)/((a^2 + b^2)*(c^2 + d^2)) + (b^2*Log[a*Cos[e + f*x] + b*Si n[e + f*x]])/((a^2 + b^2)*(b*c - a*d)*f) - (d^2*Log[c*Cos[e + f*x] + d*Sin [e + f*x]])/((b*c - a*d)*(c^2 + d^2)*f)
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[1/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f _.)*(x_)])), x_Symbol] :> Simp[(a*c - b*d)*(x/((a^2 + b^2)*(c^2 + d^2))), x ] + (Simp[b^2/((b*c - a*d)*(a^2 + b^2)) Int[(b - a*Tan[e + f*x])/(a + b*T an[e + f*x]), x], x] - Simp[d^2/((b*c - a*d)*(c^2 + d^2)) Int[(d - c*Tan[ e + f*x])/(c + 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] && NeQ[c^2 + d^2, 0]
Time = 0.21 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.13
method | result | size |
derivativedivides | \(\frac {\frac {d^{2} \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (a d -b c \right ) \left (c^{2}+d^{2}\right )}-\frac {b^{2} \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a d -b c \right ) \left (a^{2}+b^{2}\right )}+\frac {\frac {\left (-a d -b c \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a c -b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right ) \left (c^{2}+d^{2}\right )}}{f}\) | \(133\) |
default | \(\frac {\frac {d^{2} \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (a d -b c \right ) \left (c^{2}+d^{2}\right )}-\frac {b^{2} \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a d -b c \right ) \left (a^{2}+b^{2}\right )}+\frac {\frac {\left (-a d -b c \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a c -b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right ) \left (c^{2}+d^{2}\right )}}{f}\) | \(133\) |
norman | \(\frac {\left (a c -b d \right ) x}{\left (a^{2}+b^{2}\right ) \left (c^{2}+d^{2}\right )}+\frac {d^{2} \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (a \,c^{2} d +a \,d^{3}-b \,c^{3}-b c \,d^{2}\right )}-\frac {b^{2} \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a d -b c \right ) f \left (a^{2}+b^{2}\right )}-\frac {\left (a d +b c \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 \left (a^{2}+b^{2}\right ) \left (c^{2}+d^{2}\right ) f}\) | \(154\) |
parallelrisch | \(-\frac {-2 x \,a^{2} c d f +2 x a b \,c^{2} f +2 x a b \,d^{2} f -2 x \,b^{2} c d f +\ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{2} d^{2}-\ln \left (1+\tan \left (f x +e \right )^{2}\right ) b^{2} c^{2}+2 \ln \left (a +b \tan \left (f x +e \right )\right ) b^{2} c^{2}+2 \ln \left (a +b \tan \left (f x +e \right )\right ) b^{2} d^{2}-2 \ln \left (c +d \tan \left (f x +e \right )\right ) a^{2} d^{2}-2 \ln \left (c +d \tan \left (f x +e \right )\right ) b^{2} d^{2}}{2 \left (a \,c^{2} d +a \,d^{3}-b \,c^{3}-b c \,d^{2}\right ) f \left (a^{2}+b^{2}\right )}\) | \(192\) |
risch | \(-\frac {x}{i a d +i b c -a c +b d}+\frac {2 i b^{2} x}{a^{3} d -a^{2} b c +a \,b^{2} d -b^{3} c}+\frac {2 i b^{2} e}{f \left (a^{3} d -a^{2} b c +a \,b^{2} d -b^{3} c \right )}-\frac {2 i d^{2} x}{a \,c^{2} d +a \,d^{3}-b \,c^{3}-b c \,d^{2}}-\frac {2 i d^{2} e}{f \left (a \,c^{2} d +a \,d^{3}-b \,c^{3}-b c \,d^{2}\right )}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right )}{f \left (a^{3} d -a^{2} b c +a \,b^{2} d -b^{3} c \right )}+\frac {d^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right )}{f \left (a \,c^{2} d +a \,d^{3}-b \,c^{3}-b c \,d^{2}\right )}\) | \(294\) |
Input:
int(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/f*(d^2/(a*d-b*c)/(c^2+d^2)*ln(c+d*tan(f*x+e))-b^2/(a*d-b*c)/(a^2+b^2)*ln (a+b*tan(f*x+e))+1/(a^2+b^2)/(c^2+d^2)*(1/2*(-a*d-b*c)*ln(1+tan(f*x+e)^2)+ (a*c-b*d)*arctan(tan(f*x+e))))
Time = 0.16 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.70 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=-\frac {{\left (a^{2} + b^{2}\right )} d^{2} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (a b c^{2} + a b d^{2} - {\left (a^{2} + b^{2}\right )} c d\right )} f x - {\left (b^{2} c^{2} + b^{2} d^{2}\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left ({\left (a^{2} b + b^{3}\right )} c^{3} - {\left (a^{3} + a b^{2}\right )} c^{2} d + {\left (a^{2} b + b^{3}\right )} c d^{2} - {\left (a^{3} + a b^{2}\right )} d^{3}\right )} f} \] Input:
integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="fricas")
Output:
-1/2*((a^2 + b^2)*d^2*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/ (tan(f*x + e)^2 + 1)) - 2*(a*b*c^2 + a*b*d^2 - (a^2 + b^2)*c*d)*f*x - (b^2 *c^2 + b^2*d^2)*log((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2)/(tan(f *x + e)^2 + 1)))/(((a^2*b + b^3)*c^3 - (a^3 + a*b^2)*c^2*d + (a^2*b + b^3) *c*d^2 - (a^3 + a*b^2)*d^3)*f)
Result contains complex when optimal does not.
Time = 2.51 (sec) , antiderivative size = 8053, normalized size of antiderivative = 68.25 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=\text {Too large to display} \] Input:
integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x)
Output:
Piecewise(((2*c*f*x/(2*c**2*f + 2*d**2*f) + 2*d*log(c/d + tan(e + f*x))/(2 *c**2*f + 2*d**2*f) - d*log(tan(e + f*x)**2 + 1)/(2*c**2*f + 2*d**2*f))/a, Eq(b, 0)), ((2*a*f*x/(2*a**2*f + 2*b**2*f) + 2*b*log(a/b + tan(e + f*x))/ (2*a**2*f + 2*b**2*f) - b*log(tan(e + f*x)**2 + 1)/(2*a**2*f + 2*b**2*f))/ c, Eq(d, 0)), (I*c**2*f*x*tan(e + f*x)/(2*b*c**3*f*tan(e + f*x) - 2*I*b*c* *3*f + 2*I*b*c**2*d*f*tan(e + f*x) + 2*b*c**2*d*f + 2*b*c*d**2*f*tan(e + f *x) - 2*I*b*c*d**2*f + 2*I*b*d**3*f*tan(e + f*x) + 2*b*d**3*f) + c**2*f*x/ (2*b*c**3*f*tan(e + f*x) - 2*I*b*c**3*f + 2*I*b*c**2*d*f*tan(e + f*x) + 2* b*c**2*d*f + 2*b*c*d**2*f*tan(e + f*x) - 2*I*b*c*d**2*f + 2*I*b*d**3*f*tan (e + f*x) + 2*b*d**3*f) + I*c**2/(2*b*c**3*f*tan(e + f*x) - 2*I*b*c**3*f + 2*I*b*c**2*d*f*tan(e + f*x) + 2*b*c**2*d*f + 2*b*c*d**2*f*tan(e + f*x) - 2*I*b*c*d**2*f + 2*I*b*d**3*f*tan(e + f*x) + 2*b*d**3*f) - 2*c*d*f*x*tan(e + f*x)/(2*b*c**3*f*tan(e + f*x) - 2*I*b*c**3*f + 2*I*b*c**2*d*f*tan(e + f *x) + 2*b*c**2*d*f + 2*b*c*d**2*f*tan(e + f*x) - 2*I*b*c*d**2*f + 2*I*b*d* *3*f*tan(e + f*x) + 2*b*d**3*f) + 2*I*c*d*f*x/(2*b*c**3*f*tan(e + f*x) - 2 *I*b*c**3*f + 2*I*b*c**2*d*f*tan(e + f*x) + 2*b*c**2*d*f + 2*b*c*d**2*f*ta n(e + f*x) - 2*I*b*c*d**2*f + 2*I*b*d**3*f*tan(e + f*x) + 2*b*d**3*f) + I* d**2*f*x*tan(e + f*x)/(2*b*c**3*f*tan(e + f*x) - 2*I*b*c**3*f + 2*I*b*c**2 *d*f*tan(e + f*x) + 2*b*c**2*d*f + 2*b*c*d**2*f*tan(e + f*x) - 2*I*b*c*d** 2*f + 2*I*b*d**3*f*tan(e + f*x) + 2*b*d**3*f) + d**2*f*x/(2*b*c**3*f*ta...
Time = 0.11 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.49 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=\frac {\frac {2 \, b^{2} \log \left (b \tan \left (f x + e\right ) + a\right )}{{\left (a^{2} b + b^{3}\right )} c - {\left (a^{3} + a b^{2}\right )} d} - \frac {2 \, d^{2} \log \left (d \tan \left (f x + e\right ) + c\right )}{b c^{3} - a c^{2} d + b c d^{2} - a d^{3}} + \frac {2 \, {\left (a c - b d\right )} {\left (f x + e\right )}}{{\left (a^{2} + b^{2}\right )} c^{2} + {\left (a^{2} + b^{2}\right )} d^{2}} - \frac {{\left (b c + a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{{\left (a^{2} + b^{2}\right )} c^{2} + {\left (a^{2} + b^{2}\right )} d^{2}}}{2 \, f} \] Input:
integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="maxima")
Output:
1/2*(2*b^2*log(b*tan(f*x + e) + a)/((a^2*b + b^3)*c - (a^3 + a*b^2)*d) - 2 *d^2*log(d*tan(f*x + e) + c)/(b*c^3 - a*c^2*d + b*c*d^2 - a*d^3) + 2*(a*c - b*d)*(f*x + e)/((a^2 + b^2)*c^2 + (a^2 + b^2)*d^2) - (b*c + a*d)*log(tan (f*x + e)^2 + 1)/((a^2 + b^2)*c^2 + (a^2 + b^2)*d^2))/f
Time = 0.19 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.75 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=\frac {b^{3} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b^{2} c f + b^{4} c f - a^{3} b d f - a b^{3} d f} - \frac {d^{3} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{b c^{3} d f - a c^{2} d^{2} f + b c d^{3} f - a d^{4} f} + \frac {{\left (a c - b d\right )} {\left (f x + e\right )}}{a^{2} c^{2} f + b^{2} c^{2} f + a^{2} d^{2} f + b^{2} d^{2} f} - \frac {{\left (b c + a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{2 \, {\left (a^{2} c^{2} f + b^{2} c^{2} f + a^{2} d^{2} f + b^{2} d^{2} f\right )}} \] Input:
integrate(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x, algorithm="giac")
Output:
b^3*log(abs(b*tan(f*x + e) + a))/(a^2*b^2*c*f + b^4*c*f - a^3*b*d*f - a*b^ 3*d*f) - d^3*log(abs(d*tan(f*x + e) + c))/(b*c^3*d*f - a*c^2*d^2*f + b*c*d ^3*f - a*d^4*f) + (a*c - b*d)*(f*x + e)/(a^2*c^2*f + b^2*c^2*f + a^2*d^2*f + b^2*d^2*f) - 1/2*(b*c + a*d)*log(tan(f*x + e)^2 + 1)/(a^2*c^2*f + b^2*c ^2*f + a^2*d^2*f + b^2*d^2*f)
Time = 2.83 (sec) , antiderivative size = 173, normalized size of antiderivative = 1.47 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=\frac {d^2\,\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}{f\,\left (a\,d-b\,c\right )\,\left (c^2+d^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}{2\,f\,\left (a\,c\,1{}\mathrm {i}+a\,d+b\,c-b\,d\,1{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\frac {d^2}{\left (a\,d-b\,c\right )\,\left (c^2+d^2\right )}-\frac {a\,d+b\,c}{\left (a^2+b^2\right )\,\left (c^2+d^2\right )}\right )}{f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}{2\,f\,\left (a\,d-a\,c\,1{}\mathrm {i}+b\,c+b\,d\,1{}\mathrm {i}\right )} \] Input:
int(1/((a + b*tan(e + f*x))*(c + d*tan(e + f*x))),x)
Output:
(d^2*log(c + d*tan(e + f*x)))/(f*(a*d - b*c)*(c^2 + d^2)) - log(tan(e + f* x) + 1i)/(2*f*(a*c*1i + a*d + b*c - b*d*1i)) - (log(a + b*tan(e + f*x))*(d ^2/((a*d - b*c)*(c^2 + d^2)) - (a*d + b*c)/((a^2 + b^2)*(c^2 + d^2))))/f - log(tan(e + f*x) - 1i)/(2*f*(a*d - a*c*1i + b*c + b*d*1i))
Time = 0.17 (sec) , antiderivative size = 226, normalized size of antiderivative = 1.92 \[ \int \frac {1}{(a+b \tan (e+f x)) (c+d \tan (e+f x))} \, dx=\frac {-\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a^{2} d^{2}+\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) b^{2} c^{2}-2 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) b^{2} c^{2}-2 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) b^{2} d^{2}+2 \,\mathrm {log}\left (d \tan \left (f x +e \right )+c \right ) a^{2} d^{2}+2 \,\mathrm {log}\left (d \tan \left (f x +e \right )+c \right ) b^{2} d^{2}+2 a^{2} c d f x -2 a b \,c^{2} f x -2 a b \,d^{2} f x +2 b^{2} c d f x}{2 f \left (a^{3} c^{2} d +a^{3} d^{3}-a^{2} b \,c^{3}-a^{2} b c \,d^{2}+a \,b^{2} c^{2} d +a \,b^{2} d^{3}-b^{3} c^{3}-b^{3} c \,d^{2}\right )} \] Input:
int(1/(a+b*tan(f*x+e))/(c+d*tan(f*x+e)),x)
Output:
( - log(tan(e + f*x)**2 + 1)*a**2*d**2 + log(tan(e + f*x)**2 + 1)*b**2*c** 2 - 2*log(tan(e + f*x)*b + a)*b**2*c**2 - 2*log(tan(e + f*x)*b + a)*b**2*d **2 + 2*log(tan(e + f*x)*d + c)*a**2*d**2 + 2*log(tan(e + f*x)*d + c)*b**2 *d**2 + 2*a**2*c*d*f*x - 2*a*b*c**2*f*x - 2*a*b*d**2*f*x + 2*b**2*c*d*f*x) /(2*f*(a**3*c**2*d + a**3*d**3 - a**2*b*c**3 - a**2*b*c*d**2 + a*b**2*c**2 *d + a*b**2*d**3 - b**3*c**3 - b**3*c*d**2))