3.1219 \(\int \cos ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx\)

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

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

Rule 948

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] && IGtQ[p, 0] && (IGtQ[m, 0] || (EqQ[m, -2] && EqQ[p, 1] && EqQ[d, 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 \cos ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {b^3 (a+x)^2 \left (b^2-x^2\right )^2}{x^3} \, dx,x,b \sin (c+d x)\right )}{b^5 d}\\ &=\frac {\operatorname {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^2}{x^3} \, dx,x,b \sin (c+d x)\right )}{b^2 d}\\ &=\frac {\operatorname {Subst}\left (\int \left (-4 a b^2+\frac {a^2 b^4}{x^3}+\frac {2 a b^4}{x^2}+\frac {-2 a^2 b^2+b^4}{x}+\left (a^2-2 b^2\right ) x+2 a x^2+x^3\right ) \, dx,x,b \sin (c+d x)\right )}{b^2 d}\\ &=-\frac {2 a b \csc (c+d x)}{d}-\frac {a^2 \csc ^2(c+d x)}{2 d}-\frac {\left (2 a^2-b^2\right ) \log (\sin (c+d x))}{d}-\frac {4 a b \sin (c+d x)}{d}+\frac {\left (a^2-2 b^2\right ) \sin ^2(c+d x)}{2 d}+\frac {2 a b \sin ^3(c+d x)}{3 d}+\frac {b^2 \sin ^4(c+d x)}{4 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.30, size = 103, normalized size = 0.81 \[ \frac {6 \left (a^2-2 b^2\right ) \sin ^2(c+d x)+12 \left (b^2-2 a^2\right ) \log (\sin (c+d x))-6 a^2 \csc ^2(c+d x)+8 a b \sin ^3(c+d x)-48 a b \sin (c+d x)-24 a b \csc (c+d x)+3 b^2 \sin ^4(c+d x)}{12 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-24*a*b*Csc[c + d*x] - 6*a^2*Csc[c + d*x]^2 + 12*(-2*a^2 + b^2)*Log[Sin[c + d*x]] - 48*a*b*Sin[c + d*x] + 6*(
a^2 - 2*b^2)*Sin[c + d*x]^2 + 8*a*b*Sin[c + d*x]^3 + 3*b^2*Sin[c + d*x]^4)/(12*d)

________________________________________________________________________________________

fricas [A]  time = 1.35, size = 160, normalized size = 1.26 \[ \frac {24 \, b^{2} \cos \left (d x + c\right )^{6} - 24 \, {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 9 \, {\left (8 \, a^{2} - 9 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 24 \, a^{2} + 33 \, b^{2} - 96 \, {\left ({\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} + b^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) - 64 \, {\left (a b \cos \left (d x + c\right )^{4} + 4 \, a b \cos \left (d x + c\right )^{2} - 8 \, a b\right )} \sin \left (d x + c\right )}{96 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/96*(24*b^2*cos(d*x + c)^6 - 24*(2*a^2 - b^2)*cos(d*x + c)^4 + 9*(8*a^2 - 9*b^2)*cos(d*x + c)^2 + 24*a^2 + 33
*b^2 - 96*((2*a^2 - b^2)*cos(d*x + c)^2 - 2*a^2 + b^2)*log(1/2*sin(d*x + c)) - 64*(a*b*cos(d*x + c)^4 + 4*a*b*
cos(d*x + c)^2 - 8*a*b)*sin(d*x + c))/(d*cos(d*x + c)^2 - d)

________________________________________________________________________________________

giac [A]  time = 0.26, size = 140, normalized size = 1.10 \[ \frac {3 \, b^{2} \sin \left (d x + c\right )^{4} + 8 \, a b \sin \left (d x + c\right )^{3} + 6 \, a^{2} \sin \left (d x + c\right )^{2} - 12 \, b^{2} \sin \left (d x + c\right )^{2} - 48 \, a b \sin \left (d x + c\right ) - 12 \, {\left (2 \, a^{2} - b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) + \frac {6 \, {\left (6 \, a^{2} \sin \left (d x + c\right )^{2} - 3 \, b^{2} \sin \left (d x + c\right )^{2} - 4 \, a b \sin \left (d x + c\right ) - a^{2}\right )}}{\sin \left (d x + c\right )^{2}}}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/12*(3*b^2*sin(d*x + c)^4 + 8*a*b*sin(d*x + c)^3 + 6*a^2*sin(d*x + c)^2 - 12*b^2*sin(d*x + c)^2 - 48*a*b*sin(
d*x + c) - 12*(2*a^2 - b^2)*log(abs(sin(d*x + c))) + 6*(6*a^2*sin(d*x + c)^2 - 3*b^2*sin(d*x + c)^2 - 4*a*b*si
n(d*x + c) - a^2)/sin(d*x + c)^2)/d

________________________________________________________________________________________

maple [A]  time = 0.54, size = 197, normalized size = 1.55 \[ -\frac {a^{2} \left (\cos ^{6}\left (d x +c \right )\right )}{2 d \sin \left (d x +c \right )^{2}}-\frac {a^{2} \left (\cos ^{4}\left (d x +c \right )\right )}{2 d}-\frac {a^{2} \left (\cos ^{2}\left (d x +c \right )\right )}{d}-\frac {2 a^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {2 a b \left (\cos ^{6}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )}-\frac {16 a b \sin \left (d x +c \right )}{3 d}-\frac {2 a b \sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{d}-\frac {8 a b \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right )}{3 d}+\frac {b^{2} \left (\cos ^{4}\left (d x +c \right )\right )}{4 d}+\frac {b^{2} \left (\cos ^{2}\left (d x +c \right )\right )}{2 d}+\frac {b^{2} \ln \left (\sin \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 104, normalized size = 0.82 \[ \frac {3 \, b^{2} \sin \left (d x + c\right )^{4} + 8 \, a b \sin \left (d x + c\right )^{3} - 48 \, a b \sin \left (d x + c\right ) + 6 \, {\left (a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )^{2} - 12 \, {\left (2 \, a^{2} - b^{2}\right )} \log \left (\sin \left (d x + c\right )\right ) - \frac {6 \, {\left (4 \, a b \sin \left (d x + c\right ) + a^{2}\right )}}{\sin \left (d x + c\right )^{2}}}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 11.68, size = 331, normalized size = 2.61 \[ \frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (2\,a^2-b^2\right )}{d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (14\,a^2-16\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {15\,a^2}{2}-16\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (5\,a^2-16\,b^2\right )+\frac {a^2}{2}+48\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {296\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{3}+\frac {272\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{3}+36\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,a^2-b^2\right )}{d}-\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(log(tan(c/2 + (d*x)/2)^2 + 1)*(2*a^2 - b^2))/d - (a^2*tan(c/2 + (d*x)/2)^2)/(8*d) - (2*a^2*tan(c/2 + (d*x)/2)
^2 - tan(c/2 + (d*x)/2)^6*(14*a^2 - 16*b^2) - tan(c/2 + (d*x)/2)^8*((15*a^2)/2 - 16*b^2) - tan(c/2 + (d*x)/2)^
4*(5*a^2 - 16*b^2) + a^2/2 + 48*a*b*tan(c/2 + (d*x)/2)^3 + (296*a*b*tan(c/2 + (d*x)/2)^5)/3 + (272*a*b*tan(c/2
 + (d*x)/2)^7)/3 + 36*a*b*tan(c/2 + (d*x)/2)^9 + 4*a*b*tan(c/2 + (d*x)/2))/(d*(4*tan(c/2 + (d*x)/2)^2 + 16*tan
(c/2 + (d*x)/2)^4 + 24*tan(c/2 + (d*x)/2)^6 + 16*tan(c/2 + (d*x)/2)^8 + 4*tan(c/2 + (d*x)/2)^10)) - (log(tan(c
/2 + (d*x)/2))*(2*a^2 - b^2))/d - (a*b*tan(c/2 + (d*x)/2))/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)**3*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________