Integrand size = 13, antiderivative size = 109 \[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=\frac {2 a^3 b \text {arctanh}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}-\frac {\sec (x) \left (3 a^2 b-a \left (2 a^2+b^2\right ) \sin (x)\right )}{3 \left (a^2-b^2\right )^2} \] Output:
2*a^3*b*arctanh((a+b*tan(1/2*x))/(a^2-b^2)^(1/2))/(a^2-b^2)^(5/2)-sec(x)^3 *(b-a*sin(x))/(3*a^2-3*b^2)-1/3*sec(x)*(3*a^2*b-a*(2*a^2+b^2)*sin(x))/(a^2 -b^2)^2
Time = 0.67 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.11 \[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=\frac {-\frac {24 a^3 b \arctan \left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}+\sec ^3(x) \left (-10 a^2 b+4 b^3-6 a^2 b \cos (2 x)+6 a^3 \sin (x)-3 a b^2 \sin (x)+2 a^3 \sin (3 x)+a b^2 \sin (3 x)\right )}{12 (a-b)^2 (a+b)^2} \] Input:
Integrate[Sec[x]^4/(a + b*Csc[x]),x]
Output:
((-24*a^3*b*ArcTan[(a + b*Tan[x/2])/Sqrt[-a^2 + b^2]])/Sqrt[-a^2 + b^2] + Sec[x]^3*(-10*a^2*b + 4*b^3 - 6*a^2*b*Cos[2*x] + 6*a^3*Sin[x] - 3*a*b^2*Si n[x] + 2*a^3*Sin[3*x] + a*b^2*Sin[3*x]))/(12*(a - b)^2*(a + b)^2)
Time = 0.60 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.17, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.923, Rules used = {3042, 4360, 3042, 3345, 25, 3042, 3345, 27, 3042, 3139, 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 {\sec ^4(x)}{a+b \csc (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\cos (x)^4 (a+b \csc (x))}dx\) |
\(\Big \downarrow \) 4360 |
\(\displaystyle \int \frac {\tan (x) \sec ^3(x)}{a \sin (x)+b}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin (x)}{\cos (x)^4 (a \sin (x)+b)}dx\) |
\(\Big \downarrow \) 3345 |
\(\displaystyle \frac {\int -\frac {\sec ^2(x) \left (a b-2 a^2 \sin (x)\right )}{b+a \sin (x)}dx}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\int \frac {\sec ^2(x) \left (a b-2 a^2 \sin (x)\right )}{b+a \sin (x)}dx}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \frac {a b-2 a^2 \sin (x)}{\cos (x)^2 (b+a \sin (x))}dx}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 3345 |
\(\displaystyle -\frac {\frac {\int \frac {3 a^3 b}{b+a \sin (x)}dx}{a^2-b^2}+\frac {\sec (x) \left (3 a^2 b-a \left (2 a^2+b^2\right ) \sin (x)\right )}{a^2-b^2}}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle -\frac {\frac {3 a^3 b \int \frac {1}{b+a \sin (x)}dx}{a^2-b^2}+\frac {\sec (x) \left (3 a^2 b-a \left (2 a^2+b^2\right ) \sin (x)\right )}{a^2-b^2}}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\frac {3 a^3 b \int \frac {1}{b+a \sin (x)}dx}{a^2-b^2}+\frac {\sec (x) \left (3 a^2 b-a \left (2 a^2+b^2\right ) \sin (x)\right )}{a^2-b^2}}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle -\frac {\frac {6 a^3 b \int \frac {1}{b \tan ^2\left (\frac {x}{2}\right )+2 a \tan \left (\frac {x}{2}\right )+b}d\tan \left (\frac {x}{2}\right )}{a^2-b^2}+\frac {\sec (x) \left (3 a^2 b-a \left (2 a^2+b^2\right ) \sin (x)\right )}{a^2-b^2}}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle -\frac {\frac {\sec (x) \left (3 a^2 b-a \left (2 a^2+b^2\right ) \sin (x)\right )}{a^2-b^2}-\frac {12 a^3 b \int \frac {1}{4 \left (a^2-b^2\right )-\left (2 a+2 b \tan \left (\frac {x}{2}\right )\right )^2}d\left (2 a+2 b \tan \left (\frac {x}{2}\right )\right )}{a^2-b^2}}{3 \left (a^2-b^2\right )}-\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {\sec ^3(x) (b-a \sin (x))}{3 \left (a^2-b^2\right )}-\frac {\frac {\sec (x) \left (3 a^2 b-a \left (2 a^2+b^2\right ) \sin (x)\right )}{a^2-b^2}-\frac {6 a^3 b \text {arctanh}\left (\frac {2 a+2 b \tan \left (\frac {x}{2}\right )}{2 \sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}}{3 \left (a^2-b^2\right )}\) |
Input:
Int[Sec[x]^4/(a + b*Csc[x]),x]
Output:
-1/3*(Sec[x]^3*(b - a*Sin[x]))/(a^2 - b^2) - ((-6*a^3*b*ArcTanh[(2*a + 2*b *Tan[x/2])/(2*Sqrt[a^2 - b^2])])/(a^2 - b^2)^(3/2) + (Sec[x]*(3*a^2*b - a* (2*a^2 + b^2)*Sin[x]))/(a^2 - b^2))/(3*(a^2 - b^2))
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, 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[((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[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + 2*b*e*x + a *e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ [a^2 - b^2, 0]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(g*Co s[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m + 1)*((b*c - a*d - (a*c - b*d)* Sin[e + f*x])/(f*g*(a^2 - b^2)*(p + 1))), x] + Simp[1/(g^2*(a^2 - b^2)*(p + 1)) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^m*Simp[c*(a^2*(p + 2) - b^2*(m + p + 2)) + a*b*d*m + b*(a*c - b*d)*(m + p + 3)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && NeQ[a^2 - b^2, 0] && Lt Q[p, -1] && IntegerQ[2*m]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
Time = 0.40 (sec) , antiderivative size = 176, normalized size of antiderivative = 1.61
method | result | size |
default | \(-\frac {2 a^{3} b \arctan \left (\frac {2 b \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2} \sqrt {-a^{2}+b^{2}}}-\frac {4}{3 \left (\tan \left (\frac {x}{2}\right )+1\right )^{3} \left (4 a -4 b \right )}+\frac {2}{\left (4 a -4 b \right ) \left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {2 a -b}{2 \left (a -b \right )^{2} \left (\tan \left (\frac {x}{2}\right )+1\right )}-\frac {4}{3 \left (\tan \left (\frac {x}{2}\right )-1\right )^{3} \left (4 a +4 b \right )}-\frac {2}{\left (4 a +4 b \right ) \left (\tan \left (\frac {x}{2}\right )-1\right )^{2}}-\frac {2 a +b}{2 \left (a +b \right )^{2} \left (\tan \left (\frac {x}{2}\right )-1\right )}\) | \(176\) |
risch | \(\frac {2 i a \,b^{2} {\mathrm e}^{4 i x}-2 a^{2} b \,{\mathrm e}^{5 i x}+4 i a^{3} {\mathrm e}^{2 i x}-\frac {20 a^{2} b \,{\mathrm e}^{3 i x}}{3}+\frac {8 b^{3} {\mathrm e}^{3 i x}}{3}+\frac {4 i a^{3}}{3}+\frac {2 i a \,b^{2}}{3}-2 a^{2} b \,{\mathrm e}^{i x}}{\left (-a^{2}+b^{2}\right )^{2} \left ({\mathrm e}^{2 i x}+1\right )^{3}}+\frac {b \,a^{3} \ln \left ({\mathrm e}^{i x}+\frac {i b \sqrt {a^{2}-b^{2}}+a^{2}-b^{2}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}-\frac {b \,a^{3} \ln \left ({\mathrm e}^{i x}+\frac {i b \sqrt {a^{2}-b^{2}}-a^{2}+b^{2}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}\) | \(253\) |
Input:
int(sec(x)^4/(a+b*csc(x)),x,method=_RETURNVERBOSE)
Output:
-2*a^3*b/(a-b)^2/(a+b)^2/(-a^2+b^2)^(1/2)*arctan(1/2*(2*b*tan(1/2*x)+2*a)/ (-a^2+b^2)^(1/2))-4/3/(tan(1/2*x)+1)^3/(4*a-4*b)+2/(4*a-4*b)/(tan(1/2*x)+1 )^2-1/2*(2*a-b)/(a-b)^2/(tan(1/2*x)+1)-4/3/(tan(1/2*x)-1)^3/(4*a+4*b)-2/(4 *a+4*b)/(tan(1/2*x)-1)^2-1/2*(2*a+b)/(a+b)^2/(tan(1/2*x)-1)
Time = 0.10 (sec) , antiderivative size = 395, normalized size of antiderivative = 3.62 \[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=\left [\frac {3 \, \sqrt {a^{2} - b^{2}} a^{3} b \cos \left (x\right )^{3} \log \left (\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (x\right )^{2} + 2 \, a b \sin \left (x\right ) + a^{2} + b^{2} + 2 \, {\left (b \cos \left (x\right ) \sin \left (x\right ) + a \cos \left (x\right )\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) - 2 \, a^{4} b + 4 \, a^{2} b^{3} - 2 \, b^{5} - 6 \, {\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (x\right )^{2} + 2 \, {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4} + {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{6 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cos \left (x\right )^{3}}, \frac {3 \, \sqrt {-a^{2} + b^{2}} a^{3} b \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \left (x\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \left (x\right )}\right ) \cos \left (x\right )^{3} - a^{4} b + 2 \, a^{2} b^{3} - b^{5} - 3 \, {\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (x\right )^{2} + {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4} + {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{3 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cos \left (x\right )^{3}}\right ] \] Input:
integrate(sec(x)^4/(a+b*csc(x)),x, algorithm="fricas")
Output:
[1/6*(3*sqrt(a^2 - b^2)*a^3*b*cos(x)^3*log(((a^2 - 2*b^2)*cos(x)^2 + 2*a*b *sin(x) + a^2 + b^2 + 2*(b*cos(x)*sin(x) + a*cos(x))*sqrt(a^2 - b^2))/(a^2 *cos(x)^2 - 2*a*b*sin(x) - a^2 - b^2)) - 2*a^4*b + 4*a^2*b^3 - 2*b^5 - 6*( a^4*b - a^2*b^3)*cos(x)^2 + 2*(a^5 - 2*a^3*b^2 + a*b^4 + (2*a^5 - a^3*b^2 - a*b^4)*cos(x)^2)*sin(x))/((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*cos(x)^3), 1/3*(3*sqrt(-a^2 + b^2)*a^3*b*arctan(-sqrt(-a^2 + b^2)*(b*sin(x) + a)/((a ^2 - b^2)*cos(x)))*cos(x)^3 - a^4*b + 2*a^2*b^3 - b^5 - 3*(a^4*b - a^2*b^3 )*cos(x)^2 + (a^5 - 2*a^3*b^2 + a*b^4 + (2*a^5 - a^3*b^2 - a*b^4)*cos(x)^2 )*sin(x))/((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*cos(x)^3)]
\[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=\int \frac {\sec ^{4}{\left (x \right )}}{a + b \csc {\left (x \right )}}\, dx \] Input:
integrate(sec(x)**4/(a+b*csc(x)),x)
Output:
Integral(sec(x)**4/(a + b*csc(x)), x)
Exception generated. \[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(sec(x)^4/(a+b*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(4*a^2-4*b^2>0)', see `assume?` f or more de
Time = 0.14 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.72 \[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=-\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, x\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a^{3} b}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {2 \, {\left (3 \, a^{3} \tan \left (\frac {1}{2} \, x\right )^{5} - 6 \, a^{2} b \tan \left (\frac {1}{2} \, x\right )^{4} + 3 \, b^{3} \tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, a^{3} \tan \left (\frac {1}{2} \, x\right )^{3} - 4 \, a b^{2} \tan \left (\frac {1}{2} \, x\right )^{3} + 6 \, a^{2} b \tan \left (\frac {1}{2} \, x\right )^{2} + 3 \, a^{3} \tan \left (\frac {1}{2} \, x\right ) - 4 \, a^{2} b + b^{3}\right )}}{3 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}^{3}} \] Input:
integrate(sec(x)^4/(a+b*csc(x)),x, algorithm="giac")
Output:
-2*(pi*floor(1/2*x/pi + 1/2)*sgn(b) + arctan((b*tan(1/2*x) + a)/sqrt(-a^2 + b^2)))*a^3*b/((a^4 - 2*a^2*b^2 + b^4)*sqrt(-a^2 + b^2)) - 2/3*(3*a^3*tan (1/2*x)^5 - 6*a^2*b*tan(1/2*x)^4 + 3*b^3*tan(1/2*x)^4 - 2*a^3*tan(1/2*x)^3 - 4*a*b^2*tan(1/2*x)^3 + 6*a^2*b*tan(1/2*x)^2 + 3*a^3*tan(1/2*x) - 4*a^2* b + b^3)/((a^4 - 2*a^2*b^2 + b^4)*(tan(1/2*x)^2 - 1)^3)
Time = 15.50 (sec) , antiderivative size = 298, normalized size of antiderivative = 2.73 \[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=\frac {\frac {2\,\left (4\,a^2\,b-b^3\right )}{3\,\left (a^4-2\,a^2\,b^2+b^4\right )}+\frac {2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4\,\left (2\,a^2\,b-b^3\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {2\,a^3\,\mathrm {tan}\left (\frac {x}{2}\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {2\,a^3\,{\mathrm {tan}\left (\frac {x}{2}\right )}^5}{a^4-2\,a^2\,b^2+b^4}-\frac {4\,a^2\,b\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{a^4-2\,a^2\,b^2+b^4}+\frac {4\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,\left (a^2+2\,b^2\right )}{3\,\left (a^4-2\,a^2\,b^2+b^4\right )}}{{\mathrm {tan}\left (\frac {x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-1}+\frac {2\,a^3\,b\,\mathrm {atanh}\left (\frac {2\,a\,b^4+2\,a^5-4\,a^3\,b^2+2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}{2\,{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}}\right )}{{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}} \] Input:
int(1/(cos(x)^4*(a + b/sin(x))),x)
Output:
((2*(4*a^2*b - b^3))/(3*(a^4 + b^4 - 2*a^2*b^2)) + (2*tan(x/2)^4*(2*a^2*b - b^3))/(a^4 + b^4 - 2*a^2*b^2) - (2*a^3*tan(x/2))/(a^4 + b^4 - 2*a^2*b^2) - (2*a^3*tan(x/2)^5)/(a^4 + b^4 - 2*a^2*b^2) - (4*a^2*b*tan(x/2)^2)/(a^4 + b^4 - 2*a^2*b^2) + (4*a*tan(x/2)^3*(a^2 + 2*b^2))/(3*(a^4 + b^4 - 2*a^2* b^2)))/(3*tan(x/2)^2 - 3*tan(x/2)^4 + tan(x/2)^6 - 1) + (2*a^3*b*atanh((2* a*b^4 + 2*a^5 - 4*a^3*b^2 + 2*b*tan(x/2)*(a^4 + b^4 - 2*a^2*b^2))/(2*(a + b)^(5/2)*(a - b)^(5/2))))/((a + b)^(5/2)*(a - b)^(5/2))
Time = 0.18 (sec) , antiderivative size = 286, normalized size of antiderivative = 2.62 \[ \int \frac {\sec ^4(x)}{a+b \csc (x)} \, dx=\frac {6 \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) b +a}{\sqrt {-a^{2}+b^{2}}}\right ) \cos \left (x \right ) \sin \left (x \right )^{2} a^{3} b -6 \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) b +a}{\sqrt {-a^{2}+b^{2}}}\right ) \cos \left (x \right ) a^{3} b -\cos \left (x \right ) \sin \left (x \right )^{2} a^{2} b^{3}+\cos \left (x \right ) \sin \left (x \right )^{2} b^{5}+\cos \left (x \right ) a^{2} b^{3}-\cos \left (x \right ) b^{5}+2 \sin \left (x \right )^{3} a^{5}-\sin \left (x \right )^{3} a^{3} b^{2}-\sin \left (x \right )^{3} a \,b^{4}-3 \sin \left (x \right )^{2} a^{4} b +3 \sin \left (x \right )^{2} a^{2} b^{3}-3 \sin \left (x \right ) a^{5}+3 \sin \left (x \right ) a^{3} b^{2}+4 a^{4} b -5 a^{2} b^{3}+b^{5}}{3 \cos \left (x \right ) \left (\sin \left (x \right )^{2} a^{6}-3 \sin \left (x \right )^{2} a^{4} b^{2}+3 \sin \left (x \right )^{2} a^{2} b^{4}-\sin \left (x \right )^{2} b^{6}-a^{6}+3 a^{4} b^{2}-3 a^{2} b^{4}+b^{6}\right )} \] Input:
int(sec(x)^4/(a+b*csc(x)),x)
Output:
(6*sqrt( - a**2 + b**2)*atan((tan(x/2)*b + a)/sqrt( - a**2 + b**2))*cos(x) *sin(x)**2*a**3*b - 6*sqrt( - a**2 + b**2)*atan((tan(x/2)*b + a)/sqrt( - a **2 + b**2))*cos(x)*a**3*b - cos(x)*sin(x)**2*a**2*b**3 + cos(x)*sin(x)**2 *b**5 + cos(x)*a**2*b**3 - cos(x)*b**5 + 2*sin(x)**3*a**5 - sin(x)**3*a**3 *b**2 - sin(x)**3*a*b**4 - 3*sin(x)**2*a**4*b + 3*sin(x)**2*a**2*b**3 - 3* sin(x)*a**5 + 3*sin(x)*a**3*b**2 + 4*a**4*b - 5*a**2*b**3 + b**5)/(3*cos(x )*(sin(x)**2*a**6 - 3*sin(x)**2*a**4*b**2 + 3*sin(x)**2*a**2*b**4 - sin(x) **2*b**6 - a**6 + 3*a**4*b**2 - 3*a**2*b**4 + b**6))