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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, 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 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]

Rule 3770

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

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

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.13, 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]

-1/24*(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]))

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int x \sec (x) \tan ^3(x) \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.20, size = 47, normalized size = 1.57 \[ \frac {5 \, \cos \relax (x)^{3} \log \left (\sin \relax (x) + 1\right ) - 5 \, \cos \relax (x)^{3} \log \left (-\sin \relax (x) + 1\right ) - 12 \, x \cos \relax (x)^{2} - 2 \, \cos \relax (x) \sin \relax (x) + 4 \, x}{12 \, \cos \relax (x)^{3}} \]

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

________________________________________________________________________________________

giac [B]  time = 1.22, size = 341, normalized size = 11.37 \[ \frac {8 \, x \tan \left (\frac {1}{2} \, x\right )^{6} + 5 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{6} - 5 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{6} - 24 \, x \tan \left (\frac {1}{2} \, x\right )^{4} - 15 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{4} + 15 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{4} - 4 \, \tan \left (\frac {1}{2} \, x\right )^{5} - 24 \, x \tan \left (\frac {1}{2} \, x\right )^{2} + 15 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{2} - 15 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{2} + 8 \, x - 5 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) + 5 \, \log \left (\frac {2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, x\right ) + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) + 4 \, \tan \left (\frac {1}{2} \, x\right )}{12 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{6} - 3 \, \tan \left (\frac {1}{2} \, x\right )^{4} + 3 \, \tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}} \]

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)

________________________________________________________________________________________

maple [B]  time = 0.10, size = 76, normalized size = 2.53




method result size



norman \(\frac {\frac {2 x}{3}-\frac {\left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{3}-2 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )+\frac {2 x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{3}+\frac {\tan \left (\frac {x}{2}\right )}{3}}{\left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )^{3}}-\frac {5 \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{6}+\frac {5 \ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{6}\) \(76\)
risch \(-\frac {6 x \,{\mathrm e}^{5 i x}+4 x \,{\mathrm e}^{3 i x}-i {\mathrm e}^{5 i x}+6 x \,{\mathrm e}^{i x}+i {\mathrm e}^{i x}}{3 \left (1+{\mathrm e}^{2 i x}\right )^{3}}-\frac {5 \ln \left ({\mathrm e}^{i x}-i\right )}{6}+\frac {5 \ln \left ({\mathrm e}^{i x}+i\right )}{6}\) \(76\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2/3*x-1/3*tan(1/2*x)^5-2*x*tan(1/2*x)^2-2*x*tan(1/2*x)^4+2/3*x*tan(1/2*x)^6+1/3*tan(1/2*x))/(tan(1/2*x)^2-1)^
3-5/6*ln(tan(1/2*x)-1)+5/6*ln(tan(1/2*x)+1)

________________________________________________________________________________________

maxima [B]  time = 1.47, size = 619, normalized size = 20.63 \[ \text {result too large to display} \]

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)

________________________________________________________________________________________

mupad [B]  time = 0.50, size = 35, normalized size = 1.17 \[ -\frac {x\,{\cos \relax (x)}^2-\frac {x}{3}+\frac {\sin \left (2\,x\right )}{12}}{{\cos \relax (x)}^3}-\frac {\mathrm {atan}\left (\cos \relax (x)+\sin \relax (x)\,1{}\mathrm {i}\right )\,5{}\mathrm {i}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

- (atan(cos(x) + sin(x)*1i)*5i)/3 - (sin(2*x)/12 - x/3 + x*cos(x)^2)/cos(x)^3

________________________________________________________________________________________

sympy [B]  time = 1.69, size = 551, normalized size = 18.37 \[ \frac {4 x \tan ^{6}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} - \frac {12 x \tan ^{4}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} - \frac {12 x \tan ^{2}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} + \frac {4 x}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} - \frac {5 \log {\left (\tan {\left (\frac {x}{2} \right )} - 1 \right )} \tan ^{6}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} + \frac {15 \log {\left (\tan {\left (\frac {x}{2} \right )} - 1 \right )} \tan ^{4}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} - \frac {15 \log {\left (\tan {\left (\frac {x}{2} \right )} - 1 \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} + \frac {5 \log {\left (\tan {\left (\frac {x}{2} \right )} - 1 \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} + \frac {5 \log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{6}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} - \frac {15 \log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{4}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} + \frac {15 \log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} - \frac {5 \log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} - \frac {2 \tan ^{5}{\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} + \frac {2 \tan {\left (\frac {x}{2} \right )}}{6 \tan ^{6}{\left (\frac {x}{2} \right )} - 18 \tan ^{4}{\left (\frac {x}{2} \right )} + 18 \tan ^{2}{\left (\frac {x}{2} \right )} - 6} \]

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)

________________________________________________________________________________________