\(\int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx\) [1445]

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

Optimal result

Integrand size = 27, antiderivative size = 70 \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {3 a \text {arctanh}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x)}{d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d}+\frac {a \sec (c+d x)}{d}+\frac {b \tan (c+d x)}{d} \] Output:

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(172\) vs. \(2(70)=140\).

Time = 0.46 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.46 \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {2 b \cot (2 (c+d x))}{d}-\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {3 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {3 a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {a \sin \left (\frac {1}{2} (c+d x)\right )}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}-\frac {a \sin \left (\frac {1}{2} (c+d x)\right )}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.04, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.370, Rules used = {3042, 3317, 3042, 3100, 244, 2009, 3102, 252, 262, 219}

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 \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {a+b \sin (c+d x)}{\sin (c+d x)^3 \cos (c+d x)^2}dx\)

\(\Big \downarrow \) 3317

\(\displaystyle a \int \csc ^3(c+d x) \sec ^2(c+d x)dx+b \int \csc ^2(c+d x) \sec ^2(c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a \int \csc (c+d x)^3 \sec (c+d x)^2dx+b \int \csc (c+d x)^2 \sec (c+d x)^2dx\)

\(\Big \downarrow \) 3100

\(\displaystyle a \int \csc (c+d x)^3 \sec (c+d x)^2dx+\frac {b \int \cot ^2(c+d x) \left (\tan ^2(c+d x)+1\right )d\tan (c+d x)}{d}\)

\(\Big \downarrow \) 244

\(\displaystyle a \int \csc (c+d x)^3 \sec (c+d x)^2dx+\frac {b \int \left (\cot ^2(c+d x)+1\right )d\tan (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle a \int \csc (c+d x)^3 \sec (c+d x)^2dx+\frac {b (\tan (c+d x)-\cot (c+d x))}{d}\)

\(\Big \downarrow \) 3102

\(\displaystyle \frac {a \int \frac {\sec ^4(c+d x)}{\left (1-\sec ^2(c+d x)\right )^2}d\sec (c+d x)}{d}+\frac {b (\tan (c+d x)-\cot (c+d x))}{d}\)

\(\Big \downarrow \) 252

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

\(\Big \downarrow \) 262

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

\(\Big \downarrow \) 219

\(\displaystyle \frac {a \left (\frac {\sec ^3(c+d x)}{2 \left (1-\sec ^2(c+d x)\right )}-\frac {3}{2} (\text {arctanh}(\sec (c+d x))-\sec (c+d x))\right )}{d}+\frac {b (\tan (c+d x)-\cot (c+d x))}{d}\)

Input:

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

Output:

(a*((-3*(ArcTanh[Sec[c + d*x]] - Sec[c + d*x]))/2 + Sec[c + d*x]^3/(2*(1 - 
 Sec[c + d*x]^2))))/d + (b*(-Cot[c + d*x] + Tan[c + d*x]))/d
 

Defintions of rubi rules used

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 244
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand 
Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && IGtQ[p 
, 0]
 

rule 252
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x 
)^(m - 1)*((a + b*x^2)^(p + 1)/(2*b*(p + 1))), x] - Simp[c^2*((m - 1)/(2*b* 
(p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c 
}, x] && LtQ[p, -1] && GtQ[m, 1] &&  !ILtQ[(m + 2*p + 3)/2, 0] && IntBinomi 
alQ[a, b, c, 2, m, p, x]
 

rule 262
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) 
^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ 
(b*(m + 2*p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b 
, c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c 
, 2, m, p, x]
 

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 3100
Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] 
:> Simp[1/f   Subst[Int[(1 + x^2)^((m + n)/2 - 1)/x^m, x], x, Tan[e + f*x]] 
, x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n)/2]
 

rule 3102
Int[csc[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_), x_S 
ymbol] :> Simp[1/(f*a^n)   Subst[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/ 
2), x], x, a*Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1 
)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])
 

rule 3317
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a   Int[(g*Co 
s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[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]
 
Maple [A] (verified)

Time = 1.29 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.19

method result size
derivativedivides \(\frac {a \left (-\frac {1}{2 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )}+\frac {3}{2 \cos \left (d x +c \right )}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) \(83\)
default \(\frac {a \left (-\frac {1}{2 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )}+\frac {3}{2 \cos \left (d x +c \right )}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) \(83\)
parallelrisch \(\frac {\left (12 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -12 a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3} b +\cot \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a +4 \cot \left (\frac {d x}{2}+\frac {c}{2}\right ) b -24 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-18 a}{8 d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-8 d}\) \(119\)
risch \(-\frac {i \left (3 i a \,{\mathrm e}^{5 i \left (d x +c \right )}-2 i a \,{\mathrm e}^{3 i \left (d x +c \right )}+3 i a \,{\mathrm e}^{i \left (d x +c \right )}+4 b \,{\mathrm e}^{2 i \left (d x +c \right )}-4 b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}\) \(125\)
norman \(\frac {\frac {a}{8 d}-\frac {9 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{4 d}+\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{8 d}+\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d}-\frac {5 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{2 d}-\frac {5 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 d}+\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{2 d}-\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}+\frac {3 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) \(184\)

Input:

int(csc(d*x+c)^3*sec(d*x+c)^2*(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)
 

Output:

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

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.83 \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {6 \, a \cos \left (d x + c\right )^{2} - 3 \, {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 3 \, {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 4 \, {\left (2 \, b \cos \left (d x + c\right )^{2} - b\right )} \sin \left (d x + c\right ) - 4 \, a}{4 \, {\left (d \cos \left (d x + c\right )^{3} - d \cos \left (d x + c\right )\right )}} \] Input:

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

Output:

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

Sympy [F(-1)]

Timed out. \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=\text {Timed out} \] Input:

integrate(csc(d*x+c)**3*sec(d*x+c)**2*(a+b*sin(d*x+c)),x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.20 \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {a {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 2\right )}}{\cos \left (d x + c\right )^{3} - \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 )} - 4 \, b {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )}}{4 \, d} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.66 \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {16 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - \frac {18 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 4 \, 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 )^{2}}}{8 \, d} \] Input:

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

Output:

1/8*(a*tan(1/2*d*x + 1/2*c)^2 + 12*a*log(abs(tan(1/2*d*x + 1/2*c))) + 4*b* 
tan(1/2*d*x + 1/2*c) - 16*(b*tan(1/2*d*x + 1/2*c) + a)/(tan(1/2*d*x + 1/2* 
c)^2 - 1) - (18*a*tan(1/2*d*x + 1/2*c)^2 + 4*b*tan(1/2*d*x + 1/2*c) + a)/t 
an(1/2*d*x + 1/2*c)^2)/d
 

Mupad [B] (verification not implemented)

Time = 19.95 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.81 \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {-10\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {17\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2}+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a}{2}}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {3\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d} \] Input:

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

Output:

(b*tan(c/2 + (d*x)/2))/(2*d) - (a/2 + 2*b*tan(c/2 + (d*x)/2) - (17*a*tan(c 
/2 + (d*x)/2)^2)/2 - 10*b*tan(c/2 + (d*x)/2)^3)/(d*(4*tan(c/2 + (d*x)/2)^2 
 - 4*tan(c/2 + (d*x)/2)^4)) + (a*tan(c/2 + (d*x)/2)^2)/(8*d) + (3*a*log(ta 
n(c/2 + (d*x)/2)))/(2*d)
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.43 \[ \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {12 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2} a -9 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a +16 \sin \left (d x +c \right )^{3} b +12 \sin \left (d x +c \right )^{2} a -8 \sin \left (d x +c \right ) b -4 a}{8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} d} \] Input:

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

Output:

(12*cos(c + d*x)*log(tan((c + d*x)/2))*sin(c + d*x)**2*a - 9*cos(c + d*x)* 
sin(c + d*x)**2*a + 16*sin(c + d*x)**3*b + 12*sin(c + d*x)**2*a - 8*sin(c 
+ d*x)*b - 4*a)/(8*cos(c + d*x)*sin(c + d*x)**2*d)