3.267 \(\int (a \sec (x)+b \tan (x)) \, dx\)

Optimal. Leaf size=12 \[ a \tanh ^{-1}(\sin (x))-b \log (\cos (x)) \]

[Out]

a*ArcTanh[Sin[x]] - b*Log[Cos[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0074644, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {3770, 3475} \[ a \tanh ^{-1}(\sin (x))-b \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[a*Sec[x] + b*Tan[x],x]

[Out]

a*ArcTanh[Sin[x]] - b*Log[Cos[x]]

Rule 3770

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

Rule 3475

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

Rubi steps

\begin{align*} \int (a \sec (x)+b \tan (x)) \, dx &=a \int \sec (x) \, dx+b \int \tan (x) \, dx\\ &=a \tanh ^{-1}(\sin (x))-b \log (\cos (x))\\ \end{align*}

Mathematica [B]  time = 0.0053123, size = 42, normalized size = 3.5 \[ -a \log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )+a \log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )-b \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[a*Sec[x] + b*Tan[x],x]

[Out]

-(b*Log[Cos[x]]) - a*Log[Cos[x/2] - Sin[x/2]] + a*Log[Cos[x/2] + Sin[x/2]]

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 16, normalized size = 1.3 \begin{align*} a\ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) -b\ln \left ( \cos \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a*sec(x)+b*tan(x),x)

[Out]

a*ln(sec(x)+tan(x))-b*ln(cos(x))

________________________________________________________________________________________

Maxima [A]  time = 1.00249, size = 19, normalized size = 1.58 \begin{align*} a \log \left (\sec \left (x\right ) + \tan \left (x\right )\right ) + b \log \left (\sec \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*log(sec(x) + tan(x)) + b*log(sec(x))

________________________________________________________________________________________

Fricas [B]  time = 2.23704, size = 81, normalized size = 6.75 \begin{align*} \frac{1}{2} \,{\left (a - b\right )} \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \,{\left (a + b\right )} \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(a - b)*log(sin(x) + 1) - 1/2*(a + b)*log(-sin(x) + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.107771, size = 24, normalized size = 2. \begin{align*} a \left (- \frac{\log{\left (\sin{\left (x \right )} - 1 \right )}}{2} + \frac{\log{\left (\sin{\left (x \right )} + 1 \right )}}{2}\right ) - b \log{\left (\cos{\left (x \right )} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*sec(x)+b*tan(x),x)

[Out]

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

________________________________________________________________________________________

Giac [B]  time = 1.14809, size = 46, normalized size = 3.83 \begin{align*} \frac{1}{4} \, a{\left (\log \left ({\left | \frac{1}{\sin \left (x\right )} + \sin \left (x\right ) + 2 \right |}\right ) - \log \left ({\left | \frac{1}{\sin \left (x\right )} + \sin \left (x\right ) - 2 \right |}\right )\right )} - b \log \left ({\left | \cos \left (x\right ) \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*a*(log(abs(1/sin(x) + sin(x) + 2)) - log(abs(1/sin(x) + sin(x) - 2))) - b*log(abs(cos(x)))