\(\int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx\) [16]

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

Optimal result

Integrand size = 13, antiderivative size = 120 \[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=\frac {a \left (3 a^4+10 a^2 b^2+15 b^4\right ) x}{8 \left (a^2+b^2\right )^3}-\frac {b^5 \log (b \cos (x)+a \sin (x))}{\left (a^2+b^2\right )^3}-\frac {\left (4 b^3+a \left (3 a^2+7 b^2\right ) \cot (x)\right ) \sin ^2(x)}{8 \left (a^2+b^2\right )^2}-\frac {(b+a \cot (x)) \sin ^4(x)}{4 \left (a^2+b^2\right )} \] Output:

1/8*a*(3*a^4+10*a^2*b^2+15*b^4)*x/(a^2+b^2)^3-b^5*ln(b*cos(x)+a*sin(x))/(a 
^2+b^2)^3-1/8*(4*b^3+a*(3*a^2+7*b^2)*cot(x))*sin(x)^2/(a^2+b^2)^2-(b+a*cot 
(x))*sin(x)^4/(4*a^2+4*b^2)
 

Mathematica [A] (verified)

Time = 0.25 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.26 \[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=\frac {12 a^5 x+40 a^3 b^2 x+60 a b^4 x+4 b \left (a^4+4 a^2 b^2+3 b^4\right ) \cos (2 x)-b \left (a^2+b^2\right )^2 \cos (4 x)-32 b^5 \log (b \cos (x)+a \sin (x))-8 a^5 \sin (2 x)-24 a^3 b^2 \sin (2 x)-16 a b^4 \sin (2 x)+a^5 \sin (4 x)+2 a^3 b^2 \sin (4 x)+a b^4 \sin (4 x)}{32 \left (a^2+b^2\right )^3} \] Input:

Integrate[Sin[x]^4/(a + b*Cot[x]),x]
 

Output:

(12*a^5*x + 40*a^3*b^2*x + 60*a*b^4*x + 4*b*(a^4 + 4*a^2*b^2 + 3*b^4)*Cos[ 
2*x] - b*(a^2 + b^2)^2*Cos[4*x] - 32*b^5*Log[b*Cos[x] + a*Sin[x]] - 8*a^5* 
Sin[2*x] - 24*a^3*b^2*Sin[2*x] - 16*a*b^4*Sin[2*x] + a^5*Sin[4*x] + 2*a^3* 
b^2*Sin[4*x] + a*b^4*Sin[4*x])/(32*(a^2 + b^2)^3)
 

Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 215, normalized size of antiderivative = 1.79, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.692, Rules used = {3042, 3987, 27, 496, 25, 686, 25, 657, 2009}

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 ^4(x)}{a+b \cot (x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sec \left (x-\frac {\pi }{2}\right )^4 \left (a-b \tan \left (x-\frac {\pi }{2}\right )\right )}dx\)

\(\Big \downarrow \) 3987

\(\displaystyle -\frac {\int \frac {b^6}{(a+b \cot (x)) \left (\cot ^2(x) b^2+b^2\right )^3}d(b \cot (x))}{b}\)

\(\Big \downarrow \) 27

\(\displaystyle -b^5 \int \frac {1}{(a+b \cot (x)) \left (\cot ^2(x) b^2+b^2\right )^3}d(b \cot (x))\)

\(\Big \downarrow \) 496

\(\displaystyle -b^5 \left (\frac {a b \cot (x)+b^2}{4 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )^2}-\frac {\int -\frac {3 a^2+3 b \cot (x) a+4 b^2}{(a+b \cot (x)) \left (\cot ^2(x) b^2+b^2\right )^2}d(b \cot (x))}{4 b^2 \left (a^2+b^2\right )}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle -b^5 \left (\frac {\int \frac {3 a^2+3 b \cot (x) a+4 b^2}{(a+b \cot (x)) \left (\cot ^2(x) b^2+b^2\right )^2}d(b \cot (x))}{4 b^2 \left (a^2+b^2\right )}+\frac {a b \cot (x)+b^2}{4 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )^2}\right )\)

\(\Big \downarrow \) 686

\(\displaystyle -b^5 \left (\frac {\frac {a b \left (3 a^2+7 b^2\right ) \cot (x)+4 b^4}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )}-\frac {\int -\frac {3 a^4+7 b^2 a^2+b \left (3 a^2+7 b^2\right ) \cot (x) a+8 b^4}{(a+b \cot (x)) \left (\cot ^2(x) b^2+b^2\right )}d(b \cot (x))}{2 b^2 \left (a^2+b^2\right )}}{4 b^2 \left (a^2+b^2\right )}+\frac {a b \cot (x)+b^2}{4 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )^2}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle -b^5 \left (\frac {\frac {\int \frac {3 a^4+7 b^2 a^2+b \left (3 a^2+7 b^2\right ) \cot (x) a+8 b^4}{(a+b \cot (x)) \left (\cot ^2(x) b^2+b^2\right )}d(b \cot (x))}{2 b^2 \left (a^2+b^2\right )}+\frac {a b \left (3 a^2+7 b^2\right ) \cot (x)+4 b^4}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )}}{4 b^2 \left (a^2+b^2\right )}+\frac {a b \cot (x)+b^2}{4 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )^2}\right )\)

\(\Big \downarrow \) 657

\(\displaystyle -b^5 \left (\frac {\frac {\int \left (\frac {8 b^4}{\left (a^2+b^2\right ) (a+b \cot (x))}+\frac {3 a^5+10 b^2 a^3+15 b^4 a-8 b^5 \cot (x)}{\left (a^2+b^2\right ) \left (\cot ^2(x) b^2+b^2\right )}\right )d(b \cot (x))}{2 b^2 \left (a^2+b^2\right )}+\frac {a b \left (3 a^2+7 b^2\right ) \cot (x)+4 b^4}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )}}{4 b^2 \left (a^2+b^2\right )}+\frac {a b \cot (x)+b^2}{4 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )^2}\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle -b^5 \left (\frac {a b \cot (x)+b^2}{4 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )^2}+\frac {\frac {a b \left (3 a^2+7 b^2\right ) \cot (x)+4 b^4}{2 b^2 \left (a^2+b^2\right ) \left (b^2 \cot ^2(x)+b^2\right )}+\frac {-\frac {4 b^4 \log \left (b^2 \cot ^2(x)+b^2\right )}{a^2+b^2}+\frac {8 b^4 \log (a+b \cot (x))}{a^2+b^2}+\frac {a \left (3 a^4+10 a^2 b^2+15 b^4\right ) \arctan (\cot (x))}{b \left (a^2+b^2\right )}}{2 b^2 \left (a^2+b^2\right )}}{4 b^2 \left (a^2+b^2\right )}\right )\)

Input:

Int[Sin[x]^4/(a + b*Cot[x]),x]
 

Output:

-(b^5*((b^2 + a*b*Cot[x])/(4*b^2*(a^2 + b^2)*(b^2 + b^2*Cot[x]^2)^2) + ((4 
*b^4 + a*b*(3*a^2 + 7*b^2)*Cot[x])/(2*b^2*(a^2 + b^2)*(b^2 + b^2*Cot[x]^2) 
) + ((a*(3*a^4 + 10*a^2*b^2 + 15*b^4)*ArcTan[Cot[x]])/(b*(a^2 + b^2)) + (8 
*b^4*Log[a + b*Cot[x]])/(a^2 + b^2) - (4*b^4*Log[b^2 + b^2*Cot[x]^2])/(a^2 
 + b^2))/(2*b^2*(a^2 + b^2)))/(4*b^2*(a^2 + b^2))))
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 496
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[ 
(-(a*d + b*c*x))*(c + d*x)^(n + 1)*((a + b*x^2)^(p + 1)/(2*a*(p + 1)*(b*c^2 
 + a*d^2))), x] + Simp[1/(2*a*(p + 1)*(b*c^2 + a*d^2))   Int[(c + d*x)^n*(a 
 + b*x^2)^(p + 1)*Simp[b*c^2*(2*p + 3) + a*d^2*(n + 2*p + 3) + b*c*d*(n + 2 
*p + 4)*x, x], x], x] /; FreeQ[{a, b, c, d, n}, x] && LtQ[p, -1] && IntQuad 
raticQ[a, 0, b, c, d, n, p, x]
 

rule 657
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_) + (c_.)*( 
x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g*x)^n/(a + c*x^ 
2)), x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IntegersQ[n]
 

rule 686
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p 
_), x_Symbol] :> Simp[(-(d + e*x)^(m + 1))*(f*a*c*e - a*g*c*d + c*(c*d*f + 
a*e*g)*x)*((a + c*x^2)^(p + 1)/(2*a*c*(p + 1)*(c*d^2 + a*e^2))), x] + Simp[ 
1/(2*a*c*(p + 1)*(c*d^2 + a*e^2))   Int[(d + e*x)^m*(a + c*x^2)^(p + 1)*Sim 
p[f*(c^2*d^2*(2*p + 3) + a*c*e^2*(m + 2*p + 3)) - a*c*d*e*g*m + c*e*(c*d*f 
+ a*e*g)*(m + 2*p + 4)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g}, x] && LtQ 
[p, -1] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3987
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ 
), x_Symbol] :> Simp[1/(b*f)   Subst[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), 
 x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b^2, 
0] && IntegerQ[m/2]
 
Maple [A] (verified)

Time = 4.64 (sec) , antiderivative size = 170, normalized size of antiderivative = 1.42

method result size
default \(\frac {\frac {\left (-\frac {7}{4} b^{2} a^{3}-\frac {9}{8} a \,b^{4}-\frac {5}{8} a^{5}\right ) \tan \left (x \right )^{3}+\left (\frac {1}{2} a^{4} b +\frac {3}{2} a^{2} b^{3}+b^{5}\right ) \tan \left (x \right )^{2}+\left (-\frac {3}{8} a^{5}-\frac {5}{4} b^{2} a^{3}-\frac {7}{8} a \,b^{4}\right ) \tan \left (x \right )+\frac {a^{4} b}{4}+a^{2} b^{3}+\frac {3 b^{5}}{4}}{\left (\tan \left (x \right )^{2}+1\right )^{2}}+\frac {b^{5} \ln \left (\tan \left (x \right )^{2}+1\right )}{2}+\frac {\left (3 a^{5}+10 b^{2} a^{3}+15 a \,b^{4}\right ) \arctan \left (\tan \left (x \right )\right )}{8}}{\left (a^{2}+b^{2}\right )^{3}}-\frac {b^{5} \ln \left (\tan \left (x \right ) a +b \right )}{\left (a^{2}+b^{2}\right )^{3}}\) \(170\)
risch \(\frac {9 i x a b}{8 \left (3 i a^{2} b -i b^{3}+a^{3}-3 a \,b^{2}\right )}+\frac {3 x \,a^{2}}{8 \left (3 i a^{2} b -i b^{3}+a^{3}-3 a \,b^{2}\right )}-\frac {x \,b^{2}}{3 i a^{2} b -i b^{3}+a^{3}-3 a \,b^{2}}-\frac {3 \,{\mathrm e}^{2 i x} b}{16 \left (2 i a b +a^{2}-b^{2}\right )}+\frac {i a \,{\mathrm e}^{2 i x}}{16 i a b +8 a^{2}-8 b^{2}}-\frac {3 \,{\mathrm e}^{-2 i x} b}{16 \left (-i b +a \right )^{2}}-\frac {i {\mathrm e}^{-2 i x} a}{8 \left (-i b +a \right )^{2}}+\frac {2 i b^{5} x}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}-\frac {b^{5} \ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right )}{a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}}+\frac {b \cos \left (4 x \right )}{-32 a^{2}-32 b^{2}}-\frac {a \sin \left (4 x \right )}{32 \left (-a^{2}-b^{2}\right )}\) \(303\)

Input:

int(sin(x)^4/(a+b*cot(x)),x,method=_RETURNVERBOSE)
 

Output:

1/(a^2+b^2)^3*(((-7/4*b^2*a^3-9/8*a*b^4-5/8*a^5)*tan(x)^3+(1/2*a^4*b+3/2*a 
^2*b^3+b^5)*tan(x)^2+(-3/8*a^5-5/4*b^2*a^3-7/8*a*b^4)*tan(x)+1/4*a^4*b+a^2 
*b^3+3/4*b^5)/(tan(x)^2+1)^2+1/2*b^5*ln(tan(x)^2+1)+1/8*(3*a^5+10*a^3*b^2+ 
15*a*b^4)*arctan(tan(x)))-b^5/(a^2+b^2)^3*ln(tan(x)*a+b)
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.53 \[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=-\frac {4 \, b^{5} \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right ) + 2 \, {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} \cos \left (x\right )^{4} - 4 \, {\left (a^{4} b + 3 \, a^{2} b^{3} + 2 \, b^{5}\right )} \cos \left (x\right )^{2} - {\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 15 \, a b^{4}\right )} x - {\left (2 \, {\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (x\right )^{3} - {\left (5 \, a^{5} + 14 \, a^{3} b^{2} + 9 \, a b^{4}\right )} \cos \left (x\right )\right )} \sin \left (x\right )}{8 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )}} \] Input:

integrate(sin(x)^4/(a+b*cot(x)),x, algorithm="fricas")
 

Output:

-1/8*(4*b^5*log(2*a*b*cos(x)*sin(x) - (a^2 - b^2)*cos(x)^2 + a^2) + 2*(a^4 
*b + 2*a^2*b^3 + b^5)*cos(x)^4 - 4*(a^4*b + 3*a^2*b^3 + 2*b^5)*cos(x)^2 - 
(3*a^5 + 10*a^3*b^2 + 15*a*b^4)*x - (2*(a^5 + 2*a^3*b^2 + a*b^4)*cos(x)^3 
- (5*a^5 + 14*a^3*b^2 + 9*a*b^4)*cos(x))*sin(x))/(a^6 + 3*a^4*b^2 + 3*a^2* 
b^4 + b^6)
 

Sympy [F]

\[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=\int \frac {\sin ^{4}{\left (x \right )}}{a + b \cot {\left (x \right )}}\, dx \] Input:

integrate(sin(x)**4/(a+b*cot(x)),x)
 

Output:

Integral(sin(x)**4/(a + b*cot(x)), x)
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 244 vs. \(2 (114) = 228\).

Time = 0.11 (sec) , antiderivative size = 244, normalized size of antiderivative = 2.03 \[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=-\frac {b^{5} \log \left (a \tan \left (x\right ) + b\right )}{a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}} + \frac {b^{5} \log \left (\tan \left (x\right )^{2} + 1\right )}{2 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )}} + \frac {{\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 15 \, a b^{4}\right )} x}{8 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )}} - \frac {{\left (5 \, a^{3} + 9 \, a b^{2}\right )} \tan \left (x\right )^{3} - 2 \, a^{2} b - 6 \, b^{3} - 4 \, {\left (a^{2} b + 2 \, b^{3}\right )} \tan \left (x\right )^{2} + {\left (3 \, a^{3} + 7 \, a b^{2}\right )} \tan \left (x\right )}{8 \, {\left ({\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \tan \left (x\right )^{4} + a^{4} + 2 \, a^{2} b^{2} + b^{4} + 2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \tan \left (x\right )^{2}\right )}} \] Input:

integrate(sin(x)^4/(a+b*cot(x)),x, algorithm="maxima")
 

Output:

-b^5*log(a*tan(x) + b)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + 1/2*b^5*log(t 
an(x)^2 + 1)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + 1/8*(3*a^5 + 10*a^3*b^2 
 + 15*a*b^4)*x/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 1/8*((5*a^3 + 9*a*b^2 
)*tan(x)^3 - 2*a^2*b - 6*b^3 - 4*(a^2*b + 2*b^3)*tan(x)^2 + (3*a^3 + 7*a*b 
^2)*tan(x))/((a^4 + 2*a^2*b^2 + b^4)*tan(x)^4 + a^4 + 2*a^2*b^2 + b^4 + 2* 
(a^4 + 2*a^2*b^2 + b^4)*tan(x)^2)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 273 vs. \(2 (114) = 228\).

Time = 0.12 (sec) , antiderivative size = 273, normalized size of antiderivative = 2.28 \[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=-\frac {a b^{5} \log \left ({\left | a \tan \left (x\right ) + b \right |}\right )}{a^{7} + 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}} + \frac {b^{5} \log \left (\tan \left (x\right )^{2} + 1\right )}{2 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )}} + \frac {{\left (3 \, a^{5} + 10 \, a^{3} b^{2} + 15 \, a b^{4}\right )} x}{8 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )}} - \frac {6 \, b^{5} \tan \left (x\right )^{4} + 5 \, a^{5} \tan \left (x\right )^{3} + 14 \, a^{3} b^{2} \tan \left (x\right )^{3} + 9 \, a b^{4} \tan \left (x\right )^{3} - 4 \, a^{4} b \tan \left (x\right )^{2} - 12 \, a^{2} b^{3} \tan \left (x\right )^{2} + 4 \, b^{5} \tan \left (x\right )^{2} + 3 \, a^{5} \tan \left (x\right ) + 10 \, a^{3} b^{2} \tan \left (x\right ) + 7 \, a b^{4} \tan \left (x\right ) - 2 \, a^{4} b - 8 \, a^{2} b^{3}}{8 \, {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} {\left (\tan \left (x\right )^{2} + 1\right )}^{2}} \] Input:

integrate(sin(x)^4/(a+b*cot(x)),x, algorithm="giac")
 

Output:

-a*b^5*log(abs(a*tan(x) + b))/(a^7 + 3*a^5*b^2 + 3*a^3*b^4 + a*b^6) + 1/2* 
b^5*log(tan(x)^2 + 1)/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) + 1/8*(3*a^5 + 1 
0*a^3*b^2 + 15*a*b^4)*x/(a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6) - 1/8*(6*b^5*t 
an(x)^4 + 5*a^5*tan(x)^3 + 14*a^3*b^2*tan(x)^3 + 9*a*b^4*tan(x)^3 - 4*a^4* 
b*tan(x)^2 - 12*a^2*b^3*tan(x)^2 + 4*b^5*tan(x)^2 + 3*a^5*tan(x) + 10*a^3* 
b^2*tan(x) + 7*a*b^4*tan(x) - 2*a^4*b - 8*a^2*b^3)/((a^6 + 3*a^4*b^2 + 3*a 
^2*b^4 + b^6)*(tan(x)^2 + 1)^2)
 

Mupad [B] (verification not implemented)

Time = 10.07 (sec) , antiderivative size = 263, normalized size of antiderivative = 2.19 \[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=\frac {\frac {a^2\,b+3\,b^3}{4\,{\left (a^2+b^2\right )}^2}-\frac {{\mathrm {tan}\left (x\right )}^3\,\left (5\,a^3+9\,a\,b^2\right )}{8\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {{\mathrm {tan}\left (x\right )}^2\,\left (a^2\,b+2\,b^3\right )}{2\,{\left (a^2+b^2\right )}^2}-\frac {a\,\mathrm {tan}\left (x\right )\,\left (3\,a^2+7\,b^2\right )}{8\,\left (a^4+2\,a^2\,b^2+b^4\right )}}{{\mathrm {tan}\left (x\right )}^4+2\,{\mathrm {tan}\left (x\right )}^2+1}-\frac {b^5\,\ln \left (b+a\,\mathrm {tan}\left (x\right )\right )}{{\left (a^2+b^2\right )}^3}+\frac {\ln \left (\mathrm {tan}\left (x\right )-\mathrm {i}\right )\,\left (-3\,a^2+a\,b\,9{}\mathrm {i}+8\,b^2\right )}{16\,\left (-a^3\,1{}\mathrm {i}-3\,a^2\,b+a\,b^2\,3{}\mathrm {i}+b^3\right )}+\frac {\ln \left (\mathrm {tan}\left (x\right )+1{}\mathrm {i}\right )\,\left (-a^2\,3{}\mathrm {i}+9\,a\,b+b^2\,8{}\mathrm {i}\right )}{16\,\left (-a^3-a^2\,b\,3{}\mathrm {i}+3\,a\,b^2+b^3\,1{}\mathrm {i}\right )} \] Input:

int(sin(x)^4/(a + b*cot(x)),x)
 

Output:

((a^2*b + 3*b^3)/(4*(a^2 + b^2)^2) - (tan(x)^3*(9*a*b^2 + 5*a^3))/(8*(a^4 
+ b^4 + 2*a^2*b^2)) + (tan(x)^2*(a^2*b + 2*b^3))/(2*(a^2 + b^2)^2) - (a*ta 
n(x)*(3*a^2 + 7*b^2))/(8*(a^4 + b^4 + 2*a^2*b^2)))/(2*tan(x)^2 + tan(x)^4 
+ 1) - (b^5*log(b + a*tan(x)))/(a^2 + b^2)^3 + (log(tan(x) - 1i)*(a*b*9i - 
 3*a^2 + 8*b^2))/(16*(a*b^2*3i - 3*a^2*b - a^3*1i + b^3)) + (log(tan(x) + 
1i)*(9*a*b - a^2*3i + b^2*8i))/(16*(3*a*b^2 - a^2*b*3i - a^3 + b^3*1i))
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 225, normalized size of antiderivative = 1.88 \[ \int \frac {\sin ^4(x)}{a+b \cot (x)} \, dx=\frac {-2 \cos \left (x \right ) \sin \left (x \right )^{3} a^{5}-4 \cos \left (x \right ) \sin \left (x \right )^{3} a^{3} b^{2}-2 \cos \left (x \right ) \sin \left (x \right )^{3} a \,b^{4}-3 \cos \left (x \right ) \sin \left (x \right ) a^{5}-10 \cos \left (x \right ) \sin \left (x \right ) a^{3} b^{2}-7 \cos \left (x \right ) \sin \left (x \right ) a \,b^{4}+8 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b^{5}-8 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} b -2 \tan \left (\frac {x}{2}\right ) a -b \right ) b^{5}-2 \sin \left (x \right )^{4} a^{4} b -4 \sin \left (x \right )^{4} a^{2} b^{3}-2 \sin \left (x \right )^{4} b^{5}-4 \sin \left (x \right )^{2} a^{2} b^{3}-4 \sin \left (x \right )^{2} b^{5}+3 a^{5} x +10 a^{3} b^{2} x +4 a^{2} b^{3}+15 a \,b^{4} x +4 b^{5}}{8 a^{6}+24 a^{4} b^{2}+24 a^{2} b^{4}+8 b^{6}} \] Input:

int(sin(x)^4/(a+b*cot(x)),x)
 

Output:

( - 2*cos(x)*sin(x)**3*a**5 - 4*cos(x)*sin(x)**3*a**3*b**2 - 2*cos(x)*sin( 
x)**3*a*b**4 - 3*cos(x)*sin(x)*a**5 - 10*cos(x)*sin(x)*a**3*b**2 - 7*cos(x 
)*sin(x)*a*b**4 + 8*log(tan(x/2)**2 + 1)*b**5 - 8*log(tan(x/2)**2*b - 2*ta 
n(x/2)*a - b)*b**5 - 2*sin(x)**4*a**4*b - 4*sin(x)**4*a**2*b**3 - 2*sin(x) 
**4*b**5 - 4*sin(x)**2*a**2*b**3 - 4*sin(x)**2*b**5 + 3*a**5*x + 10*a**3*b 
**2*x + 4*a**2*b**3 + 15*a*b**4*x + 4*b**5)/(8*(a**6 + 3*a**4*b**2 + 3*a** 
2*b**4 + b**6))