Integrand size = 21, antiderivative size = 57 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=\frac {2 a^2 \text {arctanh}(\sin (c+d x))}{d}-\frac {2 a^2 \cot (c+d x)}{d}-\frac {2 a^2 \csc (c+d x)}{d}+\frac {a^2 \tan (c+d x)}{d} \] Output:
2*a^2*arctanh(sin(d*x+c))/d-2*a^2*cot(d*x+c)/d-2*a^2*csc(d*x+c)/d+a^2*tan( d*x+c)/d
Leaf count is larger than twice the leaf count of optimal. \(401\) vs. \(2(57)=114\).
Time = 6.53 (sec) , antiderivative size = 401, normalized size of antiderivative = 7.04 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=-\frac {\cos ^2(c+d x) \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right ) (a+a \sec (c+d x))^2}{2 d}+\frac {\cos ^2(c+d x) \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right ) (a+a \sec (c+d x))^2}{2 d}+\frac {\cos ^2(c+d x) \csc \left (\frac {c}{2}\right ) \csc \left (\frac {c}{2}+\frac {d x}{2}\right ) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right ) (a+a \sec (c+d x))^2 \sin \left (\frac {d x}{2}\right )}{2 d}+\frac {\cos ^2(c+d x) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right ) (a+a \sec (c+d x))^2 \sin \left (\frac {d x}{2}\right )}{4 d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}+\frac {\cos ^2(c+d x) \sec ^4\left (\frac {c}{2}+\frac {d x}{2}\right ) (a+a \sec (c+d x))^2 \sin \left (\frac {d x}{2}\right )}{4 d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )} \] Input:
Integrate[Csc[c + d*x]^2*(a + a*Sec[c + d*x])^2,x]
Output:
-1/2*(Cos[c + d*x]^2*Log[Cos[c/2 + (d*x)/2] - Sin[c/2 + (d*x)/2]]*Sec[c/2 + (d*x)/2]^4*(a + a*Sec[c + d*x])^2)/d + (Cos[c + d*x]^2*Log[Cos[c/2 + (d* x)/2] + Sin[c/2 + (d*x)/2]]*Sec[c/2 + (d*x)/2]^4*(a + a*Sec[c + d*x])^2)/( 2*d) + (Cos[c + d*x]^2*Csc[c/2]*Csc[c/2 + (d*x)/2]*Sec[c/2 + (d*x)/2]^4*(a + a*Sec[c + d*x])^2*Sin[(d*x)/2])/(2*d) + (Cos[c + d*x]^2*Sec[c/2 + (d*x) /2]^4*(a + a*Sec[c + d*x])^2*Sin[(d*x)/2])/(4*d*(Cos[c/2] - Sin[c/2])*(Cos [c/2 + (d*x)/2] - Sin[c/2 + (d*x)/2])) + (Cos[c + d*x]^2*Sec[c/2 + (d*x)/2 ]^4*(a + a*Sec[c + d*x])^2*Sin[(d*x)/2])/(4*d*(Cos[c/2] + Sin[c/2])*(Cos[c /2 + (d*x)/2] + Sin[c/2 + (d*x)/2]))
Time = 0.49 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4360, 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) (a \sec (c+d x)+a)^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a-a \csc \left (c+d x-\frac {\pi }{2}\right )\right )^2}{\cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 4360 |
\(\displaystyle \int \csc ^2(c+d x) \sec ^2(c+d x) (a (-\cos (c+d x))-a)^2dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \sin \left (c+d x-\frac {\pi }{2}\right )-a\right )^2}{\sin \left (c+d x-\frac {\pi }{2}\right )^2 \cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 3352 |
\(\displaystyle \int \left (a^2 \csc ^2(c+d x)+a^2 \csc ^2(c+d x) \sec ^2(c+d x)+2 a^2 \csc ^2(c+d x) \sec (c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {2 a^2 \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d}-\frac {2 a^2 \cot (c+d x)}{d}-\frac {2 a^2 \csc (c+d x)}{d}\) |
Input:
Int[Csc[c + d*x]^2*(a + a*Sec[c + d*x])^2,x]
Output:
(2*a^2*ArcTanh[Sin[c + d*x]])/d - (2*a^2*Cot[c + d*x])/d - (2*a^2*Csc[c + d*x])/d + (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]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
Time = 0.16 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.35
method | result | size |
derivativedivides | \(\frac {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 )+2 a^{2} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a^{2} \cot \left (d x +c \right )}{d}\) | \(77\) |
default | \(\frac {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 )+2 a^{2} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a^{2} \cot \left (d x +c \right )}{d}\) | \(77\) |
parallelrisch | \(-\frac {a^{2} \left (3 \cot \left (\frac {d x}{2}+\frac {c}{2}\right ) \cos \left (d x +c \right )-\cot \left (\frac {d x}{2}+\frac {c}{2}\right )+2 \cos \left (d x +c \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-2 \cos \left (d x +c \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )\right )}{d \cos \left (d x +c \right )}\) | \(86\) |
norman | \(\frac {\frac {2 a^{2}}{d}-\frac {4 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{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 )}-\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(97\) |
risch | \(-\frac {2 i a^{2} \left (2 \,{\mathrm e}^{2 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}+3\right )}{d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 a^{2} \ln \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 )}+i\right )}{d}\) | \(103\) |
Input:
int(csc(d*x+c)^2*(a+a*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(a^2*(1/sin(d*x+c)/cos(d*x+c)-2*cot(d*x+c))+2*a^2*(-1/sin(d*x+c)+ln(se c(d*x+c)+tan(d*x+c)))-a^2*cot(d*x+c))
Time = 0.09 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.77 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=\frac {a^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - a^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 3 \, a^{2} \cos \left (d x + c\right )^{2} - 2 \, a^{2} \cos \left (d x + c\right ) + a^{2}}{d \cos \left (d x + c\right ) \sin \left (d x + c\right )} \] Input:
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c))^2,x, algorithm="fricas")
Output:
(a^2*cos(d*x + c)*log(sin(d*x + c) + 1)*sin(d*x + c) - a^2*cos(d*x + c)*lo g(-sin(d*x + c) + 1)*sin(d*x + c) - 3*a^2*cos(d*x + c)^2 - 2*a^2*cos(d*x + c) + a^2)/(d*cos(d*x + c)*sin(d*x + c))
\[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=a^{2} \left (\int 2 \csc ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \csc ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \csc ^{2}{\left (c + d x \right )}\, dx\right ) \] Input:
integrate(csc(d*x+c)**2*(a+a*sec(d*x+c))**2,x)
Output:
a**2*(Integral(2*csc(c + d*x)**2*sec(c + d*x), x) + Integral(csc(c + d*x)* *2*sec(c + d*x)**2, x) + Integral(csc(c + d*x)**2, x))
Time = 0.03 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.30 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=-\frac {a^{2} {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \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 )} + \frac {a^{2}}{\tan \left (d x + c\right )}}{d} \] Input:
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c))^2,x, algorithm="maxima")
Output:
-(a^2*(2/sin(d*x + c) - log(sin(d*x + c) + 1) + log(sin(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 = 90, normalized size of antiderivative = 1.58 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=\frac {2 \, {\left (a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}\right )}}{d} \] Input:
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c))^2,x, algorithm="giac")
Output:
2*(a^2*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - a^2*log(abs(tan(1/2*d*x + 1/2* c) - 1)) - (2*a^2*tan(1/2*d*x + 1/2*c)^2 - a^2)/(tan(1/2*d*x + 1/2*c)^3 - tan(1/2*d*x + 1/2*c)))/d
Time = 10.41 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.23 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=\frac {4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-2\,a^2}{d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}+\frac {4\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \] Input:
int((a + a/cos(c + d*x))^2/sin(c + d*x)^2,x)
Output:
(4*a^2*tan(c/2 + (d*x)/2)^2 - 2*a^2)/(d*(tan(c/2 + (d*x)/2) - tan(c/2 + (d *x)/2)^3)) + (4*a^2*atanh(tan(c/2 + (d*x)/2)))/d
Time = 0.17 (sec) , antiderivative size = 143, normalized size of antiderivative = 2.51 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x))^2 \, dx=\frac {2 a^{2} \left (-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}-\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )} \] Input:
int(csc(d*x+c)^2*(a+a*sec(d*x+c))^2,x)
Output:
(2*a**2*( - log(tan((c + d*x)/2) - 1)*tan((c + d*x)/2)**3 + log(tan((c + d *x)/2) - 1)*tan((c + d*x)/2) + log(tan((c + d*x)/2) + 1)*tan((c + d*x)/2)* *3 - log(tan((c + d*x)/2) + 1)*tan((c + d*x)/2) - 2*tan((c + d*x)/2)**2 + 1))/(tan((c + d*x)/2)*d*(tan((c + d*x)/2)**2 - 1))