3.488 \(\int x \sec (x) \tan ^3(x) \, dx\)

Optimal. Leaf size=30 \[ \frac{1}{3} x \sec ^3(x)-x \sec (x)+\frac{5}{6} \tanh ^{-1}(\sin (x))-\frac{1}{6} \tan (x) \sec (x) \]

[Out]

(5*ArcTanh[Sin[x]])/6 - x*Sec[x] + (x*Sec[x]^3)/3 - (Sec[x]*Tan[x])/6

________________________________________________________________________________________

Rubi [A]  time = 0.0407061, antiderivative size = 30, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {2606, 4417, 3770, 3768} \[ \frac{1}{3} x \sec ^3(x)-x \sec (x)+\frac{5}{6} \tanh ^{-1}(\sin (x))-\frac{1}{6} \tan (x) \sec (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(5*ArcTanh[Sin[x]])/6 - x*Sec[x] + (x*Sec[x]^3)/3 - (Sec[x]*Tan[x])/6

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 4417

Int[((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b_.)*(x_)]^(n_.)*Tan[(a_.) + (b_.)*(x_)]^(p_.), x_Symbol] :> Modul
e[{u = IntHide[Sec[a + b*x]^n*Tan[a + b*x]^p, x]}, Dist[(c + d*x)^m, u, x] - Dist[d*m, Int[(c + d*x)^(m - 1)*u
, x], x]] /; FreeQ[{a, b, c, d, n, p}, x] && IGtQ[m, 0] && (IntegerQ[n/2] || IntegerQ[(p - 1)/2])

Rule 3770

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

Rule 3768

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Csc[c + d*x])^(n - 1))/(d*(n -
 1)), x] + Dist[(b^2*(n - 2))/(n - 1), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1
] && IntegerQ[2*n]

Rubi steps

\begin{align*} \int x \sec (x) \tan ^3(x) \, dx &=-x \sec (x)+\frac{1}{3} x \sec ^3(x)-\int \left (-\sec (x)+\frac{\sec ^3(x)}{3}\right ) \, dx\\ &=-x \sec (x)+\frac{1}{3} x \sec ^3(x)-\frac{1}{3} \int \sec ^3(x) \, dx+\int \sec (x) \, dx\\ &=\tanh ^{-1}(\sin (x))-x \sec (x)+\frac{1}{3} x \sec ^3(x)-\frac{1}{6} \sec (x) \tan (x)-\frac{1}{6} \int \sec (x) \, dx\\ &=\frac{5}{6} \tanh ^{-1}(\sin (x))-x \sec (x)+\frac{1}{3} x \sec ^3(x)-\frac{1}{6} \sec (x) \tan (x)\\ \end{align*}

Mathematica [B]  time = 0.11333, size = 104, normalized size = 3.47 \[ -\frac{1}{24} \sec ^3(x) \left (4 x+2 \sin (2 x)+12 x \cos (2 x)+5 \cos (3 x) \log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )+15 \cos (x) \left (\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )\right )-5 \cos (3 x) \log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(Sec[x]^3*(4*x + 12*x*Cos[2*x] + 5*Cos[3*x]*Log[Cos[x/2] - Sin[x/2]] + 15*Cos[x]*(Log[Cos[x/2] - Sin[x/2]] -
Log[Cos[x/2] + Sin[x/2]]) - 5*Cos[3*x]*Log[Cos[x/2] + Sin[x/2]] + 2*Sin[2*x]))/24

________________________________________________________________________________________

Maple [A]  time = 0.122, size = 30, normalized size = 1. \begin{align*} -{\frac{x}{\cos \left ( x \right ) }}+{\frac{5\,\ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) }{6}}+{\frac{x}{3\, \left ( \cos \left ( x \right ) \right ) ^{3}}}-{\frac{\sec \left ( x \right ) \tan \left ( x \right ) }{6}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sin(x)^3/cos(x)^4,x)

[Out]

-x/cos(x)+5/6*ln(sec(x)+tan(x))+1/3*x/cos(x)^3-1/6*sec(x)*tan(x)

________________________________________________________________________________________

Maxima [B]  time = 1.51156, size = 836, normalized size = 27.87 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x)^3/cos(x)^4,x, algorithm="maxima")

[Out]

-1/12*(48*x*sin(3*x)*sin(2*x) + 4*(6*x*cos(5*x) + 4*x*cos(3*x) + 6*x*cos(x) + sin(5*x) - sin(x))*cos(6*x) + 12
*(6*x*cos(4*x) + 6*x*cos(2*x) + 2*x - sin(4*x) - sin(2*x))*cos(5*x) + 12*(4*x*cos(3*x) + 6*x*cos(x) - sin(x))*
cos(4*x) + 16*(3*x*cos(2*x) + x)*cos(3*x) + 12*(6*x*cos(x) - sin(x))*cos(2*x) + 24*x*cos(x) - 5*(2*(3*cos(4*x)
 + 3*cos(2*x) + 1)*cos(6*x) + cos(6*x)^2 + 6*(3*cos(2*x) + 1)*cos(4*x) + 9*cos(4*x)^2 + 9*cos(2*x)^2 + 6*(sin(
4*x) + sin(2*x))*sin(6*x) + sin(6*x)^2 + 9*sin(4*x)^2 + 18*sin(4*x)*sin(2*x) + 9*sin(2*x)^2 + 6*cos(2*x) + 1)*
log(cos(x)^2 + sin(x)^2 + 2*sin(x) + 1) + 5*(2*(3*cos(4*x) + 3*cos(2*x) + 1)*cos(6*x) + cos(6*x)^2 + 6*(3*cos(
2*x) + 1)*cos(4*x) + 9*cos(4*x)^2 + 9*cos(2*x)^2 + 6*(sin(4*x) + sin(2*x))*sin(6*x) + sin(6*x)^2 + 9*sin(4*x)^
2 + 18*sin(4*x)*sin(2*x) + 9*sin(2*x)^2 + 6*cos(2*x) + 1)*log(cos(x)^2 + sin(x)^2 - 2*sin(x) + 1) + 4*(6*x*sin
(5*x) + 4*x*sin(3*x) + 6*x*sin(x) - cos(5*x) + cos(x))*sin(6*x) + 4*(18*x*sin(4*x) + 18*x*sin(2*x) + 3*cos(4*x
) + 3*cos(2*x) + 1)*sin(5*x) + 12*(4*x*sin(3*x) + 6*x*sin(x) + cos(x))*sin(4*x) + 12*(6*x*sin(x) + cos(x))*sin
(2*x) - 4*sin(x))/(2*(3*cos(4*x) + 3*cos(2*x) + 1)*cos(6*x) + cos(6*x)^2 + 6*(3*cos(2*x) + 1)*cos(4*x) + 9*cos
(4*x)^2 + 9*cos(2*x)^2 + 6*(sin(4*x) + sin(2*x))*sin(6*x) + sin(6*x)^2 + 9*sin(4*x)^2 + 18*sin(4*x)*sin(2*x) +
 9*sin(2*x)^2 + 6*cos(2*x) + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.9149, size = 154, normalized size = 5.13 \begin{align*} \frac{5 \, \cos \left (x\right )^{3} \log \left (\sin \left (x\right ) + 1\right ) - 5 \, \cos \left (x\right )^{3} \log \left (-\sin \left (x\right ) + 1\right ) - 12 \, x \cos \left (x\right )^{2} - 2 \, \cos \left (x\right ) \sin \left (x\right ) + 4 \, x}{12 \, \cos \left (x\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x)^3/cos(x)^4,x, algorithm="fricas")

[Out]

1/12*(5*cos(x)^3*log(sin(x) + 1) - 5*cos(x)^3*log(-sin(x) + 1) - 12*x*cos(x)^2 - 2*cos(x)*sin(x) + 4*x)/cos(x)
^3

________________________________________________________________________________________

Sympy [B]  time = 1.81592, size = 551, normalized size = 18.37 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x)**3/cos(x)**4,x)

[Out]

4*x*tan(x/2)**6/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) - 12*x*tan(x/2)**4/(6*tan(x/2)**6 - 18*t
an(x/2)**4 + 18*tan(x/2)**2 - 6) - 12*x*tan(x/2)**2/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) + 4*
x/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) - 5*log(tan(x/2) - 1)*tan(x/2)**6/(6*tan(x/2)**6 - 18*
tan(x/2)**4 + 18*tan(x/2)**2 - 6) + 15*log(tan(x/2) - 1)*tan(x/2)**4/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(
x/2)**2 - 6) - 15*log(tan(x/2) - 1)*tan(x/2)**2/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) + 5*log(
tan(x/2) - 1)/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) + 5*log(tan(x/2) + 1)*tan(x/2)**6/(6*tan(x
/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) - 15*log(tan(x/2) + 1)*tan(x/2)**4/(6*tan(x/2)**6 - 18*tan(x/2)*
*4 + 18*tan(x/2)**2 - 6) + 15*log(tan(x/2) + 1)*tan(x/2)**2/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 -
 6) - 5*log(tan(x/2) + 1)/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) - 2*tan(x/2)**5/(6*tan(x/2)**6
 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6) + 2*tan(x/2)/(6*tan(x/2)**6 - 18*tan(x/2)**4 + 18*tan(x/2)**2 - 6)

________________________________________________________________________________________

Giac [B]  time = 1.52935, size = 460, normalized size = 15.33 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x)^3/cos(x)^4,x, algorithm="giac")

[Out]

1/12*(8*x*tan(1/2*x)^6 + 5*log(2*(tan(1/2*x)^2 + 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1))*tan(1/2*x)^6 - 5*log(2*
(tan(1/2*x)^2 - 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1))*tan(1/2*x)^6 - 24*x*tan(1/2*x)^4 - 15*log(2*(tan(1/2*x)^
2 + 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1))*tan(1/2*x)^4 + 15*log(2*(tan(1/2*x)^2 - 2*tan(1/2*x) + 1)/(tan(1/2*x
)^2 + 1))*tan(1/2*x)^4 - 4*tan(1/2*x)^5 - 24*x*tan(1/2*x)^2 + 15*log(2*(tan(1/2*x)^2 + 2*tan(1/2*x) + 1)/(tan(
1/2*x)^2 + 1))*tan(1/2*x)^2 - 15*log(2*(tan(1/2*x)^2 - 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + 8*
x - 5*log(2*(tan(1/2*x)^2 + 2*tan(1/2*x) + 1)/(tan(1/2*x)^2 + 1)) + 5*log(2*(tan(1/2*x)^2 - 2*tan(1/2*x) + 1)/
(tan(1/2*x)^2 + 1)) + 4*tan(1/2*x))/(tan(1/2*x)^6 - 3*tan(1/2*x)^4 + 3*tan(1/2*x)^2 - 1)