### 3.13 $$\int x \tan ^3(a+b x) \, dx$$

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

[Out]

x/(2*b) - (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 - Tan[
a + b*x]/(2*b^2) + (x*Tan[a + b*x]^2)/(2*b)

________________________________________________________________________________________

Rubi [A]  time = 0.102632, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 10, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.7, Rules used = {3720, 3473, 8, 3719, 2190, 2279, 2391} $-\frac{i \text{Li}_2\left (-e^{2 i (a+b x)}\right )}{2 b^2}-\frac{\tan (a+b x)}{2 b^2}+\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}+\frac{x \tan ^2(a+b x)}{2 b}+\frac{x}{2 b}-\frac{i x^2}{2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x/(2*b) - (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 - Tan[
a + b*x]/(2*b^2) + (x*Tan[a + b*x]^2)/(2*b)

Rule 3720

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(c + d*x)^m*(b*Tan[e
+ f*x])^(n - 1))/(f*(n - 1)), x] + (-Dist[(b*d*m)/(f*(n - 1)), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

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 ^3(a+b x) \, dx &=\frac{x \tan ^2(a+b x)}{2 b}-\frac{\int \tan ^2(a+b x) \, dx}{2 b}-\int x \tan (a+b x) \, dx\\ &=-\frac{i x^2}{2}-\frac{\tan (a+b x)}{2 b^2}+\frac{x \tan ^2(a+b x)}{2 b}+2 i \int \frac{e^{2 i (a+b x)} x}{1+e^{2 i (a+b x)}} \, dx+\frac{\int 1 \, dx}{2 b}\\ &=\frac{x}{2 b}-\frac{i x^2}{2}+\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac{\tan (a+b x)}{2 b^2}+\frac{x \tan ^2(a+b x)}{2 b}-\frac{\int \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b}\\ &=\frac{x}{2 b}-\frac{i x^2}{2}+\frac{x \log \left (1+e^{2 i (a+b x)}\right )}{b}-\frac{\tan (a+b x)}{2 b^2}+\frac{x \tan ^2(a+b x)}{2 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{x}{2 b}-\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}-\frac{\tan (a+b x)}{2 b^2}+\frac{x \tan ^2(a+b x)}{2 b}\\ \end{align*}

Mathematica [A]  time = 4.31034, size = 171, normalized size = 1.9 $\frac{-i \text{PolyLog}\left (2,e^{2 i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )-b^2 x^2 \tan (a)+b^2 x^2 \tan (a) \sqrt{\csc ^2(a)} e^{-i \tan ^{-1}(\cot (a))}+b x \sec ^2(a+b x)+i b x \left (2 \tan ^{-1}(\cot (a))+\pi \right )-\sec (a) \sin (b x) \sec (a+b x)+2 \left (b x-\tan ^{-1}(\cot (a))\right ) \log \left (1-e^{2 i \left (b x-\tan ^{-1}(\cot (a))\right )}\right )+2 \tan ^{-1}(\cot (a)) \log \left (\sin \left (b x-\tan ^{-1}(\cot (a))\right )\right )+\pi \log \left (1+e^{-2 i b x}\right )-\pi \log (\cos (b x))}{2 b^2}$

Warning: Unable to verify antiderivative.

[In]

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

[Out]

(I*b*x*(Pi + 2*ArcTan[Cot[a]]) + Pi*Log[1 + E^((-2*I)*b*x)] + 2*(b*x - ArcTan[Cot[a]])*Log[1 - E^((2*I)*(b*x -
ArcTan[Cot[a]]))] - Pi*Log[Cos[b*x]] + 2*ArcTan[Cot[a]]*Log[Sin[b*x - ArcTan[Cot[a]]]] - I*PolyLog[2, E^((2*I
)*(b*x - ArcTan[Cot[a]]))] + b*x*Sec[a + b*x]^2 - Sec[a]*Sec[a + b*x]*Sin[b*x] - b^2*x^2*Tan[a] + (b^2*x^2*Sqr
t[Csc[a]^2]*Tan[a])/E^(I*ArcTan[Cot[a]]))/(2*b^2)

________________________________________________________________________________________

Maple [A]  time = 0.051, size = 122, normalized size = 1.4 \begin{align*} -{\frac{i}{2}}{x}^{2}+{\frac{2\,bx{{\rm e}^{2\,i \left ( bx+a \right ) }}-i{{\rm e}^{2\,i \left ( bx+a \right ) }}-i}{{b}^{2} \left ( 1+{{\rm e}^{2\,i \left ( bx+a \right ) }} \right ) ^{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)^3,x)

[Out]

-1/2*I*x^2+(2*b*x*exp(2*I*(b*x+a))-I*exp(2*I*(b*x+a))-I)/b^2/(1+exp(2*I*(b*x+a)))^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.87564, size = 524, normalized size = 5.82 \begin{align*} -\frac{b^{2} x^{2} \cos \left (4 \, b x + 4 \, a\right ) + i \, b^{2} x^{2} \sin \left (4 \, b x + 4 \, a\right ) + b^{2} x^{2} -{\left (2 \, b x \cos \left (4 \, b x + 4 \, a\right ) + 4 \, b x \cos \left (2 \, b x + 2 \, a\right ) + 2 i \, b x \sin \left (4 \, b x + 4 \, a\right ) + 4 i \, b x \sin \left (2 \, b x + 2 \, a\right ) + 2 \, b x\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \,{\left (b^{2} x^{2} + 2 i \, b x + 1\right )} \cos \left (2 \, b x + 2 \, a\right ) +{\left (\cos \left (4 \, b x + 4 \, a\right ) + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (4 \, b x + 4 \, a\right ) + 2 i \, \sin \left (2 \, b x + 2 \, a\right ) + 1\right )}{\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) -{\left (-i \, b x \cos \left (4 \, b x + 4 \, a\right ) - 2 i \, b x \cos \left (2 \, b x + 2 \, a\right ) + b x \sin \left (4 \, b x + 4 \, a\right ) + 2 \, b x \sin \left (2 \, b x + 2 \, a\right ) - i \, b x\right )} \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 ) -{\left (-2 i \, b^{2} x^{2} + 4 \, b x - 2 i\right )} \sin \left (2 \, b x + 2 \, a\right ) + 2}{-2 i \, b^{2} \cos \left (4 \, b x + 4 \, a\right ) - 4 i \, b^{2} \cos \left (2 \, b x + 2 \, a\right ) + 2 \, b^{2} \sin \left (4 \, b x + 4 \, a\right ) + 4 \, b^{2} \sin \left (2 \, b x + 2 \, a\right ) - 2 i \, b^{2}} \end{align*}

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

[In]

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

[Out]

-(b^2*x^2*cos(4*b*x + 4*a) + I*b^2*x^2*sin(4*b*x + 4*a) + b^2*x^2 - (2*b*x*cos(4*b*x + 4*a) + 4*b*x*cos(2*b*x
+ 2*a) + 2*I*b*x*sin(4*b*x + 4*a) + 4*I*b*x*sin(2*b*x + 2*a) + 2*b*x)*arctan2(sin(2*b*x + 2*a), cos(2*b*x + 2*
a) + 1) + 2*(b^2*x^2 + 2*I*b*x + 1)*cos(2*b*x + 2*a) + (cos(4*b*x + 4*a) + 2*cos(2*b*x + 2*a) + I*sin(4*b*x +
4*a) + 2*I*sin(2*b*x + 2*a) + 1)*dilog(-e^(2*I*b*x + 2*I*a)) - (-I*b*x*cos(4*b*x + 4*a) - 2*I*b*x*cos(2*b*x +
2*a) + b*x*sin(4*b*x + 4*a) + 2*b*x*sin(2*b*x + 2*a) - I*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) - (-2*I*b^2*x^2 + 4*b*x - 2*I)*sin(2*b*x + 2*a) + 2)/(-2*I*b^2*cos(4*b*x + 4*a) - 4*I*b^
2*cos(2*b*x + 2*a) + 2*b^2*sin(4*b*x + 4*a) + 4*b^2*sin(2*b*x + 2*a) - 2*I*b^2)

________________________________________________________________________________________

Fricas [B]  time = 1.60697, size = 396, normalized size = 4.4 \begin{align*} \frac{2 \, b x \tan \left (b x + a\right )^{2} + 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 ) + 2 \, b x + 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 ) - 2 \, \tan \left (b x + a\right )}{4 \, b^{2}} \end{align*}

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

[In]

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

[Out]

1/4*(2*b*x*tan(b*x + a)^2 + 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)) + 2*b*x + 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) - 2*tan(b*x + a))/b^2

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \tan ^{3}{\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)**3,x)

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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