3.128 \(\int x^3 \tan ^4(x) \, dx\)

Optimal. Leaf size=104 \[ 4 i x \text{PolyLog}\left (2,-e^{2 i x}\right )-2 \text{PolyLog}\left (3,-e^{2 i x}\right )+\frac{x^4}{4}+\frac{4 i x^3}{3}-\frac{x^2}{2}-4 x^2 \log \left (1+e^{2 i x}\right )+\frac{1}{3} x^3 \tan ^3(x)-\frac{1}{2} x^2 \tan ^2(x)-x^3 \tan (x)+x \tan (x)+\log (\cos (x)) \]

[Out]

-x^2/2 + ((4*I)/3)*x^3 + x^4/4 - 4*x^2*Log[1 + E^((2*I)*x)] + Log[Cos[x]] + (4*I)*x*PolyLog[2, -E^((2*I)*x)] -
 2*PolyLog[3, -E^((2*I)*x)] + x*Tan[x] - x^3*Tan[x] - (x^2*Tan[x]^2)/2 + (x^3*Tan[x]^3)/3

________________________________________________________________________________________

Rubi [A]  time = 0.227076, antiderivative size = 104, normalized size of antiderivative = 1., number of steps used = 17, number of rules used = 8, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 1., Rules used = {3720, 3475, 30, 3719, 2190, 2531, 2282, 6589} \[ 4 i x \text{PolyLog}\left (2,-e^{2 i x}\right )-2 \text{PolyLog}\left (3,-e^{2 i x}\right )+\frac{x^4}{4}+\frac{4 i x^3}{3}-\frac{x^2}{2}-4 x^2 \log \left (1+e^{2 i x}\right )+\frac{1}{3} x^3 \tan ^3(x)-\frac{1}{2} x^2 \tan ^2(x)-x^3 \tan (x)+x \tan (x)+\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[x^3*Tan[x]^4,x]

[Out]

-x^2/2 + ((4*I)/3)*x^3 + x^4/4 - 4*x^2*Log[1 + E^((2*I)*x)] + Log[Cos[x]] + (4*I)*x*PolyLog[2, -E^((2*I)*x)] -
 2*PolyLog[3, -E^((2*I)*x)] + x*Tan[x] - x^3*Tan[x] - (x^2*Tan[x]^2)/2 + (x^3*Tan[x]^3)/3

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 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

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 2531

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> -Simp[((
f + g*x)^m*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)])/(b*c*n*Log[F]), x] + Dist[(g*m)/(b*c*n*Log[F]), Int[(f + g*x)
^(m - 1)*PolyLog[2, -(e*(F^(c*(a + b*x)))^n)], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin{align*} \int x^3 \tan ^4(x) \, dx &=\frac{1}{3} x^3 \tan ^3(x)-\int x^3 \tan ^2(x) \, dx-\int x^2 \tan ^3(x) \, dx\\ &=-x^3 \tan (x)-\frac{1}{2} x^2 \tan ^2(x)+\frac{1}{3} x^3 \tan ^3(x)+3 \int x^2 \tan (x) \, dx+\int x^3 \, dx+\int x^2 \tan (x) \, dx+\int x \tan ^2(x) \, dx\\ &=\frac{4 i x^3}{3}+\frac{x^4}{4}+x \tan (x)-x^3 \tan (x)-\frac{1}{2} x^2 \tan ^2(x)+\frac{1}{3} x^3 \tan ^3(x)-2 i \int \frac{e^{2 i x} x^2}{1+e^{2 i x}} \, dx-6 i \int \frac{e^{2 i x} x^2}{1+e^{2 i x}} \, dx-\int x \, dx-\int \tan (x) \, dx\\ &=-\frac{x^2}{2}+\frac{4 i x^3}{3}+\frac{x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+x \tan (x)-x^3 \tan (x)-\frac{1}{2} x^2 \tan ^2(x)+\frac{1}{3} x^3 \tan ^3(x)+2 \int x \log \left (1+e^{2 i x}\right ) \, dx+6 \int x \log \left (1+e^{2 i x}\right ) \, dx\\ &=-\frac{x^2}{2}+\frac{4 i x^3}{3}+\frac{x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text{Li}_2\left (-e^{2 i x}\right )+x \tan (x)-x^3 \tan (x)-\frac{1}{2} x^2 \tan ^2(x)+\frac{1}{3} x^3 \tan ^3(x)-i \int \text{Li}_2\left (-e^{2 i x}\right ) \, dx-3 i \int \text{Li}_2\left (-e^{2 i x}\right ) \, dx\\ &=-\frac{x^2}{2}+\frac{4 i x^3}{3}+\frac{x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text{Li}_2\left (-e^{2 i x}\right )+x \tan (x)-x^3 \tan (x)-\frac{1}{2} x^2 \tan ^2(x)+\frac{1}{3} x^3 \tan ^3(x)-\frac{1}{2} \operatorname{Subst}\left (\int \frac{\text{Li}_2(-x)}{x} \, dx,x,e^{2 i x}\right )-\frac{3}{2} \operatorname{Subst}\left (\int \frac{\text{Li}_2(-x)}{x} \, dx,x,e^{2 i x}\right )\\ &=-\frac{x^2}{2}+\frac{4 i x^3}{3}+\frac{x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text{Li}_2\left (-e^{2 i x}\right )-2 \text{Li}_3\left (-e^{2 i x}\right )+x \tan (x)-x^3 \tan (x)-\frac{1}{2} x^2 \tan ^2(x)+\frac{1}{3} x^3 \tan ^3(x)\\ \end{align*}

Mathematica [A]  time = 0.14389, size = 101, normalized size = 0.97 \[ 4 i x \text{PolyLog}\left (2,-e^{2 i x}\right )-2 \text{PolyLog}\left (3,-e^{2 i x}\right )+\frac{x^4}{4}+\frac{4 i x^3}{3}-4 x^2 \log \left (1+e^{2 i x}\right )-\frac{4}{3} x^3 \tan (x)-\frac{1}{2} x^2 \sec ^2(x)+\frac{1}{3} x^3 \tan (x) \sec ^2(x)+x \tan (x)+\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[x^3*Tan[x]^4,x]

[Out]

((4*I)/3)*x^3 + x^4/4 - 4*x^2*Log[1 + E^((2*I)*x)] + Log[Cos[x]] + (4*I)*x*PolyLog[2, -E^((2*I)*x)] - 2*PolyLo
g[3, -E^((2*I)*x)] - (x^2*Sec[x]^2)/2 + x*Tan[x] - (4*x^3*Tan[x])/3 + (x^3*Sec[x]^2*Tan[x])/3

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 138, normalized size = 1.3 \begin{align*}{\frac{{x}^{4}}{4}}-{\frac{{\frac{2\,i}{3}}x \left ( 6\,{x}^{2}{{\rm e}^{4\,ix}}+6\,{x}^{2}{{\rm e}^{2\,ix}}-3\,{{\rm e}^{4\,ix}}-3\,ix{{\rm e}^{4\,ix}}+4\,{x}^{2}-6\,{{\rm e}^{2\,ix}}-3\,ix{{\rm e}^{2\,ix}}-3 \right ) }{ \left ( 1+{{\rm e}^{2\,ix}} \right ) ^{3}}}-2\,\ln \left ({{\rm e}^{ix}} \right ) +\ln \left ( 1+{{\rm e}^{2\,ix}} \right ) +{\frac{8\,i}{3}}{x}^{3}-4\,{x}^{2}\ln \left ( 1+{{\rm e}^{2\,ix}} \right ) +4\,ix{\it polylog} \left ( 2,-{{\rm e}^{2\,ix}} \right ) -2\,{\it polylog} \left ( 3,-{{\rm e}^{2\,ix}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3*tan(x)^4,x)

[Out]

1/4*x^4-2/3*I*x*(6*x^2*exp(4*I*x)+6*x^2*exp(2*I*x)-3*exp(4*I*x)-3*I*x*exp(4*I*x)+4*x^2-6*exp(2*I*x)-3*I*x*exp(
2*I*x)-3)/(1+exp(2*I*x))^3-2*ln(exp(I*x))+ln(1+exp(2*I*x))+8/3*I*x^3-4*x^2*ln(1+exp(2*I*x))+4*I*x*polylog(2,-e
xp(2*I*x))-2*polylog(3,-exp(2*I*x))

________________________________________________________________________________________

Maxima [B]  time = 1.72096, size = 655, normalized size = 6.3 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*tan(x)^4,x, algorithm="maxima")

[Out]

-(3*I*x^4 + (48*x^2 + 12*(4*x^2 - 1)*cos(6*x) + 36*(4*x^2 - 1)*cos(4*x) + 36*(4*x^2 - 1)*cos(2*x) + (48*I*x^2
- 12*I)*sin(6*x) + (144*I*x^2 - 36*I)*sin(4*x) + (144*I*x^2 - 36*I)*sin(2*x) - 12)*arctan2(sin(2*x), cos(2*x)
+ 1) + (3*I*x^4 - 32*x^3 + 24*x)*cos(6*x) + (9*I*x^4 - 48*x^3 - 24*I*x^2 + 48*x)*cos(4*x) + (9*I*x^4 - 48*x^3
- 24*I*x^2 + 24*x)*cos(2*x) - (48*x*cos(6*x) + 144*x*cos(4*x) + 144*x*cos(2*x) + 48*I*x*sin(6*x) + 144*I*x*sin
(4*x) + 144*I*x*sin(2*x) + 48*x)*dilog(-e^(2*I*x)) + (-24*I*x^2 + (-24*I*x^2 + 6*I)*cos(6*x) + (-72*I*x^2 + 18
*I)*cos(4*x) + (-72*I*x^2 + 18*I)*cos(2*x) + 6*(4*x^2 - 1)*sin(6*x) + 18*(4*x^2 - 1)*sin(4*x) + 18*(4*x^2 - 1)
*sin(2*x) + 6*I)*log(cos(2*x)^2 + sin(2*x)^2 + 2*cos(2*x) + 1) + (-24*I*cos(6*x) - 72*I*cos(4*x) - 72*I*cos(2*
x) + 24*sin(6*x) + 72*sin(4*x) + 72*sin(2*x) - 24*I)*polylog(3, -e^(2*I*x)) - (3*x^4 + 32*I*x^3 - 24*I*x)*sin(
6*x) - (9*x^4 + 48*I*x^3 - 24*x^2 - 48*I*x)*sin(4*x) - (9*x^4 + 48*I*x^3 - 24*x^2 - 24*I*x)*sin(2*x))/(-12*I*c
os(6*x) - 36*I*cos(4*x) - 36*I*cos(2*x) + 12*sin(6*x) + 36*sin(4*x) + 36*sin(2*x) - 12*I)

________________________________________________________________________________________

Fricas [C]  time = 1.92639, size = 548, normalized size = 5.27 \begin{align*} \frac{1}{3} \, x^{3} \tan \left (x\right )^{3} + \frac{1}{4} \, x^{4} - \frac{1}{2} \, x^{2} \tan \left (x\right )^{2} - \frac{1}{2} \, x^{2} - 2 i \, x{\rm Li}_2\left (\frac{2 \,{\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) + 2 i \, x{\rm Li}_2\left (\frac{2 \,{\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) - \frac{1}{2} \,{\left (4 \, x^{2} - 1\right )} \log \left (-\frac{2 \,{\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) - \frac{1}{2} \,{\left (4 \, x^{2} - 1\right )} \log \left (-\frac{2 \,{\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) -{\left (x^{3} - x\right )} \tan \left (x\right ) -{\rm polylog}\left (3, \frac{\tan \left (x\right )^{2} + 2 i \, \tan \left (x\right ) - 1}{\tan \left (x\right )^{2} + 1}\right ) -{\rm polylog}\left (3, \frac{\tan \left (x\right )^{2} - 2 i \, \tan \left (x\right ) - 1}{\tan \left (x\right )^{2} + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*tan(x)^4,x, algorithm="fricas")

[Out]

1/3*x^3*tan(x)^3 + 1/4*x^4 - 1/2*x^2*tan(x)^2 - 1/2*x^2 - 2*I*x*dilog(2*(I*tan(x) - 1)/(tan(x)^2 + 1) + 1) + 2
*I*x*dilog(2*(-I*tan(x) - 1)/(tan(x)^2 + 1) + 1) - 1/2*(4*x^2 - 1)*log(-2*(I*tan(x) - 1)/(tan(x)^2 + 1)) - 1/2
*(4*x^2 - 1)*log(-2*(-I*tan(x) - 1)/(tan(x)^2 + 1)) - (x^3 - x)*tan(x) - polylog(3, (tan(x)^2 + 2*I*tan(x) - 1
)/(tan(x)^2 + 1)) - polylog(3, (tan(x)^2 - 2*I*tan(x) - 1)/(tan(x)^2 + 1))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**3*tan(x)**4,x)

[Out]

Integral(x**3*tan(x)**4, x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*tan(x)^4,x, algorithm="giac")

[Out]

integrate(x^3*tan(x)^4, x)