Integrand size = 21, antiderivative size = 114 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {\left (2 a b+\left (a^2+b^2\right ) \cos (c+d x)\right ) \csc ^2(c+d x)}{2 d}+\frac {(a+b) (a+3 b) \log (1-\cos (c+d x))}{4 d}-\frac {2 a b \log (\cos (c+d x))}{d}-\frac {(a-3 b) (a-b) \log (1+\cos (c+d x))}{4 d}+\frac {b^2 \sec (c+d x)}{d} \] Output:
-1/2*(2*a*b+(a^2+b^2)*cos(d*x+c))*csc(d*x+c)^2/d+1/4*(a+b)*(a+3*b)*ln(1-co s(d*x+c))/d-2*a*b*ln(cos(d*x+c))/d-1/4*(a-3*b)*(a-b)*ln(1+cos(d*x+c))/d+b^ 2*sec(d*x+c)/d
Leaf count is larger than twice the leaf count of optimal. \(329\) vs. \(2(114)=228\).
Time = 0.87 (sec) , antiderivative size = 329, normalized size of antiderivative = 2.89 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {\csc ^4(c+d x) \left (2 a^2-2 b^2+2 \left (a^2+3 b^2\right ) \cos (2 (c+d x))-a^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+4 a b \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-3 b^2 \cos (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-4 a b \cos (3 (c+d x)) \log (\cos (c+d x))+a^2 \cos (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 a b \cos (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+3 b^2 \cos (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+\cos (c+d x) \left (8 a b+\left (a^2-4 a b+3 b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+4 a b \log (\cos (c+d x))-a^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-3 b^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )\right )}{2 d \left (\csc ^2\left (\frac {1}{2} (c+d x)\right )-\sec ^2\left (\frac {1}{2} (c+d x)\right )\right )} \] Input:
Integrate[Csc[c + d*x]^3*(a + b*Sec[c + d*x])^2,x]
Output:
-1/2*(Csc[c + d*x]^4*(2*a^2 - 2*b^2 + 2*(a^2 + 3*b^2)*Cos[2*(c + d*x)] - a ^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2]] + 4*a*b*Cos[3*(c + d*x)]*Log[Cos [(c + d*x)/2]] - 3*b^2*Cos[3*(c + d*x)]*Log[Cos[(c + d*x)/2]] - 4*a*b*Cos[ 3*(c + d*x)]*Log[Cos[c + d*x]] + a^2*Cos[3*(c + d*x)]*Log[Sin[(c + d*x)/2] ] + 4*a*b*Cos[3*(c + d*x)]*Log[Sin[(c + d*x)/2]] + 3*b^2*Cos[3*(c + d*x)]* Log[Sin[(c + d*x)/2]] + Cos[c + d*x]*(8*a*b + (a^2 - 4*a*b + 3*b^2)*Log[Co s[(c + d*x)/2]] + 4*a*b*Log[Cos[c + d*x]] - a^2*Log[Sin[(c + d*x)/2]] - 4* a*b*Log[Sin[(c + d*x)/2]] - 3*b^2*Log[Sin[(c + d*x)/2]])))/(d*(Csc[(c + d* x)/2]^2 - Sec[(c + d*x)/2]^2))
Time = 0.58 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.30, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 4360, 3042, 3316, 27, 532, 25, 2333, 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) (a+b \sec (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a-b \csc \left (c+d x-\frac {\pi }{2}\right )\right )^2}{\cos \left (c+d x-\frac {\pi }{2}\right )^3}dx\) |
\(\Big \downarrow \) 4360 |
\(\displaystyle \int \csc ^3(c+d x) \sec ^2(c+d x) (-a \cos (c+d x)-b)^2dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \sin \left (c+d x-\frac {\pi }{2}\right )-b\right )^2}{\sin \left (c+d x-\frac {\pi }{2}\right )^2 \cos \left (c+d x-\frac {\pi }{2}\right )^3}dx\) |
\(\Big \downarrow \) 3316 |
\(\displaystyle \frac {a^3 \int \frac {(b+a \cos (c+d x))^2 \sec ^2(c+d x)}{\left (a^2-a^2 \cos ^2(c+d x)\right )^2}d(-a \cos (c+d x))}{d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {a^5 \int \frac {(b+a \cos (c+d x))^2 \sec ^2(c+d x)}{a^2 \left (a^2-a^2 \cos ^2(c+d x)\right )^2}d(-a \cos (c+d x))}{d}\) |
\(\Big \downarrow \) 532 |
\(\displaystyle \frac {a^5 \left (-\frac {\int -\frac {\left (2 b^2+4 a \cos (c+d x) b+\left (a^2+b^2\right ) \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a^2 \left (a^2-a^2 \cos ^2(c+d x)\right )}d(-a \cos (c+d x))}{2 a^2}-\frac {a \left (\frac {b^2}{a^2}+1\right ) \cos (c+d x)+2 b}{2 a^2 \left (a^2-a^2 \cos ^2(c+d x)\right )}\right )}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {a^5 \left (\frac {\int \frac {\left (2 b^2+4 a \cos (c+d x) b+\left (a^2+b^2\right ) \cos ^2(c+d x)\right ) \sec ^2(c+d x)}{a^2 \left (a^2-a^2 \cos ^2(c+d x)\right )}d(-a \cos (c+d x))}{2 a^2}-\frac {a \left (\frac {b^2}{a^2}+1\right ) \cos (c+d x)+2 b}{2 a^2 \left (a^2-a^2 \cos ^2(c+d x)\right )}\right )}{d}\) |
\(\Big \downarrow \) 2333 |
\(\displaystyle \frac {a^5 \left (\frac {\int \left (\frac {2 b^2 \sec ^2(c+d x)}{a^4}+\frac {4 b \sec (c+d x)}{a^3}+\frac {(a+b) (a+3 b)}{2 a^3 (a-a \cos (c+d x))}+\frac {(a-3 b) (a-b)}{2 a^3 (\cos (c+d x) a+a)}\right )d(-a \cos (c+d x))}{2 a^2}-\frac {a \left (\frac {b^2}{a^2}+1\right ) \cos (c+d x)+2 b}{2 a^2 \left (a^2-a^2 \cos ^2(c+d x)\right )}\right )}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^5 \left (\frac {\frac {2 b^2 \sec (c+d x)}{a^3}+\frac {(a+b) (a+3 b) \log (a-a \cos (c+d x))}{2 a^3}-\frac {(a-3 b) (a-b) \log (a \cos (c+d x)+a)}{2 a^3}-\frac {4 b \log (-a \cos (c+d x))}{a^2}}{2 a^2}-\frac {a \left (\frac {b^2}{a^2}+1\right ) \cos (c+d x)+2 b}{2 a^2 \left (a^2-a^2 \cos ^2(c+d x)\right )}\right )}{d}\) |
Input:
Int[Csc[c + d*x]^3*(a + b*Sec[c + d*x])^2,x]
Output:
(a^5*(-1/2*(2*b + a*(1 + b^2/a^2)*Cos[c + d*x])/(a^2*(a^2 - a^2*Cos[c + d* x]^2)) + ((-4*b*Log[-(a*Cos[c + d*x])])/a^2 + ((a + b)*(a + 3*b)*Log[a - a *Cos[c + d*x]])/(2*a^3) - ((a - 3*b)*(a - b)*Log[a + a*Cos[c + d*x]])/(2*a ^3) + (2*b^2*Sec[c + d*x])/a^3)/(2*a^2)))/d
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[(x_)^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbo l] :> With[{Qx = PolynomialQuotient[x^m*(c + d*x)^n, a + b*x^2, x], e = Coe ff[PolynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 0], f = Coeff[Pol ynomialRemainder[x^m*(c + d*x)^n, a + b*x^2, x], x, 1]}, Simp[(a*f - b*e*x) *((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Simp[1/(2*a*(p + 1)) Int[x^m *(a + b*x^2)^(p + 1)*ExpandToSum[2*a*(p + 1)*(Qx/x^m) + e*((2*p + 3)/x^m), x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGtQ[n, 0] && ILtQ[m, 0] && LtQ[p, -1] && IntegerQ[2*p]
Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ ExpandIntegrand[(c*x)^m*Pq*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_ .)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b^p* f) Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x, b* Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1) /2] && NeQ[a^2 - b^2, 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.39 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.02
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+2 a b \left (-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+b^{2} \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 )}{d}\) | \(116\) |
default | \(\frac {a^{2} \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+2 a b \left (-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+b^{2} \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 )}{d}\) | \(116\) |
norman | \(\frac {\frac {a^{2}+2 a b +b^{2}}{8 d}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{8 d}-\frac {\left (a^{2}+9 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{4 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 )}+\frac {\left (a^{2}+4 a b +3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(164\) |
parallelrisch | \(\frac {16 b a \left (1-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+16 b a \left (1-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+4 \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 ) \left (a +3 b \right ) \left (a +b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (a -b \right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (a +b \right )^{2} \cot \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-2 a^{2}-18 b^{2}}{8 d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\) | \(172\) |
risch | \(\frac {a^{2} {\mathrm e}^{5 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+4 a b \,{\mathrm e}^{4 i \left (d x +c \right )}+2 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}-2 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+4 a b \,{\mathrm e}^{2 i \left (d x +c \right )}+a^{2} {\mathrm e}^{i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{i \left (d x +c \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 {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) a b}{d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{2 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) a b}{d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{2 d}-\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(278\) |
Input:
int(csc(d*x+c)^3*(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
1/d*(a^2*(-1/2*csc(d*x+c)*cot(d*x+c)+1/2*ln(csc(d*x+c)-cot(d*x+c)))+2*a*b* (-1/2/sin(d*x+c)^2+ln(tan(d*x+c)))+b^2*(-1/2/sin(d*x+c)^2/cos(d*x+c)+3/2/c os(d*x+c)+3/2*ln(csc(d*x+c)-cot(d*x+c))))
Time = 0.10 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.80 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {4 \, a b \cos \left (d x + c\right ) + 2 \, {\left (a^{2} + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 4 \, b^{2} - 8 \, {\left (a b \cos \left (d x + c\right )^{3} - a b \cos \left (d x + c\right )\right )} \log \left (-\cos \left (d x + c\right )\right ) - {\left ({\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{3} - {\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \cos \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left ({\left (a^{2} + 4 \, a b + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{3} - {\left (a^{2} + 4 \, a b + 3 \, b^{2}\right )} \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{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*(a+b*sec(d*x+c))^2,x, algorithm="fricas")
Output:
1/4*(4*a*b*cos(d*x + c) + 2*(a^2 + 3*b^2)*cos(d*x + c)^2 - 4*b^2 - 8*(a*b* cos(d*x + c)^3 - a*b*cos(d*x + c))*log(-cos(d*x + c)) - ((a^2 - 4*a*b + 3* b^2)*cos(d*x + c)^3 - (a^2 - 4*a*b + 3*b^2)*cos(d*x + c))*log(1/2*cos(d*x + c) + 1/2) + ((a^2 + 4*a*b + 3*b^2)*cos(d*x + c)^3 - (a^2 + 4*a*b + 3*b^2 )*cos(d*x + c))*log(-1/2*cos(d*x + c) + 1/2))/(d*cos(d*x + c)^3 - d*cos(d* x + c))
\[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \csc ^{3}{\left (c + d x \right )}\, dx \] Input:
integrate(csc(d*x+c)**3*(a+b*sec(d*x+c))**2,x)
Output:
Integral((a + b*sec(c + d*x))**2*csc(c + d*x)**3, x)
Time = 0.04 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.04 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {8 \, a b \log \left (\cos \left (d x + c\right )\right ) + {\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \log \left (\cos \left (d x + c\right ) + 1\right ) - {\left (a^{2} + 4 \, a b + 3 \, b^{2}\right )} \log \left (\cos \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (2 \, a b \cos \left (d x + c\right ) + {\left (a^{2} + 3 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, b^{2}\right )}}{\cos \left (d x + c\right )^{3} - \cos \left (d x + c\right )}}{4 \, d} \] Input:
integrate(csc(d*x+c)^3*(a+b*sec(d*x+c))^2,x, algorithm="maxima")
Output:
-1/4*(8*a*b*log(cos(d*x + c)) + (a^2 - 4*a*b + 3*b^2)*log(cos(d*x + c) + 1 ) - (a^2 + 4*a*b + 3*b^2)*log(cos(d*x + c) - 1) - 2*(2*a*b*cos(d*x + c) + (a^2 + 3*b^2)*cos(d*x + c)^2 - 2*b^2)/(cos(d*x + c)^3 - cos(d*x + c)))/d
Time = 0.13 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.20 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=-\frac {2 \, a b \log \left ({\left | \cos \left (d x + c\right ) \right |}\right )}{d} - \frac {{\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \log \left ({\left | \cos \left (d x + c\right ) + 1 \right |}\right )}{4 \, d} + \frac {{\left (a^{2} + 4 \, a b + 3 \, b^{2}\right )} \log \left ({\left | \cos \left (d x + c\right ) - 1 \right |}\right )}{4 \, d} + \frac {a^{2} \cos \left (d x + c\right )^{2} + 3 \, b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) - 2 \, b^{2}}{2 \, {\left (\cos \left (d x + c\right )^{3} - \cos \left (d x + c\right )\right )} d} \] Input:
integrate(csc(d*x+c)^3*(a+b*sec(d*x+c))^2,x, algorithm="giac")
Output:
-2*a*b*log(abs(cos(d*x + c)))/d - 1/4*(a^2 - 4*a*b + 3*b^2)*log(abs(cos(d* x + c) + 1))/d + 1/4*(a^2 + 4*a*b + 3*b^2)*log(abs(cos(d*x + c) - 1))/d + 1/2*(a^2*cos(d*x + c)^2 + 3*b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) - 2*b^ 2)/((cos(d*x + c)^3 - cos(d*x + c))*d)
Time = 0.12 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.05 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {\ln \left (\cos \left (c+d\,x\right )-1\right )\,\left (a+b\right )\,\left (a+3\,b\right )}{4\,d}-\frac {\ln \left (\cos \left (c+d\,x\right )+1\right )\,\left (a-b\right )\,\left (a-3\,b\right )}{4\,d}-\frac {2\,a\,b\,\ln \left (\cos \left (c+d\,x\right )\right )}{d}-\frac {{\cos \left (c+d\,x\right )}^2\,\left (\frac {a^2}{2}+\frac {3\,b^2}{2}\right )-b^2+a\,b\,\cos \left (c+d\,x\right )}{d\,\left (\cos \left (c+d\,x\right )-{\cos \left (c+d\,x\right )}^3\right )} \] Input:
int((a + b/cos(c + d*x))^2/sin(c + d*x)^3,x)
Output:
(log(cos(c + d*x) - 1)*(a + b)*(a + 3*b))/(4*d) - (log(cos(c + d*x) + 1)*( a - b)*(a - 3*b))/(4*d) - (2*a*b*log(cos(c + d*x)))/d - (cos(c + d*x)^2*(a ^2/2 + (3*b^2)/2) - b^2 + a*b*cos(c + d*x))/(d*(cos(c + d*x) - cos(c + d*x )^3))
Time = 0.17 (sec) , antiderivative size = 270, normalized size of antiderivative = 2.37 \[ \int \csc ^3(c+d x) (a+b \sec (c+d x))^2 \, dx=\frac {-16 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} a b -16 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} a b +4 \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^{2}+16 \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 b +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} b^{2}-\cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{2}+2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a b -9 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{2}-8 \cos \left (d x +c \right ) a b +4 \sin \left (d x +c \right )^{2} a^{2}+12 \sin \left (d x +c \right )^{2} b^{2}-4 a^{2}-4 b^{2}}{8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} d} \] Input:
int(csc(d*x+c)^3*(a+b*sec(d*x+c))^2,x)
Output:
( - 16*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*a*b - 16*cos (c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*a*b + 4*cos(c + d*x)*l og(tan((c + d*x)/2))*sin(c + d*x)**2*a**2 + 16*cos(c + d*x)*log(tan((c + d *x)/2))*sin(c + d*x)**2*a*b + 12*cos(c + d*x)*log(tan((c + d*x)/2))*sin(c + d*x)**2*b**2 - cos(c + d*x)*sin(c + d*x)**2*a**2 + 2*cos(c + d*x)*sin(c + d*x)**2*a*b - 9*cos(c + d*x)*sin(c + d*x)**2*b**2 - 8*cos(c + d*x)*a*b + 4*sin(c + d*x)**2*a**2 + 12*sin(c + d*x)**2*b**2 - 4*a**2 - 4*b**2)/(8*co s(c + d*x)*sin(c + d*x)**2*d)