Integrand size = 18, antiderivative size = 125 \[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\frac {(c+d x)^2}{2 (a+i b) d}+\frac {b (c+d x) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{\left (a^2+b^2\right ) f}-\frac {i b d \operatorname {PolyLog}\left (2,-\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 \left (a^2+b^2\right ) f^2} \] Output:
1/2*(d*x+c)^2/(a+I*b)/d+b*(d*x+c)*ln(1+(a^2+b^2)*exp(2*I*(f*x+e))/(a+I*b)^ 2)/(a^2+b^2)/f-1/2*I*b*d*polylog(2,-(a^2+b^2)*exp(2*I*(f*x+e))/(a+I*b)^2)/ (a^2+b^2)/f^2
Time = 1.40 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.42 \[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\frac {b (c+d x)^2}{(a-i b) d \left (b-b e^{2 i e}-i a \left (1+e^{2 i e}\right )\right )}+\frac {b (c+d x) \log \left (1+\frac {(a+i b) e^{-2 i (e+f x)}}{a-i b}\right )}{\left (a^2+b^2\right ) f}+\frac {i b d \operatorname {PolyLog}\left (2,\frac {(-a-i b) e^{-2 i (e+f x)}}{a-i b}\right )}{2 \left (a^2+b^2\right ) f^2}+\frac {x (2 c+d x) \cos (e)}{2 (a \cos (e)+b \sin (e))} \] Input:
Integrate[(c + d*x)/(a + b*Tan[e + f*x]),x]
Output:
(b*(c + d*x)^2)/((a - I*b)*d*(b - b*E^((2*I)*e) - I*a*(1 + E^((2*I)*e)))) + (b*(c + d*x)*Log[1 + (a + I*b)/((a - I*b)*E^((2*I)*(e + f*x)))])/((a^2 + b^2)*f) + ((I/2)*b*d*PolyLog[2, (-a - I*b)/((a - I*b)*E^((2*I)*(e + f*x)) )])/((a^2 + b^2)*f^2) + (x*(2*c + d*x)*Cos[e])/(2*(a*Cos[e] + b*Sin[e]))
Time = 0.49 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.06, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3042, 4215, 2620, 2715, 2838}
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 x}{a+b \tan (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {c+d x}{a+b \tan (e+f x)}dx\) |
\(\Big \downarrow \) 4215 |
\(\displaystyle 2 i b \int \frac {e^{2 i (e+f x)} (c+d x)}{(a+i b)^2+\left (a^2+b^2\right ) e^{2 i (e+f x)}}dx+\frac {(c+d x)^2}{2 d (a+i b)}\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle 2 i b \left (\frac {i d \int \log \left (\frac {e^{2 i (e+f x)} \left (a^2+b^2\right )}{(a+i b)^2}+1\right )dx}{2 f \left (a^2+b^2\right )}-\frac {i (c+d x) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f \left (a^2+b^2\right )}\right )+\frac {(c+d x)^2}{2 d (a+i b)}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle 2 i b \left (\frac {d \int e^{-2 i (e+f x)} \log \left (\frac {e^{2 i (e+f x)} \left (a^2+b^2\right )}{(a+i b)^2}+1\right )de^{2 i (e+f x)}}{4 f^2 \left (a^2+b^2\right )}-\frac {i (c+d x) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f \left (a^2+b^2\right )}\right )+\frac {(c+d x)^2}{2 d (a+i b)}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle 2 i b \left (-\frac {i (c+d x) \log \left (1+\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f \left (a^2+b^2\right )}-\frac {d \operatorname {PolyLog}\left (2,-\frac {\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{4 f^2 \left (a^2+b^2\right )}\right )+\frac {(c+d x)^2}{2 d (a+i b)}\) |
Input:
Int[(c + d*x)/(a + b*Tan[e + f*x]),x]
Output:
(c + d*x)^2/(2*(a + I*b)*d) + (2*I)*b*(((-1/2*I)*(c + d*x)*Log[1 + ((a^2 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2])/((a^2 + b^2)*f) - (d*PolyLog[2, - (((a^2 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2)])/(4*(a^2 + b^2)*f^2))
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ ((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp [((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si mp[d*(m/(b*f*g*n*Log[F])) Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x )))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Sy mbol] :> Simp[(c + d*x)^(m + 1)/(d*(m + 1)*(a + I*b)), x] + Simp[2*I*b In t[(c + d*x)^m*(E^Simp[2*I*(e + f*x), x]/((a + I*b)^2 + (a^2 + b^2)*E^Simp[2 *I*(e + f*x), x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[a^2 + b^2 , 0] && IGtQ[m, 0]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 461 vs. \(2 (113 ) = 226\).
Time = 0.49 (sec) , antiderivative size = 462, normalized size of antiderivative = 3.70
method | result | size |
risch | \(-\frac {d \,x^{2}}{2 \left (i b -a \right )}-\frac {c x}{i b -a}+\frac {b c \ln \left (i b \,{\mathrm e}^{2 i \left (f x +e \right )}-a \,{\mathrm e}^{2 i \left (f x +e \right )}-i b -a \right )}{f \left (-i b +a \right ) \left (i b +a \right )}-\frac {2 b c \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f \left (-i b +a \right ) \left (i b +a \right )}-\frac {b d \ln \left (1-\frac {\left (-i b +a \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{-i b -a}\right ) x}{f \left (-i b +a \right ) \left (-i b -a \right )}+\frac {i b d \,x^{2}}{\left (-i b +a \right ) \left (-i b -a \right )}-\frac {b d \ln \left (1-\frac {\left (-i b +a \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{-i b -a}\right ) e}{f^{2} \left (-i b +a \right ) \left (-i b -a \right )}+\frac {2 i b d e x}{f \left (-i b +a \right ) \left (-i b -a \right )}+\frac {i b d \,e^{2}}{f^{2} \left (-i b +a \right ) \left (-i b -a \right )}+\frac {i b d \operatorname {polylog}\left (2, \frac {\left (-i b +a \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{-i b -a}\right )}{2 f^{2} \left (-i b +a \right ) \left (-i b -a \right )}-\frac {b d e \ln \left (i b \,{\mathrm e}^{2 i \left (f x +e \right )}-a \,{\mathrm e}^{2 i \left (f x +e \right )}-i b -a \right )}{f^{2} \left (-i b +a \right ) \left (i b +a \right )}+\frac {2 b d e \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{f^{2} \left (-i b +a \right ) \left (i b +a \right )}\) | \(462\) |
Input:
int((d*x+c)/(a+b*tan(f*x+e)),x,method=_RETURNVERBOSE)
Output:
-1/2/(I*b-a)*d*x^2-1/(I*b-a)*c*x+1/f*b/(a-I*b)*c/(a+I*b)*ln(I*b*exp(2*I*(f *x+e))-a*exp(2*I*(f*x+e))-I*b-a)-2/f*b/(a-I*b)*c/(a+I*b)*ln(exp(I*(f*x+e)) )-1/f*b/(a-I*b)/(-I*b-a)*d*ln(1-(a-I*b)*exp(2*I*(f*x+e))/(-I*b-a))*x+I*b/( a-I*b)/(-I*b-a)*d*x^2-1/f^2*b/(a-I*b)/(-I*b-a)*d*ln(1-(a-I*b)*exp(2*I*(f*x +e))/(-I*b-a))*e+2*I/f*b/(a-I*b)/(-I*b-a)*d*e*x+I/f^2*b/(a-I*b)/(-I*b-a)*d *e^2+1/2*I/f^2*b/(a-I*b)/(-I*b-a)*d*polylog(2,(a-I*b)*exp(2*I*(f*x+e))/(-I *b-a))-1/f^2*b/(a-I*b)*d*e/(a+I*b)*ln(I*b*exp(2*I*(f*x+e))-a*exp(2*I*(f*x+ e))-I*b-a)+2/f^2*b/(a-I*b)*d*e/(a+I*b)*ln(exp(I*(f*x+e)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 527 vs. \(2 (108) = 216\).
Time = 0.09 (sec) , antiderivative size = 527, normalized size of antiderivative = 4.22 \[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\frac {2 \, a d f^{2} x^{2} + 4 \, a c f^{2} x + i \, b d {\rm Li}_2\left (\frac {2 \, {\left ({\left (i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} - i \, a b + {\left (i \, a^{2} - 2 \, a b - i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}} + 1\right ) - i \, b d {\rm Li}_2\left (\frac {2 \, {\left ({\left (-i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} + i \, a b + {\left (-i \, a^{2} - 2 \, a b + i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}} + 1\right ) + 2 \, {\left (b d f x + b d e\right )} \log \left (-\frac {2 \, {\left ({\left (i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} - i \, a b + {\left (i \, a^{2} - 2 \, a b - i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}}\right ) + 2 \, {\left (b d f x + b d e\right )} \log \left (-\frac {2 \, {\left ({\left (-i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} + i \, a b + {\left (-i \, a^{2} - 2 \, a b + i \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{{\left (a^{2} + b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + b^{2}}\right ) - 2 \, {\left (b d e - b c f\right )} \log \left (\frac {{\left (i \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} - a^{2} + i \, a b + {\left (i \, a^{2} + i \, b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (b d e - b c f\right )} \log \left (\frac {{\left (i \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} + a^{2} + i \, a b + {\left (i \, a^{2} + i \, b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}\right )}{4 \, {\left (a^{2} + b^{2}\right )} f^{2}} \] Input:
integrate((d*x+c)/(a+b*tan(f*x+e)),x, algorithm="fricas")
Output:
1/4*(2*a*d*f^2*x^2 + 4*a*c*f^2*x + I*b*d*dilog(2*((I*a*b - b^2)*tan(f*x + e)^2 - a^2 - I*a*b + (I*a^2 - 2*a*b - I*b^2)*tan(f*x + e))/((a^2 + b^2)*ta n(f*x + e)^2 + a^2 + b^2) + 1) - I*b*d*dilog(2*((-I*a*b - b^2)*tan(f*x + e )^2 - a^2 + I*a*b + (-I*a^2 - 2*a*b + I*b^2)*tan(f*x + e))/((a^2 + b^2)*ta n(f*x + e)^2 + a^2 + b^2) + 1) + 2*(b*d*f*x + b*d*e)*log(-2*((I*a*b - b^2) *tan(f*x + e)^2 - a^2 - I*a*b + (I*a^2 - 2*a*b - I*b^2)*tan(f*x + e))/((a^ 2 + b^2)*tan(f*x + e)^2 + a^2 + b^2)) + 2*(b*d*f*x + b*d*e)*log(-2*((-I*a* b - b^2)*tan(f*x + e)^2 - a^2 + I*a*b + (-I*a^2 - 2*a*b + I*b^2)*tan(f*x + e))/((a^2 + b^2)*tan(f*x + e)^2 + a^2 + b^2)) - 2*(b*d*e - b*c*f)*log(((I *a*b + b^2)*tan(f*x + e)^2 - a^2 + I*a*b + (I*a^2 + I*b^2)*tan(f*x + e))/( tan(f*x + e)^2 + 1)) - 2*(b*d*e - b*c*f)*log(((I*a*b - b^2)*tan(f*x + e)^2 + a^2 + I*a*b + (I*a^2 + I*b^2)*tan(f*x + e))/(tan(f*x + e)^2 + 1)))/((a^ 2 + b^2)*f^2)
\[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\int \frac {c + d x}{a + b \tan {\left (e + f x \right )}}\, dx \] Input:
integrate((d*x+c)/(a+b*tan(f*x+e)),x)
Output:
Integral((c + d*x)/(a + b*tan(e + f*x)), x)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 399 vs. \(2 (108) = 216\).
Time = 0.30 (sec) , antiderivative size = 399, normalized size of antiderivative = 3.19 \[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\frac {{\left (a - i \, b\right )} d f^{2} x^{2} + 2 \, {\left (a - i \, b\right )} c f^{2} x - 2 i \, b d f x \arctan \left (\frac {2 \, a b \cos \left (2 \, f x + 2 \, e\right ) - {\left (a^{2} - b^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{a^{2} + b^{2}}, \frac {2 \, a b \sin \left (2 \, f x + 2 \, e\right ) + a^{2} + b^{2} + {\left (a^{2} - b^{2}\right )} \cos \left (2 \, f x + 2 \, e\right )}{a^{2} + b^{2}}\right ) + b d f x \log \left (\frac {{\left (a^{2} + b^{2}\right )} \cos \left (2 \, f x + 2 \, e\right )^{2} + 4 \, a b \sin \left (2 \, f x + 2 \, e\right ) + {\left (a^{2} + b^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )^{2} + a^{2} + b^{2} + 2 \, {\left (a^{2} - b^{2}\right )} \cos \left (2 \, f x + 2 \, e\right )}{a^{2} + b^{2}}\right ) + 2 i \, b c f \arctan \left (-b \cos \left (2 \, f x + 2 \, e\right ) + a \sin \left (2 \, f x + 2 \, e\right ) + b, a \cos \left (2 \, f x + 2 \, e\right ) + b \sin \left (2 \, f x + 2 \, e\right ) + a\right ) + b c f \log \left ({\left (a^{2} + b^{2}\right )} \cos \left (2 \, f x + 2 \, e\right )^{2} + 4 \, a b \sin \left (2 \, f x + 2 \, e\right ) + {\left (a^{2} + b^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )^{2} + a^{2} + b^{2} + 2 \, {\left (a^{2} - b^{2}\right )} \cos \left (2 \, f x + 2 \, e\right )\right ) - i \, b d {\rm Li}_2\left (\frac {{\left (i \, a + b\right )} e^{\left (2 i \, f x + 2 i \, e\right )}}{-i \, a + b}\right )}{2 \, {\left (a^{2} + b^{2}\right )} f^{2}} \] Input:
integrate((d*x+c)/(a+b*tan(f*x+e)),x, algorithm="maxima")
Output:
1/2*((a - I*b)*d*f^2*x^2 + 2*(a - I*b)*c*f^2*x - 2*I*b*d*f*x*arctan2((2*a* b*cos(2*f*x + 2*e) - (a^2 - b^2)*sin(2*f*x + 2*e))/(a^2 + b^2), (2*a*b*sin (2*f*x + 2*e) + a^2 + b^2 + (a^2 - b^2)*cos(2*f*x + 2*e))/(a^2 + b^2)) + b *d*f*x*log(((a^2 + b^2)*cos(2*f*x + 2*e)^2 + 4*a*b*sin(2*f*x + 2*e) + (a^2 + b^2)*sin(2*f*x + 2*e)^2 + a^2 + b^2 + 2*(a^2 - b^2)*cos(2*f*x + 2*e))/( a^2 + b^2)) + 2*I*b*c*f*arctan2(-b*cos(2*f*x + 2*e) + a*sin(2*f*x + 2*e) + b, a*cos(2*f*x + 2*e) + b*sin(2*f*x + 2*e) + a) + b*c*f*log((a^2 + b^2)*c os(2*f*x + 2*e)^2 + 4*a*b*sin(2*f*x + 2*e) + (a^2 + b^2)*sin(2*f*x + 2*e)^ 2 + a^2 + b^2 + 2*(a^2 - b^2)*cos(2*f*x + 2*e)) - I*b*d*dilog((I*a + b)*e^ (2*I*f*x + 2*I*e)/(-I*a + b)))/((a^2 + b^2)*f^2)
\[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\int { \frac {d x + c}{b \tan \left (f x + e\right ) + a} \,d x } \] Input:
integrate((d*x+c)/(a+b*tan(f*x+e)),x, algorithm="giac")
Output:
integrate((d*x + c)/(b*tan(f*x + e) + a), x)
Timed out. \[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\int \frac {c+d\,x}{a+b\,\mathrm {tan}\left (e+f\,x\right )} \,d x \] Input:
int((c + d*x)/(a + b*tan(e + f*x)),x)
Output:
int((c + d*x)/(a + b*tan(e + f*x)), x)
\[ \int \frac {c+d x}{a+b \tan (e+f x)} \, dx=\frac {2 \left (\int \frac {x}{\tan \left (f x +e \right ) b +a}d x \right ) a^{2} d f +2 \left (\int \frac {x}{\tan \left (f x +e \right ) b +a}d x \right ) b^{2} d f -\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 ) b c +2 a c f x}{2 f \left (a^{2}+b^{2}\right )} \] Input:
int((d*x+c)/(a+b*tan(f*x+e)),x)
Output:
(2*int(x/(tan(e + f*x)*b + a),x)*a**2*d*f + 2*int(x/(tan(e + f*x)*b + a),x )*b**2*d*f - log(tan(e + f*x)**2 + 1)*b*c + 2*log(tan(e + f*x)*b + a)*b*c + 2*a*c*f*x)/(2*f*(a**2 + b**2))