\(\int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx\) [803]

Optimal result
Mathematica [B] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (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 = 104 \[ \int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {5 a \text {arctanh}(\cos (c+d x))}{2 d}-\frac {a \cot (c+d x)}{d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d}+\frac {2 a \sec (c+d x)}{d}+\frac {a \sec ^3(c+d x)}{3 d}+\frac {2 a \tan (c+d x)}{d}+\frac {a \tan ^3(c+d x)}{3 d} \] Output:

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(359\) vs. \(2(104)=208\).

Time = 6.33 (sec) , antiderivative size = 359, normalized size of antiderivative = 3.45 \[ \int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {a \cot (c+d x)}{d}-\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {5 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {5 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}{12 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {a \sin \left (\frac {1}{2} (c+d x)\right )}{6 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {13 a \sin \left (\frac {1}{2} (c+d x)\right )}{6 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 )}{6 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {a}{12 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {13 a \sin \left (\frac {1}{2} (c+d x)\right )}{6 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {5 a \tan (c+d x)}{3 d}+\frac {a \sec ^2(c+d x) \tan (c+d x)}{3 d} \] Input:

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

Output:

-((a*Cot[c + d*x])/d) - (a*Csc[(c + d*x)/2]^2)/(8*d) - (5*a*Log[Cos[(c + d 
*x)/2]])/(2*d) + (5*a*Log[Sin[(c + d*x)/2]])/(2*d) + (a*Sec[(c + d*x)/2]^2 
)/(8*d) + a/(12*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2) + (a*Sin[(c + d 
*x)/2])/(6*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^3) + (13*a*Sin[(c + d*x 
)/2])/(6*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])) - (a*Sin[(c + d*x)/2])/( 
6*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^3) + a/(12*d*(Cos[(c + d*x)/2] + 
 Sin[(c + d*x)/2])^2) - (13*a*Sin[(c + d*x)/2])/(6*d*(Cos[(c + d*x)/2] + S 
in[(c + d*x)/2])) + (5*a*Tan[c + d*x])/(3*d) + (a*Sec[c + d*x]^2*Tan[c + d 
*x])/(3*d)
 

Rubi [A] (verified)

Time = 0.46 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.95, 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, 254, 2009}

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 ^4(c+d x) (a \sin (c+d x)+a) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3317

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3100

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

\(\Big \downarrow \) 244

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

\(\Big \downarrow \) 2009

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

\(\Big \downarrow \) 3102

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

\(\Big \downarrow \) 252

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

\(\Big \downarrow \) 254

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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 254
Int[(x_)^(m_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[x^m, 
 a + b*x^2, x], x] /; FreeQ[{a, b}, x] && IGtQ[m, 3]
 

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 = 0.91 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.15

method result size
derivativedivides \(\frac {a \left (\frac {1}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}+\frac {4}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {8 \cot \left (d x +c \right )}{3}\right )+a \left (\frac {1}{3 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )^{3}}-\frac {5}{6 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )}+\frac {5}{2 \cos \left (d x +c \right )}+\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) \(120\)
default \(\frac {a \left (\frac {1}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}+\frac {4}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {8 \cot \left (d x +c \right )}{3}\right )+a \left (\frac {1}{3 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )^{3}}-\frac {5}{6 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )}+\frac {5}{2 \cos \left (d x +c \right )}+\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) \(120\)
parallelrisch \(\frac {\left (20 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}-50 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\cot \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+30 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+2 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {170 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3}-\frac {160}{3}\right ) a}{8 d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}\) \(154\)
risch \(\frac {a \left (-30 i {\mathrm e}^{6 i \left (d x +c \right )}+15 \,{\mathrm e}^{7 i \left (d x +c \right )}+20 i {\mathrm e}^{4 i \left (d x +c \right )}-25 \,{\mathrm e}^{5 i \left (d x +c \right )}+2 i {\mathrm e}^{2 i \left (d x +c \right )}-7 \,{\mathrm e}^{3 i \left (d x +c \right )}-16 i+17 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) d}+\frac {5 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}-\frac {5 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}\) \(168\)
norman \(\frac {\frac {a}{8 d}+\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d}-\frac {11 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{2 d}+\frac {7 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 d}+\frac {5 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{2 d}+\frac {7 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{3 d}-\frac {11 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{2 d}+\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{2 d}+\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}}{8 d}-\frac {31 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{6 d}-\frac {53 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{8 d}+\frac {89 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{24 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 )^{3} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}+\frac {5 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) \(252\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 222 vs. \(2 (96) = 192\).

Time = 0.08 (sec) , antiderivative size = 222, normalized size of antiderivative = 2.13 \[ \int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {32 \, a \cos \left (d x + c\right )^{4} - 18 \, a \cos \left (d x + c\right )^{2} - 15 \, {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right ) - {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 15 \, {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right ) - {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, {\left (a \cos \left (d x + c\right )^{2} + 2 \, a\right )} \sin \left (d x + c\right ) - 8 \, a}{12 \, {\left (d \cos \left (d x + c\right )^{3} - d \cos \left (d x + c\right ) - {\left (d \cos \left (d x + c\right )^{3} - d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )\right )}} \] Input:

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

Output:

1/12*(32*a*cos(d*x + c)^4 - 18*a*cos(d*x + c)^2 - 15*(a*cos(d*x + c)^3 - a 
*cos(d*x + c) - (a*cos(d*x + c)^3 - a*cos(d*x + c))*sin(d*x + c))*log(1/2* 
cos(d*x + c) + 1/2) + 15*(a*cos(d*x + c)^3 - a*cos(d*x + c) - (a*cos(d*x + 
 c)^3 - a*cos(d*x + c))*sin(d*x + c))*log(-1/2*cos(d*x + c) + 1/2) + 2*(a* 
cos(d*x + c)^2 + 2*a)*sin(d*x + c) - 8*a)/(d*cos(d*x + c)^3 - d*cos(d*x + 
c) - (d*cos(d*x + c)^3 - d*cos(d*x + c))*sin(d*x + c))
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.02 \[ \int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {4 \, {\left (\tan \left (d x + c\right )^{3} - \frac {3}{\tan \left (d x + c\right )} + 6 \, \tan \left (d x + c\right )\right )} a + a {\left (\frac {2 \, {\left (15 \, \cos \left (d x + c\right )^{4} - 10 \, \cos \left (d x + c\right )^{2} - 2\right )}}{\cos \left (d x + c\right )^{5} - \cos \left (d x + c\right )^{3}} - 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{12 \, d} \] Input:

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

Output:

1/12*(4*(tan(d*x + c)^3 - 3/tan(d*x + c) + 6*tan(d*x + c))*a + a*(2*(15*co 
s(d*x + c)^4 - 10*cos(d*x + c)^2 - 2)/(cos(d*x + c)^5 - cos(d*x + c)^3) - 
15*log(cos(d*x + c) + 1) + 15*log(cos(d*x + c) - 1)))/d
 

Giac [A] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.42 \[ \int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 60 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 12 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {12 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1} - \frac {3 \, {\left (30 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 4 \, a \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}} - \frac {4 \, {\left (27 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 48 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 25 \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}}}{24 \, d} \] Input:

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

Output:

1/24*(3*a*tan(1/2*d*x + 1/2*c)^2 + 60*a*log(abs(tan(1/2*d*x + 1/2*c))) + 1 
2*a*tan(1/2*d*x + 1/2*c) + 12*a/(tan(1/2*d*x + 1/2*c) + 1) - 3*(30*a*tan(1 
/2*d*x + 1/2*c)^2 + 4*a*tan(1/2*d*x + 1/2*c) + a)/tan(1/2*d*x + 1/2*c)^2 - 
 4*(27*a*tan(1/2*d*x + 1/2*c)^2 - 48*a*tan(1/2*d*x + 1/2*c) + 25*a)/(tan(1 
/2*d*x + 1/2*c) - 1)^3)/d
 

Mupad [B] (verification not implemented)

Time = 32.91 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.73 \[ \int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {-18\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {23\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}+\frac {67\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}-\frac {68\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+a\,\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 )}^6+8\,{\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+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {5\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d} \] Input:

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

Output:

(a*tan(c/2 + (d*x)/2))/(2*d) - (a/2 + a*tan(c/2 + (d*x)/2) - (68*a*tan(c/2 
 + (d*x)/2)^2)/3 + (67*a*tan(c/2 + (d*x)/2)^3)/3 + (23*a*tan(c/2 + (d*x)/2 
)^4)/2 - 18*a*tan(c/2 + (d*x)/2)^5)/(d*(4*tan(c/2 + (d*x)/2)^2 - 8*tan(c/2 
 + (d*x)/2)^3 + 8*tan(c/2 + (d*x)/2)^5 - 4*tan(c/2 + (d*x)/2)^6)) + (a*tan 
(c/2 + (d*x)/2)^2)/(8*d) + (5*a*log(tan(c/2 + (d*x)/2)))/(2*d)
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.50 \[ \int \csc ^3(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \left (60 \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 )^{3}-60 \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}+5 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}-5 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}+64 \sin \left (d x +c \right )^{4}-4 \sin \left (d x +c \right )^{3}-92 \sin \left (d x +c \right )^{2}+12 \sin \left (d x +c \right )+12\right )}{24 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} d \left (\sin \left (d x +c \right )-1\right )} \] Input:

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

Output:

(a*(60*cos(c + d*x)*log(tan((c + d*x)/2))*sin(c + d*x)**3 - 60*cos(c + d*x 
)*log(tan((c + d*x)/2))*sin(c + d*x)**2 + 5*cos(c + d*x)*sin(c + d*x)**3 - 
 5*cos(c + d*x)*sin(c + d*x)**2 + 64*sin(c + d*x)**4 - 4*sin(c + d*x)**3 - 
 92*sin(c + d*x)**2 + 12*sin(c + d*x) + 12))/(24*cos(c + d*x)*sin(c + d*x) 
**2*d*(sin(c + d*x) - 1))