\(\int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx\) [555]

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

Optimal result

Integrand size = 30, antiderivative size = 24 \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=-\frac {c \cos (x)-b \sin (x)}{a+b \cos (x)+c \sin (x)} \]

[Out]

(-c*cos(x)+b*sin(x))/(a+b*cos(x)+c*sin(x))

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(68\) vs. \(2(24)=48\).

Time = 0.07 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.83, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.033, Rules used = {3229} \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=-\frac {c \cos (x) \left (a^2-b^2-c^2\right )-b \sin (x) \left (a^2-b^2-c^2\right )}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))} \]

[In]

Int[(b^2 + c^2 + a*b*Cos[x] + a*c*Sin[x])/(a + b*Cos[x] + c*Sin[x])^2,x]

[Out]

-((c*(a^2 - b^2 - c^2)*Cos[x] - b*(a^2 - b^2 - c^2)*Sin[x])/((a^2 - b^2 - c^2)*(a + b*Cos[x] + c*Sin[x])))

Rule 3229

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

Rubi steps \begin{align*} \text {integral}& = -\frac {c \left (a^2-b^2-c^2\right ) \cos (x)-b \left (a^2-b^2-c^2\right ) \sin (x)}{\left (a^2-b^2-c^2\right ) (a+b \cos (x)+c \sin (x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.16 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.33 \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=\frac {a c+b^2 \sin (x)+c^2 \sin (x)}{b (a+b \cos (x)+c \sin (x))} \]

[In]

Integrate[(b^2 + c^2 + a*b*Cos[x] + a*c*Sin[x])/(a + b*Cos[x] + c*Sin[x])^2,x]

[Out]

(a*c + b^2*Sin[x] + c^2*Sin[x])/(b*(a + b*Cos[x] + c*Sin[x]))

Maple [A] (verified)

Time = 0.76 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.50

method result size
parallelrisch \(\frac {-b^{2} \cos \left (x \right )-c^{2} \cos \left (x \right )-a b}{\left (a +b \cos \left (x \right )+c \sin \left (x \right )\right ) c}\) \(36\)
risch \(-\frac {2 i \left (-i b +c -i a \,{\mathrm e}^{i x}\right )}{c \,{\mathrm e}^{2 i x}+i b \,{\mathrm e}^{2 i x}-c +2 i a \,{\mathrm e}^{i x}+i b}\) \(54\)
default \(-\frac {2 \left (-\frac {\left (a b -b^{2}-c^{2}\right ) \tan \left (\frac {x}{2}\right )}{a -b}+\frac {a c}{a -b}\right )}{\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} b +2 c \tan \left (\frac {x}{2}\right )+a +b}\) \(70\)
norman \(\frac {-\frac {2 a b +2 b^{2}+2 c^{2}}{2 c}-\frac {\left (2 a b -2 b^{2}-2 c^{2}\right ) \tan \left (\frac {x}{2}\right )^{4}}{2 c}-\frac {2 a b \tan \left (\frac {x}{2}\right )^{2}}{c}}{\left (1+\tan \left (\frac {x}{2}\right )^{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} b +2 c \tan \left (\frac {x}{2}\right )+a +b \right )}\) \(101\)

[In]

int((b^2+c^2+a*b*cos(x)+a*c*sin(x))/(a+b*cos(x)+c*sin(x))^2,x,method=_RETURNVERBOSE)

[Out]

(-b^2*cos(x)-c^2*cos(x)-a*b)/(a+b*cos(x)+c*sin(x))/c

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.00 \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=-\frac {c \cos \left (x\right ) - b \sin \left (x\right )}{b \cos \left (x\right ) + c \sin \left (x\right ) + a} \]

[In]

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

[Out]

-(c*cos(x) - b*sin(x))/(b*cos(x) + c*sin(x) + a)

Sympy [F(-1)]

Timed out. \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=\text {Timed out} \]

[In]

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

[Out]

Timed out

Maxima [F(-2)]

Exception generated. \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=\text {Exception raised: ValueError} \]

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(c^2+b^2-a^2>0)', see `assume?`
 for more de

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 68 vs. \(2 (24) = 48\).

Time = 0.30 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.83 \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=\frac {2 \, {\left (a b \tan \left (\frac {1}{2} \, x\right ) - b^{2} \tan \left (\frac {1}{2} \, x\right ) - c^{2} \tan \left (\frac {1}{2} \, x\right ) - a c\right )}}{{\left (a \tan \left (\frac {1}{2} \, x\right )^{2} - b \tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, c \tan \left (\frac {1}{2} \, x\right ) + a + b\right )} {\left (a - b\right )}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 26.05 (sec) , antiderivative size = 62, normalized size of antiderivative = 2.58 \[ \int \frac {b^2+c^2+a b \cos (x)+a c \sin (x)}{(a+b \cos (x)+c \sin (x))^2} \, dx=-\frac {\frac {2\,a\,c}{a-b}+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (b^2-a\,b+c^2\right )}{a-b}}{\left (a-b\right )\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,c\,\mathrm {tan}\left (\frac {x}{2}\right )+a+b} \]

[In]

int((b^2 + c^2 + a*c*sin(x) + a*b*cos(x))/(a + b*cos(x) + c*sin(x))^2,x)

[Out]

-((2*a*c)/(a - b) + (2*tan(x/2)*(b^2 - a*b + c^2))/(a - b))/(a + b + 2*c*tan(x/2) + tan(x/2)^2*(a - b))