Integrand size = 39, antiderivative size = 62 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{2} a (A+2 (B+C)) x+\frac {a C \text {arctanh}(\sin (c+d x))}{d}+\frac {a (A+B) \sin (c+d x)}{d}+\frac {a A \cos (c+d x) \sin (c+d x)}{2 d} \] Output:
1/2*a*(A+2*B+2*C)*x+a*C*arctanh(sin(d*x+c))/d+a*(A+B)*sin(d*x+c)/d+1/2*a*A *cos(d*x+c)*sin(d*x+c)/d
Time = 0.08 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.95 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {a \left (2 A c+2 A d x+4 B d x+4 C d x+4 C \coth ^{-1}(\sin (c+d x))+4 (A+B) \sin (c+d x)+A \sin (2 (c+d x))\right )}{4 d} \] Input:
Integrate[Cos[c + d*x]^2*(a + a*Sec[c + d*x])*(A + B*Sec[c + d*x] + C*Sec[ c + d*x]^2),x]
Output:
(a*(2*A*c + 2*A*d*x + 4*B*d*x + 4*C*d*x + 4*C*ArcCoth[Sin[c + d*x]] + 4*(A + B)*Sin[c + d*x] + A*Sin[2*(c + d*x)]))/(4*d)
Time = 0.58 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.06, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.256, Rules used = {3042, 4562, 25, 3042, 4535, 24, 3042, 4533, 3042, 4257}
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 \cos ^2(c+d x) (a \sec (c+d x)+a) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right ) \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 4562 |
\(\displaystyle \frac {a A \sin (c+d x) \cos (c+d x)}{2 d}-\frac {1}{2} \int -\cos (c+d x) \left (2 a C \sec ^2(c+d x)+a (A+2 (B+C)) \sec (c+d x)+2 a (A+B)\right )dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{2} \int \cos (c+d x) \left (2 a C \sec ^2(c+d x)+a (A+2 (B+C)) \sec (c+d x)+2 a (A+B)\right )dx+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \int \frac {2 a C \csc \left (c+d x+\frac {\pi }{2}\right )^2+a (A+2 (B+C)) \csc \left (c+d x+\frac {\pi }{2}\right )+2 a (A+B)}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
\(\Big \downarrow \) 4535 |
\(\displaystyle \frac {1}{2} \left (\int \cos (c+d x) \left (2 a C \sec ^2(c+d x)+2 a (A+B)\right )dx+a (A+2 (B+C)) \int 1dx\right )+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{2} \left (\int \cos (c+d x) \left (2 a C \sec ^2(c+d x)+2 a (A+B)\right )dx+a x (A+2 (B+C))\right )+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \left (\int \frac {2 a C \csc \left (c+d x+\frac {\pi }{2}\right )^2+2 a (A+B)}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+a x (A+2 (B+C))\right )+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
\(\Big \downarrow \) 4533 |
\(\displaystyle \frac {1}{2} \left (2 a C \int \sec (c+d x)dx+\frac {2 a (A+B) \sin (c+d x)}{d}+a x (A+2 (B+C))\right )+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} \left (2 a C \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {2 a (A+B) \sin (c+d x)}{d}+a x (A+2 (B+C))\right )+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {1}{2} \left (\frac {2 a (A+B) \sin (c+d x)}{d}+a x (A+2 (B+C))+\frac {2 a C \text {arctanh}(\sin (c+d x))}{d}\right )+\frac {a A \sin (c+d x) \cos (c+d x)}{2 d}\) |
Input:
Int[Cos[c + d*x]^2*(a + a*Sec[c + d*x])*(A + B*Sec[c + d*x] + C*Sec[c + d* x]^2),x]
Output:
(a*A*Cos[c + d*x]*Sin[c + d*x])/(2*d) + (a*(A + 2*(B + C))*x + (2*a*C*ArcT anh[Sin[c + d*x]])/d + (2*a*(A + B)*Sin[c + d*x])/d)/2
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e + f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + Simp[(C*m + A*(m + 1))/(b^2*m) Int[(b*Csc[e + f*x])^(m + 2), x], x] /; Fr eeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]* (B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.)), x_Symbol] :> Simp[B/b Int[(b*Cs c[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x]^2) , x] /; FreeQ[{b, e, f, A, B, C, m}, x]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a _)), x_Symbol] :> Simp[A*a*Cot[e + f*x]*((d*Csc[e + f*x])^n/(f*n)), x] + Si mp[1/(d*n) Int[(d*Csc[e + f*x])^(n + 1)*Simp[n*(B*a + A*b) + (n*(a*C + B* b) + A*a*(n + 1))*Csc[e + f*x] + b*C*n*Csc[e + f*x]^2, x], x], x] /; FreeQ[ {a, b, d, e, f, A, B, C}, x] && LtQ[n, -1]
Time = 0.32 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.21
method | result | size |
parallelrisch | \(\frac {\left (-2 C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+2 C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {A \sin \left (2 d x +2 c \right )}{2}+\left (2 A +2 B \right ) \sin \left (d x +c \right )+\left (A +2 B +2 C \right ) x d \right ) a}{2 d}\) | \(75\) |
derivativedivides | \(\frac {a A \sin \left (d x +c \right )+a B \left (d x +c \right )+C a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a B \sin \left (d x +c \right )+C a \left (d x +c \right )}{d}\) | \(82\) |
default | \(\frac {a A \sin \left (d x +c \right )+a B \left (d x +c \right )+C a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a B \sin \left (d x +c \right )+C a \left (d x +c \right )}{d}\) | \(82\) |
risch | \(\frac {a A x}{2}+a B x +a x C -\frac {i a A \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {i a B \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a A \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a B}{2 d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}+\frac {a A \sin \left (2 d x +2 c \right )}{4 d}\) | \(138\) |
norman | \(\frac {\left (\frac {1}{2} a A +a B +C a \right ) x +\left (\frac {1}{2} a A +a B +C a \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-a A -2 a B -2 C a \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {a \left (A -2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {a \left (A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {a \left (3 A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {a \left (5 A +2 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2}}+\frac {C a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {C a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(221\) |
Input:
int(cos(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x,method =_RETURNVERBOSE)
Output:
1/2*(-2*C*ln(tan(1/2*d*x+1/2*c)-1)+2*C*ln(tan(1/2*d*x+1/2*c)+1)+1/2*A*sin( 2*d*x+2*c)+(2*A+2*B)*sin(d*x+c)+(A+2*B+2*C)*x*d)*a/d
Time = 0.09 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.10 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left (A + 2 \, B + 2 \, C\right )} a d x + C a \log \left (\sin \left (d x + c\right ) + 1\right ) - C a \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (A a \cos \left (d x + c\right ) + 2 \, {\left (A + B\right )} a\right )} \sin \left (d x + c\right )}{2 \, d} \] Input:
integrate(cos(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")
Output:
1/2*((A + 2*B + 2*C)*a*d*x + C*a*log(sin(d*x + c) + 1) - C*a*log(-sin(d*x + c) + 1) + (A*a*cos(d*x + c) + 2*(A + B)*a)*sin(d*x + c))/d
\[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a \left (\int A \cos ^{2}{\left (c + d x \right )}\, dx + \int A \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx\right ) \] Input:
integrate(cos(d*x+c)**2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)+C*sec(d*x+c)**2), x)
Output:
a*(Integral(A*cos(c + d*x)**2, x) + Integral(A*cos(c + d*x)**2*sec(c + d*x ), x) + Integral(B*cos(c + d*x)**2*sec(c + d*x), x) + Integral(B*cos(c + d *x)**2*sec(c + d*x)**2, x) + Integral(C*cos(c + d*x)**2*sec(c + d*x)**2, x ) + Integral(C*cos(c + d*x)**2*sec(c + d*x)**3, x))
Time = 0.04 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.44 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a + 4 \, {\left (d x + c\right )} B a + 4 \, {\left (d x + c\right )} C a + 2 \, C a {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, A a \sin \left (d x + c\right ) + 4 \, B a \sin \left (d x + c\right )}{4 \, d} \] Input:
integrate(cos(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")
Output:
1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*A*a + 4*(d*x + c)*B*a + 4*(d*x + c)* C*a + 2*C*a*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 4*A*a*sin(d* x + c) + 4*B*a*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (59) = 118\).
Time = 0.25 (sec) , antiderivative size = 131, normalized size of antiderivative = 2.11 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \, C a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, C a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + {\left (A a + 2 \, B a + 2 \, C a\right )} {\left (d x + c\right )} + \frac {2 \, {\left (A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \] Input:
integrate(cos(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")
Output:
1/2*(2*C*a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 2*C*a*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + (A*a + 2*B*a + 2*C*a)*(d*x + c) + 2*(A*a*tan(1/2*d*x + 1/ 2*c)^3 + 2*B*a*tan(1/2*d*x + 1/2*c)^3 + 3*A*a*tan(1/2*d*x + 1/2*c) + 2*B*a *tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^2)/d
Time = 13.40 (sec) , antiderivative size = 159, normalized size of antiderivative = 2.56 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {A\,a\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}-\frac {C\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d} \] Input:
int(cos(c + d*x)^2*(a + a/cos(c + d*x))*(A + B/cos(c + d*x) + C/cos(c + d* x)^2),x)
Output:
(A*a*sin(c + d*x))/d + (B*a*sin(c + d*x))/d + (A*a*atan(sin(c/2 + (d*x)/2) /cos(c/2 + (d*x)/2)))/d + (2*B*a*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2 )))/d + (2*C*a*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d - (C*a*atan( (sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*2i)/d + (A*a*sin(2*c + 2*d*x)) /(4*d)
Time = 0.16 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.53 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {a \left (\cos \left (d x +c \right ) \sin \left (d x +c \right ) a -2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) c +2 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) c +2 \sin \left (d x +c \right ) a +2 \sin \left (d x +c \right ) b +a c +a d x +2 b c +2 b d x +2 c^{2}+2 c d x \right )}{2 d} \] Input:
int(cos(d*x+c)^2*(a+a*sec(d*x+c))*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x)
Output:
(a*(cos(c + d*x)*sin(c + d*x)*a - 2*log(tan((c + d*x)/2) - 1)*c + 2*log(ta n((c + d*x)/2) + 1)*c + 2*sin(c + d*x)*a + 2*sin(c + d*x)*b + a*c + a*d*x + 2*b*c + 2*b*d*x + 2*c**2 + 2*c*d*x))/(2*d)