\(\int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx\) [391]

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

Optimal result

Integrand size = 24, antiderivative size = 33 \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=\frac {\log \left (a+b \tan \left (\frac {d}{2}+\frac {\pi }{4}+\frac {e x}{2}\right )\right )}{2 b e} \]

[Out]

1/2*ln(a+b*tan(1/2*d+1/4*Pi+1/2*e*x))/b/e

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3201, 31} \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=\frac {\log \left (a+b \tan \left (\frac {d}{2}+\frac {e x}{2}+\frac {\pi }{4}\right )\right )}{2 b e} \]

[In]

Int[(2*a + 2*b*Cos[d + e*x] - 2*a*Sin[d + e*x])^(-1),x]

[Out]

Log[a + b*Tan[d/2 + Pi/4 + (e*x)/2]]/(2*b*e)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3201

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Module[{f = Free
Factors[Tan[(d + e*x)/2 + Pi/4], x]}, Dist[f/e, Subst[Int[1/(a + b*f*x), x], x, Tan[(d + e*x)/2 + Pi/4]/f], x]
] /; FreeQ[{a, b, c, d, e}, x] && EqQ[a + c, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{2 a+2 b x} \, dx,x,\tan \left (\frac {\pi }{4}+\frac {1}{2} (d+e x)\right )\right )}{e} \\ & = \frac {\log \left (a+b \tan \left (\frac {d}{2}+\frac {\pi }{4}+\frac {e x}{2}\right )\right )}{2 b e} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(96\) vs. \(2(33)=66\).

Time = 0.41 (sec) , antiderivative size = 96, normalized size of antiderivative = 2.91 \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=-\frac {\log \left (\cos \left (\frac {1}{2} (d+e x)\right )-\sin \left (\frac {1}{2} (d+e x)\right )\right )}{2 b e}+\frac {\log \left (a \cos \left (\frac {1}{2} (d+e x)\right )+b \cos \left (\frac {1}{2} (d+e x)\right )-a \sin \left (\frac {1}{2} (d+e x)\right )+b \sin \left (\frac {1}{2} (d+e x)\right )\right )}{2 b e} \]

[In]

Integrate[(2*a + 2*b*Cos[d + e*x] - 2*a*Sin[d + e*x])^(-1),x]

[Out]

-1/2*Log[Cos[(d + e*x)/2] - Sin[(d + e*x)/2]]/(b*e) + Log[a*Cos[(d + e*x)/2] + b*Cos[(d + e*x)/2] - a*Sin[(d +
 e*x)/2] + b*Sin[(d + e*x)/2]]/(2*b*e)

Maple [A] (verified)

Time = 0.88 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.42

method result size
parallelrisch \(\frac {-\ln \left (\tan \left (\frac {e x}{2}+\frac {d}{2}\right )-1\right )+\ln \left (-a -b +\left (a -b \right ) \tan \left (\frac {e x}{2}+\frac {d}{2}\right )\right )}{2 b e}\) \(47\)
derivativedivides \(\frac {-\frac {\ln \left (\tan \left (\frac {e x}{2}+\frac {d}{2}\right )-1\right )}{b}+\frac {\ln \left (a \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-b \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-a -b \right )}{b}}{2 e}\) \(59\)
default \(\frac {-\frac {\ln \left (\tan \left (\frac {e x}{2}+\frac {d}{2}\right )-1\right )}{b}+\frac {\ln \left (a \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-b \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-a -b \right )}{b}}{2 e}\) \(59\)
norman \(-\frac {\ln \left (\tan \left (\frac {e x}{2}+\frac {d}{2}\right )-1\right )}{2 b e}+\frac {\ln \left (a \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-b \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-a -b \right )}{2 b e}\) \(61\)
risch \(\frac {\ln \left ({\mathrm e}^{i \left (e x +d \right )}+\frac {i a -b}{i b -a}\right )}{2 b e}-\frac {\ln \left ({\mathrm e}^{i \left (e x +d \right )}-i\right )}{2 b e}\) \(61\)

[In]

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

[Out]

1/2*(-ln(tan(1/2*e*x+1/2*d)-1)+ln(-a-b+(a-b)*tan(1/2*e*x+1/2*d)))/b/e

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (25) = 50\).

Time = 0.27 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.73 \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=\frac {\log \left (2 \, a b \cos \left (e x + d\right ) + a^{2} + b^{2} - {\left (a^{2} - b^{2}\right )} \sin \left (e x + d\right )\right ) - \log \left (-\sin \left (e x + d\right ) + 1\right )}{4 \, b e} \]

[In]

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

[Out]

1/4*(log(2*a*b*cos(e*x + d) + a^2 + b^2 - (a^2 - b^2)*sin(e*x + d)) - log(-sin(e*x + d) + 1))/(b*e)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 109 vs. \(2 (22) = 44\).

Time = 0.98 (sec) , antiderivative size = 109, normalized size of antiderivative = 3.30 \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=\begin {cases} \frac {\tilde {\infty } x}{\cos {\left (d \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge e = 0 \\- \frac {1}{a e \tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} - a e} & \text {for}\: b = 0 \\\frac {x}{- 2 a \sin {\left (d \right )} + 2 a + 2 b \cos {\left (d \right )}} & \text {for}\: e = 0 \\- \frac {\log {\left (\tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} - 1 \right )}}{2 b e} & \text {for}\: a = b \\- \frac {\log {\left (\tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} - 1 \right )}}{2 b e} + \frac {\log {\left (- \frac {a}{a - b} - \frac {b}{a - b} + \tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} \right )}}{2 b e} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(2*a+2*b*cos(e*x+d)-2*a*sin(e*x+d)),x)

[Out]

Piecewise((zoo*x/cos(d), Eq(a, 0) & Eq(b, 0) & Eq(e, 0)), (-1/(a*e*tan(d/2 + e*x/2) - a*e), Eq(b, 0)), (x/(-2*
a*sin(d) + 2*a + 2*b*cos(d)), Eq(e, 0)), (-log(tan(d/2 + e*x/2) - 1)/(2*b*e), Eq(a, b)), (-log(tan(d/2 + e*x/2
) - 1)/(2*b*e) + log(-a/(a - b) - b/(a - b) + tan(d/2 + e*x/2))/(2*b*e), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 62 vs. \(2 (25) = 50\).

Time = 0.23 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.88 \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=\frac {\frac {\log \left (a + b - \frac {{\left (a - b\right )} \sin \left (e x + d\right )}{\cos \left (e x + d\right ) + 1}\right )}{b} - \frac {\log \left (\frac {\sin \left (e x + d\right )}{\cos \left (e x + d\right ) + 1} - 1\right )}{b}}{2 \, e} \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 79 vs. \(2 (25) = 50\).

Time = 0.28 (sec) , antiderivative size = 79, normalized size of antiderivative = 2.39 \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=\frac {\log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) - 2 \, b \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) - 2 \, a - 2 \, {\left | b \right |} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) - 2 \, b \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) - 2 \, a + 2 \, {\left | b \right |} \right |}}\right )}{2 \, e {\left | b \right |}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 27.43 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.97 \[ \int \frac {1}{2 a+2 b \cos (d+e x)-2 a \sin (d+e x)} \, dx=\frac {\mathrm {atanh}\left (\frac {a-\frac {\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )\,\left (2\,a-2\,b\right )}{2}}{b}\right )}{b\,e} \]

[In]

int(1/(2*a + 2*b*cos(d + e*x) - 2*a*sin(d + e*x)),x)

[Out]

atanh((a - (tan(d/2 + (e*x)/2)*(2*a - 2*b))/2)/b)/(b*e)