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

Optimal. Leaf size=52 \[ -\frac {a \cot ^3(c+d x)}{3 d}+\frac {b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x) \csc (c+d x)}{2 d} \]

[Out]

1/2*b*arctanh(cos(d*x+c))/d-1/3*a*cot(d*x+c)^3/d-1/2*b*cot(d*x+c)*csc(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2838, 2607, 30, 2611, 3770} \[ -\frac {a \cot ^3(c+d x)}{3 d}+\frac {b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x) \csc (c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(b*ArcTanh[Cos[c + d*x]])/(2*d) - (a*Cot[c + d*x]^3)/(3*d) - (b*Cot[c + d*x]*Csc[c + d*x])/(2*d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2611

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(a*Sec[e
+ f*x])^m*(b*Tan[e + f*x])^(n - 1))/(f*(m + n - 1)), x] - Dist[(b^2*(n - 1))/(m + n - 1), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2838

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

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 \cot ^2(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x)) \, dx &=a \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx+b \int \cot ^2(c+d x) \csc (c+d x) \, dx\\ &=-\frac {b \cot (c+d x) \csc (c+d x)}{2 d}-\frac {1}{2} b \int \csc (c+d x) \, dx+\frac {a \operatorname {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=\frac {b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {a \cot ^3(c+d x)}{3 d}-\frac {b \cot (c+d x) \csc (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 95, normalized size = 1.83 \[ -\frac {a \cot ^3(c+d x)}{3 d}-\frac {b \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {b \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-1/3*(a*Cot[c + d*x]^3)/d - (b*Csc[(c + d*x)/2]^2)/(8*d) + (b*Log[Cos[(c + d*x)/2]])/(2*d) - (b*Log[Sin[(c + d
*x)/2]])/(2*d) + (b*Sec[(c + d*x)/2]^2)/(8*d)

________________________________________________________________________________________

fricas [B]  time = 0.67, size = 119, normalized size = 2.29 \[ \frac {4 \, a \cos \left (d x + c\right )^{3} + 6 \, b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 3 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right )}{12 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.19, size = 115, normalized size = 2.21 \[ \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {22 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/24*(a*tan(1/2*d*x + 1/2*c)^3 + 3*b*tan(1/2*d*x + 1/2*c)^2 - 12*b*log(abs(tan(1/2*d*x + 1/2*c))) - 3*a*tan(1/
2*d*x + 1/2*c) + (22*b*tan(1/2*d*x + 1/2*c)^3 + 3*a*tan(1/2*d*x + 1/2*c)^2 - 3*b*tan(1/2*d*x + 1/2*c) - a)/tan
(1/2*d*x + 1/2*c)^3)/d

________________________________________________________________________________________

maple [A]  time = 0.40, size = 80, normalized size = 1.54 \[ -\frac {a \left (\cos ^{3}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )^{3}}-\frac {b \left (\cos ^{3}\left (d x +c \right )\right )}{2 d \sin \left (d x +c \right )^{2}}-\frac {b \cos \left (d x +c \right )}{2 d}-\frac {b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.38, size = 61, normalized size = 1.17 \[ \frac {3 \, b {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - \frac {4 \, a}{\tan \left (d x + c\right )^{3}}}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/12*(3*b*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) + log(cos(d*x + c) + 1) - log(cos(d*x + c) - 1)) - 4*a/tan(d*x
+ c)^3)/d

________________________________________________________________________________________

mupad [B]  time = 9.31, size = 111, normalized size = 2.13 \[ \frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a}{3}\right )}{8\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(a*tan(c/2 + (d*x)/2)^3)/(24*d) - (a*tan(c/2 + (d*x)/2))/(8*d) + (b*tan(c/2 + (d*x)/2)^2)/(8*d) - (b*log(tan(c
/2 + (d*x)/2)))/(2*d) - (cot(c/2 + (d*x)/2)^3*(a/3 + b*tan(c/2 + (d*x)/2) - a*tan(c/2 + (d*x)/2)^2))/(8*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \csc ^{4}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________