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

Optimal result
Mathematica [A] (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 = 81 \[ \int \csc ^2(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {a \text {arctanh}(\cos (c+d x))}{d}-\frac {a \cot (c+d x)}{d}+\frac {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:

-a*arctanh(cos(d*x+c))/d-a*cot(d*x+c)/d+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 [A] (verified)

Time = 0.28 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.35 \[ \int \csc ^2(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {a \cot (c+d x)}{d}-\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {a \sec (c+d x)}{d}+\frac {a \sec ^3(c+d x)}{3 d}+\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]^2*Sec[c + d*x]^4*(a + a*Sin[c + d*x]),x]
 

Output:

-((a*Cot[c + d*x])/d) - (a*Log[Cos[(c + d*x)/2]])/d + (a*Log[Sin[(c + d*x) 
/2]])/d + (a*Sec[c + d*x])/d + (a*Sec[c + d*x]^3)/(3*d) + (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.43 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.84, 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, 25, 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 ^2(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)^2 \cos (c+d x)^4}dx\)

\(\Big \downarrow \) 3317

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

\(\Big \downarrow \) 3042

\(\displaystyle a \int \csc (c+d x) \sec (c+d x)^4dx+a \int \csc (c+d x)^2 \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) \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) \sec (c+d x)^4dx\)

\(\Big \downarrow \) 2009

\(\displaystyle a \int \csc (c+d x) \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 ^4(c+d x)}{1-\sec ^2(c+d x)}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 \) 25

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

\(\Big \downarrow \) 254

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {a \left (-\text {arctanh}(\sec (c+d x))+\frac {1}{3} \sec ^3(c+d x)+\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}\)

Input:

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

Output:

(a*(-ArcTanh[Sec[c + d*x]] + Sec[c + d*x] + Sec[c + d*x]^3/3))/d + (a*(-Co 
t[c + d*x] + 2*Tan[c + d*x] + Tan[c + d*x]^3/3))/d
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 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.78 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.11

method result size
derivativedivides \(\frac {a \left (\frac {1}{3 \cos \left (d x +c \right )^{3}}+\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+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 )}{d}\) \(90\)
default \(\frac {a \left (\frac {1}{3 \cos \left (d x +c \right )^{3}}+\frac {1}{\cos \left (d x +c \right )}+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+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 )}{d}\) \(90\)
parallelrisch \(\frac {\left (2 \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 )^{5}-\frac {13 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2}+12 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\cot \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {22 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3}-\frac {17}{6}\right ) a}{2 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}}\) \(128\)
risch \(\frac {-\frac {4 a \,{\mathrm e}^{3 i \left (d x +c \right )}}{3}-4 i a \,{\mathrm e}^{4 i \left (d x +c \right )}-\frac {26 a \,{\mathrm e}^{i \left (d x +c \right )}}{3}+\frac {16 i a}{3}-\frac {4 i a \,{\mathrm e}^{2 i \left (d x +c \right )}}{3}+2 a \,{\mathrm e}^{5 i \left (d x +c \right )}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{3} d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) \(150\)
norman \(\frac {\frac {a}{2 d}-\frac {11 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{2 d}+\frac {7 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{3 d}+\frac {7 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{3 d}-\frac {11 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{2 d}+\frac {a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{2 d}-\frac {4 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {4 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {8 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \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 {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(200\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 170 vs. \(2 (77) = 154\).

Time = 0.08 (sec) , antiderivative size = 170, normalized size of antiderivative = 2.10 \[ \int \csc ^2(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {10 \, 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 ) \sin \left (d x + c\right ) - 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 ) \sin \left (d x + c\right ) - a \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 2 \, {\left (8 \, a \cos \left (d x + c\right )^{2} - a\right )} \sin \left (d x + c\right ) - 4 \, a}{6 \, {\left (d \cos \left (d x + c\right )^{3} + d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - d \cos \left (d x + c\right )\right )}} \] Input:

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

Output:

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

Sympy [F(-1)]

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

integrate(csc(d*x+c)**2*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 = 83, normalized size of antiderivative = 1.02 \[ \int \csc ^2(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {2 \, {\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 (3 \, \cos \left (d x + c\right )^{2} + 1\right )}}{\cos \left (d x + c\right )^{3}} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{6 \, d} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.59 \[ \int \csc ^2(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {6 \, a \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 {3 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, 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} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {21 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 36 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 19 \, a}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}^{3}}}{6 \, d} \] Input:

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

Output:

1/6*(6*a*log(abs(tan(1/2*d*x + 1/2*c))) + 3*a*tan(1/2*d*x + 1/2*c) - 3*(a* 
tan(1/2*d*x + 1/2*c)^2 + 3*a*tan(1/2*d*x + 1/2*c) + a)/(tan(1/2*d*x + 1/2* 
c)^2 + tan(1/2*d*x + 1/2*c)) - (21*a*tan(1/2*d*x + 1/2*c)^2 - 36*a*tan(1/2 
*d*x + 1/2*c) + 19*a)/(tan(1/2*d*x + 1/2*c) - 1)^3)/d
 

Mupad [B] (verification not implemented)

Time = 31.73 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.79 \[ \int \csc ^2(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 {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {-9\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+10\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {8\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}-\frac {22\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+a}{d\,\left (-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,{\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+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )} \] Input:

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

Output:

(a*tan(c/2 + (d*x)/2))/(2*d) + (a*log(tan(c/2 + (d*x)/2)))/d - (a - (22*a* 
tan(c/2 + (d*x)/2))/3 + (8*a*tan(c/2 + (d*x)/2)^2)/3 + 10*a*tan(c/2 + (d*x 
)/2)^3 - 9*a*tan(c/2 + (d*x)/2)^4)/(d*(2*tan(c/2 + (d*x)/2) - 4*tan(c/2 + 
(d*x)/2)^2 + 4*tan(c/2 + (d*x)/2)^4 - 2*tan(c/2 + (d*x)/2)^5))
 

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.75 \[ \int \csc ^2(c+d x) \sec ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \left (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}-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 )-11 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}+11 \cos \left (d x +c \right ) \sin \left (d x +c \right )+32 \sin \left (d x +c \right )^{3}-20 \sin \left (d x +c \right )^{2}-28 \sin \left (d x +c \right )+12\right )}{12 \cos \left (d x +c \right ) \sin \left (d x +c \right ) d \left (\sin \left (d x +c \right )-1\right )} \] Input:

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

Output:

(a*(12*cos(c + d*x)*log(tan((c + d*x)/2))*sin(c + d*x)**2 - 12*cos(c + d*x 
)*log(tan((c + d*x)/2))*sin(c + d*x) - 11*cos(c + d*x)*sin(c + d*x)**2 + 1 
1*cos(c + d*x)*sin(c + d*x) + 32*sin(c + d*x)**3 - 20*sin(c + d*x)**2 - 28 
*sin(c + d*x) + 12))/(12*cos(c + d*x)*sin(c + d*x)*d*(sin(c + d*x) - 1))