Integrand size = 29, antiderivative size = 58 \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {2 a^2 \text {arctanh}(\cos (c+d x))}{d}-\frac {a^2 \cot (c+d x)}{d}+\frac {2 a^2 \sec (c+d x)}{d}+\frac {2 a^2 \tan (c+d x)}{d} \] Output:
-2*a^2*arctanh(cos(d*x+c))/d-a^2*cot(d*x+c)/d+2*a^2*sec(d*x+c)/d+2*a^2*tan (d*x+c)/d
Time = 0.87 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.66 \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^2 \left (-\cot \left (\frac {1}{2} (c+d x)\right )-4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+4 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {8 \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}+\tan \left (\frac {1}{2} (c+d x)\right )\right )}{2 d} \] Input:
Integrate[Csc[c + d*x]^2*Sec[c + d*x]^2*(a + a*Sin[c + d*x])^2,x]
Output:
(a^2*(-Cot[(c + d*x)/2] - 4*Log[Cos[(c + d*x)/2]] + 4*Log[Sin[(c + d*x)/2] ] + (8*Sin[(c + d*x)/2])/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2]) + Tan[(c + d*x)/2]))/(2*d)
Time = 0.42 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3042, 3352, 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 ^2(c+d x) (a \sin (c+d x)+a)^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a \sin (c+d x)+a)^2}{\sin (c+d x)^2 \cos (c+d x)^2}dx\) |
\(\Big \downarrow \) 3352 |
\(\displaystyle \int \left (a^2 \sec ^2(c+d x)+a^2 \csc ^2(c+d x) \sec ^2(c+d x)+2 a^2 \csc (c+d x) \sec ^2(c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2 a^2 \text {arctanh}(\cos (c+d x))}{d}+\frac {2 a^2 \tan (c+d x)}{d}-\frac {a^2 \cot (c+d x)}{d}+\frac {2 a^2 \sec (c+d x)}{d}\) |
Input:
Int[Csc[c + d*x]^2*Sec[c + d*x]^2*(a + a*Sin[c + d*x])^2,x]
Output:
(-2*a^2*ArcTanh[Cos[c + d*x]])/d - (a^2*Cot[c + d*x])/d + (2*a^2*Sec[c + d *x])/d + (2*a^2*Tan[c + d*x])/d
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n _)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig [(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x] /; F reeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]
Time = 0.88 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.17
method | result | size |
parallelrisch | \(\frac {\left (\left (4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-4\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\cot \left (\frac {d x}{2}+\frac {c}{2}\right )-10\right ) a^{2}}{2 d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) | \(68\) |
derivativedivides | \(\frac {a^{2} \tan \left (d x +c \right )+2 a^{2} \left (\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^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) | \(76\) |
default | \(\frac {a^{2} \tan \left (d x +c \right )+2 a^{2} \left (\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^{2} \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) | \(76\) |
risch | \(\frac {-6 a^{2}-2 i a^{2} {\mathrm e}^{i \left (d x +c \right )}+4 a^{2} {\mathrm e}^{2 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 ) d}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(109\) |
norman | \(\frac {\frac {a^{2}}{2 d}-\frac {4 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}-\frac {9 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}-\frac {4 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}+\frac {a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{2 d}-\frac {4 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {4 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {8 a^{2} \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 ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(202\) |
Input:
int(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/2*((4*tan(1/2*d*x+1/2*c)-4)*ln(tan(1/2*d*x+1/2*c))+tan(1/2*d*x+1/2*c)^2+ cot(1/2*d*x+1/2*c)-10)*a^2/d/(tan(1/2*d*x+1/2*c)-1)
Leaf count of result is larger than twice the leaf count of optimal. 192 vs. \(2 (58) = 116\).
Time = 0.08 (sec) , antiderivative size = 192, normalized size of antiderivative = 3.31 \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {3 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2} \cos \left (d x + c\right ) - 2 \, a^{2} + {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2} + {\left (a^{2} \cos \left (d x + c\right ) + a^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2} + {\left (a^{2} \cos \left (d x + c\right ) + a^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (3 \, a^{2} \cos \left (d x + c\right ) + 2 \, a^{2}\right )} \sin \left (d x + c\right )}{d \cos \left (d x + c\right )^{2} + {\left (d \cos \left (d x + c\right ) + d\right )} \sin \left (d x + c\right ) - d} \] Input:
integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x, algorithm="frica s")
Output:
-(3*a^2*cos(d*x + c)^2 + a^2*cos(d*x + c) - 2*a^2 + (a^2*cos(d*x + c)^2 - a^2 + (a^2*cos(d*x + c) + a^2)*sin(d*x + c))*log(1/2*cos(d*x + c) + 1/2) - (a^2*cos(d*x + c)^2 - a^2 + (a^2*cos(d*x + c) + a^2)*sin(d*x + c))*log(-1 /2*cos(d*x + c) + 1/2) - (3*a^2*cos(d*x + c) + 2*a^2)*sin(d*x + c))/(d*cos (d*x + c)^2 + (d*cos(d*x + c) + d)*sin(d*x + c) - d)
Timed out. \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\text {Timed out} \] Input:
integrate(csc(d*x+c)**2*sec(d*x+c)**2*(a+a*sin(d*x+c))**2,x)
Output:
Timed out
Time = 0.03 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.24 \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^{2} {\left (\frac {2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - a^{2} {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + a^{2} \tan \left (d x + c\right )}{d} \] Input:
integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x, algorithm="maxim a")
Output:
(a^2*(2/cos(d*x + c) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1)) - a^ 2*(1/tan(d*x + c) - tan(d*x + c)) + a^2*tan(d*x + c))/d
Time = 0.15 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.69 \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {4 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 7 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}}{\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 )}}{2 \, d} \] Input:
integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x, algorithm="giac" )
Output:
1/2*(4*a^2*log(abs(tan(1/2*d*x + 1/2*c))) + a^2*tan(1/2*d*x + 1/2*c) - (2* a^2*tan(1/2*d*x + 1/2*c)^2 + 7*a^2*tan(1/2*d*x + 1/2*c) - a^2)/(tan(1/2*d* x + 1/2*c)^2 - tan(1/2*d*x + 1/2*c)))/d
Time = 31.32 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.48 \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {2\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a^2-9\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}+\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \] Input:
int((a + a*sin(c + d*x))^2/(cos(c + d*x)^2*sin(c + d*x)^2),x)
Output:
(2*a^2*log(tan(c/2 + (d*x)/2)))/d - (a^2 - 9*a^2*tan(c/2 + (d*x)/2))/(d*(2 *tan(c/2 + (d*x)/2) - 2*tan(c/2 + (d*x)/2)^2)) + (a^2*tan(c/2 + (d*x)/2))/ (2*d)
Time = 0.17 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.76 \[ \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^{2} \left (4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-4 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}-10 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right )}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )} \] Input:
int(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c))^2,x)
Output:
(a**2*(4*log(tan((c + d*x)/2))*tan((c + d*x)/2)**2 - 4*log(tan((c + d*x)/2 ))*tan((c + d*x)/2) + tan((c + d*x)/2)**3 - 10*tan((c + d*x)/2)**2 + 1))/( 2*tan((c + d*x)/2)*d*(tan((c + d*x)/2) - 1))