Integrand size = 21, antiderivative size = 74 \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {(b B+c C) \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\left (b^2+c^2\right )^{3/2}}-\frac {B c-b C}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))} \] Output:
-(B*b+C*c)*arctanh((c*cos(x)-b*sin(x))/(b^2+c^2)^(1/2))/(b^2+c^2)^(3/2)-(B *c-C*b)/(b^2+c^2)/(b*cos(x)+c*sin(x))
Time = 0.27 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.01 \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=\frac {2 (b B+c C) \text {arctanh}\left (\frac {-c+b \tan \left (\frac {x}{2}\right )}{\sqrt {b^2+c^2}}\right )}{\left (b^2+c^2\right )^{3/2}}+\frac {-B c+b C}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))} \] Input:
Integrate[(B*Cos[x] + C*Sin[x])/(b*Cos[x] + c*Sin[x])^2,x]
Output:
(2*(b*B + c*C)*ArcTanh[(-c + b*Tan[x/2])/Sqrt[b^2 + c^2]])/(b^2 + c^2)^(3/ 2) + (-(B*c) + b*C)/((b^2 + c^2)*(b*Cos[x] + c*Sin[x]))
Time = 0.33 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 3632, 3042, 3553, 219}
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 {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2}dx\) |
\(\Big \downarrow \) 3632 |
\(\displaystyle \frac {(b B+c C) \int \frac {1}{b \cos (x)+c \sin (x)}dx}{b^2+c^2}-\frac {B c-b C}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(b B+c C) \int \frac {1}{b \cos (x)+c \sin (x)}dx}{b^2+c^2}-\frac {B c-b C}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))}\) |
\(\Big \downarrow \) 3553 |
\(\displaystyle -\frac {(b B+c C) \int \frac {1}{b^2+c^2-(c \cos (x)-b \sin (x))^2}d(c \cos (x)-b \sin (x))}{b^2+c^2}-\frac {B c-b C}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {(b B+c C) \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\left (b^2+c^2\right )^{3/2}}-\frac {B c-b C}{\left (b^2+c^2\right ) (b \cos (x)+c \sin (x))}\) |
Input:
Int[(B*Cos[x] + C*Sin[x])/(b*Cos[x] + c*Sin[x])^2,x]
Output:
-(((b*B + c*C)*ArcTanh[(c*Cos[x] - b*Sin[x])/Sqrt[b^2 + c^2]])/(b^2 + c^2) ^(3/2)) - (B*c - b*C)/((b^2 + c^2)*(b*Cos[x] + c*Sin[x]))
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x _Symbol] :> Simp[-d^(-1) Subst[Int[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]
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] + Simp[(a*A - b*B - c*C)/(a^2 - b^2 - c^2) Int[1/(a + b*Cos[d + e*x] + c*S in[d + e*x]), x], x] /; FreeQ[{a, b, c, d, e, A, B, C}, x] && NeQ[a^2 - b^2 - c^2, 0] && NeQ[a*A - b*B - c*C, 0]
Time = 0.26 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.53
method | result | size |
default | \(-\frac {2 \left (-\frac {c \left (B c -b C \right ) \tan \left (\frac {x}{2}\right )}{b \left (b^{2}+c^{2}\right )}-\frac {B c -b C}{b^{2}+c^{2}}\right )}{b \tan \left (\frac {x}{2}\right )^{2}-2 c \tan \left (\frac {x}{2}\right )-b}+\frac {2 \left (B b +C c \right ) \operatorname {arctanh}\left (\frac {2 b \tan \left (\frac {x}{2}\right )-2 c}{2 \sqrt {b^{2}+c^{2}}}\right )}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\) | \(113\) |
risch | \(-\frac {2 \,{\mathrm e}^{i x} \left (B c -b C \right )}{\left (i c +b \right ) \left (-i c +b \right ) \left (-i c \,{\mathrm e}^{2 i x}+b \,{\mathrm e}^{2 i x}+i c +b \right )}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right ) B b}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right ) C c}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right ) B b}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {i b^{3}+i b \,c^{2}-b^{2} c -c^{3}}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\right ) C c}{\left (b^{2}+c^{2}\right )^{\frac {3}{2}}}\) | \(277\) |
Input:
int((B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x))^2,x,method=_RETURNVERBOSE)
Output:
-2*(-c*(B*c-C*b)/b/(b^2+c^2)*tan(1/2*x)-(B*c-C*b)/(b^2+c^2))/(b*tan(1/2*x) ^2-2*c*tan(1/2*x)-b)+2*(B*b+C*c)/(b^2+c^2)^(3/2)*arctanh(1/2*(2*b*tan(1/2* x)-2*c)/(b^2+c^2)^(1/2))
Leaf count of result is larger than twice the leaf count of optimal. 194 vs. \(2 (69) = 138\).
Time = 0.09 (sec) , antiderivative size = 194, normalized size of antiderivative = 2.62 \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=\frac {2 \, C b^{3} - 2 \, B b^{2} c + 2 \, C b c^{2} - 2 \, B c^{3} + \sqrt {b^{2} + c^{2}} {\left ({\left (B b^{2} + C b c\right )} \cos \left (x\right ) + {\left (B b c + C c^{2}\right )} \sin \left (x\right )\right )} \log \left (-\frac {2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} - 2 \, b^{2} - c^{2} + 2 \, \sqrt {b^{2} + c^{2}} {\left (c \cos \left (x\right ) - b \sin \left (x\right )\right )}}{2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} + c^{2}}\right )}{2 \, {\left ({\left (b^{5} + 2 \, b^{3} c^{2} + b c^{4}\right )} \cos \left (x\right ) + {\left (b^{4} c + 2 \, b^{2} c^{3} + c^{5}\right )} \sin \left (x\right )\right )}} \] Input:
integrate((B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x))^2,x, algorithm="fricas")
Output:
1/2*(2*C*b^3 - 2*B*b^2*c + 2*C*b*c^2 - 2*B*c^3 + sqrt(b^2 + c^2)*((B*b^2 + C*b*c)*cos(x) + (B*b*c + C*c^2)*sin(x))*log(-(2*b*c*cos(x)*sin(x) + (b^2 - c^2)*cos(x)^2 - 2*b^2 - c^2 + 2*sqrt(b^2 + c^2)*(c*cos(x) - b*sin(x)))/( 2*b*c*cos(x)*sin(x) + (b^2 - c^2)*cos(x)^2 + c^2)))/((b^5 + 2*b^3*c^2 + b* c^4)*cos(x) + (b^4*c + 2*b^2*c^3 + c^5)*sin(x))
Timed out. \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=\text {Timed out} \] Input:
integrate((B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x))**2,x)
Output:
Timed out
Leaf count of result is larger than twice the leaf count of optimal. 271 vs. \(2 (69) = 138\).
Time = 0.12 (sec) , antiderivative size = 271, normalized size of antiderivative = 3.66 \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-B {\left (\frac {b \log \left (\frac {c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {b^{2} + c^{2}}}{c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {b^{2} + c^{2}}}\right )}{{\left (b^{2} + c^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, {\left (b c + \frac {c^{2} \sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}}{b^{4} + b^{2} c^{2} + \frac {2 \, {\left (b^{3} c + b c^{3}\right )} \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {{\left (b^{4} + b^{2} c^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}\right )} - C {\left (\frac {c \log \left (\frac {c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {b^{2} + c^{2}}}{c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {b^{2} + c^{2}}}\right )}{{\left (b^{2} + c^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b + \frac {c \sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}}{b^{3} + b c^{2} + \frac {2 \, {\left (b^{2} c + c^{3}\right )} \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {{\left (b^{3} + b c^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}\right )} \] Input:
integrate((B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x))^2,x, algorithm="maxima")
Output:
-B*(b*log((c - b*sin(x)/(cos(x) + 1) + sqrt(b^2 + c^2))/(c - b*sin(x)/(cos (x) + 1) - sqrt(b^2 + c^2)))/(b^2 + c^2)^(3/2) + 2*(b*c + c^2*sin(x)/(cos( x) + 1))/(b^4 + b^2*c^2 + 2*(b^3*c + b*c^3)*sin(x)/(cos(x) + 1) - (b^4 + b ^2*c^2)*sin(x)^2/(cos(x) + 1)^2)) - C*(c*log((c - b*sin(x)/(cos(x) + 1) + sqrt(b^2 + c^2))/(c - b*sin(x)/(cos(x) + 1) - sqrt(b^2 + c^2)))/(b^2 + c^2 )^(3/2) - 2*(b + c*sin(x)/(cos(x) + 1))/(b^3 + b*c^2 + 2*(b^2*c + c^3)*sin (x)/(cos(x) + 1) - (b^3 + b*c^2)*sin(x)^2/(cos(x) + 1)^2))
Time = 0.33 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.78 \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {{\left (B b + C c\right )} \log \left (\frac {{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, c - 2 \, \sqrt {b^{2} + c^{2}} \right |}}{{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, c + 2 \, \sqrt {b^{2} + c^{2}} \right |}}\right )}{{\left (b^{2} + c^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (C b c \tan \left (\frac {1}{2} \, x\right ) - B c^{2} \tan \left (\frac {1}{2} \, x\right ) + C b^{2} - B b c\right )}}{{\left (b^{3} + b c^{2}\right )} {\left (b \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, c \tan \left (\frac {1}{2} \, x\right ) - b\right )}} \] Input:
integrate((B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x))^2,x, algorithm="giac")
Output:
-(B*b + C*c)*log(abs(2*b*tan(1/2*x) - 2*c - 2*sqrt(b^2 + c^2))/abs(2*b*tan (1/2*x) - 2*c + 2*sqrt(b^2 + c^2)))/(b^2 + c^2)^(3/2) - 2*(C*b*c*tan(1/2*x ) - B*c^2*tan(1/2*x) + C*b^2 - B*b*c)/((b^3 + b*c^2)*(b*tan(1/2*x)^2 - 2*c *tan(1/2*x) - b))
Time = 16.71 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.74 \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {\frac {2\,\left (B\,c-C\,b\right )}{b^2+c^2}+\frac {2\,c\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (B\,c-C\,b\right )}{b\,\left (b^2+c^2\right )}}{-b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,c\,\mathrm {tan}\left (\frac {x}{2}\right )+b}+\frac {\mathrm {atan}\left (\frac {b^2\,c\,1{}\mathrm {i}+c^3\,1{}\mathrm {i}-b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (b^2+c^2\right )\,1{}\mathrm {i}}{{\left (b^2+c^2\right )}^{3/2}}\right )\,\left (B\,b+C\,c\right )\,2{}\mathrm {i}}{{\left (b^2+c^2\right )}^{3/2}} \] Input:
int((B*cos(x) + C*sin(x))/(b*cos(x) + c*sin(x))^2,x)
Output:
(atan((b^2*c*1i + c^3*1i - b*tan(x/2)*(b^2 + c^2)*1i)/(b^2 + c^2)^(3/2))*( B*b + C*c)*2i)/(b^2 + c^2)^(3/2) - ((2*(B*c - C*b))/(b^2 + c^2) + (2*c*tan (x/2)*(B*c - C*b))/(b*(b^2 + c^2)))/(b + 2*c*tan(x/2) - b*tan(x/2)^2)
Time = 0.15 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.59 \[ \int \frac {B \cos (x)+C \sin (x)}{(b \cos (x)+c \sin (x))^2} \, dx=-\frac {2 \sqrt {b^{2}+c^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) b i -c i}{\sqrt {b^{2}+c^{2}}}\right ) i}{b^{2}+c^{2}} \] Input:
int((B*cos(x)+C*sin(x))/(b*cos(x)+c*sin(x))^2,x)
Output:
( - 2*sqrt(b**2 + c**2)*atan((tan(x/2)*b*i - c*i)/sqrt(b**2 + c**2))*i)/(b **2 + c**2)