\(\int x \sec (1+x) \tan (1+x) \, dx\) [904]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 14 \[ \int x \sec (1+x) \tan (1+x) \, dx=-\text {arctanh}(\sin (1+x))+x \sec (1+x) \]

[Out]

-arctanh(sin(1+x))+x*sec(1+x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3842, 3855} \[ \int x \sec (1+x) \tan (1+x) \, dx=x \sec (x+1)-\text {arctanh}(\sin (x+1)) \]

[In]

Int[x*Sec[1 + x]*Tan[1 + x],x]

[Out]

-ArcTanh[Sin[1 + x]] + x*Sec[1 + x]

Rule 3842

Int[(x_)^(m_.)*Sec[(a_.) + (b_.)*(x_)^(n_.)]^(p_.)*Tan[(a_.) + (b_.)*(x_)^(n_.)]^(q_.), x_Symbol] :> Simp[x^(m
 - n + 1)*(Sec[a + b*x^n]^p/(b*n*p)), x] - Dist[(m - n + 1)/(b*n*p), Int[x^(m - n)*Sec[a + b*x^n]^p, x], x] /;
 FreeQ[{a, b, p}, x] && IntegerQ[n] && GeQ[m, n] && EqQ[q, 1]

Rule 3855

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

Rubi steps \begin{align*} \text {integral}& = x \sec (1+x)-\int \sec (1+x) \, dx \\ & = -\text {arctanh}(\sin (1+x))+x \sec (1+x) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(47\) vs. \(2(14)=28\).

Time = 0.04 (sec) , antiderivative size = 47, normalized size of antiderivative = 3.36 \[ \int x \sec (1+x) \tan (1+x) \, dx=\log \left (\cos \left (\frac {1+x}{2}\right )-\sin \left (\frac {1+x}{2}\right )\right )-\log \left (\cos \left (\frac {1+x}{2}\right )+\sin \left (\frac {1+x}{2}\right )\right )+x \sec (1+x) \]

[In]

Integrate[x*Sec[1 + x]*Tan[1 + x],x]

[Out]

Log[Cos[(1 + x)/2] - Sin[(1 + x)/2]] - Log[Cos[(1 + x)/2] + Sin[(1 + x)/2]] + x*Sec[1 + x]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(31\) vs. \(2(14)=28\).

Time = 0.29 (sec) , antiderivative size = 32, normalized size of antiderivative = 2.29

method result size
derivativedivides \(\frac {x +1}{\cos \left (x +1\right )}-\ln \left (\sec \left (x +1\right )+\tan \left (x +1\right )\right )-\frac {1}{\cos \left (x +1\right )}\) \(32\)
default \(\frac {x +1}{\cos \left (x +1\right )}-\ln \left (\sec \left (x +1\right )+\tan \left (x +1\right )\right )-\frac {1}{\cos \left (x +1\right )}\) \(32\)
risch \(\frac {2 x \,{\mathrm e}^{i \left (x +1\right )}}{{\mathrm e}^{2 i \left (x +1\right )}+1}+\ln \left ({\mathrm e}^{i \left (x +1\right )}-i\right )-\ln \left ({\mathrm e}^{i \left (x +1\right )}+i\right )\) \(47\)

[In]

int(x*sec(x+1)*tan(x+1),x,method=_RETURNVERBOSE)

[Out]

(x+1)/cos(x+1)-ln(sec(x+1)+tan(x+1))-1/cos(x+1)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (14) = 28\).

Time = 0.24 (sec) , antiderivative size = 39, normalized size of antiderivative = 2.79 \[ \int x \sec (1+x) \tan (1+x) \, dx=-\frac {\cos \left (x + 1\right ) \log \left (\sin \left (x + 1\right ) + 1\right ) - \cos \left (x + 1\right ) \log \left (-\sin \left (x + 1\right ) + 1\right ) - 2 \, x}{2 \, \cos \left (x + 1\right )} \]

[In]

integrate(x*sec(1+x)*tan(1+x),x, algorithm="fricas")

[Out]

-1/2*(cos(x + 1)*log(sin(x + 1) + 1) - cos(x + 1)*log(-sin(x + 1) + 1) - 2*x)/cos(x + 1)

Sympy [A] (verification not implemented)

Time = 0.85 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.21 \[ \int x \sec (1+x) \tan (1+x) \, dx=x \sec {\left (x + 1 \right )} - \log {\left (\tan {\left (x + 1 \right )} + \sec {\left (x + 1 \right )} \right )} \]

[In]

integrate(x*sec(1+x)*tan(1+x),x)

[Out]

x*sec(x + 1) - log(tan(x + 1) + sec(x + 1))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 176 vs. \(2 (14) = 28\).

Time = 0.28 (sec) , antiderivative size = 176, normalized size of antiderivative = 12.57 \[ \int x \sec (1+x) \tan (1+x) \, dx=\frac {4 \, {\left (x + 1\right )} \cos \left (2 \, x + 2\right ) \cos \left (x + 1\right ) + 4 \, {\left (x + 1\right )} \sin \left (2 \, x + 2\right ) \sin \left (x + 1\right ) + 4 \, {\left (x + 1\right )} \cos \left (x + 1\right ) - {\left (\cos \left (2 \, x + 2\right )^{2} + \sin \left (2 \, x + 2\right )^{2} + 2 \, \cos \left (2 \, x + 2\right ) + 1\right )} \log \left (\cos \left (x + 1\right )^{2} + \sin \left (x + 1\right )^{2} + 2 \, \sin \left (x + 1\right ) + 1\right ) + {\left (\cos \left (2 \, x + 2\right )^{2} + \sin \left (2 \, x + 2\right )^{2} + 2 \, \cos \left (2 \, x + 2\right ) + 1\right )} \log \left (\cos \left (x + 1\right )^{2} + \sin \left (x + 1\right )^{2} - 2 \, \sin \left (x + 1\right ) + 1\right )}{2 \, {\left (\cos \left (2 \, x + 2\right )^{2} + \sin \left (2 \, x + 2\right )^{2} + 2 \, \cos \left (2 \, x + 2\right ) + 1\right )}} - \frac {1}{\cos \left (x + 1\right )} \]

[In]

integrate(x*sec(1+x)*tan(1+x),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 949 vs. \(2 (14) = 28\).

Time = 0.45 (sec) , antiderivative size = 949, normalized size of antiderivative = 67.79 \[ \int x \sec (1+x) \tan (1+x) \, dx=\text {Too large to display} \]

[In]

integrate(x*sec(1+x)*tan(1+x),x, algorithm="giac")

[Out]

1/2*(2*x*tan(1/2)^2*tan(1/2*x)^2 + log(2*(tan(1/2)^2*tan(1/2*x)^2 + 2*tan(1/2)^2*tan(1/2*x) + 2*tan(1/2)*tan(1
/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 - 2*tan(1/2) - 2*tan(1/2*x) + 1)/(tan(1/2)^2*tan(1/2*x)^2 + tan(1/2)^2 + t
an(1/2*x)^2 + 1))*tan(1/2)^2*tan(1/2*x)^2 - log(2*(tan(1/2)^2*tan(1/2*x)^2 - 2*tan(1/2)^2*tan(1/2*x) - 2*tan(1
/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 2*tan(1/2) + 2*tan(1/2*x) + 1)/(tan(1/2)^2*tan(1/2*x)^2 + tan(1
/2)^2 + tan(1/2*x)^2 + 1))*tan(1/2)^2*tan(1/2*x)^2 + 2*x*tan(1/2)^2 - log(2*(tan(1/2)^2*tan(1/2*x)^2 + 2*tan(1
/2)^2*tan(1/2*x) + 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 - 2*tan(1/2) - 2*tan(1/2*x) + 1)/(tan(1
/2)^2*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1))*tan(1/2)^2 + log(2*(tan(1/2)^2*tan(1/2*x)^2 - 2*tan(1/2)^
2*tan(1/2*x) - 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 2*tan(1/2) + 2*tan(1/2*x) + 1)/(tan(1/2)^
2*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1))*tan(1/2)^2 - 4*log(2*(tan(1/2)^2*tan(1/2*x)^2 + 2*tan(1/2)^2*
tan(1/2*x) + 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 - 2*tan(1/2) - 2*tan(1/2*x) + 1)/(tan(1/2)^2*
tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1))*tan(1/2)*tan(1/2*x) + 4*log(2*(tan(1/2)^2*tan(1/2*x)^2 - 2*tan(
1/2)^2*tan(1/2*x) - 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 2*tan(1/2) + 2*tan(1/2*x) + 1)/(tan(
1/2)^2*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1))*tan(1/2)*tan(1/2*x) + 2*x*tan(1/2*x)^2 - log(2*(tan(1/2)
^2*tan(1/2*x)^2 + 2*tan(1/2)^2*tan(1/2*x) + 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 - 2*tan(1/2) -
 2*tan(1/2*x) + 1)/(tan(1/2)^2*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + log(2*(tan(1/2)^2
*tan(1/2*x)^2 - 2*tan(1/2)^2*tan(1/2*x) - 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 2*tan(1/2) + 2
*tan(1/2*x) + 1)/(tan(1/2)^2*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + 2*x + log(2*(tan(1/
2)^2*tan(1/2*x)^2 + 2*tan(1/2)^2*tan(1/2*x) + 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 - 2*tan(1/2)
 - 2*tan(1/2*x) + 1)/(tan(1/2)^2*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1)) - log(2*(tan(1/2)^2*tan(1/2*x)
^2 - 2*tan(1/2)^2*tan(1/2*x) - 2*tan(1/2)*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 2*tan(1/2) + 2*tan(1/2*x)
 + 1)/(tan(1/2)^2*tan(1/2*x)^2 + tan(1/2)^2 + tan(1/2*x)^2 + 1)))/(tan(1/2)^2*tan(1/2*x)^2 - tan(1/2)^2 - 4*ta
n(1/2)*tan(1/2*x) - tan(1/2*x)^2 + 1)

Mupad [B] (verification not implemented)

Time = 26.92 (sec) , antiderivative size = 34, normalized size of antiderivative = 2.43 \[ \int x \sec (1+x) \tan (1+x) \, dx=\frac {2\,x\,\cos \left (x+1\right )}{\cos \left (2\,x+2\right )+1}+\mathrm {atan}\left (\cos \left (x+1\right )+\sin \left (x+1\right )\,1{}\mathrm {i}\right )\,2{}\mathrm {i} \]

[In]

int((x*tan(x + 1))/cos(x + 1),x)

[Out]

atan(cos(x + 1) + sin(x + 1)*1i)*2i + (2*x*cos(x + 1))/(cos(2*x + 2) + 1)