3.121 \(\int \cos (2 x) \sec (x) \, dx\)

Optimal. Leaf size=10 \[ 2 \sin (x)-\tanh ^{-1}(\sin (x)) \]

[Out]

-ArcTanh[Sin[x]] + 2*Sin[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0179098, antiderivative size = 10, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.429, Rules used = {4364, 388, 206} \[ 2 \sin (x)-\tanh ^{-1}(\sin (x)) \]

Antiderivative was successfully verified.

[In]

Int[Cos[2*x]*Sec[x],x]

[Out]

-ArcTanh[Sin[x]] + 2*Sin[x]

Rule 4364

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

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \cos (2 x) \sec (x) \, dx &=\operatorname{Subst}\left (\int \frac{1-2 x^2}{1-x^2} \, dx,x,\sin (x)\right )\\ &=2 \sin (x)-\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (x)\right )\\ &=-\tanh ^{-1}(\sin (x))+2 \sin (x)\\ \end{align*}

Mathematica [A]  time = 0.0074482, size = 10, normalized size = 1. \[ 2 \sin (x)-\tanh ^{-1}(\sin (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[2*x]*Sec[x],x]

[Out]

-ArcTanh[Sin[x]] + 2*Sin[x]

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 14, normalized size = 1.4 \begin{align*} 2\,\sin \left ( x \right ) -\ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(2*x)*sec(x),x)

[Out]

2*sin(x)-ln(sec(x)+tan(x))

________________________________________________________________________________________

Maxima [A]  time = 0.995195, size = 26, normalized size = 2.6 \begin{align*} -\frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) + \frac{1}{2} \, \log \left (\sin \left (x\right ) - 1\right ) + 2 \, \sin \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(2*x)*sec(x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.36127, size = 76, normalized size = 7.6 \begin{align*} -\frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) + \frac{1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) + 2 \, \sin \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(2*x)*sec(x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 2.57399, size = 20, normalized size = 2. \begin{align*} \frac{\log{\left (\sin{\left (x \right )} - 1 \right )}}{2} - \frac{\log{\left (\sin{\left (x \right )} + 1 \right )}}{2} + 2 \sin{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(2*x)*sec(x),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.09479, size = 28, normalized size = 2.8 \begin{align*} -\frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) + \frac{1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) + 2 \, \sin \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(2*x)*sec(x),x, algorithm="giac")

[Out]

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