3.827 \(\int (\csc (x)-\sec (x)) (\cos (x)+\sin (x)) \, dx\)

Optimal. Leaf size=7 \[ \log (\sin (x))+\log (\cos (x)) \]

[Out]

Log[Cos[x]] + Log[Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0454076, antiderivative size = 9, normalized size of antiderivative = 1.29, number of steps used = 4, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {446, 72} \[ \log (\tan (x))+2 \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[(Csc[x] - Sec[x])*(Cos[x] + Sin[x]),x]

[Out]

2*Log[Cos[x]] + Log[Tan[x]]

Rule 446

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

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

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

Mathematica [A]  time = 0.0071322, size = 7, normalized size = 1. \[ \log (\sin (x))+\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[(Csc[x] - Sec[x])*(Cos[x] + Sin[x]),x]

[Out]

Log[Cos[x]] + Log[Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.04, size = 8, normalized size = 1.1 \begin{align*} \ln \left ( \cos \left ( x \right ) \right ) +\ln \left ( \sin \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((csc(x)-sec(x))*(cos(x)+sin(x)),x)

[Out]

ln(cos(x))+ln(sin(x))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sec(x))*(cos(x)+sin(x)),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.27852, size = 34, normalized size = 4.86 \begin{align*} \log \left (-\frac{1}{2} \, \cos \left (x\right ) \sin \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sec(x))*(cos(x)+sin(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 6.47874, size = 8, normalized size = 1.14 \begin{align*} \log{\left (\sin{\left (x \right )} \right )} + \log{\left (\cos{\left (x \right )} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sec(x))*(cos(x)+sin(x)),x)

[Out]

log(sin(x)) + log(cos(x))

________________________________________________________________________________________

Giac [B]  time = 1.08246, size = 26, normalized size = 3.71 \begin{align*} \frac{1}{2} \, \log \left (\cos \left (x\right )^{2}\right ) + \frac{1}{2} \, \log \left (-\cos \left (x\right )^{2} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sec(x))*(cos(x)+sin(x)),x, algorithm="giac")

[Out]

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