Integrand size = 16, antiderivative size = 33 \[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=-\frac {\text {arctanh}(\sin (c-b x)) \sin ^2(a+c)}{b}+\frac {\sin (2 a+c+b x)}{b} \] Output:
arctanh(sin(b*x-c))*sin(a+c)^2/b+sin(b*x+2*a+c)/b
Leaf count is larger than twice the leaf count of optimal. \(74\) vs. \(2(33)=66\).
Time = 0.15 (sec) , antiderivative size = 74, normalized size of antiderivative = 2.24 \[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=\frac {\left (\log \left (\cos \left (\frac {1}{2} (c-b x)\right )-\sin \left (\frac {1}{2} (c-b x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c-b x)\right )+\sin \left (\frac {1}{2} (c-b x)\right )\right )\right ) \sin ^2(a+c)+\sin (2 a+c+b x)}{b} \] Input:
Integrate[Cos[a + b*x]^2*Sec[c - b*x],x]
Output:
((Log[Cos[(c - b*x)/2] - Sin[(c - b*x)/2]] - Log[Cos[(c - b*x)/2] + Sin[(c - b*x)/2]])*Sin[a + c]^2 + Sin[2*a + c + b*x])/b
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(a+b x) \sec (c-b x) \, dx\) |
\(\Big \downarrow \) 7299 |
\(\displaystyle \int \cos ^2(a+b x) \sec (c-b x)dx\) |
Input:
Int[Cos[a + b*x]^2*Sec[c - b*x],x]
Output:
$Aborted
Result contains complex when optimal does not.
Time = 1.13 (sec) , antiderivative size = 135, normalized size of antiderivative = 4.09
method | result | size |
risch | \(-\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}-i {\mathrm e}^{i \left (a +c \right )}\right )}{2 b}+\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}-i {\mathrm e}^{i \left (a +c \right )}\right ) \cos \left (2 a +2 c \right )}{2 b}+\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}+i {\mathrm e}^{i \left (a +c \right )}\right )}{2 b}-\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}+i {\mathrm e}^{i \left (a +c \right )}\right ) \cos \left (2 a +2 c \right )}{2 b}+\frac {\sin \left (b x +2 a +c \right )}{b}\) | \(135\) |
default | \(\frac {\frac {2 \left (-\sin \left (c \right )^{2} \cos \left (a \right )^{2}-2 \cos \left (a \right ) \cos \left (c \right ) \sin \left (a \right ) \sin \left (c \right )-\cos \left (c \right )^{2} \sin \left (a \right )^{2}\right ) \arctan \left (\frac {2 \left (\cos \left (a \right ) \cos \left (c \right )-\sin \left (a \right ) \sin \left (c \right )\right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )-2 \sin \left (a \right ) \cos \left (c \right )-2 \cos \left (a \right ) \sin \left (c \right )}{2 \sqrt {-\cos \left (c \right )^{2} \sin \left (a \right )^{2}-\cos \left (a \right )^{2} \cos \left (c \right )^{2}-\sin \left (a \right )^{2} \sin \left (c \right )^{2}-\sin \left (c \right )^{2} \cos \left (a \right )^{2}}}\right )}{\left (\cos \left (a \right )^{2} \cos \left (c \right )^{2}+\sin \left (c \right )^{2} \cos \left (a \right )^{2}+\cos \left (c \right )^{2} \sin \left (a \right )^{2}+\sin \left (a \right )^{2} \sin \left (c \right )^{2}\right ) \sqrt {-\cos \left (c \right )^{2} \sin \left (a \right )^{2}-\cos \left (a \right )^{2} \cos \left (c \right )^{2}-\sin \left (a \right )^{2} \sin \left (c \right )^{2}-\sin \left (c \right )^{2} \cos \left (a \right )^{2}}}-\frac {2 \left (\left (-\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )\right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )-\sin \left (a \right ) \cos \left (c \right )-\cos \left (a \right ) \sin \left (c \right )\right )}{\left (\cos \left (a \right )^{2} \cos \left (c \right )^{2}+\sin \left (c \right )^{2} \cos \left (a \right )^{2}+\cos \left (c \right )^{2} \sin \left (a \right )^{2}+\sin \left (a \right )^{2} \sin \left (c \right )^{2}\right ) \left (1+\tan \left (\frac {a}{2}+\frac {b x}{2}\right )^{2}\right )}}{b}\) | \(294\) |
Input:
int(cos(b*x+a)^2*sec(b*x-c),x,method=_RETURNVERBOSE)
Output:
-1/2/b*ln(exp(I*(b*x+a))-I*exp(I*(a+c)))+1/2/b*ln(exp(I*(b*x+a))-I*exp(I*( a+c)))*cos(2*a+2*c)+1/2/b*ln(exp(I*(b*x+a))+I*exp(I*(a+c)))-1/2/b*ln(exp(I *(b*x+a))+I*exp(I*(a+c)))*cos(2*a+2*c)+sin(b*x+2*a+c)/b
Leaf count of result is larger than twice the leaf count of optimal. 121 vs. \(2 (33) = 66\).
Time = 0.09 (sec) , antiderivative size = 121, normalized size of antiderivative = 3.67 \[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=-\frac {{\left (\cos \left (a + c\right )^{2} - 1\right )} \log \left (\frac {2 \, {\left (\cos \left (a + c\right ) \sin \left (b x + a\right ) - \cos \left (b x + a\right ) \sin \left (a + c\right ) + 1\right )}}{\cos \left (a + c\right ) + 1}\right ) - {\left (\cos \left (a + c\right )^{2} - 1\right )} \log \left (-\frac {2 \, {\left (\cos \left (a + c\right ) \sin \left (b x + a\right ) - \cos \left (b x + a\right ) \sin \left (a + c\right ) - 1\right )}}{\cos \left (a + c\right ) + 1}\right ) - 2 \, \cos \left (a + c\right ) \sin \left (b x + a\right ) - 2 \, \cos \left (b x + a\right ) \sin \left (a + c\right )}{2 \, b} \] Input:
integrate(cos(b*x+a)^2*sec(b*x-c),x, algorithm="fricas")
Output:
-1/2*((cos(a + c)^2 - 1)*log(2*(cos(a + c)*sin(b*x + a) - cos(b*x + a)*sin (a + c) + 1)/(cos(a + c) + 1)) - (cos(a + c)^2 - 1)*log(-2*(cos(a + c)*sin (b*x + a) - cos(b*x + a)*sin(a + c) - 1)/(cos(a + c) + 1)) - 2*cos(a + c)* sin(b*x + a) - 2*cos(b*x + a)*sin(a + c))/b
Leaf count of result is larger than twice the leaf count of optimal. 874 vs. \(2 (27) = 54\).
Time = 19.43 (sec) , antiderivative size = 3645, normalized size of antiderivative = 110.45 \[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=\text {Too large to display} \] Input:
integrate(cos(b*x+a)**2*sec(b*x-c),x)
Output:
-2*Piecewise((sin(b*x)/b, Eq(c, pi/2)), (-sin(b*x)/b, Eq(c, -pi/2)), (0, E q(b, 0)), (-2*log(tan(b*x/2) + tan(c/2)/(tan(c/2) - 1) + 1/(tan(c/2) - 1)) *tan(c/2)**3*tan(b*x/2)**2/(b*tan(c/2)**4*tan(b*x/2)**2 + b*tan(c/2)**4 + 2*b*tan(c/2)**2*tan(b*x/2)**2 + 2*b*tan(c/2)**2 + b*tan(b*x/2)**2 + b) - 2 *log(tan(b*x/2) + tan(c/2)/(tan(c/2) - 1) + 1/(tan(c/2) - 1))*tan(c/2)**3/ (b*tan(c/2)**4*tan(b*x/2)**2 + b*tan(c/2)**4 + 2*b*tan(c/2)**2*tan(b*x/2)* *2 + 2*b*tan(c/2)**2 + b*tan(b*x/2)**2 + b) + 2*log(tan(b*x/2) + tan(c/2)/ (tan(c/2) - 1) + 1/(tan(c/2) - 1))*tan(c/2)*tan(b*x/2)**2/(b*tan(c/2)**4*t an(b*x/2)**2 + b*tan(c/2)**4 + 2*b*tan(c/2)**2*tan(b*x/2)**2 + 2*b*tan(c/2 )**2 + b*tan(b*x/2)**2 + b) + 2*log(tan(b*x/2) + tan(c/2)/(tan(c/2) - 1) + 1/(tan(c/2) - 1))*tan(c/2)/(b*tan(c/2)**4*tan(b*x/2)**2 + b*tan(c/2)**4 + 2*b*tan(c/2)**2*tan(b*x/2)**2 + 2*b*tan(c/2)**2 + b*tan(b*x/2)**2 + b) + 2*log(tan(b*x/2) - tan(c/2)/(tan(c/2) + 1) + 1/(tan(c/2) + 1))*tan(c/2)**3 *tan(b*x/2)**2/(b*tan(c/2)**4*tan(b*x/2)**2 + b*tan(c/2)**4 + 2*b*tan(c/2) **2*tan(b*x/2)**2 + 2*b*tan(c/2)**2 + b*tan(b*x/2)**2 + b) + 2*log(tan(b*x /2) - tan(c/2)/(tan(c/2) + 1) + 1/(tan(c/2) + 1))*tan(c/2)**3/(b*tan(c/2)* *4*tan(b*x/2)**2 + b*tan(c/2)**4 + 2*b*tan(c/2)**2*tan(b*x/2)**2 + 2*b*tan (c/2)**2 + b*tan(b*x/2)**2 + b) - 2*log(tan(b*x/2) - tan(c/2)/(tan(c/2) + 1) + 1/(tan(c/2) + 1))*tan(c/2)*tan(b*x/2)**2/(b*tan(c/2)**4*tan(b*x/2)**2 + b*tan(c/2)**4 + 2*b*tan(c/2)**2*tan(b*x/2)**2 + 2*b*tan(c/2)**2 + b*...
Leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (33) = 66\).
Time = 0.17 (sec) , antiderivative size = 106, normalized size of antiderivative = 3.21 \[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=\frac {{\left (\cos \left (2 \, a + 2 \, c\right ) - 1\right )} \log \left (\frac {\cos \left (b x\right )^{2} + \cos \left (c\right )^{2} - 2 \, \cos \left (c\right ) \sin \left (b x\right ) + \sin \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}}{\cos \left (b x\right )^{2} + \cos \left (c\right )^{2} + 2 \, \cos \left (c\right ) \sin \left (b x\right ) + \sin \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}}\right ) + 4 \, \sin \left (b x + 2 \, a + c\right )}{4 \, b} \] Input:
integrate(cos(b*x+a)^2*sec(b*x-c),x, algorithm="maxima")
Output:
1/4*((cos(2*a + 2*c) - 1)*log((cos(b*x)^2 + cos(c)^2 - 2*cos(c)*sin(b*x) + sin(b*x)^2 + 2*cos(b*x)*sin(c) + sin(c)^2)/(cos(b*x)^2 + cos(c)^2 + 2*cos (c)*sin(b*x) + sin(b*x)^2 - 2*cos(b*x)*sin(c) + sin(c)^2)) + 4*sin(b*x + 2 *a + c))/b
Leaf count of result is larger than twice the leaf count of optimal. 1725 vs. \(2 (33) = 66\).
Time = 0.24 (sec) , antiderivative size = 1725, normalized size of antiderivative = 52.27 \[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=\text {Too large to display} \] Input:
integrate(cos(b*x+a)^2*sec(b*x-c),x, algorithm="giac")
Output:
2*(2*(tan(1/2*a)^5*tan(1/2*c)^3 + 2*tan(1/2*a)^4*tan(1/2*c)^4 + tan(1/2*a) ^3*tan(1/2*c)^5 - tan(1/2*a)^5*tan(1/2*c)^2 - 3*tan(1/2*a)^4*tan(1/2*c)^3 - 3*tan(1/2*a)^3*tan(1/2*c)^4 - tan(1/2*a)^2*tan(1/2*c)^5 - 3*tan(1/2*a)^4 *tan(1/2*c)^2 - 6*tan(1/2*a)^3*tan(1/2*c)^3 - 3*tan(1/2*a)^2*tan(1/2*c)^4 + 2*tan(1/2*a)^4*tan(1/2*c) + 6*tan(1/2*a)^3*tan(1/2*c)^2 + 6*tan(1/2*a)^2 *tan(1/2*c)^3 + 2*tan(1/2*a)*tan(1/2*c)^4 + 3*tan(1/2*a)^3*tan(1/2*c) + 6* tan(1/2*a)^2*tan(1/2*c)^2 + 3*tan(1/2*a)*tan(1/2*c)^3 - tan(1/2*a)^3 - 3*t an(1/2*a)^2*tan(1/2*c) - 3*tan(1/2*a)*tan(1/2*c)^2 - tan(1/2*c)^3 - tan(1/ 2*a)^2 - 2*tan(1/2*a)*tan(1/2*c) - tan(1/2*c)^2)*log(abs(-tan(1/2*b*x + 1/ 2*a)*tan(1/2*a)*tan(1/2*c) + tan(1/2*b*x + 1/2*a)*tan(1/2*a) + tan(1/2*b*x + 1/2*a)*tan(1/2*c) - tan(1/2*a)*tan(1/2*c) + tan(1/2*b*x + 1/2*a) - tan( 1/2*a) - tan(1/2*c) + 1))/(tan(1/2*a)^5*tan(1/2*c)^5 - tan(1/2*a)^5*tan(1/ 2*c)^4 - tan(1/2*a)^4*tan(1/2*c)^5 + 2*tan(1/2*a)^5*tan(1/2*c)^3 - tan(1/2 *a)^4*tan(1/2*c)^4 + 2*tan(1/2*a)^3*tan(1/2*c)^5 - 2*tan(1/2*a)^5*tan(1/2* c)^2 - 2*tan(1/2*a)^4*tan(1/2*c)^3 - 2*tan(1/2*a)^3*tan(1/2*c)^4 - 2*tan(1 /2*a)^2*tan(1/2*c)^5 + tan(1/2*a)^5*tan(1/2*c) - 2*tan(1/2*a)^4*tan(1/2*c) ^2 + 4*tan(1/2*a)^3*tan(1/2*c)^3 - 2*tan(1/2*a)^2*tan(1/2*c)^4 + tan(1/2*a )*tan(1/2*c)^5 - tan(1/2*a)^5 - tan(1/2*a)^4*tan(1/2*c) - 4*tan(1/2*a)^3*t an(1/2*c)^2 - 4*tan(1/2*a)^2*tan(1/2*c)^3 - tan(1/2*a)*tan(1/2*c)^4 - tan( 1/2*c)^5 - tan(1/2*a)^4 + 2*tan(1/2*a)^3*tan(1/2*c) - 4*tan(1/2*a)^2*ta...
Time = 1.78 (sec) , antiderivative size = 217, normalized size of antiderivative = 6.58 \[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-c\,1{}\mathrm {i}-b\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2\,b}-\frac {{\mathrm {e}}^{a\,2{}\mathrm {i}+c\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2\,b}+\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-c\,2{}\mathrm {i}}\,\ln \left (-\frac {{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}-1\right )}^2\,1{}\mathrm {i}}{2}+\frac {{\mathrm {e}}^{-c\,1{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}\,\left (1+{\mathrm {e}}^{a\,4{}\mathrm {i}}\,{\mathrm {e}}^{c\,4{}\mathrm {i}}-2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}\right )}{2}\right )\,{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}-1\right )}^2}{4\,b}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-c\,2{}\mathrm {i}}\,\ln \left (\frac {{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}-1\right )}^2\,1{}\mathrm {i}}{2}+\frac {{\mathrm {e}}^{-c\,1{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}\,\left (1+{\mathrm {e}}^{a\,4{}\mathrm {i}}\,{\mathrm {e}}^{c\,4{}\mathrm {i}}-2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{c\,2{}\mathrm {i}}\right )}{2}\right )\,{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+c\,2{}\mathrm {i}}-1\right )}^2}{4\,b} \] Input:
int(cos(a + b*x)^2/cos(c - b*x),x)
Output:
(exp(- a*2i - c*1i - b*x*1i)*1i)/(2*b) - (exp(a*2i + c*1i + b*x*1i)*1i)/(2 *b) + (exp(- a*2i - c*2i)*log((exp(-c*1i)*exp(b*x*1i)*(exp(a*4i)*exp(c*4i) - 2*exp(a*2i)*exp(c*2i) + 1))/2 - ((exp(a*2i)*exp(c*2i) - 1)^2*1i)/2)*(ex p(a*2i + c*2i) - 1)^2)/(4*b) - (exp(- a*2i - c*2i)*log(((exp(a*2i)*exp(c*2 i) - 1)^2*1i)/2 + (exp(-c*1i)*exp(b*x*1i)*(exp(a*4i)*exp(c*4i) - 2*exp(a*2 i)*exp(c*2i) + 1))/2)*(exp(a*2i + c*2i) - 1)^2)/(4*b)
\[ \int \cos ^2(a+b x) \sec (c-b x) \, dx=\int \cos \left (b x +a \right )^{2} \sec \left (b x -c \right )d x \] Input:
int(cos(b*x+a)^2*sec(b*x-c),x)
Output:
int(cos(a + b*x)**2*sec(b*x - c),x)