3.1229 \(\int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx\)

Optimal. Leaf size=120 \[ \frac {\left (a^2-b^2\right )^2}{a b^4 d (a+b \sin (c+d x))}+\frac {\left (3 a^2+b^2\right ) \left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4 d}+\frac {\log (\sin (c+d x))}{a^2 d}-\frac {2 a \sin (c+d x)}{b^3 d}+\frac {\sin ^2(c+d x)}{2 b^2 d} \]

[Out]

ln(sin(d*x+c))/a^2/d+(a^2-b^2)*(3*a^2+b^2)*ln(a+b*sin(d*x+c))/a^2/b^4/d-2*a*sin(d*x+c)/b^3/d+1/2*sin(d*x+c)^2/
b^2/d+(a^2-b^2)^2/a/b^4/d/(a+b*sin(d*x+c))

________________________________________________________________________________________

Rubi [A]  time = 0.16, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2837, 12, 894} \[ \frac {\left (a^2-b^2\right )^2}{a b^4 d (a+b \sin (c+d x))}+\frac {\left (3 a^2+b^2\right ) \left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4 d}+\frac {\log (\sin (c+d x))}{a^2 d}-\frac {2 a \sin (c+d x)}{b^3 d}+\frac {\sin ^2(c+d x)}{2 b^2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

Log[Sin[c + d*x]]/(a^2*d) + ((a^2 - b^2)*(3*a^2 + b^2)*Log[a + b*Sin[c + d*x]])/(a^2*b^4*d) - (2*a*Sin[c + d*x
])/(b^3*d) + Sin[c + d*x]^2/(2*b^2*d) + (a^2 - b^2)^2/(a*b^4*d*(a + b*Sin[c + d*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2837

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d*x)/b)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\cos ^4(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {b \left (b^2-x^2\right )^2}{x (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b^5 d}\\ &=\frac {\operatorname {Subst}\left (\int \frac {\left (b^2-x^2\right )^2}{x (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b^4 d}\\ &=\frac {\operatorname {Subst}\left (\int \left (-2 a+\frac {b^4}{a^2 x}+x-\frac {\left (a^2-b^2\right )^2}{a (a+x)^2}+\frac {\left (a^2-b^2\right ) \left (3 a^2+b^2\right )}{a^2 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{b^4 d}\\ &=\frac {\log (\sin (c+d x))}{a^2 d}+\frac {\left (a^2-b^2\right ) \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4 d}-\frac {2 a \sin (c+d x)}{b^3 d}+\frac {\sin ^2(c+d x)}{2 b^2 d}+\frac {\left (a^2-b^2\right )^2}{a b^4 d (a+b \sin (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.52, size = 111, normalized size = 0.92 \[ \frac {\frac {2 \left (a^2-b^2\right )^2}{a b^4 (a+b \sin (c+d x))}+\frac {2 (a-b) (a+b) \left (3 a^2+b^2\right ) \log (a+b \sin (c+d x))}{a^2 b^4}+\frac {2 \log (\sin (c+d x))}{a^2}-\frac {4 a \sin (c+d x)}{b^3}+\frac {\sin ^2(c+d x)}{b^2}}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((2*Log[Sin[c + d*x]])/a^2 + (2*(a - b)*(a + b)*(3*a^2 + b^2)*Log[a + b*Sin[c + d*x]])/(a^2*b^4) - (4*a*Sin[c
+ d*x])/b^3 + Sin[c + d*x]^2/b^2 + (2*(a^2 - b^2)^2)/(a*b^4*(a + b*Sin[c + d*x])))/(2*d)

________________________________________________________________________________________

fricas [A]  time = 0.81, size = 189, normalized size = 1.58 \[ \frac {6 \, a^{3} b^{2} \cos \left (d x + c\right )^{2} + 4 \, a^{5} - 15 \, a^{3} b^{2} + 4 \, a b^{4} + 4 \, {\left (3 \, a^{5} - 2 \, a^{3} b^{2} - a b^{4} + {\left (3 \, a^{4} b - 2 \, a^{2} b^{3} - b^{5}\right )} \sin \left (d x + c\right )\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) + 4 \, {\left (b^{5} \sin \left (d x + c\right ) + a b^{4}\right )} \log \left (-\frac {1}{2} \, \sin \left (d x + c\right )\right ) - {\left (2 \, a^{2} b^{3} \cos \left (d x + c\right )^{2} + 8 \, a^{4} b - a^{2} b^{3}\right )} \sin \left (d x + c\right )}{4 \, {\left (a^{2} b^{5} d \sin \left (d x + c\right ) + a^{3} b^{4} d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.19, size = 154, normalized size = 1.28 \[ \frac {\frac {2 \, \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{2}} + \frac {b^{2} \sin \left (d x + c\right )^{2} - 4 \, a b \sin \left (d x + c\right )}{b^{4}} + \frac {2 \, {\left (3 \, a^{4} - 2 \, a^{2} b^{2} - b^{4}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{4}} - \frac {2 \, {\left (3 \, a^{4} b \sin \left (d x + c\right ) - 2 \, a^{2} b^{3} \sin \left (d x + c\right ) - b^{5} \sin \left (d x + c\right ) + 2 \, a^{5} - 2 \, a b^{4}\right )}}{{\left (b \sin \left (d x + c\right ) + a\right )} a^{2} b^{4}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*(2*log(abs(sin(d*x + c)))/a^2 + (b^2*sin(d*x + c)^2 - 4*a*b*sin(d*x + c))/b^4 + 2*(3*a^4 - 2*a^2*b^2 - b^4
)*log(abs(b*sin(d*x + c) + a))/(a^2*b^4) - 2*(3*a^4*b*sin(d*x + c) - 2*a^2*b^3*sin(d*x + c) - b^5*sin(d*x + c)
 + 2*a^5 - 2*a*b^4)/((b*sin(d*x + c) + a)*a^2*b^4))/d

________________________________________________________________________________________

maple [A]  time = 0.76, size = 169, normalized size = 1.41 \[ \frac {\sin ^{2}\left (d x +c \right )}{2 b^{2} d}-\frac {2 a \sin \left (d x +c \right )}{b^{3} d}+\frac {a^{3}}{d \,b^{4} \left (a +b \sin \left (d x +c \right )\right )}-\frac {2 a}{d \,b^{2} \left (a +b \sin \left (d x +c \right )\right )}+\frac {1}{a d \left (a +b \sin \left (d x +c \right )\right )}+\frac {3 a^{2} \ln \left (a +b \sin \left (d x +c \right )\right )}{d \,b^{4}}-\frac {2 \ln \left (a +b \sin \left (d x +c \right )\right )}{d \,b^{2}}-\frac {\ln \left (a +b \sin \left (d x +c \right )\right )}{a^{2} d}+\frac {\ln \left (\sin \left (d x +c \right )\right )}{a^{2} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x)

[Out]

1/2*sin(d*x+c)^2/b^2/d-2*a*sin(d*x+c)/b^3/d+1/d*a^3/b^4/(a+b*sin(d*x+c))-2/d*a/b^2/(a+b*sin(d*x+c))+1/a/d/(a+b
*sin(d*x+c))+3/d*a^2/b^4*ln(a+b*sin(d*x+c))-2/d/b^2*ln(a+b*sin(d*x+c))-ln(a+b*sin(d*x+c))/a^2/d+ln(sin(d*x+c))
/a^2/d

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 118, normalized size = 0.98 \[ \frac {\frac {2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )}}{a b^{5} \sin \left (d x + c\right ) + a^{2} b^{4}} + \frac {2 \, \log \left (\sin \left (d x + c\right )\right )}{a^{2}} + \frac {b \sin \left (d x + c\right )^{2} - 4 \, a \sin \left (d x + c\right )}{b^{3}} + \frac {2 \, {\left (3 \, a^{4} - 2 \, a^{2} b^{2} - b^{4}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{2} b^{4}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)/(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

1/2*(2*(a^4 - 2*a^2*b^2 + b^4)/(a*b^5*sin(d*x + c) + a^2*b^4) + 2*log(sin(d*x + c))/a^2 + (b*sin(d*x + c)^2 -
4*a*sin(d*x + c))/b^3 + 2*(3*a^4 - 2*a^2*b^2 - b^4)*log(b*sin(d*x + c) + a)/(a^2*b^4))/d

________________________________________________________________________________________

mupad [B]  time = 12.08, size = 338, normalized size = 2.82 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}-\frac {\frac {6\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {6\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{b^2}+\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,a^4-3\,a^2\,b^2+b^4\right )}{a^2\,b^3}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (3\,a^4-2\,a^2\,b^2+b^4\right )}{a^2\,b^3}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (3\,a^4-2\,a^2\,b^2+b^4\right )}{a^2\,b^3}}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (3\,a^2-2\,b^2\right )}{b^4\,d}-\frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (-3\,a^4+2\,a^2\,b^2+b^4\right )}{a^2\,b^4\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^5/(sin(c + d*x)*(a + b*sin(c + d*x))^2),x)

[Out]

log(tan(c/2 + (d*x)/2))/(a^2*d) - ((6*a*tan(c/2 + (d*x)/2)^2)/b^2 + (6*a*tan(c/2 + (d*x)/2)^4)/b^2 + (4*tan(c/
2 + (d*x)/2)^3*(3*a^4 + b^4 - 3*a^2*b^2))/(a^2*b^3) + (2*tan(c/2 + (d*x)/2)^5*(3*a^4 + b^4 - 2*a^2*b^2))/(a^2*
b^3) + (2*tan(c/2 + (d*x)/2)*(3*a^4 + b^4 - 2*a^2*b^2))/(a^2*b^3))/(d*(a + 2*b*tan(c/2 + (d*x)/2) + 3*a*tan(c/
2 + (d*x)/2)^2 + 3*a*tan(c/2 + (d*x)/2)^4 + a*tan(c/2 + (d*x)/2)^6 + 4*b*tan(c/2 + (d*x)/2)^3 + 2*b*tan(c/2 +
(d*x)/2)^5)) - (log(tan(c/2 + (d*x)/2)^2 + 1)*(3*a^2 - 2*b^2))/(b^4*d) - (log(a + 2*b*tan(c/2 + (d*x)/2) + a*t
an(c/2 + (d*x)/2)^2)*(b^4 - 3*a^4 + 2*a^2*b^2))/(a^2*b^4*d)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)/(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________