Integrand size = 13, antiderivative size = 39 \[ \int \tan (a+b x) \tan (c+b x) \, dx=-x-\frac {\cot (a-c) \log (\cos (a+b x))}{b}+\frac {\cot (a-c) \log (\cos (c+b x))}{b} \]
Time = 0.41 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.79 \[ \int \tan (a+b x) \tan (c+b x) \, dx=-x+\frac {\cot (a-c) (-\log (\cos (a+b x))+\log (\cos (c+b x)))}{b} \]
Time = 0.29 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.21, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {5123, 5121, 3042, 3956}
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 \tan (a+b x) \tan (b x+c) \, dx\) |
\(\Big \downarrow \) 5123 |
\(\displaystyle \cos (a-c) \int \sec (a+b x) \sec (c+b x)dx-x\) |
\(\Big \downarrow \) 5121 |
\(\displaystyle \cos (a-c) (\csc (a-c) \int \tan (a+b x)dx-\csc (a-c) \int \tan (c+b x)dx)-x\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \cos (a-c) (\csc (a-c) \int \tan (a+b x)dx-\csc (a-c) \int \tan (c+b x)dx)-x\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \cos (a-c) \left (\frac {\csc (a-c) \log (\cos (b x+c))}{b}-\frac {\csc (a-c) \log (\cos (a+b x))}{b}\right )-x\) |
3.2.39.3.1 Defintions of rubi rules used
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[Sec[(a_.) + (b_.)*(x_)]*Sec[(c_) + (d_.)*(x_)], x_Symbol] :> Simp[-Csc[ (b*c - a*d)/d] Int[Tan[a + b*x], x], x] + Simp[Csc[(b*c - a*d)/b] Int[T an[c + d*x], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0] && NeQ[b *c - a*d, 0]
Int[Tan[(a_.) + (b_.)*(x_)]*Tan[(c_) + (d_.)*(x_)], x_Symbol] :> Simp[(-b)* (x/d), x] + Simp[(b/d)*Cos[(b*c - a*d)/d] Int[Sec[a + b*x]*Sec[c + d*x], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0] && NeQ[b*c - a*d, 0]
Result contains complex when optimal does not.
Time = 0.36 (sec) , antiderivative size = 173, normalized size of antiderivative = 4.44
method | result | size |
risch | \(-x +\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+{\mathrm e}^{2 i \left (a -c \right )}\right ) {\mathrm e}^{2 i a}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}+\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+{\mathrm e}^{2 i \left (a -c \right )}\right ) {\mathrm e}^{2 i c}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}-\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) {\mathrm e}^{2 i a}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}-\frac {i \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) {\mathrm e}^{2 i c}}{b \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right )}\) | \(173\) |
-x+I/b/(exp(2*I*a)-exp(2*I*c))*ln(exp(2*I*(b*x+a))+exp(2*I*(a-c)))*exp(2*I *a)+I/b/(exp(2*I*a)-exp(2*I*c))*ln(exp(2*I*(b*x+a))+exp(2*I*(a-c)))*exp(2* I*c)-I/b/(exp(2*I*a)-exp(2*I*c))*ln(exp(2*I*(b*x+a))+1)*exp(2*I*a)-I/b/(ex p(2*I*a)-exp(2*I*c))*ln(exp(2*I*(b*x+a))+1)*exp(2*I*c)
Leaf count of result is larger than twice the leaf count of optimal. 145 vs. \(2 (39) = 78\).
Time = 0.25 (sec) , antiderivative size = 145, normalized size of antiderivative = 3.72 \[ \int \tan (a+b x) \tan (c+b x) \, dx=-\frac {2 \, b x \sin \left (-2 \, a + 2 \, c\right ) - {\left (\cos \left (-2 \, a + 2 \, c\right ) + 1\right )} \log \left (-\frac {{\left (\cos \left (-2 \, a + 2 \, c\right ) - 1\right )} \tan \left (b x + c\right )^{2} - 2 \, \sin \left (-2 \, a + 2 \, c\right ) \tan \left (b x + c\right ) - \cos \left (-2 \, a + 2 \, c\right ) - 1}{{\left (\cos \left (-2 \, a + 2 \, c\right ) + 1\right )} \tan \left (b x + c\right )^{2} + \cos \left (-2 \, a + 2 \, c\right ) + 1}\right ) + {\left (\cos \left (-2 \, a + 2 \, c\right ) + 1\right )} \log \left (\frac {1}{\tan \left (b x + c\right )^{2} + 1}\right )}{2 \, b \sin \left (-2 \, a + 2 \, c\right )} \]
-1/2*(2*b*x*sin(-2*a + 2*c) - (cos(-2*a + 2*c) + 1)*log(-((cos(-2*a + 2*c) - 1)*tan(b*x + c)^2 - 2*sin(-2*a + 2*c)*tan(b*x + c) - cos(-2*a + 2*c) - 1)/((cos(-2*a + 2*c) + 1)*tan(b*x + c)^2 + cos(-2*a + 2*c) + 1)) + (cos(-2 *a + 2*c) + 1)*log(1/(tan(b*x + c)^2 + 1)))/(b*sin(-2*a + 2*c))
Leaf count of result is larger than twice the leaf count of optimal. 2020 vs. \(2 (31) = 62\).
Time = 2.88 (sec) , antiderivative size = 7672, normalized size of antiderivative = 196.72 \[ \int \tan (a+b x) \tan (c+b x) \, dx=\text {Too large to display} \]
Piecewise((0, Eq(a, 0) & Eq(b, 0) & Eq(c, 0)), (-2*b*x*tan(c)/(2*b*tan(c)* *2 + 2*b) - 2*log(tan(b*x) - 1/tan(c))/(2*b*tan(c)**2 + 2*b) + log(tan(b*x )**2 + 1)/(2*b*tan(c)**2 + 2*b), Eq(a, 0)), (-2*b*x*tan(a)/(2*b*tan(a)**2 + 2*b) - 2*log(tan(b*x) - 1/tan(a))/(2*b*tan(a)**2 + 2*b) + log(tan(b*x)** 2 + 1)/(2*b*tan(a)**2 + 2*b), Eq(c, 0)), (-4*b*x*tan(c)**2*tan(b*x)/(2*b*t an(c)**5*tan(b*x) - 2*b*tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2*b*tan(c)*tan(b*x) - 2*b) + 4*b*x*tan(c)/(2*b*tan(c)**5*tan(b*x) - 2*b *tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2*b*tan(c)*tan(b*x) - 2*b) + 2*log(tan(b*x) - 1/tan(c))*tan(c)**3*tan(b*x)/(2*b*tan(c)**5*tan( b*x) - 2*b*tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2*b*tan(c) *tan(b*x) - 2*b) - 2*log(tan(b*x) - 1/tan(c))*tan(c)**2/(2*b*tan(c)**5*tan (b*x) - 2*b*tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2*b*tan(c )*tan(b*x) - 2*b) - 2*log(tan(b*x) - 1/tan(c))*tan(c)*tan(b*x)/(2*b*tan(c) **5*tan(b*x) - 2*b*tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2* b*tan(c)*tan(b*x) - 2*b) + 2*log(tan(b*x) - 1/tan(c))/(2*b*tan(c)**5*tan(b *x) - 2*b*tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2*b*tan(c)* tan(b*x) - 2*b) - log(tan(b*x)**2 + 1)*tan(c)**3*tan(b*x)/(2*b*tan(c)**5*t an(b*x) - 2*b*tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2*b*tan (c)*tan(b*x) - 2*b) + log(tan(b*x)**2 + 1)*tan(c)**2/(2*b*tan(c)**5*tan(b* x) - 2*b*tan(c)**4 + 4*b*tan(c)**3*tan(b*x) - 4*b*tan(c)**2 + 2*b*tan(c...
Leaf count of result is larger than twice the leaf count of optimal. 371 vs. \(2 (39) = 78\).
Time = 0.22 (sec) , antiderivative size = 371, normalized size of antiderivative = 9.51 \[ \int \tan (a+b x) \tan (c+b x) \, dx=-\frac {{\left (2 \, b \cos \left (2 \, a\right ) \cos \left (2 \, c\right ) - b \cos \left (2 \, c\right )^{2} + 2 \, b \sin \left (2 \, a\right ) \sin \left (2 \, c\right ) - b \sin \left (2 \, c\right )^{2} - {\left (\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2}\right )} b\right )} x + {\left (\cos \left (2 \, a\right )^{2} - \cos \left (2 \, c\right )^{2} + \sin \left (2 \, a\right )^{2} - \sin \left (2 \, c\right )^{2}\right )} \arctan \left (\sin \left (2 \, b x\right ) - \sin \left (2 \, a\right ), \cos \left (2 \, b x\right ) + \cos \left (2 \, a\right )\right ) - {\left (\cos \left (2 \, a\right )^{2} - \cos \left (2 \, c\right )^{2} + \sin \left (2 \, a\right )^{2} - \sin \left (2 \, c\right )^{2}\right )} \arctan \left (\sin \left (2 \, b x\right ) - \sin \left (2 \, c\right ), \cos \left (2 \, b x\right ) + \cos \left (2 \, c\right )\right ) - {\left (\cos \left (2 \, c\right ) \sin \left (2 \, a\right ) - \cos \left (2 \, a\right ) \sin \left (2 \, c\right )\right )} \log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, a\right ) + \cos \left (2 \, a\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, a\right ) + \sin \left (2 \, a\right )^{2}\right ) + {\left (\cos \left (2 \, c\right ) \sin \left (2 \, a\right ) - \cos \left (2 \, a\right ) \sin \left (2 \, c\right )\right )} \log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, c\right ) + \cos \left (2 \, c\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, c\right ) + \sin \left (2 \, c\right )^{2}\right )}{2 \, b \cos \left (2 \, a\right ) \cos \left (2 \, c\right ) - b \cos \left (2 \, c\right )^{2} + 2 \, b \sin \left (2 \, a\right ) \sin \left (2 \, c\right ) - b \sin \left (2 \, c\right )^{2} - {\left (\cos \left (2 \, a\right )^{2} + \sin \left (2 \, a\right )^{2}\right )} b} \]
-((2*b*cos(2*a)*cos(2*c) - b*cos(2*c)^2 + 2*b*sin(2*a)*sin(2*c) - b*sin(2* c)^2 - (cos(2*a)^2 + sin(2*a)^2)*b)*x + (cos(2*a)^2 - cos(2*c)^2 + sin(2*a )^2 - sin(2*c)^2)*arctan2(sin(2*b*x) - sin(2*a), cos(2*b*x) + cos(2*a)) - (cos(2*a)^2 - cos(2*c)^2 + sin(2*a)^2 - sin(2*c)^2)*arctan2(sin(2*b*x) - s in(2*c), cos(2*b*x) + cos(2*c)) - (cos(2*c)*sin(2*a) - cos(2*a)*sin(2*c))* log(cos(2*b*x)^2 + 2*cos(2*b*x)*cos(2*a) + cos(2*a)^2 + sin(2*b*x)^2 - 2*s in(2*b*x)*sin(2*a) + sin(2*a)^2) + (cos(2*c)*sin(2*a) - cos(2*a)*sin(2*c)) *log(cos(2*b*x)^2 + 2*cos(2*b*x)*cos(2*c) + cos(2*c)^2 + sin(2*b*x)^2 - 2* sin(2*b*x)*sin(2*c) + sin(2*c)^2))/(2*b*cos(2*a)*cos(2*c) - b*cos(2*c)^2 + 2*b*sin(2*a)*sin(2*c) - b*sin(2*c)^2 - (cos(2*a)^2 + sin(2*a)^2)*b)
Leaf count of result is larger than twice the leaf count of optimal. 242 vs. \(2 (39) = 78\).
Time = 0.29 (sec) , antiderivative size = 242, normalized size of antiderivative = 6.21 \[ \int \tan (a+b x) \tan (c+b x) \, dx=-\frac {2 \, b x + \frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right )^{3} + 4 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )\right )} \log \left ({\left | 2 \, \tan \left (b x\right ) \tan \left (\frac {1}{2} \, a\right ) + \tan \left (\frac {1}{2} \, a\right )^{2} - 1 \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )} - \frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, c\right )\right )} \log \left ({\left | 2 \, \tan \left (b x\right ) \tan \left (\frac {1}{2} \, c\right ) + \tan \left (\frac {1}{2} \, c\right )^{2} - 1 \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, c\right )^{2}}}{2 \, b} \]
-1/2*(2*b*x + (tan(1/2*a)^3*tan(1/2*c)^2 - tan(1/2*a)^3 + 4*tan(1/2*a)^2*t an(1/2*c) - tan(1/2*a)*tan(1/2*c)^2 + tan(1/2*a))*log(abs(2*tan(b*x)*tan(1 /2*a) + tan(1/2*a)^2 - 1))/(tan(1/2*a)^3*tan(1/2*c) - tan(1/2*a)^2*tan(1/2 *c)^2 + tan(1/2*a)^2 - tan(1/2*a)*tan(1/2*c)) - (tan(1/2*a)^2*tan(1/2*c)^3 - tan(1/2*a)^2*tan(1/2*c) + 4*tan(1/2*a)*tan(1/2*c)^2 - tan(1/2*c)^3 + ta n(1/2*c))*log(abs(2*tan(b*x)*tan(1/2*c) + tan(1/2*c)^2 - 1))/(tan(1/2*a)^2 *tan(1/2*c)^2 - tan(1/2*a)*tan(1/2*c)^3 + tan(1/2*a)*tan(1/2*c) - tan(1/2* c)^2))/b
Time = 31.89 (sec) , antiderivative size = 207, normalized size of antiderivative = 5.31 \[ \int \tan (a+b x) \tan (c+b x) \, dx=-\frac {\frac {x}{2}+x\,\left ({\sin \left (a-c\right )}^2-\frac {1}{2}\right )}{{\sin \left (a-c\right )}^2}-\frac {\frac {\sin \left (2\,a-2\,c\right )\,\ln \left ({\sin \left (2\,a-2\,c\right )}^2\,2{}\mathrm {i}-{\sin \left (a+b\,x\right )}^2\,2{}\mathrm {i}+{\sin \left (3\,a-2\,c+b\,x\right )}^2\,2{}\mathrm {i}+\sin \left (4\,a-4\,c\right )+\sin \left (6\,a-4\,c+2\,b\,x\right )-\sin \left (2\,a+2\,b\,x\right )\right )}{2}-\frac {\sin \left (2\,a-2\,c\right )\,\ln \left ({\sin \left (2\,a-2\,c\right )}^2\,2{}\mathrm {i}-{\sin \left (c+b\,x\right )}^2\,2{}\mathrm {i}+{\sin \left (2\,a-c+b\,x\right )}^2\,2{}\mathrm {i}+\sin \left (4\,a-4\,c\right )+\sin \left (4\,a-2\,c+2\,b\,x\right )-\sin \left (2\,c+2\,b\,x\right )\right )}{2}}{b\,{\sin \left (a-c\right )}^2} \]
- (x/2 + x*(sin(a - c)^2 - 1/2))/sin(a - c)^2 - ((sin(2*a - 2*c)*log(sin(4 *a - 4*c) + sin(6*a - 4*c + 2*b*x) - sin(2*a + 2*b*x) + sin(2*a - 2*c)^2*2 i - sin(a + b*x)^2*2i + sin(3*a - 2*c + b*x)^2*2i))/2 - (sin(2*a - 2*c)*lo g(sin(4*a - 4*c) + sin(4*a - 2*c + 2*b*x) - sin(2*c + 2*b*x) + sin(2*a - 2 *c)^2*2i - sin(c + b*x)^2*2i + sin(2*a - c + b*x)^2*2i))/2)/(b*sin(a - c)^ 2)