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*ln(cos(x))

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 12, normalized size of antiderivative = 1.00, 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 3475

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

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*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.01, size = 42, normalized size = 3.50 \[ -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]]

________________________________________________________________________________________

fricas [B]  time = 1.49, size = 25, normalized size = 2.08 \[ \frac {1}{2} \, {\left (a - b\right )} \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, {\left (a + b\right )} \log \left (-\sin \relax (x) + 1\right ) \]

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)

________________________________________________________________________________________

giac [B]  time = 0.13, size = 34, normalized size = 2.83 \[ \frac {1}{4} \, a {\left (\log \left ({\left | \frac {1}{\sin \relax (x)} + \sin \relax (x) + 2 \right |}\right ) - \log \left ({\left | \frac {1}{\sin \relax (x)} + \sin \relax (x) - 2 \right |}\right )\right )} - b \log \left ({\left | \cos \relax (x) \right |}\right ) \]

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

________________________________________________________________________________________

maple [A]  time = 0.00, size = 16, normalized size = 1.33 \[ a \ln \left (\sec \relax (x )+\tan \relax (x )\right )-b \ln \left (\cos \relax (x )\right ) \]

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 = 0.30, size = 14, normalized size = 1.17 \[ a \log \left (\sec \relax (x) + \tan \relax (x)\right ) + b \log \left (\sec \relax (x)\right ) \]

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

________________________________________________________________________________________

mupad [B]  time = 2.49, size = 37, normalized size = 3.08 \[ b\,\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )-\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right )\,\left (a+b\right )+\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )\,\left (a-b\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(b*tan(x) + a/cos(x),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 24, normalized size = 2.00 \[ a \left (- \frac {\log {\left (\sin {\relax (x )} - 1 \right )}}{2} + \frac {\log {\left (\sin {\relax (x )} + 1 \right )}}{2}\right ) - b \log {\left (\cos {\relax (x )} \right )} \]

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

________________________________________________________________________________________