Integrand size = 23, antiderivative size = 58 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=\frac {(a c+b d) x}{a^2+b^2}+\frac {(b c-a d) \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right ) f} \] Output:
(a*c+b*d)*x/(a^2+b^2)+(-a*d+b*c)*ln(a*cos(f*x+e)+b*sin(f*x+e))/(a^2+b^2)/f
Time = 0.09 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.14 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=\frac {2 (a c+b d) \arctan (\tan (e+f x))-(b c-a d) \left (\log \left (\sec ^2(e+f x)\right )-2 \log (a+b \tan (e+f x))\right )}{2 \left (a^2+b^2\right ) f} \] Input:
Integrate[(c + d*Tan[e + f*x])/(a + b*Tan[e + f*x]),x]
Output:
(2*(a*c + b*d)*ArcTan[Tan[e + f*x]] - (b*c - a*d)*(Log[Sec[e + f*x]^2] - 2 *Log[a + b*Tan[e + f*x]]))/(2*(a^2 + b^2)*f)
Time = 0.33 (sec) , antiderivative size = 58, 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.174, Rules used = {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 {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle \frac {(b c-a d) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{a^2+b^2}+\frac {x (a c+b d)}{a^2+b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(b c-a d) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{a^2+b^2}+\frac {x (a c+b d)}{a^2+b^2}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle \frac {(b c-a d) \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right )}+\frac {x (a c+b d)}{a^2+b^2}\) |
Input:
Int[(c + d*Tan[e + f*x])/(a + b*Tan[e + f*x]),x]
Output:
((a*c + b*d)*x)/(a^2 + b^2) + ((b*c - a*d)*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])/((a^2 + b^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[((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]
Time = 0.12 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.43
method | result | size |
derivativedivides | \(\frac {\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 )}{a^{2}+b^{2}}-\frac {\left (a d -b c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{a^{2}+b^{2}}}{f}\) | \(83\) |
default | \(\frac {\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 )}{a^{2}+b^{2}}-\frac {\left (a d -b c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{a^{2}+b^{2}}}{f}\) | \(83\) |
norman | \(\frac {\left (a c +b d \right ) x}{a^{2}+b^{2}}+\frac {\left (a d -b c \right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a^{2}+b^{2}\right )}-\frac {\left (a d -b c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{f \left (a^{2}+b^{2}\right )}\) | \(86\) |
parallelrisch | \(\frac {2 a c f x +2 b d f x +\ln \left (1+\tan \left (f x +e \right )^{2}\right ) a d -\ln \left (1+\tan \left (f x +e \right )^{2}\right ) b c -2 \ln \left (a +b \tan \left (f x +e \right )\right ) a d +2 \ln \left (a +b \tan \left (f x +e \right )\right ) b c}{2 f \left (a^{2}+b^{2}\right )}\) | \(87\) |
risch | \(\frac {i x d}{i b -a}-\frac {x c}{i b -a}+\frac {2 i a d x}{a^{2}+b^{2}}-\frac {2 i b c x}{a^{2}+b^{2}}+\frac {2 i a d e}{f \left (a^{2}+b^{2}\right )}-\frac {2 i b c e}{f \left (a^{2}+b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a d}{f \left (a^{2}+b^{2}\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) b c}{f \left (a^{2}+b^{2}\right )}\) | \(186\) |
Input:
int((c+d*tan(f*x+e))/(a+b*tan(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/f*(1/(a^2+b^2)*(1/2*(a*d-b*c)*ln(1+tan(f*x+e)^2)+(a*c+b*d)*arctan(tan(f* x+e)))-(a*d-b*c)/(a^2+b^2)*ln(a+b*tan(f*x+e)))
Time = 0.12 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.29 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=\frac {2 \, {\left (a c + b d\right )} f x + {\left (b c - a d\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 (a^{2} + b^{2}\right )} f} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e)),x, algorithm="fricas")
Output:
1/2*(2*(a*c + b*d)*f*x + (b*c - a*d)*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^2)*f)
Result contains complex when optimal does not.
Time = 0.47 (sec) , antiderivative size = 524, normalized size of antiderivative = 9.03 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=\begin {cases} \frac {\tilde {\infty } x \left (c + d \tan {\left (e \right )}\right )}{\tan {\left (e \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {c x + \frac {d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f}}{a} & \text {for}\: b = 0 \\\frac {i c f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} - 2 i b f} + \frac {c f x}{2 b f \tan {\left (e + f x \right )} - 2 i b f} + \frac {i c}{2 b f \tan {\left (e + f x \right )} - 2 i b f} + \frac {d f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} - 2 i b f} - \frac {i d f x}{2 b f \tan {\left (e + f x \right )} - 2 i b f} - \frac {d}{2 b f \tan {\left (e + f x \right )} - 2 i b f} & \text {for}\: a = - i b \\- \frac {i c f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} + 2 i b f} + \frac {c f x}{2 b f \tan {\left (e + f x \right )} + 2 i b f} - \frac {i c}{2 b f \tan {\left (e + f x \right )} + 2 i b f} + \frac {d f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} + 2 i b f} + \frac {i d f x}{2 b f \tan {\left (e + f x \right )} + 2 i b f} - \frac {d}{2 b f \tan {\left (e + f x \right )} + 2 i b f} & \text {for}\: a = i b \\\frac {x \left (c + d \tan {\left (e \right )}\right )}{a + b \tan {\left (e \right )}} & \text {for}\: f = 0 \\\frac {2 a c f x}{2 a^{2} f + 2 b^{2} f} - \frac {2 a d \log {\left (\frac {a}{b} + \tan {\left (e + f x \right )} \right )}}{2 a^{2} f + 2 b^{2} f} + \frac {a d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f + 2 b^{2} f} + \frac {2 b c \log {\left (\frac {a}{b} + \tan {\left (e + f x \right )} \right )}}{2 a^{2} f + 2 b^{2} f} - \frac {b c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f + 2 b^{2} f} + \frac {2 b d f x}{2 a^{2} f + 2 b^{2} f} & \text {otherwise} \end {cases} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e)),x)
Output:
Piecewise((zoo*x*(c + d*tan(e))/tan(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ( (c*x + d*log(tan(e + f*x)**2 + 1)/(2*f))/a, Eq(b, 0)), (I*c*f*x*tan(e + f* x)/(2*b*f*tan(e + f*x) - 2*I*b*f) + c*f*x/(2*b*f*tan(e + f*x) - 2*I*b*f) + I*c/(2*b*f*tan(e + f*x) - 2*I*b*f) + d*f*x*tan(e + f*x)/(2*b*f*tan(e + f* x) - 2*I*b*f) - I*d*f*x/(2*b*f*tan(e + f*x) - 2*I*b*f) - d/(2*b*f*tan(e + f*x) - 2*I*b*f), Eq(a, -I*b)), (-I*c*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) + 2*I*b*f) + c*f*x/(2*b*f*tan(e + f*x) + 2*I*b*f) - I*c/(2*b*f*tan(e + f*x ) + 2*I*b*f) + d*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) + 2*I*b*f) + I*d*f*x /(2*b*f*tan(e + f*x) + 2*I*b*f) - d/(2*b*f*tan(e + f*x) + 2*I*b*f), Eq(a, I*b)), (x*(c + d*tan(e))/(a + b*tan(e)), Eq(f, 0)), (2*a*c*f*x/(2*a**2*f + 2*b**2*f) - 2*a*d*log(a/b + tan(e + f*x))/(2*a**2*f + 2*b**2*f) + a*d*log (tan(e + f*x)**2 + 1)/(2*a**2*f + 2*b**2*f) + 2*b*c*log(a/b + tan(e + f*x) )/(2*a**2*f + 2*b**2*f) - b*c*log(tan(e + f*x)**2 + 1)/(2*a**2*f + 2*b**2* f) + 2*b*d*f*x/(2*a**2*f + 2*b**2*f), True))
Time = 0.12 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.53 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=\frac {\frac {2 \, {\left (a c + b d\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left (b c - a d\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{2} + b^{2}} - \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, f} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e)),x, algorithm="maxima")
Output:
1/2*(2*(a*c + b*d)*(f*x + e)/(a^2 + b^2) + 2*(b*c - a*d)*log(b*tan(f*x + e ) + a)/(a^2 + b^2) - (b*c - a*d)*log(tan(f*x + e)^2 + 1)/(a^2 + b^2))/f
Time = 0.21 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.71 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=\frac {{\left (a c + b d\right )} {\left (f x + e\right )}}{a^{2} f + b^{2} f} - \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{2 \, {\left (a^{2} f + b^{2} f\right )}} + \frac {{\left (b^{2} c - a b d\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b f + b^{3} f} \] Input:
integrate((c+d*tan(f*x+e))/(a+b*tan(f*x+e)),x, algorithm="giac")
Output:
(a*c + b*d)*(f*x + e)/(a^2*f + b^2*f) - 1/2*(b*c - a*d)*log(tan(f*x + e)^2 + 1)/(a^2*f + b^2*f) + (b^2*c - a*b*d)*log(abs(b*tan(f*x + e) + a))/(a^2* b*f + b^3*f)
Time = 2.73 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.62 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-d+c\,1{}\mathrm {i}\right )}{2\,f\,\left (a+b\,1{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a\,d-b\,c\right )}{f\,\left (a^2+b^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (c-d\,1{}\mathrm {i}\right )}{2\,f\,\left (b+a\,1{}\mathrm {i}\right )} \] Input:
int((c + d*tan(e + f*x))/(a + b*tan(e + f*x)),x)
Output:
- (log(tan(e + f*x) - 1i)*(c*1i - d))/(2*f*(a + b*1i)) - (log(a + b*tan(e + f*x))*(a*d - b*c))/(f*(a^2 + b^2)) - (log(tan(e + f*x) + 1i)*(c - d*1i)) /(2*f*(a*1i + b))
Time = 0.23 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.48 \[ \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx=\frac {\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a d -\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) b c -2 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) a d +2 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) b c +2 a c f x +2 b d f x}{2 f \left (a^{2}+b^{2}\right )} \] Input:
int((c+d*tan(f*x+e))/(a+b*tan(f*x+e)),x)
Output:
(log(tan(e + f*x)**2 + 1)*a*d - log(tan(e + f*x)**2 + 1)*b*c - 2*log(tan(e + f*x)*b + a)*a*d + 2*log(tan(e + f*x)*b + a)*b*c + 2*a*c*f*x + 2*b*d*f*x )/(2*f*(a**2 + b**2))