Integrand size = 29, antiderivative size = 60 \[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=a (2 A b+a B) x+\frac {b (A b+2 a B) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 A \sin (c+d x)}{d}+\frac {b^2 B \tan (c+d x)}{d} \] Output:
a*(2*A*b+B*a)*x+b*(A*b+2*B*a)*arctanh(sin(d*x+c))/d+a^2*A*sin(d*x+c)/d+b^2 *B*tan(d*x+c)/d
Time = 0.49 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.18 \[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=2 a A b x+a^2 B x+\frac {A b^2 \text {arctanh}(\sin (c+d x))}{d}+\frac {2 a b B \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 A \sin (c+d x)}{d}+\frac {b^2 B \tan (c+d x)}{d} \] Input:
Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]
Output:
2*a*A*b*x + a^2*B*x + (A*b^2*ArcTanh[Sin[c + d*x]])/d + (2*a*b*B*ArcTanh[S in[c + d*x]])/d + (a^2*A*Sin[c + d*x])/d + (b^2*B*Tan[c + d*x])/d
Time = 0.31 (sec) , antiderivative size = 60, 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, 4512, 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 \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4512 |
\(\displaystyle \frac {a^2 A \sin (c+d x)}{d}-\int \left (-b^2 B \sec ^2(c+d x)-b (A b+2 a B) \sec (c+d x)-a (2 A b+a B)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 A \sin (c+d x)}{d}+\frac {b (2 a B+A b) \text {arctanh}(\sin (c+d x))}{d}+a x (a B+2 A b)+\frac {b^2 B \tan (c+d x)}{d}\) |
Input:
Int[Cos[c + d*x]*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]
Output:
a*(2*A*b + a*B)*x + (b*(A*b + 2*a*B)*ArcTanh[Sin[c + d*x]])/d + (a^2*A*Sin [c + d*x])/d + (b^2*B*Tan[c + d*x])/d
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^2*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[a^2*A*Cos[ e + f*x]*((d*Csc[e + f*x])^(n + 1)/(d*f*n)), x] + Simp[1/(d*n) Int[(d*Csc [e + f*x])^(n + 1)*(a*(2*A*b + a*B)*n + (2*a*b*B*n + A*(b^2*n + a^2*(n + 1) ))*Csc[e + f*x] + b^2*B*n*Csc[e + f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]
Time = 0.55 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.43
method | result | size |
derivativedivides | \(\frac {A \,a^{2} \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )+2 A a b \left (d x +c \right )+2 B a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,b^{2} \tan \left (d x +c \right )}{d}\) | \(86\) |
default | \(\frac {A \,a^{2} \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )+2 A a b \left (d x +c \right )+2 B a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,b^{2} \tan \left (d x +c \right )}{d}\) | \(86\) |
parallelrisch | \(\frac {-2 b \cos \left (d x +c \right ) \left (A b +2 B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+2 b \cos \left (d x +c \right ) \left (A b +2 B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+A \,a^{2} \sin \left (2 d x +2 c \right )+4 x a \left (A b +\frac {B a}{2}\right ) d \cos \left (d x +c \right )+2 b^{2} B \sin \left (d x +c \right )}{2 \cos \left (d x +c \right ) d}\) | \(118\) |
risch | \(2 A a b x +B \,a^{2} x -\frac {i A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i A \,a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i b^{2} B}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,b^{2}}{d}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,b^{2}}{d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a b}{d}\) | \(160\) |
norman | \(\frac {\left (2 A a b +B \,a^{2}\right ) x +\left (-2 A a b -B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-2 A a b -B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (2 A a b +B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\frac {2 \left (A \,a^{2}-b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {2 \left (A \,a^{2}+b^{2} B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 A \,a^{2} \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 ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2}}+\frac {b \left (A b +2 B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b \left (A b +2 B a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(245\) |
Input:
int(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE )
Output:
1/d*(A*a^2*sin(d*x+c)+B*a^2*(d*x+c)+2*A*a*b*(d*x+c)+2*B*a*b*ln(sec(d*x+c)+ tan(d*x+c))+A*b^2*ln(sec(d*x+c)+tan(d*x+c))+B*b^2*tan(d*x+c))
Time = 0.10 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.95 \[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {2 \, {\left (B a^{2} + 2 \, A a b\right )} d x \cos \left (d x + c\right ) + {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a^{2} \cos \left (d x + c\right ) + B b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \] Input:
integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="fri cas")
Output:
1/2*(2*(B*a^2 + 2*A*a*b)*d*x*cos(d*x + c) + (2*B*a*b + A*b^2)*cos(d*x + c) *log(sin(d*x + c) + 1) - (2*B*a*b + A*b^2)*cos(d*x + c)*log(-sin(d*x + c) + 1) + 2*(A*a^2*cos(d*x + c) + B*b^2)*sin(d*x + c))/(d*cos(d*x + c))
\[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos {\left (c + d x \right )}\, dx \] Input:
integrate(cos(d*x+c)*(a+b*sec(d*x+c))**2*(A+B*sec(d*x+c)),x)
Output:
Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))**2*cos(c + d*x), x)
Time = 0.04 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.72 \[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {2 \, {\left (d x + c\right )} B a^{2} + 4 \, {\left (d x + c\right )} A a b + 2 \, B a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + A b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a^{2} \sin \left (d x + c\right ) + 2 \, B b^{2} \tan \left (d x + c\right )}{2 \, d} \] Input:
integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="max ima")
Output:
1/2*(2*(d*x + c)*B*a^2 + 4*(d*x + c)*A*a*b + 2*B*a*b*(log(sin(d*x + c) + 1 ) - log(sin(d*x + c) - 1)) + A*b^2*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*A*a^2*sin(d*x + c) + 2*B*b^2*tan(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 154 vs. \(2 (60) = 120\).
Time = 0.16 (sec) , antiderivative size = 154, normalized size of antiderivative = 2.57 \[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {{\left (B a^{2} + 2 \, A a b\right )} {\left (d x + c\right )} + {\left (2 \, B a b + A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, B a b + A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \] Input:
integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="gia c")
Output:
((B*a^2 + 2*A*a*b)*(d*x + c) + (2*B*a*b + A*b^2)*log(abs(tan(1/2*d*x + 1/2 *c) + 1)) - (2*B*a*b + A*b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(A*a^ 2*tan(1/2*d*x + 1/2*c)^3 - B*b^2*tan(1/2*d*x + 1/2*c)^3 - A*a^2*tan(1/2*d* x + 1/2*c) - B*b^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^4 - 1))/d
Time = 11.76 (sec) , antiderivative size = 163, normalized size of antiderivative = 2.72 \[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {B\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,B\,a^2\,\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\,A\,b^2\,\mathrm {atanh}\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^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d\,\cos \left (c+d\,x\right )}+\frac {4\,A\,a\,b\,\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 {4\,B\,a\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \] Input:
int(cos(c + d*x)*(A + B/cos(c + d*x))*(a + b/cos(c + d*x))^2,x)
Output:
(B*b^2*tan(c + d*x))/d + (2*B*a^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/ 2)))/d + (2*A*b^2*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (A*a^2 *sin(2*c + 2*d*x))/(2*d*cos(c + d*x)) + (4*A*a*b*atan(sin(c/2 + (d*x)/2)/c os(c/2 + (d*x)/2)))/d + (4*B*a*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/ 2)))/d
Time = 0.16 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.90 \[ \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {-3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a \,b^{2}+3 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a \,b^{2}+\cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{3}+3 \cos \left (d x +c \right ) a^{2} b c +3 \cos \left (d x +c \right ) a^{2} b d x +\sin \left (d x +c \right ) b^{3}}{\cos \left (d x +c \right ) d} \] Input:
int(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x)
Output:
( - 3*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a*b**2 + 3*cos(c + d*x)*log(t an((c + d*x)/2) + 1)*a*b**2 + cos(c + d*x)*sin(c + d*x)*a**3 + 3*cos(c + d *x)*a**2*b*c + 3*cos(c + d*x)*a**2*b*d*x + sin(c + d*x)*b**3)/(cos(c + d*x )*d)