3.56 $$\int \frac{c+d x}{a+b \tan (e+f x)} \, dx$$

Optimal. Leaf size=125 $-\frac{i b d \text{PolyLog}\left (2,-\frac{\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f^2 \left (a^2+b^2\right )}+\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 )}{f \left (a^2+b^2\right )}+\frac{(c+d x)^2}{2 d (a+i b)}$

[Out]

(c + d*x)^2/(2*(a + I*b)*d) + (b*(c + d*x)*Log[1 + ((a^2 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2])/((a^2 + b^2
)*f) - ((I/2)*b*d*PolyLog[2, -(((a^2 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2)])/((a^2 + b^2)*f^2)

________________________________________________________________________________________

Rubi [A]  time = 0.159057, antiderivative size = 125, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 18, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.222, Rules used = {3732, 2190, 2279, 2391} $\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 )}{f \left (a^2+b^2\right )}-\frac{i b d \text{Li}_2\left (-\frac{\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right )}{2 f^2 \left (a^2+b^2\right )}+\frac{(c+d x)^2}{2 d (a+i b)}$

Antiderivative was successfully veriﬁed.

[In]

Int[(c + d*x)/(a + b*Tan[e + f*x]),x]

[Out]

(c + d*x)^2/(2*(a + I*b)*d) + (b*(c + d*x)*Log[1 + ((a^2 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2])/((a^2 + b^2
)*f) - ((I/2)*b*d*PolyLog[2, -(((a^2 + b^2)*E^((2*I)*(e + f*x)))/(a + I*b)^2)])/((a^2 + b^2)*f^2)

Rule 3732

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(d*
(m + 1)*(a + I*b)), x] + Dist[2*I*b, Int[((c + d*x)^m*E^Simp[2*I*(e + f*x), x])/((a + I*b)^2 + (a^2 + b^2)*E^S
imp[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]

Rule 2190

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*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), x]
- Dist[(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]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[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]

Rule 2391

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]

Rubi steps

\begin{align*} \int \frac{c+d x}{a+b \tan (e+f x)} \, dx &=\frac{(c+d x)^2}{2 (a+i b) d}+(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 (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{(b d) \int \log \left (1+\frac{\left (a^2+b^2\right ) e^{2 i (e+f x)}}{(a+i b)^2}\right ) \, dx}{\left (a^2+b^2\right ) f}\\ &=\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{Subst}\left (\int \frac{\log \left (1+\frac{\left (a^2+b^2\right ) x}{(a+i b)^2}\right )}{x} \, dx,x,e^{2 i (e+f x)}\right )}{2 \left (a^2+b^2\right ) f^2}\\ &=\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 \text{Li}_2\left (-\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}\\ \end{align*}

Mathematica [A]  time = 1.46755, size = 177, normalized size = 1.42 $\frac{i b d \text{PolyLog}\left (2,\frac{(-a-i b) e^{-2 i (e+f x)}}{a-i b}\right )}{2 f^2 \left (a^2+b^2\right )}+\frac{b (c+d x) \log \left (1+\frac{(a+i b) e^{-2 i (e+f x)}}{a-i b}\right )}{f \left (a^2+b^2\right )}+\frac{b (c+d x)^2}{d (a-i b) \left (-i a \left (1+e^{2 i e}\right )+b \left (-e^{2 i e}\right )+b\right )}+\frac{x \cos (e) (2 c+d x)}{2 (a \cos (e)+b \sin (e))}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(c + d*x)/(a + b*Tan[e + f*x]),x]

[Out]

(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]))

________________________________________________________________________________________

Maple [B]  time = 0.204, size = 462, normalized size = 3.7 \begin{align*} -{\frac{d{x}^{2}}{2\,ib-2\,a}}-{\frac{cx}{ib-a}}+{\frac{bc\ln \left ( i{{\rm e}^{2\,i \left ( fx+e \right ) }}b-a{{\rm e}^{2\,i \left ( fx+e \right ) }}-ib-a \right ) }{ \left ( a-ib \right ) f \left ( a+ib \right ) }}-2\,{\frac{bc\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{ \left ( a-ib \right ) f \left ( a+ib \right ) }}-{\frac{bdx}{ \left ( a-ib \right ) f \left ( -ib-a \right ) }\ln \left ( 1-{\frac{ \left ( a-ib \right ){{\rm e}^{2\,i \left ( fx+e \right ) }}}{-ib-a}} \right ) }-{\frac{bde}{ \left ( a-ib \right ){f}^{2} \left ( -ib-a \right ) }\ln \left ( 1-{\frac{ \left ( a-ib \right ){{\rm e}^{2\,i \left ( fx+e \right ) }}}{-ib-a}} \right ) }+{\frac{ibd{x}^{2}}{ \left ( a-ib \right ) \left ( -ib-a \right ) }}+{\frac{2\,ibdex}{ \left ( a-ib \right ) f \left ( -ib-a \right ) }}+{\frac{ibd{e}^{2}}{ \left ( a-ib \right ){f}^{2} \left ( -ib-a \right ) }}+{\frac{{\frac{i}{2}}bd}{ \left ( a-ib \right ){f}^{2} \left ( -ib-a \right ) }{\it polylog} \left ( 2,{\frac{ \left ( a-ib \right ){{\rm e}^{2\,i \left ( fx+e \right ) }}}{-ib-a}} \right ) }-{\frac{bde\ln \left ( i{{\rm e}^{2\,i \left ( fx+e \right ) }}b-a{{\rm e}^{2\,i \left ( fx+e \right ) }}-ib-a \right ) }{ \left ( a-ib \right ){f}^{2} \left ( a+ib \right ) }}+2\,{\frac{bde\ln \left ({{\rm e}^{i \left ( fx+e \right ) }} \right ) }{ \left ( a-ib \right ){f}^{2} \left ( a+ib \right ) }} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)/(a+b*tan(f*x+e)),x)

[Out]

-1/2/(I*b-a)*d*x^2-1/(I*b-a)*c*x+1/(a-I*b)*b/f*c/(a+I*b)*ln(I*exp(2*I*(f*x+e))*b-a*exp(2*I*(f*x+e))-I*b-a)-2/(
a-I*b)*b/f*c/(a+I*b)*ln(exp(I*(f*x+e)))-1/(a-I*b)*b/f*d/(-I*b-a)*ln(1-(a-I*b)*exp(2*I*(f*x+e))/(-I*b-a))*x-1/(
a-I*b)*b/f^2*d/(-I*b-a)*ln(1-(a-I*b)*exp(2*I*(f*x+e))/(-I*b-a))*e+I/(a-I*b)*b*d/(-I*b-a)*x^2+2*I/(a-I*b)*b/f*d
/(-I*b-a)*e*x+I/(a-I*b)*b/f^2*d/(-I*b-a)*e^2+1/2*I/(a-I*b)*b/f^2*d/(-I*b-a)*polylog(2,(a-I*b)*exp(2*I*(f*x+e))
/(-I*b-a))-1/(a-I*b)*b/f^2*d*e/(a+I*b)*ln(I*exp(2*I*(f*x+e))*b-a*exp(2*I*(f*x+e))-I*b-a)+2/(a-I*b)*b/f^2*d*e/(
a+I*b)*ln(exp(I*(f*x+e)))

________________________________________________________________________________________

Maxima [B]  time = 2.07047, size = 539, normalized size = 4.31 \begin{align*} \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}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*tan(f*x+e)),x, algorithm="maxima")

[Out]

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)*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)) - I*b*d*dilog((I*a +
b)*e^(2*I*f*x + 2*I*e)/(-I*a + b)))/((a^2 + b^2)*f^2)

________________________________________________________________________________________

Fricas [B]  time = 1.87714, size = 1273, normalized size = 10.18 \begin{align*} \frac{2 \, a d f^{2} x^{2} + 4 \, a c f^{2} x - i \, b d{\rm Li}_2\left (-\frac{{\left (2 i \, a b + 2 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + 2 \, a^{2} - 2 i \, a b +{\left (2 i \, a^{2} + 4 \, a b - 2 i \, b^{2}\right )} \tan \left (f x + e\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{{\left (-2 i \, a b + 2 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + 2 \, a^{2} + 2 i \, a b +{\left (-2 i \, a^{2} + 4 \, a b + 2 i \, b^{2}\right )} \tan \left (f x + e\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{{\left (2 i \, a b + 2 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + 2 \, a^{2} - 2 i \, a b +{\left (2 i \, a^{2} + 4 \, a b - 2 i \, b^{2}\right )} \tan \left (f x + e\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{{\left (-2 i \, a b + 2 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + 2 \, a^{2} + 2 i \, a b +{\left (-2 i \, a^{2} + 4 \, a b + 2 i \, b^{2}\right )} \tan \left (f x + e\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}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/4*(2*a*d*f^2*x^2 + 4*a*c*f^2*x - I*b*d*dilog(-((2*I*a*b + 2*b^2)*tan(f*x + e)^2 + 2*a^2 - 2*I*a*b + (2*I*a^2
+ 4*a*b - 2*I*b^2)*tan(f*x + e))/((a^2 + b^2)*tan(f*x + e)^2 + a^2 + b^2) + 1) + I*b*d*dilog(-((-2*I*a*b + 2*
b^2)*tan(f*x + e)^2 + 2*a^2 + 2*I*a*b + (-2*I*a^2 + 4*a*b + 2*I*b^2)*tan(f*x + e))/((a^2 + b^2)*tan(f*x + e)^2
+ a^2 + b^2) + 1) + 2*(b*d*f*x + b*d*e)*log(((2*I*a*b + 2*b^2)*tan(f*x + e)^2 + 2*a^2 - 2*I*a*b + (2*I*a^2 +
4*a*b - 2*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
+ 2*b^2)*tan(f*x + e)^2 + 2*a^2 + 2*I*a*b + (-2*I*a^2 + 4*a*b + 2*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)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{c + d x}{a + b \tan{\left (e + f x \right )}}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*tan(f*x+e)),x)

[Out]

Integral((c + d*x)/(a + b*tan(e + f*x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{d x + c}{b \tan \left (f x + e\right ) + a}\,{d x} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)/(a+b*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((d*x + c)/(b*tan(f*x + e) + a), x)