Integrand size = 14, antiderivative size = 60 \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=-\frac {b \text {arctanh}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}+\frac {a}{\left (a^2+b^2\right ) (a \cos (x)+b \sin (x))} \] Output:
-b*arctanh((b*cos(x)-a*sin(x))/(a^2+b^2)^(1/2))/(a^2+b^2)^(3/2)+a/(a^2+b^2 )/(a*cos(x)+b*sin(x))
Time = 0.18 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.03 \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=\frac {2 b \text {arctanh}\left (\frac {-b+a \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}+\frac {a}{\left (a^2+b^2\right ) (a \cos (x)+b \sin (x))} \] Input:
Integrate[Sin[x]/(a*Cos[x] + b*Sin[x])^2,x]
Output:
(2*b*ArcTanh[(-b + a*Tan[x/2])/Sqrt[a^2 + b^2]])/(a^2 + b^2)^(3/2) + a/((a ^2 + b^2)*(a*Cos[x] + b*Sin[x]))
Time = 0.30 (sec) , antiderivative size = 60, 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.357, Rules used = {3042, 3633, 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 {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2}dx\) |
\(\Big \downarrow \) 3633 |
\(\displaystyle \frac {b \int \frac {1}{a \cos (x)+b \sin (x)}dx}{a^2+b^2}+\frac {a}{\left (a^2+b^2\right ) (a \cos (x)+b \sin (x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {b \int \frac {1}{a \cos (x)+b \sin (x)}dx}{a^2+b^2}+\frac {a}{\left (a^2+b^2\right ) (a \cos (x)+b \sin (x))}\) |
\(\Big \downarrow \) 3553 |
\(\displaystyle \frac {a}{\left (a^2+b^2\right ) (a \cos (x)+b \sin (x))}-\frac {b \int \frac {1}{a^2+b^2-(b \cos (x)-a \sin (x))^2}d(b \cos (x)-a \sin (x))}{a^2+b^2}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {a}{\left (a^2+b^2\right ) (a \cos (x)+b \sin (x))}-\frac {b \text {arctanh}\left (\frac {b \cos (x)-a \sin (x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}\) |
Input:
Int[Sin[x]/(a*Cos[x] + b*Sin[x])^2,x]
Output:
-((b*ArcTanh[(b*Cos[x] - a*Sin[x])/Sqrt[a^2 + b^2]])/(a^2 + b^2)^(3/2)) + a/((a^2 + b^2)*(a*Cos[x] + b*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_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_) ]*(b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)])^2, x_Symbol] :> Simp[-(b*C + (a*C - c*A)*Cos[d + e*x] + 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 - c*C)/(a^2 - b^2 - c^2) Int[1/( a + b*Cos[d + e*x] + c*Sin[d + e*x]), x], x] /; FreeQ[{a, b, c, d, e, A, C} , x] && NeQ[a^2 - b^2 - c^2, 0] && NeQ[a*A - c*C, 0]
Time = 0.17 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.62
method | result | size |
default | \(\frac {8 b \tan \left (\frac {x}{2}\right )+8 a}{\left (-4 a^{2}-4 b^{2}\right ) \left (\tan \left (\frac {x}{2}\right )^{2} a -2 b \tan \left (\frac {x}{2}\right )-a \right )}-\frac {8 b \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {x}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (-4 a^{2}-4 b^{2}\right ) \sqrt {a^{2}+b^{2}}}\) | \(97\) |
risch | \(\frac {2 a \,{\mathrm e}^{i x}}{\left (i b +a \right ) \left (-i b +a \right ) \left (-i b \,{\mathrm e}^{2 i x}+a \,{\mathrm e}^{2 i x}+i b +a \right )}+\frac {i b \ln \left ({\mathrm e}^{i x}-\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, \left (a^{2}+b^{2}\right )}-\frac {i b \ln \left ({\mathrm e}^{i x}+\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, \left (a^{2}+b^{2}\right )}\) | \(157\) |
Input:
int(sin(x)/(a*cos(x)+b*sin(x))^2,x,method=_RETURNVERBOSE)
Output:
4*(2*b*tan(1/2*x)+2*a)/(-4*a^2-4*b^2)/(tan(1/2*x)^2*a-2*b*tan(1/2*x)-a)-8* b/(-4*a^2-4*b^2)/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tan(1/2*x)-2*b)/(a^2+b^2 )^(1/2))
Leaf count of result is larger than twice the leaf count of optimal. 164 vs. \(2 (56) = 112\).
Time = 0.08 (sec) , antiderivative size = 164, normalized size of antiderivative = 2.73 \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=\frac {2 \, a^{3} + 2 \, a b^{2} + {\left (a b \cos \left (x\right ) + b^{2} \sin \left (x\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (-\frac {2 \, a b \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (x\right ) - a \sin \left (x\right )\right )}}{2 \, a b \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}}\right )}{2 \, {\left ({\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (x\right ) + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \sin \left (x\right )\right )}} \] Input:
integrate(sin(x)/(a*cos(x)+b*sin(x))^2,x, algorithm="fricas")
Output:
1/2*(2*a^3 + 2*a*b^2 + (a*b*cos(x) + b^2*sin(x))*sqrt(a^2 + b^2)*log(-(2*a *b*cos(x)*sin(x) + (a^2 - b^2)*cos(x)^2 - 2*a^2 - b^2 + 2*sqrt(a^2 + b^2)* (b*cos(x) - a*sin(x)))/(2*a*b*cos(x)*sin(x) + (a^2 - b^2)*cos(x)^2 + b^2)) )/((a^5 + 2*a^3*b^2 + a*b^4)*cos(x) + (a^4*b + 2*a^2*b^3 + b^5)*sin(x))
Timed out. \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=\text {Timed out} \] Input:
integrate(sin(x)/(a*cos(x)+b*sin(x))**2,x)
Output:
Timed out
Leaf count of result is larger than twice the leaf count of optimal. 128 vs. \(2 (56) = 112\).
Time = 0.12 (sec) , antiderivative size = 128, normalized size of antiderivative = 2.13 \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=-\frac {b \log \left (\frac {b - \frac {a \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, {\left (a + \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}}{a^{3} + a b^{2} + \frac {2 \, {\left (a^{2} b + b^{3}\right )} \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {{\left (a^{3} + a b^{2}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}} \] Input:
integrate(sin(x)/(a*cos(x)+b*sin(x))^2,x, algorithm="maxima")
Output:
-b*log((b - a*sin(x)/(cos(x) + 1) + sqrt(a^2 + b^2))/(b - a*sin(x)/(cos(x) + 1) - sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) + 2*(a + b*sin(x)/(cos(x) + 1) )/(a^3 + a*b^2 + 2*(a^2*b + b^3)*sin(x)/(cos(x) + 1) - (a^3 + a*b^2)*sin(x )^2/(cos(x) + 1)^2)
Time = 0.17 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.72 \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=-\frac {b \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, x\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, x\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, x\right ) + a\right )}}{{\left (a \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, x\right ) - a\right )} {\left (a^{2} + b^{2}\right )}} \] Input:
integrate(sin(x)/(a*cos(x)+b*sin(x))^2,x, algorithm="giac")
Output:
-b*log(abs(2*a*tan(1/2*x) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*tan(1/2*x) - 2*b + 2*sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) - 2*(b*tan(1/2*x) + a)/((a*tan (1/2*x)^2 - 2*b*tan(1/2*x) - a)*(a^2 + b^2))
Time = 16.55 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.43 \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=\frac {\frac {2\,a}{a^2+b^2}+\frac {2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )}{a^2+b^2}}{-a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )+a}-\frac {2\,b\,\mathrm {atanh}\left (\frac {2\,b-2\,a\,\mathrm {tan}\left (\frac {x}{2}\right )}{2\,\sqrt {a^2+b^2}}\right )}{{\left (a^2+b^2\right )}^{3/2}} \] Input:
int(sin(x)/(a*cos(x) + b*sin(x))^2,x)
Output:
((2*a)/(a^2 + b^2) + (2*b*tan(x/2))/(a^2 + b^2))/(a + 2*b*tan(x/2) - a*tan (x/2)^2) - (2*b*atanh((2*b - 2*a*tan(x/2))/(2*(a^2 + b^2)^(1/2))))/(a^2 + b^2)^(3/2)
Time = 0.15 (sec) , antiderivative size = 138, normalized size of antiderivative = 2.30 \[ \int \frac {\sin (x)}{(a \cos (x)+b \sin (x))^2} \, dx=\frac {-2 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) a i -b i}{\sqrt {a^{2}+b^{2}}}\right ) \cos \left (x \right ) a b i -2 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) a i -b i}{\sqrt {a^{2}+b^{2}}}\right ) \sin \left (x \right ) b^{2} i +a^{3}+a \,b^{2}}{\cos \left (x \right ) a^{5}+2 \cos \left (x \right ) a^{3} b^{2}+\cos \left (x \right ) a \,b^{4}+\sin \left (x \right ) a^{4} b +2 \sin \left (x \right ) a^{2} b^{3}+\sin \left (x \right ) b^{5}} \] Input:
int(sin(x)/(a*cos(x)+b*sin(x))^2,x)
Output:
( - 2*sqrt(a**2 + b**2)*atan((tan(x/2)*a*i - b*i)/sqrt(a**2 + b**2))*cos(x )*a*b*i - 2*sqrt(a**2 + b**2)*atan((tan(x/2)*a*i - b*i)/sqrt(a**2 + b**2)) *sin(x)*b**2*i + a**3 + a*b**2)/(cos(x)*a**5 + 2*cos(x)*a**3*b**2 + cos(x) *a*b**4 + sin(x)*a**4*b + 2*sin(x)*a**2*b**3 + sin(x)*b**5)