\(\int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx\) [727]

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

Optimal result

Integrand size = 14, antiderivative size = 7 \[ \int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx=-\log (1+\cos (x)) \]

[Out]

-ln(1+cos(x))

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 7, 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.143, Rules used = {4424, 31} \[ \int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx=-\log (\cos (x)+1) \]

[In]

Int[(Sec[x]*Tan[x])/(Sec[x] + Sec[x]^2),x]

[Out]

-Log[1 + Cos[x]]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 4424

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Cos[c*(a + b*x)], x]}, Dist[-(b*
c)^(-1), Subst[Int[SubstFor[1/x, Cos[c*(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[
c*(a + b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Tan] || EqQ[F, tan])

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{1+x} \, dx,x,\cos (x)\right ) \\ & = -\log (1+\cos (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.29 \[ \int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx=-2 \log \left (\cos \left (\frac {x}{2}\right )\right ) \]

[In]

Integrate[(Sec[x]*Tan[x])/(Sec[x] + Sec[x]^2),x]

[Out]

-2*Log[Cos[x/2]]

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.71

method result size
derivativedivides \(\ln \left (\sec \left (x \right )\right )-\ln \left (1+\sec \left (x \right )\right )\) \(12\)
default \(\ln \left (\sec \left (x \right )\right )-\ln \left (1+\sec \left (x \right )\right )\) \(12\)
risch \(i x -2 \ln \left ({\mathrm e}^{i x}+1\right )\) \(16\)

[In]

int(sec(x)*tan(x)/(sec(x)+sec(x)^2),x,method=_RETURNVERBOSE)

[Out]

ln(sec(x))-ln(1+sec(x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.29 \[ \int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx=-\log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \]

[In]

integrate(sec(x)*tan(x)/(sec(x)+sec(x)^2),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.10 (sec) , antiderivative size = 15, normalized size of antiderivative = 2.14 \[ \int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx=\frac {\log {\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{2} - \log {\left (\sec {\left (x \right )} + 1 \right )} \]

[In]

integrate(sec(x)*tan(x)/(sec(x)+sec(x)**2),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx=-\log \left (\cos \left (x\right ) + 1\right ) \]

[In]

integrate(sec(x)*tan(x)/(sec(x)+sec(x)^2),x, algorithm="maxima")

[Out]

-log(cos(x) + 1)

Giac [A] (verification not implemented)

none

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

[In]

integrate(sec(x)*tan(x)/(sec(x)+sec(x)^2),x, algorithm="giac")

[Out]

-log(cos(x) + 1)

Mupad [B] (verification not implemented)

Time = 26.60 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.29 \[ \int \frac {\sec (x) \tan (x)}{\sec (x)+\sec ^2(x)} \, dx=\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right ) \]

[In]

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

[Out]

log(tan(x/2)^2 + 1)