Integrand size = 14, antiderivative size = 53 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=\frac {x}{2 \sqrt {3}}+\frac {\arctan \left (\frac {\cos (x)-\sqrt {3} \sin (x)}{2 \left (2+\sqrt {3}\right )+\sqrt {3} \cos (x)+\sin (x)}\right )}{\sqrt {3}} \]
1/6*x*3^(1/2)+1/3*arctan((cos(x)-sin(x)*3^(1/2))/(sin(x)+cos(x)*3^(1/2)+4+ 2*3^(1/2)))*3^(1/2)
Time = 0.09 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.62 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=-\frac {\arctan \left (\frac {-1+\left (-4+\sqrt {3}\right ) \tan \left (\frac {x}{2}\right )}{2 \sqrt {3}}\right )}{\sqrt {3}} \]
Time = 0.20 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.64, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3603, 1082, 217}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {1}{\sin (x)+\sqrt {3} \cos (x)+4} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sin (x)+\sqrt {3} \cos (x)+4}dx\) |
\(\Big \downarrow \) 3603 |
\(\displaystyle 2 \int \frac {1}{\left (4-\sqrt {3}\right ) \tan ^2\left (\frac {x}{2}\right )+2 \tan \left (\frac {x}{2}\right )+\sqrt {3}+4}d\tan \left (\frac {x}{2}\right )\) |
\(\Big \downarrow \) 1082 |
\(\displaystyle -2 \int \frac {1}{-\left (\left (4-\sqrt {3}\right ) \tan \left (\frac {x}{2}\right )+1\right )^2-12}d\left (\left (4-\sqrt {3}\right ) \tan \left (\frac {x}{2}\right )+1\right )\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {\arctan \left (\frac {\left (4-\sqrt {3}\right ) \tan \left (\frac {x}{2}\right )+1}{2 \sqrt {3}}\right )}{\sqrt {3}}\) |
3.4.76.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( -1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & & (LtQ[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*S implify[a*(c/b^2)]}, Simp[-2/b Subst[Int[1/(q - x^2), x], x, 1 + 2*c*(x/b )], x] /; RationalQ[q] && (EqQ[q^2, 1] || !RationalQ[b^2 - 4*a*c])] /; Fre eQ[{a, b, c}, x]
Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^ (-1), x_Symbol] :> Module[{f = FreeFactors[Tan[(d + e*x)/2], x]}, Simp[2*(f /e) Subst[Int[1/(a + b + 2*c*f*x + (a - b)*f^2*x^2), x], x, Tan[(d + e*x) /2]/f], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0]
Time = 0.63 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.81
method | result | size |
default | \(-\frac {52 \arctan \left (\frac {26 \tan \left (\frac {x}{2}\right )+2 \sqrt {3}+8}{16 \sqrt {3}+12}\right )}{\left (\sqrt {3}-4\right ) \left (16 \sqrt {3}+12\right )}\) | \(43\) |
risch | \(\frac {i \sqrt {3}\, \ln \left (\frac {i \sqrt {3}}{2}+\sqrt {3}+\frac {3}{2}+i+{\mathrm e}^{i x}\right )}{6}-\frac {i \sqrt {3}\, \ln \left ({\mathrm e}^{i x}+\sqrt {3}-\frac {3}{2}+i-\frac {i \sqrt {3}}{2}\right )}{6}\) | \(52\) |
parallelrisch | \(-\frac {i \left (\ln \left (13 \tan \left (\frac {x}{2}\right )+4-6 i+\left (1-8 i\right ) \sqrt {3}\right )-\ln \left (13 \tan \left (\frac {x}{2}\right )+4+6 i+\left (1+8 i\right ) \sqrt {3}\right )\right ) \left (4+\sqrt {3}\right )}{8 \sqrt {3}+6}\) | \(57\) |
Time = 0.28 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.72 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=\frac {1}{6} \, \sqrt {3} \arctan \left (\frac {2 \, {\left ({\left (4 \, \sqrt {3} \cos \left (x\right ) + 3\right )} \sin \left (x\right ) + \sqrt {3} \cos \left (x\right ) + 3\right )}}{3 \, {\left (4 \, \cos \left (x\right )^{2} - 3\right )}}\right ) \]
1/6*sqrt(3)*arctan(2/3*((4*sqrt(3)*cos(x) + 3)*sin(x) + sqrt(3)*cos(x) + 3 )/(4*cos(x)^2 - 3))
Leaf count of result is larger than twice the leaf count of optimal. 107 vs. \(2 (48) = 96\).
Time = 4.58 (sec) , antiderivative size = 107, normalized size of antiderivative = 2.02 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=- \frac {13906891405206808 \sqrt {3} \left (\operatorname {atan}{\left (- \frac {\tan {\left (\frac {x}{2} \right )}}{2} + \frac {2 \sqrt {3} \tan {\left (\frac {x}{2} \right )}}{3} + \frac {\sqrt {3}}{6} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{-41720674215620424 + 24087442555831531 \sqrt {3}} + \frac {24087442555831531 \left (\operatorname {atan}{\left (- \frac {\tan {\left (\frac {x}{2} \right )}}{2} + \frac {2 \sqrt {3} \tan {\left (\frac {x}{2} \right )}}{3} + \frac {\sqrt {3}}{6} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{-41720674215620424 + 24087442555831531 \sqrt {3}} \]
-13906891405206808*sqrt(3)*(atan(-tan(x/2)/2 + 2*sqrt(3)*tan(x/2)/3 + sqrt (3)/6) + pi*floor((x/2 - pi/2)/pi))/(-41720674215620424 + 2408744255583153 1*sqrt(3)) + 24087442555831531*(atan(-tan(x/2)/2 + 2*sqrt(3)*tan(x/2)/3 + sqrt(3)/6) + pi*floor((x/2 - pi/2)/pi))/(-41720674215620424 + 240874425558 31531*sqrt(3))
Time = 0.26 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.51 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=-\frac {1}{3} \, \sqrt {3} \arctan \left (\frac {1}{6} \, \sqrt {3} {\left (\frac {{\left (\sqrt {3} - 4\right )} \sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right )}\right ) \]
Time = 0.28 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.47 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=\frac {{\left (x + 2 \, \arctan \left (\frac {\sqrt {3} \cos \left (x\right ) - 8 \, \sqrt {3} \sin \left (x\right ) + \sqrt {3} + 4 \, \cos \left (x\right ) + 7 \, \sin \left (x\right ) + 4}{8 \, \sqrt {3} \cos \left (x\right ) + \sqrt {3} \sin \left (x\right ) + 8 \, \sqrt {3} - 7 \, \cos \left (x\right ) + 4 \, \sin \left (x\right ) + 19}\right )\right )} {\left (\sqrt {3} + 4\right )}}{2 \, {\left (4 \, \sqrt {3} + 3\right )}} \]
1/2*(x + 2*arctan((sqrt(3)*cos(x) - 8*sqrt(3)*sin(x) + sqrt(3) + 4*cos(x) + 7*sin(x) + 4)/(8*sqrt(3)*cos(x) + sqrt(3)*sin(x) + 8*sqrt(3) - 7*cos(x) + 4*sin(x) + 19)))*(sqrt(3) + 4)/(4*sqrt(3) + 3)
Time = 0.24 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.43 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=-\frac {\sqrt {12}\,\mathrm {atan}\left (\frac {\sqrt {12}\,\left (\mathrm {tan}\left (\frac {x}{2}\right )\,\left (\sqrt {3}-4\right )-1\right )}{12}\right )}{6} \]
\[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx=-\frac {\sqrt {3}\, \mathit {atan} \left (\frac {2 \sin \left (x \right )}{3}+\frac {2}{3}\right )}{6}-\frac {4 \sqrt {3}\, \left (\int \frac {\sin \left (x \right )^{2}}{4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13}d x \right )}{5}-\frac {8 \sqrt {3}\, \left (\int \frac {\sin \left (x \right )}{4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13}d x \right )}{5}-\frac {13 \sqrt {3}\, \left (\int \frac {1}{4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13}d x \right )}{5}-\frac {2 \sqrt {3}\, \mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right )}{5}+\frac {\sqrt {3}\, \mathrm {log}\left (13 \tan \left (\frac {x}{2}\right )^{4}+16 \tan \left (\frac {x}{2}\right )^{3}+42 \tan \left (\frac {x}{2}\right )^{2}+16 \tan \left (\frac {x}{2}\right )+13\right )}{5}-\frac {\sqrt {3}\, \mathrm {log}\left (4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13\right )}{5}+\frac {\sqrt {3}\, x}{5}-\frac {12 \left (\int \frac {\sin \left (x \right )^{2}}{4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13}d x \right )}{5}-\frac {19 \left (\int \frac {\sin \left (x \right )}{4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13}d x \right )}{5}-\frac {19 \left (\int \frac {1}{4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13}d x \right )}{5}-\frac {19 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right )}{20}+\frac {19 \,\mathrm {log}\left (13 \tan \left (\frac {x}{2}\right )^{4}+16 \tan \left (\frac {x}{2}\right )^{3}+42 \tan \left (\frac {x}{2}\right )^{2}+16 \tan \left (\frac {x}{2}\right )+13\right )}{40}-\frac {19 \,\mathrm {log}\left (4 \sin \left (x \right )^{2}+8 \sin \left (x \right )+13\right )}{40}+\frac {3 x}{5} \]
( - 20*sqrt(3)*atan((2*sin(x) + 2)/3) - 96*sqrt(3)*int(sin(x)**2/(4*sin(x) **2 + 8*sin(x) + 13),x) - 192*sqrt(3)*int(sin(x)/(4*sin(x)**2 + 8*sin(x) + 13),x) - 312*sqrt(3)*int(1/(4*sin(x)**2 + 8*sin(x) + 13),x) - 48*sqrt(3)* log(tan(x/2)**2 + 1) + 24*sqrt(3)*log(13*tan(x/2)**4 + 16*tan(x/2)**3 + 42 *tan(x/2)**2 + 16*tan(x/2) + 13) - 24*sqrt(3)*log(4*sin(x)**2 + 8*sin(x) + 13) + 24*sqrt(3)*x - 288*int(sin(x)**2/(4*sin(x)**2 + 8*sin(x) + 13),x) - 456*int(sin(x)/(4*sin(x)**2 + 8*sin(x) + 13),x) - 456*int(1/(4*sin(x)**2 + 8*sin(x) + 13),x) - 114*log(tan(x/2)**2 + 1) + 57*log(13*tan(x/2)**4 + 1 6*tan(x/2)**3 + 42*tan(x/2)**2 + 16*tan(x/2) + 13) - 57*log(4*sin(x)**2 + 8*sin(x) + 13) + 72*x)/120