Integrand size = 15, antiderivative size = 36 \[ \int \sec (c+b x) \sin ^2(a+b x) \, dx=\frac {\text {arctanh}(\sin (c+b x)) \cos ^2(a-c)}{b}-\frac {\sin (2 a-c+b x)}{b} \] Output:
arctanh(sin(b*x+c))*cos(a-c)^2/b-sin(b*x+2*a-c)/b
Leaf count is larger than twice the leaf count of optimal. \(129\) vs. \(2(36)=72\).
Time = 0.11 (sec) , antiderivative size = 129, normalized size of antiderivative = 3.58 \[ \int \sec (c+b x) \sin ^2(a+b x) \, dx=\frac {(-1-\cos (2 a-2 c)) \log \left (\cos \left (\frac {c}{2}+\frac {b x}{2}\right )-\sin \left (\frac {c}{2}+\frac {b x}{2}\right )\right )}{2 b}+\frac {(1+\cos (2 a-2 c)) \log \left (\cos \left (\frac {c}{2}+\frac {b x}{2}\right )+\sin \left (\frac {c}{2}+\frac {b x}{2}\right )\right )}{2 b}-\frac {\cos (b x) \sin (2 a-c)}{b}-\frac {\cos (2 a-c) \sin (b x)}{b} \] Input:
Integrate[Sec[c + b*x]*Sin[a + b*x]^2,x]
Output:
((-1 - Cos[2*a - 2*c])*Log[Cos[c/2 + (b*x)/2] - Sin[c/2 + (b*x)/2]])/(2*b) + ((1 + Cos[2*a - 2*c])*Log[Cos[c/2 + (b*x)/2] + Sin[c/2 + (b*x)/2]])/(2* b) - (Cos[b*x]*Sin[2*a - c])/b - (Cos[2*a - c]*Sin[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 \sin ^2(a+b x) \sec (b x+c) \, dx\) |
\(\Big \downarrow \) 7299 |
\(\displaystyle \int \sin ^2(a+b x) \sec (b x+c)dx\) |
Input:
Int[Sec[c + b*x]*Sin[a + b*x]^2,x]
Output:
$Aborted
Result contains complex when optimal does not.
Time = 1.10 (sec) , antiderivative size = 146, normalized size of antiderivative = 4.06
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}\) | \(146\) |
default | \(\frac {\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 )}{\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 )}-\frac {8 \left (\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )\right )^{2} \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 (4 \cos \left (c \right )^{2} \sin \left (a \right )^{2}+4 \cos \left (a \right )^{2} \cos \left (c \right )^{2}+4 \sin \left (a \right )^{2} \sin \left (c \right )^{2}+4 \sin \left (c \right )^{2} \cos \left (a \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}}}}{b}\) | \(279\) |
Input:
int(sec(b*x+c)*sin(b*x+a)^2,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. 85 vs. \(2 (36) = 72\).
Time = 0.08 (sec) , antiderivative size = 85, normalized size of antiderivative = 2.36 \[ \int \sec (c+b x) \sin ^2(a+b x) \, dx=\frac {\cos \left (-a + c\right )^{2} \log \left (\sin \left (b x + c\right ) + 1\right ) - \cos \left (-a + c\right )^{2} \log \left (-\sin \left (b x + c\right ) + 1\right ) + 4 \, \cos \left (b x + c\right ) \cos \left (-a + c\right ) \sin \left (-a + c\right ) - 2 \, {\left (2 \, \cos \left (-a + c\right )^{2} - 1\right )} \sin \left (b x + c\right )}{2 \, b} \] Input:
integrate(sec(b*x+c)*sin(b*x+a)^2,x, algorithm="fricas")
Output:
1/2*(cos(-a + c)^2*log(sin(b*x + c) + 1) - cos(-a + c)^2*log(-sin(b*x + c) + 1) + 4*cos(b*x + c)*cos(-a + c)*sin(-a + c) - 2*(2*cos(-a + c)^2 - 1)*s in(b*x + c))/b
Leaf count of result is larger than twice the leaf count of optimal. 1581 vs. \(2 (27) = 54\).
Time = 18.89 (sec) , antiderivative size = 3645, normalized size of antiderivative = 101.25 \[ \int \sec (c+b x) \sin ^2(a+b x) \, dx=\text {Too large to display} \] Input:
integrate(sec(b*x+c)*sin(b*x+a)**2,x)
Output:
2*Piecewise((-sin(b*x)/b, Eq(c, pi/2)), (sin(b*x)/b, Eq(c, -pi/2)), (0, Eq (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*ta n(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*t...
Leaf count of result is larger than twice the leaf count of optimal. 140 vs. \(2 (36) = 72\).
Time = 0.19 (sec) , antiderivative size = 140, normalized size of antiderivative = 3.89 \[ \int \sec (c+b x) \sin ^2(a+b x) \, dx=-\frac {{\left (\cos \left (-2 \, a + 2 \, c\right ) + 1\right )} \log \left (\frac {\cos \left (b x + 2 \, c\right )^{2} + \cos \left (c\right )^{2} - 2 \, \cos \left (c\right ) \sin \left (b x + 2 \, c\right ) + \sin \left (b x + 2 \, c\right )^{2} + 2 \, \cos \left (b x + 2 \, c\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}}{\cos \left (b x + 2 \, c\right )^{2} + \cos \left (c\right )^{2} + 2 \, \cos \left (c\right ) \sin \left (b x + 2 \, c\right ) + \sin \left (b x + 2 \, c\right )^{2} - 2 \, \cos \left (b x + 2 \, c\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}}\right ) + 4 \, \sin \left (b x + 2 \, a - c\right )}{4 \, b} \] Input:
integrate(sec(b*x+c)*sin(b*x+a)^2,x, algorithm="maxima")
Output:
-1/4*((cos(-2*a + 2*c) + 1)*log((cos(b*x + 2*c)^2 + cos(c)^2 - 2*cos(c)*si n(b*x + 2*c) + sin(b*x + 2*c)^2 + 2*cos(b*x + 2*c)*sin(c) + sin(c)^2)/(cos (b*x + 2*c)^2 + cos(c)^2 + 2*cos(c)*sin(b*x + 2*c) + sin(b*x + 2*c)^2 - 2* cos(b*x + 2*c)*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. 961 vs. \(2 (36) = 72\).
Time = 0.14 (sec) , antiderivative size = 961, normalized size of antiderivative = 26.69 \[ \int \sec (c+b x) \sin ^2(a+b x) \, dx=\text {Too large to display} \] Input:
integrate(sec(b*x+c)*sin(b*x+a)^2,x, algorithm="giac")
Output:
((tan(1/2*a)^4*tan(1/2*c)^4 - 2*tan(1/2*a)^4*tan(1/2*c)^2 + 8*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)^4 - 8*tan(1/2*a)^ 3*tan(1/2*c) + 20*tan(1/2*a)^2*tan(1/2*c)^2 - 8*tan(1/2*a)*tan(1/2*c)^3 + tan(1/2*c)^4 - 2*tan(1/2*a)^2 + 8*tan(1/2*a)*tan(1/2*c) - 2*tan(1/2*c)^2 + 1)*log(abs(tan(1/2*b*x + 1/2*c) + 1))/(tan(1/2*a)^4*tan(1/2*c)^4 + 2*tan( 1/2*a)^4*tan(1/2*c)^2 + 2*tan(1/2*a)^2*tan(1/2*c)^4 + tan(1/2*a)^4 + 4*tan (1/2*a)^2*tan(1/2*c)^2 + tan(1/2*c)^4 + 2*tan(1/2*a)^2 + 2*tan(1/2*c)^2 + 1) - (tan(1/2*a)^4*tan(1/2*c)^4 - 2*tan(1/2*a)^4*tan(1/2*c)^2 + 8*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)^4 - 8*tan(1/2 *a)^3*tan(1/2*c) + 20*tan(1/2*a)^2*tan(1/2*c)^2 - 8*tan(1/2*a)*tan(1/2*c)^ 3 + tan(1/2*c)^4 - 2*tan(1/2*a)^2 + 8*tan(1/2*a)*tan(1/2*c) - 2*tan(1/2*c) ^2 + 1)*log(abs(tan(1/2*b*x + 1/2*c) - 1))/(tan(1/2*a)^4*tan(1/2*c)^4 + 2* tan(1/2*a)^4*tan(1/2*c)^2 + 2*tan(1/2*a)^2*tan(1/2*c)^4 + tan(1/2*a)^4 + 4 *tan(1/2*a)^2*tan(1/2*c)^2 + tan(1/2*c)^4 + 2*tan(1/2*a)^2 + 2*tan(1/2*c)^ 2 + 1) - 2*(tan(1/2*b*x + 1/2*c)*tan(1/2*a)^4*tan(1/2*c)^4 - 6*tan(1/2*b*x + 1/2*c)*tan(1/2*a)^4*tan(1/2*c)^2 + 16*tan(1/2*b*x + 1/2*c)*tan(1/2*a)^3 *tan(1/2*c)^3 + 4*tan(1/2*a)^4*tan(1/2*c)^3 - 6*tan(1/2*b*x + 1/2*c)*tan(1 /2*a)^2*tan(1/2*c)^4 - 4*tan(1/2*a)^3*tan(1/2*c)^4 + tan(1/2*b*x + 1/2*c)* tan(1/2*a)^4 - 16*tan(1/2*b*x + 1/2*c)*tan(1/2*a)^3*tan(1/2*c) - 4*tan(1/2 *a)^4*tan(1/2*c) + 36*tan(1/2*b*x + 1/2*c)*tan(1/2*a)^2*tan(1/2*c)^2 + ...
Time = 18.79 (sec) , antiderivative size = 217, normalized size of antiderivative = 6.03 \[ \int \sec (c+b x) \sin ^2(a+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 (2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+{\mathrm {e}}^{a\,4{}\mathrm {i}}\,{\mathrm {e}}^{-c\,4{}\mathrm {i}}+1\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 (2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+{\mathrm {e}}^{a\,4{}\mathrm {i}}\,{\mathrm {e}}^{-c\,4{}\mathrm {i}}+1\right )}{2}\right )\,{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}-c\,2{}\mathrm {i}}+1\right )}^2}{4\,b} \] Input:
int(sin(a + b*x)^2/cos(c + b*x),x)
Output:
(exp(a*2i - c*1i + b*x*1i)*1i)/(2*b) - (exp(c*1i - a*2i - b*x*1i)*1i)/(2*b ) + (exp(c*2i - a*2i)*log(- ((exp(a*2i)*exp(-c*2i) + 1)^2*1i)/2 - (exp(c*1 i)*exp(b*x*1i)*(2*exp(a*2i)*exp(-c*2i) + exp(a*4i)*exp(-c*4i) + 1))/2)*(ex p(a*2i - c*2i) + 1)^2)/(4*b) - (exp(c*2i - a*2i)*log(((exp(a*2i)*exp(-c*2i ) + 1)^2*1i)/2 - (exp(c*1i)*exp(b*x*1i)*(2*exp(a*2i)*exp(-c*2i) + exp(a*4i )*exp(-c*4i) + 1))/2)*(exp(a*2i - c*2i) + 1)^2)/(4*b)
\[ \int \sec (c+b x) \sin ^2(a+b x) \, dx=\int \sec \left (b x +c \right ) \sin \left (b x +a \right )^{2}d x \] Input:
int(sec(b*x+c)*sin(b*x+a)^2,x)
Output:
int(sec(b*x + c)*sin(a + b*x)**2,x)