Integrand size = 12, antiderivative size = 98 \[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx=\frac {a x}{a^2+b^2}+\frac {2 a c \text {arctanh}\left (\frac {a-(b-c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\left (a^2+b^2\right ) \sqrt {a^2+b^2-c^2}}-\frac {b \log (c+b \cos (x)+a \sin (x))}{a^2+b^2} \] Output:
a*x/(a^2+b^2)+2*a*c*arctanh((a-(b-c)*tan(1/2*x))/(a^2+b^2-c^2)^(1/2))/(a^2 +b^2)/(a^2+b^2-c^2)^(1/2)-b*ln(c+b*cos(x)+a*sin(x))/(a^2+b^2)
Time = 0.25 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.82 \[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx=\frac {a x+\frac {2 a c \text {arctanh}\left (\frac {a+(-b+c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\sqrt {a^2+b^2-c^2}}-b \log (c+b \cos (x)+a \sin (x))}{a^2+b^2} \] Input:
Integrate[(a + b*Cot[x] + c*Csc[x])^(-1),x]
Output:
(a*x + (2*a*c*ArcTanh[(a + (-b + c)*Tan[x/2])/Sqrt[a^2 + b^2 - c^2]])/Sqrt [a^2 + b^2 - c^2] - b*Log[c + b*Cos[x] + a*Sin[x]])/(a^2 + b^2)
Time = 0.38 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.05, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3042, 3639, 3042, 3616, 3042, 3603, 1083, 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 {1}{a+b \cot (x)+c \csc (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{a+b \cot (x)+c \csc (x)}dx\) |
\(\Big \downarrow \) 3639 |
\(\displaystyle \int \frac {\sin (x)}{a \sin (x)+b \cos (x)+c}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (x)}{a \sin (x)+b \cos (x)+c}dx\) |
\(\Big \downarrow \) 3616 |
\(\displaystyle -\frac {a c \int \frac {1}{c+b \cos (x)+a \sin (x)}dx}{a^2+b^2}-\frac {b \log (a \sin (x)+b \cos (x)+c)}{a^2+b^2}+\frac {a x}{a^2+b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {a c \int \frac {1}{c+b \cos (x)+a \sin (x)}dx}{a^2+b^2}-\frac {b \log (a \sin (x)+b \cos (x)+c)}{a^2+b^2}+\frac {a x}{a^2+b^2}\) |
\(\Big \downarrow \) 3603 |
\(\displaystyle -\frac {2 a c \int \frac {1}{-\left ((b-c) \tan ^2\left (\frac {x}{2}\right )\right )+2 a \tan \left (\frac {x}{2}\right )+b+c}d\tan \left (\frac {x}{2}\right )}{a^2+b^2}-\frac {b \log (a \sin (x)+b \cos (x)+c)}{a^2+b^2}+\frac {a x}{a^2+b^2}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {4 a c \int \frac {1}{4 \left (a^2+b^2-c^2\right )-\left (2 a-2 (b-c) \tan \left (\frac {x}{2}\right )\right )^2}d\left (2 a-2 (b-c) \tan \left (\frac {x}{2}\right )\right )}{a^2+b^2}-\frac {b \log (a \sin (x)+b \cos (x)+c)}{a^2+b^2}+\frac {a x}{a^2+b^2}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {2 a c \text {arctanh}\left (\frac {2 a-2 (b-c) \tan \left (\frac {x}{2}\right )}{2 \sqrt {a^2+b^2-c^2}}\right )}{\left (a^2+b^2\right ) \sqrt {a^2+b^2-c^2}}-\frac {b \log (a \sin (x)+b \cos (x)+c)}{a^2+b^2}+\frac {a x}{a^2+b^2}\) |
Input:
Int[(a + b*Cot[x] + c*Csc[x])^(-1),x]
Output:
(a*x)/(a^2 + b^2) + (2*a*c*ArcTanh[(2*a - 2*(b - c)*Tan[x/2])/(2*Sqrt[a^2 + b^2 - c^2])])/((a^2 + b^2)*Sqrt[a^2 + b^2 - c^2]) - (b*Log[c + b*Cos[x] + a*Sin[x]])/(a^2 + b^2)
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[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{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]
Int[((A_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_) ]*(b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[c*C*((d + e*x)/ (e*(b^2 + c^2))), x] + (-Simp[b*C*(Log[a + b*Cos[d + e*x] + c*Sin[d + e*x]] /(e*(b^2 + c^2))), x] + Simp[(A*(b^2 + c^2) - a*c*C)/(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[b^2 + c^2, 0] && NeQ[A*(b^2 + c^2) - a*c*C, 0]
Int[((a_.) + csc[(d_.) + (e_.)*(x_)]*(b_.) + cot[(d_.) + (e_.)*(x_)]*(c_.)) ^(-1), x_Symbol] :> Int[Sin[d + e*x]/(b + a*Sin[d + e*x] + c*Cos[d + e*x]), x] /; FreeQ[{a, b, c, d, e}, x]
Time = 0.54 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.80
method | result | size |
default | \(\frac {2 b \ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )+4 a \arctan \left (\tan \left (\frac {x}{2}\right )\right )}{2 a^{2}+2 b^{2}}+\frac {\frac {4 \left (b^{2}-c b \right ) \ln \left (-b \tan \left (\frac {x}{2}\right )^{2}+c \tan \left (\frac {x}{2}\right )^{2}+2 a \tan \left (\frac {x}{2}\right )+b +c \right )}{-2 b +2 c}+\frac {4 \left (-b a -a c -\frac {\left (b^{2}-c b \right ) a}{-b +c}\right ) \arctan \left (\frac {2 \left (-b +c \right ) \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}-b^{2}+c^{2}}}\right )}{\sqrt {-a^{2}-b^{2}+c^{2}}}}{2 a^{2}+2 b^{2}}\) | \(176\) |
risch | \(\text {Expression too large to display}\) | \(1313\) |
Input:
int(1/(a+b*cot(x)+c*csc(x)),x,method=_RETURNVERBOSE)
Output:
4/(2*a^2+2*b^2)*(1/2*b*ln(1+tan(1/2*x)^2)+a*arctan(tan(1/2*x)))+4/(2*a^2+2 *b^2)*(1/2*(b^2-b*c)/(-b+c)*ln(-b*tan(1/2*x)^2+c*tan(1/2*x)^2+2*a*tan(1/2* x)+b+c)+(-b*a-a*c-(b^2-b*c)*a/(-b+c))/(-a^2-b^2+c^2)^(1/2)*arctan(1/2*(2*( -b+c)*tan(1/2*x)+2*a)/(-a^2-b^2+c^2)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 203 vs. \(2 (94) = 188\).
Time = 0.13 (sec) , antiderivative size = 555, normalized size of antiderivative = 5.66 \[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx=\left [\frac {\sqrt {a^{2} + b^{2} - c^{2}} a c \log \left (\frac {a^{4} + 3 \, a^{2} b^{2} + 2 \, b^{4} + {\left (a^{2} - b^{2}\right )} c^{2} + 2 \, {\left (a^{2} b + b^{3}\right )} c \cos \left (x\right ) + {\left (a^{4} - b^{4} - 2 \, {\left (a^{2} - b^{2}\right )} c^{2}\right )} \cos \left (x\right )^{2} + 2 \, {\left ({\left (a^{3} + a b^{2}\right )} c - {\left (a^{3} b + a b^{3} - 2 \, a b c^{2}\right )} \cos \left (x\right )\right )} \sin \left (x\right ) + 2 \, {\left (2 \, a b c \cos \left (x\right )^{2} - a b c + {\left (a^{3} + a b^{2}\right )} \cos \left (x\right ) - {\left (a^{2} b + b^{3} - {\left (a^{2} - b^{2}\right )} c \cos \left (x\right )\right )} \sin \left (x\right )\right )} \sqrt {a^{2} + b^{2} - c^{2}}}{2 \, b c \cos \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + c^{2} + 2 \, {\left (a b \cos \left (x\right ) + a c\right )} \sin \left (x\right )}\right ) + 2 \, {\left (a^{3} + a b^{2} - a c^{2}\right )} x - {\left (a^{2} b + b^{3} - b c^{2}\right )} \log \left (2 \, b c \cos \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + c^{2} + 2 \, {\left (a b \cos \left (x\right ) + a c\right )} \sin \left (x\right )\right )}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4} - {\left (a^{2} + b^{2}\right )} c^{2}\right )}}, -\frac {2 \, \sqrt {-a^{2} - b^{2} + c^{2}} a c \arctan \left (\frac {{\left (b c \cos \left (x\right ) + a c \sin \left (x\right ) + a^{2} + b^{2}\right )} \sqrt {-a^{2} - b^{2} + c^{2}}}{{\left (a^{3} + a b^{2} - a c^{2}\right )} \cos \left (x\right ) - {\left (a^{2} b + b^{3} - b c^{2}\right )} \sin \left (x\right )}\right ) - 2 \, {\left (a^{3} + a b^{2} - a c^{2}\right )} x + {\left (a^{2} b + b^{3} - b c^{2}\right )} \log \left (2 \, b c \cos \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + c^{2} + 2 \, {\left (a b \cos \left (x\right ) + a c\right )} \sin \left (x\right )\right )}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4} - {\left (a^{2} + b^{2}\right )} c^{2}\right )}}\right ] \] Input:
integrate(1/(a+b*cot(x)+c*csc(x)),x, algorithm="fricas")
Output:
[1/2*(sqrt(a^2 + b^2 - c^2)*a*c*log((a^4 + 3*a^2*b^2 + 2*b^4 + (a^2 - b^2) *c^2 + 2*(a^2*b + b^3)*c*cos(x) + (a^4 - b^4 - 2*(a^2 - b^2)*c^2)*cos(x)^2 + 2*((a^3 + a*b^2)*c - (a^3*b + a*b^3 - 2*a*b*c^2)*cos(x))*sin(x) + 2*(2* a*b*c*cos(x)^2 - a*b*c + (a^3 + a*b^2)*cos(x) - (a^2*b + b^3 - (a^2 - b^2) *c*cos(x))*sin(x))*sqrt(a^2 + b^2 - c^2))/(2*b*c*cos(x) - (a^2 - b^2)*cos( x)^2 + a^2 + c^2 + 2*(a*b*cos(x) + a*c)*sin(x))) + 2*(a^3 + a*b^2 - a*c^2) *x - (a^2*b + b^3 - b*c^2)*log(2*b*c*cos(x) - (a^2 - b^2)*cos(x)^2 + a^2 + c^2 + 2*(a*b*cos(x) + a*c)*sin(x)))/(a^4 + 2*a^2*b^2 + b^4 - (a^2 + b^2)* c^2), -1/2*(2*sqrt(-a^2 - b^2 + c^2)*a*c*arctan((b*c*cos(x) + a*c*sin(x) + a^2 + b^2)*sqrt(-a^2 - b^2 + c^2)/((a^3 + a*b^2 - a*c^2)*cos(x) - (a^2*b + b^3 - b*c^2)*sin(x))) - 2*(a^3 + a*b^2 - a*c^2)*x + (a^2*b + b^3 - b*c^2 )*log(2*b*c*cos(x) - (a^2 - b^2)*cos(x)^2 + a^2 + c^2 + 2*(a*b*cos(x) + a* c)*sin(x)))/(a^4 + 2*a^2*b^2 + b^4 - (a^2 + b^2)*c^2)]
\[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx=\int \frac {1}{a + b \cot {\left (x \right )} + c \csc {\left (x \right )}}\, dx \] Input:
integrate(1/(a+b*cot(x)+c*csc(x)),x)
Output:
Integral(1/(a + b*cot(x) + c*csc(x)), x)
Exception generated. \[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(1/(a+b*cot(x)+c*csc(x)),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(c^2-b^2-a^2>0)', see `assume?` f or more de
Time = 0.30 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.61 \[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx=-\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + \arctan \left (-\frac {b \tan \left (\frac {1}{2} \, x\right ) - c \tan \left (\frac {1}{2} \, x\right ) - a}{\sqrt {-a^{2} - b^{2} + c^{2}}}\right )\right )} a c}{{\left (a^{2} + b^{2}\right )} \sqrt {-a^{2} - b^{2} + c^{2}}} + \frac {a x}{a^{2} + b^{2}} - \frac {b \log \left (-b \tan \left (\frac {1}{2} \, x\right )^{2} + c \tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, a \tan \left (\frac {1}{2} \, x\right ) + b + c\right )}{a^{2} + b^{2}} + \frac {b \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}{a^{2} + b^{2}} \] Input:
integrate(1/(a+b*cot(x)+c*csc(x)),x, algorithm="giac")
Output:
-2*(pi*floor(1/2*x/pi + 1/2)*sgn(-2*b + 2*c) + arctan(-(b*tan(1/2*x) - c*t an(1/2*x) - a)/sqrt(-a^2 - b^2 + c^2)))*a*c/((a^2 + b^2)*sqrt(-a^2 - b^2 + c^2)) + a*x/(a^2 + b^2) - b*log(-b*tan(1/2*x)^2 + c*tan(1/2*x)^2 + 2*a*ta n(1/2*x) + b + c)/(a^2 + b^2) + b*log(tan(1/2*x)^2 + 1)/(a^2 + b^2)
Time = 27.70 (sec) , antiderivative size = 965, normalized size of antiderivative = 9.85 \[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx =\text {Too large to display} \] Input:
int(1/(a + c/sin(x) + b*cot(x)),x)
Output:
log(tan(x/2) - 1i)/(a*1i + b) + (log(tan(x/2) + 1i)*1i)/(a + b*1i) - (log( - 64*tan(x/2)*(b - c)^2 - ((a^2*b - b*c^2 + b^3 + a*c*(a^2 + b^2 - c^2)^(1 /2))*(32*a*b^2 + 32*a*c^2 - 64*a*b*c - 64*tan(x/2)*(b - c)*(b*c + a^2 - c^ 2) + ((a^2*b - b*c^2 + b^3 + a*c*(a^2 + b^2 - c^2)^(1/2))*(64*a*b^3 - 32*a ^3*b + 32*a^3*c + 32*tan(x/2)*(b - c)*(a^2*b - 2*a^2*c + 2*b^2*c - 2*b^3) + 64*a*b*c^2 - 128*a*b^2*c - (32*(b - c)*(a^2*b - b*c^2 + b^3 + a*c*(a^2 + b^2 - c^2)^(1/2))*(3*a^4*tan(x/2) + 3*a*b^3 + 3*a^3*b + a^3*c + 3*a^2*b^2 *tan(x/2) - 2*a^2*c^2*tan(x/2) + 2*b^2*c^2*tan(x/2) - 2*b^3*c*tan(x/2) - 4 *a*b*c^2 + a*b^2*c - 2*a^2*b*c*tan(x/2)))/((a^2 + b^2)*(a^2 + b^2 - c^2))) )/((a^2 + b^2)*(a^2 + b^2 - c^2))))/((a^2 + b^2)*(a^2 + b^2 - c^2)))*(b*(a ^2 - c^2) + b^3 + a*c*(a^2 + b^2 - c^2)^(1/2)))/(c^2*(a^2 + b^2 - c^2) + ( a^2 + b^2 - c^2)^2) - (log(- 64*tan(x/2)*(b - c)^2 - ((a^2*b - b*c^2 + b^3 - a*c*(a^2 + b^2 - c^2)^(1/2))*(32*a*b^2 + 32*a*c^2 - 64*a*b*c - 64*tan(x /2)*(b - c)*(b*c + a^2 - c^2) + ((a^2*b - b*c^2 + b^3 - a*c*(a^2 + b^2 - c ^2)^(1/2))*(64*a*b^3 - 32*a^3*b + 32*a^3*c + 32*tan(x/2)*(b - c)*(a^2*b - 2*a^2*c + 2*b^2*c - 2*b^3) + 64*a*b*c^2 - 128*a*b^2*c - (32*(b - c)*(a^2*b - b*c^2 + b^3 - a*c*(a^2 + b^2 - c^2)^(1/2))*(3*a^4*tan(x/2) + 3*a*b^3 + 3*a^3*b + a^3*c + 3*a^2*b^2*tan(x/2) - 2*a^2*c^2*tan(x/2) + 2*b^2*c^2*tan( x/2) - 2*b^3*c*tan(x/2) - 4*a*b*c^2 + a*b^2*c - 2*a^2*b*c*tan(x/2)))/((a^2 + b^2)*(a^2 + b^2 - c^2))))/((a^2 + b^2)*(a^2 + b^2 - c^2))))/((a^2 + ...
Time = 0.16 (sec) , antiderivative size = 262, normalized size of antiderivative = 2.67 \[ \int \frac {1}{a+b \cot (x)+c \csc (x)} \, dx=\frac {-2 \sqrt {-a^{2}-b^{2}+c^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) b -\tan \left (\frac {x}{2}\right ) c -a}{\sqrt {-a^{2}-b^{2}+c^{2}}}\right ) a c +\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) a^{2} b +\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b^{3}-\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b \,c^{2}-\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} b -\tan \left (\frac {x}{2}\right )^{2} c -2 \tan \left (\frac {x}{2}\right ) a -b -c \right ) a^{2} b -\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} b -\tan \left (\frac {x}{2}\right )^{2} c -2 \tan \left (\frac {x}{2}\right ) a -b -c \right ) b^{3}+\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} b -\tan \left (\frac {x}{2}\right )^{2} c -2 \tan \left (\frac {x}{2}\right ) a -b -c \right ) b \,c^{2}+a^{3} x +a \,b^{2} x -a \,c^{2} x}{a^{4}+2 a^{2} b^{2}-a^{2} c^{2}+b^{4}-b^{2} c^{2}} \] Input:
int(1/(a+b*cot(x)+c*csc(x)),x)
Output:
( - 2*sqrt( - a**2 - b**2 + c**2)*atan((tan(x/2)*b - tan(x/2)*c - a)/sqrt( - a**2 - b**2 + c**2))*a*c + log(tan(x/2)**2 + 1)*a**2*b + log(tan(x/2)** 2 + 1)*b**3 - log(tan(x/2)**2 + 1)*b*c**2 - log(tan(x/2)**2*b - tan(x/2)** 2*c - 2*tan(x/2)*a - b - c)*a**2*b - log(tan(x/2)**2*b - tan(x/2)**2*c - 2 *tan(x/2)*a - b - c)*b**3 + log(tan(x/2)**2*b - tan(x/2)**2*c - 2*tan(x/2) *a - b - c)*b*c**2 + a**3*x + a*b**2*x - a*c**2*x)/(a**4 + 2*a**2*b**2 - a **2*c**2 + b**4 - b**2*c**2)