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

Optimal. Leaf size=181 \[ \frac {a \left (a^2+28 b^2\right ) \cos (c+d x)}{6 b d}+\frac {\left (a^2+12 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{12 a b d}+\frac {\left (2 a^2+39 b^2\right ) \sin (c+d x) \cos (c+d x)}{24 d}-\frac {3}{8} x \left (4 a^2-b^2\right )-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {2 a b \tanh ^{-1}(\cos (c+d x))}{d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d} \]

[Out]

-3/8*(4*a^2-b^2)*x-2*a*b*arctanh(cos(d*x+c))/d+1/6*a*(a^2+28*b^2)*cos(d*x+c)/b/d+1/24*(2*a^2+39*b^2)*cos(d*x+c
)*sin(d*x+c)/d+1/12*(a^2+12*b^2)*cos(d*x+c)*(a+b*sin(d*x+c))^2/a/b/d-1/4*cos(d*x+c)*(a+b*sin(d*x+c))^3/b/d-cot
(d*x+c)*(a+b*sin(d*x+c))^3/a/d

________________________________________________________________________________________

Rubi [A]  time = 0.52, antiderivative size = 181, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2894, 3049, 3033, 3023, 2735, 3770} \[ \frac {a \left (a^2+28 b^2\right ) \cos (c+d x)}{6 b d}+\frac {\left (a^2+12 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{12 a b d}+\frac {\left (2 a^2+39 b^2\right ) \sin (c+d x) \cos (c+d x)}{24 d}-\frac {3}{8} x \left (4 a^2-b^2\right )-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {2 a b \tanh ^{-1}(\cos (c+d x))}{d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-3*(4*a^2 - b^2)*x)/8 - (2*a*b*ArcTanh[Cos[c + d*x]])/d + (a*(a^2 + 28*b^2)*Cos[c + d*x])/(6*b*d) + ((2*a^2 +
 39*b^2)*Cos[c + d*x]*Sin[c + d*x])/(24*d) + ((a^2 + 12*b^2)*Cos[c + d*x]*(a + b*Sin[c + d*x])^2)/(12*a*b*d) -
 (Cos[c + d*x]*(a + b*Sin[c + d*x])^3)/(4*b*d) - (Cot[c + d*x]*(a + b*Sin[c + d*x])^3)/(a*d)

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2894

Int[cos[(e_.) + (f_.)*(x_)]^4*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)
, x_Symbol] :> Simp[(Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1)*(d*Sin[e + f*x])^(n + 1))/(a*d*f*(n + 1)), x] +
 (Dist[1/(a*b*d*(n + 1)*(m + n + 4)), Int[(a + b*Sin[e + f*x])^m*(d*Sin[e + f*x])^(n + 1)*Simp[a^2*(n + 1)*(n
+ 2) - b^2*(m + n + 2)*(m + n + 4) + a*b*(m + 3)*Sin[e + f*x] - (a^2*(n + 1)*(n + 3) - b^2*(m + n + 3)*(m + n
+ 4))*Sin[e + f*x]^2, x], x], x] - Simp[(Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1)*(d*Sin[e + f*x])^(n + 2))/(
b*d^2*f*(m + n + 4)), x]) /; FreeQ[{a, b, d, e, f, m}, x] && NeQ[a^2 - b^2, 0] && (IGtQ[m, 0] || IntegersQ[2*m
, 2*n]) &&  !m < -1 && LtQ[n, -1] && NeQ[m + n + 4, 0]

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3033

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e
_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*d*Cos[e + f*x]*Sin[e + f*x]*(a + b
*Sin[e + f*x])^(m + 1))/(b*f*(m + 3)), x] + Dist[1/(b*(m + 3)), Int[(a + b*Sin[e + f*x])^m*Simp[a*C*d + A*b*c*
(m + 3) + b*(B*c*(m + 3) + d*(C*(m + 2) + A*(m + 3)))*Sin[e + f*x] - (2*a*C*d - b*(c*C + B*d)*(m + 3))*Sin[e +
 f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] &&
!LtQ[m, -1]

Rule 3049

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)
*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e +
 f*x])^m*(c + d*Sin[e + f*x])^(n + 1))/(d*f*(m + n + 2)), x] + Dist[1/(d*(m + n + 2)), Int[(a + b*Sin[e + f*x]
)^(m - 1)*(c + d*Sin[e + f*x])^n*Simp[a*A*d*(m + n + 2) + C*(b*c*m + a*d*(n + 1)) + (d*(A*b + a*B)*(m + n + 2)
 - C*(a*c - b*d*(m + n + 1)))*Sin[e + f*x] + (C*(a*d*m - b*c*(m + 1)) + b*B*d*(m + n + 2))*Sin[e + f*x]^2, x],
 x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2
, 0] && GtQ[m, 0] &&  !(IGtQ[n, 0] && ( !IntegerQ[m] || (EqQ[a, 0] && NeQ[c, 0])))

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \cos ^2(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^2 \, dx &=-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d}-\frac {\int \csc (c+d x) (a+b \sin (c+d x))^2 \left (-8 b^2+5 a b \sin (c+d x)+\left (a^2+12 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{4 a b}\\ &=\frac {\left (a^2+12 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{12 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d}-\frac {\int \csc (c+d x) (a+b \sin (c+d x)) \left (-24 a b^2+17 a^2 b \sin (c+d x)+a \left (2 a^2+39 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{12 a b}\\ &=\frac {\left (2 a^2+39 b^2\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac {\left (a^2+12 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{12 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d}-\frac {\int \csc (c+d x) \left (-48 a^2 b^2+9 a b \left (4 a^2-b^2\right ) \sin (c+d x)+4 a^2 \left (a^2+28 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{24 a b}\\ &=\frac {a \left (a^2+28 b^2\right ) \cos (c+d x)}{6 b d}+\frac {\left (2 a^2+39 b^2\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac {\left (a^2+12 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{12 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d}-\frac {\int \csc (c+d x) \left (-48 a^2 b^2+9 a b \left (4 a^2-b^2\right ) \sin (c+d x)\right ) \, dx}{24 a b}\\ &=-\frac {3}{8} \left (4 a^2-b^2\right ) x+\frac {a \left (a^2+28 b^2\right ) \cos (c+d x)}{6 b d}+\frac {\left (2 a^2+39 b^2\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac {\left (a^2+12 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{12 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d}+(2 a b) \int \csc (c+d x) \, dx\\ &=-\frac {3}{8} \left (4 a^2-b^2\right ) x-\frac {2 a b \tanh ^{-1}(\cos (c+d x))}{d}+\frac {a \left (a^2+28 b^2\right ) \cos (c+d x)}{6 b d}+\frac {\left (2 a^2+39 b^2\right ) \cos (c+d x) \sin (c+d x)}{24 d}+\frac {\left (a^2+12 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{12 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^3}{4 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^3}{a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.70, size = 167, normalized size = 0.92 \[ -\frac {3 a^2 (c+d x)}{2 d}-\frac {a^2 \sin (2 (c+d x))}{4 d}-\frac {a^2 \cot (c+d x)}{d}+\frac {5 a b \cos (c+d x)}{2 d}+\frac {a b \cos (3 (c+d x))}{6 d}+\frac {2 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}-\frac {2 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {3 b^2 (c+d x)}{8 d}+\frac {b^2 \sin (2 (c+d x))}{4 d}+\frac {b^2 \sin (4 (c+d x))}{32 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-3*a^2*(c + d*x))/(2*d) + (3*b^2*(c + d*x))/(8*d) + (5*a*b*Cos[c + d*x])/(2*d) + (a*b*Cos[3*(c + d*x)])/(6*d)
 - (a^2*Cot[c + d*x])/d - (2*a*b*Log[Cos[(c + d*x)/2]])/d + (2*a*b*Log[Sin[(c + d*x)/2]])/d - (a^2*Sin[2*(c +
d*x)])/(4*d) + (b^2*Sin[2*(c + d*x)])/(4*d) + (b^2*Sin[4*(c + d*x)])/(32*d)

________________________________________________________________________________________

fricas [A]  time = 0.80, size = 155, normalized size = 0.86 \[ -\frac {6 \, b^{2} \cos \left (d x + c\right )^{5} - 3 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{3} + 24 \, a b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 24 \, a b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 9 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right ) - {\left (16 \, a b \cos \left (d x + c\right )^{3} - 9 \, {\left (4 \, a^{2} - b^{2}\right )} d x + 48 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d \sin \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/24*(6*b^2*cos(d*x + c)^5 - 3*(4*a^2 - b^2)*cos(d*x + c)^3 + 24*a*b*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c)
 - 24*a*b*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 9*(4*a^2 - b^2)*cos(d*x + c) - (16*a*b*cos(d*x + c)^3 -
9*(4*a^2 - b^2)*d*x + 48*a*b*cos(d*x + c))*sin(d*x + c))/(d*sin(d*x + c))

________________________________________________________________________________________

giac [A]  time = 0.22, size = 274, normalized size = 1.51 \[ \frac {48 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, {\left (4 \, a^{2} - b^{2}\right )} {\left (d x + c\right )} - \frac {12 \, {\left (4 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} + \frac {2 \, {\left (12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 96 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 192 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 160 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 64 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/24*(48*a*b*log(abs(tan(1/2*d*x + 1/2*c))) + 12*a^2*tan(1/2*d*x + 1/2*c) - 9*(4*a^2 - b^2)*(d*x + c) - 12*(4*
a*b*tan(1/2*d*x + 1/2*c) + a^2)/tan(1/2*d*x + 1/2*c) + 2*(12*a^2*tan(1/2*d*x + 1/2*c)^7 - 15*b^2*tan(1/2*d*x +
 1/2*c)^7 + 96*a*b*tan(1/2*d*x + 1/2*c)^6 + 12*a^2*tan(1/2*d*x + 1/2*c)^5 + 9*b^2*tan(1/2*d*x + 1/2*c)^5 + 192
*a*b*tan(1/2*d*x + 1/2*c)^4 - 12*a^2*tan(1/2*d*x + 1/2*c)^3 - 9*b^2*tan(1/2*d*x + 1/2*c)^3 + 160*a*b*tan(1/2*d
*x + 1/2*c)^2 - 12*a^2*tan(1/2*d*x + 1/2*c) + 15*b^2*tan(1/2*d*x + 1/2*c) + 64*a*b)/(tan(1/2*d*x + 1/2*c)^2 +
1)^4)/d

________________________________________________________________________________________

maple [A]  time = 0.54, size = 191, normalized size = 1.06 \[ -\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )}-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{d}-\frac {3 a^{2} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}-\frac {3 a^{2} x}{2}-\frac {3 a^{2} c}{2 d}+\frac {2 a b \left (\cos ^{3}\left (d x +c \right )\right )}{3 d}+\frac {2 a b \cos \left (d x +c \right )}{d}+\frac {2 a b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {b^{2} \left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4 d}+\frac {3 b^{2} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{8 d}+\frac {3 b^{2} x}{8}+\frac {3 b^{2} c}{8 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.49, size = 127, normalized size = 0.70 \[ -\frac {48 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} + 2}{\tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a^{2} - 32 \, {\left (2 \, \cos \left (d x + c\right )^{3} + 6 \, \cos \left (d x + c\right ) - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a b - 3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{2}}{96 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 9.54, size = 578, normalized size = 3.19 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (a^2-\frac {5\,b^2}{2}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (6\,a^2-\frac {5\,b^2}{2}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (8\,a^2+\frac {3\,b^2}{2}\right )-a^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (2\,a^2-\frac {3\,b^2}{2}\right )+\frac {80\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+32\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+16\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\frac {32\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+12\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {\mathrm {atan}\left (\frac {\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )\,\left (\frac {3\,b^2}{4}-3\,a^2+6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,1{}\mathrm {i}-\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )\,\left (3\,a^2-\frac {3\,b^2}{4}+6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )-4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,1{}\mathrm {i}}{\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )\,\left (\frac {3\,b^2}{4}-3\,a^2+6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )+\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )\,\left (3\,a^2-\frac {3\,b^2}{4}+6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a^2\,3{}\mathrm {i}}{2}-\frac {b^2\,3{}\mathrm {i}}{8}\right )-4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )+3\,a\,b^3-12\,a^3\,b+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a^4-\frac {9\,a^2\,b^2}{2}+\frac {9\,b^4}{16}\right )}\right )\,\left (3\,a^2-\frac {3\,b^2}{4}\right )}{d}+\frac {2\,a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(tan(c/2 + (d*x)/2)^8*(a^2 - (5*b^2)/2) - tan(c/2 + (d*x)/2)^2*(6*a^2 - (5*b^2)/2) - tan(c/2 + (d*x)/2)^4*(8*a
^2 + (3*b^2)/2) - a^2 - tan(c/2 + (d*x)/2)^6*(2*a^2 - (3*b^2)/2) + (80*a*b*tan(c/2 + (d*x)/2)^3)/3 + 32*a*b*ta
n(c/2 + (d*x)/2)^5 + 16*a*b*tan(c/2 + (d*x)/2)^7 + (32*a*b*tan(c/2 + (d*x)/2))/3)/(d*(2*tan(c/2 + (d*x)/2) + 8
*tan(c/2 + (d*x)/2)^3 + 12*tan(c/2 + (d*x)/2)^5 + 8*tan(c/2 + (d*x)/2)^7 + 2*tan(c/2 + (d*x)/2)^9)) + (a^2*tan
(c/2 + (d*x)/2))/(2*d) - (atan((((a^2*3i)/2 - (b^2*3i)/8)*((3*b^2)/4 - 3*a^2 + 6*tan(c/2 + (d*x)/2)*((a^2*3i)/
2 - (b^2*3i)/8) + 4*a*b*tan(c/2 + (d*x)/2))*1i - ((a^2*3i)/2 - (b^2*3i)/8)*(3*a^2 - (3*b^2)/4 + 6*tan(c/2 + (d
*x)/2)*((a^2*3i)/2 - (b^2*3i)/8) - 4*a*b*tan(c/2 + (d*x)/2))*1i)/(((a^2*3i)/2 - (b^2*3i)/8)*((3*b^2)/4 - 3*a^2
 + 6*tan(c/2 + (d*x)/2)*((a^2*3i)/2 - (b^2*3i)/8) + 4*a*b*tan(c/2 + (d*x)/2)) + ((a^2*3i)/2 - (b^2*3i)/8)*(3*a
^2 - (3*b^2)/4 + 6*tan(c/2 + (d*x)/2)*((a^2*3i)/2 - (b^2*3i)/8) - 4*a*b*tan(c/2 + (d*x)/2)) + 3*a*b^3 - 12*a^3
*b + 2*tan(c/2 + (d*x)/2)*(9*a^4 + (9*b^4)/16 - (9*a^2*b^2)/2)))*(3*a^2 - (3*b^2)/4))/d + (2*a*b*log(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)**4*csc(d*x+c)**2*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________