### 3.3 $$\int x \tan (a+b x) \, dx$$

Optimal. Leaf size=54 $\frac{i \text{PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b^2}-\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac{i x^2}{2}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0809173, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 8, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.5, Rules used = {3719, 2190, 2279, 2391} $\frac{i \text{Li}_2\left (-e^{2 i (a+b x)}\right )}{2 b^2}-\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac{i x^2}{2}$

Antiderivative was successfully veriﬁed.

[In]

Int[x*Tan[a + b*x],x]

[Out]

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

Rule 3719

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(I*(c + d*x)^(m + 1))/(d*(m + 1)), x
] - Dist[2*I, Int[((c + d*x)^m*E^(2*I*(e + f*x)))/(1 + E^(2*I*(e + f*x))), x], x] /; FreeQ[{c, d, e, f}, x] &&
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 x \tan (a+b x) \, dx &=\frac{i x^2}{2}-2 i \int \frac{e^{2 i (a+b x)} x}{1+e^{2 i (a+b x)}} \, dx\\ &=\frac{i x^2}{2}-\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac{\int \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b}\\ &=\frac{i x^2}{2}-\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac{i \operatorname{Subst}\left (\int \frac{\log (1+x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^2}\\ &=\frac{i x^2}{2}-\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac{i \text{Li}_2\left (-e^{2 i (a+b x)}\right )}{2 b^2}\\ \end{align*}

Mathematica [A]  time = 0.0053405, size = 54, normalized size = 1. $\frac{i \text{PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{2 b^2}-\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac{i x^2}{2}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[x*Tan[a + b*x],x]

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 78, normalized size = 1.4 \begin{align*}{\frac{i}{2}}{x}^{2}+{\frac{2\,iax}{b}}+{\frac{i{a}^{2}}{{b}^{2}}}-{\frac{x\ln \left ( 1+{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ) }{b}}+{\frac{{\frac{i}{2}}{\it polylog} \left ( 2,-{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ) }{{b}^{2}}}-2\,{\frac{a\ln \left ({{\rm e}^{i \left ( bx+a \right ) }} \right ) }{{b}^{2}}} \end{align*}

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

[In]

int(x*tan(b*x+a),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.7094, size = 124, normalized size = 2.3 \begin{align*} -\frac{-i \, b^{2} x^{2} + 2 i \, b x \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + b x \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - i \,{\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right )}{2 \, b^{2}} \end{align*}

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

[In]

integrate(x*tan(b*x+a),x, algorithm="maxima")

[Out]

-1/2*(-I*b^2*x^2 + 2*I*b*x*arctan2(sin(2*b*x + 2*a), cos(2*b*x + 2*a) + 1) + b*x*log(cos(2*b*x + 2*a)^2 + sin(
2*b*x + 2*a)^2 + 2*cos(2*b*x + 2*a) + 1) - I*dilog(-e^(2*I*b*x + 2*I*a)))/b^2

________________________________________________________________________________________

Fricas [B]  time = 1.6213, size = 332, normalized size = 6.15 \begin{align*} -\frac{2 \, b x \log \left (-\frac{2 \,{\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + 2 \, b x \log \left (-\frac{2 \,{\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) + i \,{\rm Li}_2\left (\frac{2 \,{\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - i \,{\rm Li}_2\left (\frac{2 \,{\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right )}{4 \, b^{2}} \end{align*}

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

[In]

integrate(x*tan(b*x+a),x, algorithm="fricas")

[Out]

-1/4*(2*b*x*log(-2*(I*tan(b*x + a) - 1)/(tan(b*x + a)^2 + 1)) + 2*b*x*log(-2*(-I*tan(b*x + a) - 1)/(tan(b*x +
a)^2 + 1)) + I*dilog(2*(I*tan(b*x + a) - 1)/(tan(b*x + a)^2 + 1) + 1) - I*dilog(2*(-I*tan(b*x + a) - 1)/(tan(b
*x + a)^2 + 1) + 1))/b^2

________________________________________________________________________________________

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

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

[In]

integrate(x*tan(b*x+a),x)

[Out]

Integral(x*tan(a + b*x), x)

________________________________________________________________________________________

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

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

[In]

integrate(x*tan(b*x+a),x, algorithm="giac")

[Out]

integrate(x*tan(b*x + a), x)