3.946 \(\int \frac{\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx\)

Optimal. Leaf size=18 \[ \frac{\log (\sin (a+b x)+\cos (a+b x))}{b} \]

[Out]

Log[Cos[a + b*x] + Sin[a + b*x]]/b

________________________________________________________________________________________

Rubi [A]  time = 0.0281176, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.032, Rules used = {3133} \[ \frac{\log (\sin (a+b x)+\cos (a+b x))}{b} \]

Antiderivative was successfully verified.

[In]

Int[(Cos[a + b*x] - Sin[a + b*x])/(Cos[a + b*x] + Sin[a + b*x]),x]

[Out]

Log[Cos[a + b*x] + Sin[a + b*x]]/b

Rule 3133

Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_)]*(
b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[((b*B + c*C)*x)/(b^2 + c^2), x] + Simp[((c*B - b*C)*L
og[a + b*Cos[d + e*x] + c*Sin[d + e*x]])/(e*(b^2 + c^2)), x] /; FreeQ[{a, b, c, d, e, A, B, C}, x] && NeQ[b^2
+ c^2, 0] && EqQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]

Rubi steps

\begin{align*} \int \frac{\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx &=\frac{\log (\cos (a+b x)+\sin (a+b x))}{b}\\ \end{align*}

Mathematica [A]  time = 0.043197, size = 18, normalized size = 1. \[ \frac{\log (\sin (a+b x)+\cos (a+b x))}{b} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[a + b*x] - Sin[a + b*x])/(Cos[a + b*x] + Sin[a + b*x]),x]

[Out]

Log[Cos[a + b*x] + Sin[a + b*x]]/b

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 19, normalized size = 1.1 \begin{align*}{\frac{\ln \left ( \cos \left ( bx+a \right ) +\sin \left ( bx+a \right ) \right ) }{b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(b*x+a)-sin(b*x+a))/(cos(b*x+a)+sin(b*x+a)),x)

[Out]

ln(cos(b*x+a)+sin(b*x+a))/b

________________________________________________________________________________________

Maxima [A]  time = 0.936929, size = 24, normalized size = 1.33 \begin{align*} \frac{\log \left (\cos \left (b x + a\right ) + \sin \left (b x + a\right )\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)-sin(b*x+a))/(cos(b*x+a)+sin(b*x+a)),x, algorithm="maxima")

[Out]

log(cos(b*x + a) + sin(b*x + a))/b

________________________________________________________________________________________

Fricas [A]  time = 2.05172, size = 59, normalized size = 3.28 \begin{align*} \frac{\log \left (2 \, \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 1\right )}{2 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)-sin(b*x+a))/(cos(b*x+a)+sin(b*x+a)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.484454, size = 31, normalized size = 1.72 \begin{align*} \begin{cases} \frac{\log{\left (\sin{\left (a + b x \right )} + \cos{\left (a + b x \right )} \right )}}{b} & \text{for}\: b \neq 0 \\\frac{x \left (- \sin{\left (a \right )} + \cos{\left (a \right )}\right )}{\sin{\left (a \right )} + \cos{\left (a \right )}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)-sin(b*x+a))/(cos(b*x+a)+sin(b*x+a)),x)

[Out]

Piecewise((log(sin(a + b*x) + cos(a + b*x))/b, Ne(b, 0)), (x*(-sin(a) + cos(a))/(sin(a) + cos(a)), True))

________________________________________________________________________________________

Giac [A]  time = 1.13265, size = 39, normalized size = 2.17 \begin{align*} -\frac{\log \left (\tan \left (b x + a\right )^{2} + 1\right ) - 2 \, \log \left ({\left | \tan \left (b x + a\right ) + 1 \right |}\right )}{2 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(b*x+a)-sin(b*x+a))/(cos(b*x+a)+sin(b*x+a)),x, algorithm="giac")

[Out]

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