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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 18 \[ \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} \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.032, Rules used = {3212} \[ \int \frac {\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx=\frac {\log (\sin (a+b x)+\cos (a+b x))}{b} \]

[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 3212

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*} \text {integral}& = \frac {\log (\cos (a+b x)+\sin (a+b x))}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.19 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \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} \]

[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] (verified)

Time = 0.62 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06

method result size
derivativedivides \(\frac {\ln \left (\cos \left (x b +a \right )+\sin \left (x b +a \right )\right )}{b}\) \(19\)
default \(\frac {\ln \left (\cos \left (x b +a \right )+\sin \left (x b +a \right )\right )}{b}\) \(19\)
risch \(-i x -\frac {2 i a}{b}+\frac {\ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+i\right )}{b}\) \(30\)
parallelrisch \(\frac {-\ln \left (\sec \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )+\ln \left (\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}-2 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )-1\right )}{b}\) \(45\)
norman \(\frac {\ln \left (\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}-2 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )-1\right )}{b}-\frac {\ln \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )}{b}\) \(50\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.22 \[ \int \frac {\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx=\frac {\log \left (2 \, \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 1\right )}{2 \, b} \]

[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 [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (15) = 30\).

Time = 0.21 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.72 \[ \int \frac {\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx=\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} \]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx=\frac {\log \left (\cos \left (b x + a\right ) + \sin \left (b x + a\right )\right )}{b} \]

[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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.61 \[ \int \frac {\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx=-\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} \]

[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

Mupad [B] (verification not implemented)

Time = 27.44 (sec) , antiderivative size = 50, normalized size of antiderivative = 2.78 \[ \int \frac {\cos (a+b x)-\sin (a+b x)}{\cos (a+b x)+\sin (a+b x)} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {128\,\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )+128}{16\,{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2+32\,\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )+48}-3\right )}{b} \]

[In]

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

[Out]

(2*atanh((128*tan(a/2 + (b*x)/2) + 128)/(32*tan(a/2 + (b*x)/2) + 16*tan(a/2 + (b*x)/2)^2 + 48) - 3))/b