Integrand size = 21, antiderivative size = 63 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=-\left (\left (a^2-b^2\right ) x\right )+\frac {2 a b \log (\cos (c+d x))}{d}-\frac {b^2 \tan (c+d x)}{d}+\frac {(a+b \tan (c+d x))^3}{3 b d} \] Output:
-(a^2-b^2)*x+2*a*b*ln(cos(d*x+c))/d-b^2*tan(d*x+c)/d+1/3*(a+b*tan(d*x+c))^ 3/b/d
Time = 0.22 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.57 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {a^2 \arctan (\tan (c+d x))}{d}+\frac {b^2 \arctan (\tan (c+d x))}{d}+\frac {a b \left (2 \log (\cos (c+d x))+\sec ^2(c+d x)\right )}{d}+\frac {a^2 \tan (c+d x)}{d}-\frac {b^2 \tan (c+d x)}{d}+\frac {b^2 \tan ^3(c+d x)}{3 d} \] Input:
Integrate[Tan[c + d*x]^2*(a + b*Tan[c + d*x])^2,x]
Output:
-((a^2*ArcTan[Tan[c + d*x]])/d) + (b^2*ArcTan[Tan[c + d*x]])/d + (a*b*(2*L og[Cos[c + d*x]] + Sec[c + d*x]^2))/d + (a^2*Tan[c + d*x])/d - (b^2*Tan[c + d*x])/d + (b^2*Tan[c + d*x]^3)/(3*d)
Time = 0.37 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4026, 25, 3042, 3958, 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 ^2(c+d x) (a+b \tan (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^2 (a+b \tan (c+d x))^2dx\) |
\(\Big \downarrow \) 4026 |
\(\displaystyle \int -(a+b \tan (c+d x))^2dx+\frac {(a+b \tan (c+d x))^3}{3 b d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {(a+b \tan (c+d x))^3}{3 b d}-\int (a+b \tan (c+d x))^2dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(a+b \tan (c+d x))^3}{3 b d}-\int (a+b \tan (c+d x))^2dx\) |
\(\Big \downarrow \) 3958 |
\(\displaystyle -2 a b \int \tan (c+d x)dx-x \left (a^2-b^2\right )+\frac {(a+b \tan (c+d x))^3}{3 b d}-\frac {b^2 \tan (c+d x)}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -2 a b \int \tan (c+d x)dx-x \left (a^2-b^2\right )+\frac {(a+b \tan (c+d x))^3}{3 b d}-\frac {b^2 \tan (c+d x)}{d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle -x \left (a^2-b^2\right )+\frac {(a+b \tan (c+d x))^3}{3 b d}+\frac {2 a b \log (\cos (c+d x))}{d}-\frac {b^2 \tan (c+d x)}{d}\) |
Input:
Int[Tan[c + d*x]^2*(a + b*Tan[c + d*x])^2,x]
Output:
-((a^2 - b^2)*x) + (2*a*b*Log[Cos[c + d*x]])/d - (b^2*Tan[c + d*x])/d + (a + b*Tan[c + d*x])^3/(3*b*d)
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(a^2 - b^2) *x, x] + (Simp[b^2*(Tan[c + d*x]/d), x] + Simp[2*a*b Int[Tan[c + d*x], x] , x]) /; FreeQ[{a, b, c, d}, x]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[d^2*((a + b*Tan[e + f*x])^(m + 1)/(b*f*( m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Simp[c^2 - d^2 + 2*c*d*Tan[e + f* x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && !LeQ [m, -1] && !(EqQ[m, 2] && EqQ[a, 0])
Time = 0.43 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.27
method | result | size |
norman | \(\left (-a^{2}+b^{2}\right ) x +\frac {\left (a^{2}-b^{2}\right ) \tan \left (d x +c \right )}{d}+\frac {a b \tan \left (d x +c \right )^{2}}{d}+\frac {b^{2} \tan \left (d x +c \right )^{3}}{3 d}-\frac {a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d}\) | \(80\) |
derivativedivides | \(\frac {\frac {b^{2} \tan \left (d x +c \right )^{3}}{3}+a b \tan \left (d x +c \right )^{2}+a^{2} \tan \left (d x +c \right )-b^{2} \tan \left (d x +c \right )-a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\left (-a^{2}+b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(83\) |
default | \(\frac {\frac {b^{2} \tan \left (d x +c \right )^{3}}{3}+a b \tan \left (d x +c \right )^{2}+a^{2} \tan \left (d x +c \right )-b^{2} \tan \left (d x +c \right )-a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )+\left (-a^{2}+b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(83\) |
parallelrisch | \(-\frac {-b^{2} \tan \left (d x +c \right )^{3}+3 a^{2} x d -3 b^{2} d x -3 a b \tan \left (d x +c \right )^{2}+3 a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )-3 a^{2} \tan \left (d x +c \right )+3 b^{2} \tan \left (d x +c \right )}{3 d}\) | \(83\) |
parts | \(\frac {a^{2} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {b^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {a b \tan \left (d x +c \right )^{2}}{d}-\frac {a b \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d}\) | \(90\) |
risch | \(-2 i a b x -a^{2} x +b^{2} x -\frac {4 i a b c}{d}+\frac {2 i \left (-6 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}+3 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+3 a^{2}-4 b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(161\) |
Input:
int(tan(d*x+c)^2*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
(-a^2+b^2)*x+(a^2-b^2)*tan(d*x+c)/d+a*b*tan(d*x+c)^2/d+1/3*b^2/d*tan(d*x+c )^3-a*b/d*ln(1+tan(d*x+c)^2)
Time = 0.09 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.22 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b^{2} \tan \left (d x + c\right )^{3} + 3 \, a b \tan \left (d x + c\right )^{2} - 3 \, {\left (a^{2} - b^{2}\right )} d x + 3 \, a b \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 3 \, {\left (a^{2} - b^{2}\right )} \tan \left (d x + c\right )}{3 \, d} \] Input:
integrate(tan(d*x+c)^2*(a+b*tan(d*x+c))^2,x, algorithm="fricas")
Output:
1/3*(b^2*tan(d*x + c)^3 + 3*a*b*tan(d*x + c)^2 - 3*(a^2 - b^2)*d*x + 3*a*b *log(1/(tan(d*x + c)^2 + 1)) + 3*(a^2 - b^2)*tan(d*x + c))/d
Time = 0.12 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.49 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=\begin {cases} - a^{2} x + \frac {a^{2} \tan {\left (c + d x \right )}}{d} - \frac {a b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {a b \tan ^{2}{\left (c + d x \right )}}{d} + b^{2} x + \frac {b^{2} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{2} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right )^{2} \tan ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \] Input:
integrate(tan(d*x+c)**2*(a+b*tan(d*x+c))**2,x)
Output:
Piecewise((-a**2*x + a**2*tan(c + d*x)/d - a*b*log(tan(c + d*x)**2 + 1)/d + a*b*tan(c + d*x)**2/d + b**2*x + b**2*tan(c + d*x)**3/(3*d) - b**2*tan(c + d*x)/d, Ne(d, 0)), (x*(a + b*tan(c))**2*tan(c)**2, True))
Time = 0.10 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.24 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b^{2} \tan \left (d x + c\right )^{3} + 3 \, a b \tan \left (d x + c\right )^{2} - 3 \, a b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 3 \, {\left (a^{2} - b^{2}\right )} {\left (d x + c\right )} + 3 \, {\left (a^{2} - b^{2}\right )} \tan \left (d x + c\right )}{3 \, d} \] Input:
integrate(tan(d*x+c)^2*(a+b*tan(d*x+c))^2,x, algorithm="maxima")
Output:
1/3*(b^2*tan(d*x + c)^3 + 3*a*b*tan(d*x + c)^2 - 3*a*b*log(tan(d*x + c)^2 + 1) - 3*(a^2 - b^2)*(d*x + c) + 3*(a^2 - b^2)*tan(d*x + c))/d
Time = 0.22 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.62 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {a b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{d} - \frac {{\left (a^{2} - b^{2}\right )} {\left (d x + c\right )}}{d} + \frac {b^{2} d^{2} \tan \left (d x + c\right )^{3} + 3 \, a b d^{2} \tan \left (d x + c\right )^{2} + 3 \, a^{2} d^{2} \tan \left (d x + c\right ) - 3 \, b^{2} d^{2} \tan \left (d x + c\right )}{3 \, d^{3}} \] Input:
integrate(tan(d*x+c)^2*(a+b*tan(d*x+c))^2,x, algorithm="giac")
Output:
-a*b*log(tan(d*x + c)^2 + 1)/d - (a^2 - b^2)*(d*x + c)/d + 1/3*(b^2*d^2*ta n(d*x + c)^3 + 3*a*b*d^2*tan(d*x + c)^2 + 3*a^2*d^2*tan(d*x + c) - 3*b^2*d ^2*tan(d*x + c))/d^3
Time = 1.02 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.71 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (a^2-b^2\right )}{d}-\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (a+b\right )\,\left (a-b\right )}{a^2-b^2}\right )\,\left (a+b\right )\,\left (a-b\right )}{d}-\frac {a\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{d}+\frac {a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d} \] Input:
int(tan(c + d*x)^2*(a + b*tan(c + d*x))^2,x)
Output:
(b^2*tan(c + d*x)^3)/(3*d) + (tan(c + d*x)*(a^2 - b^2))/d - (atan((tan(c + d*x)*(a + b)*(a - b))/(a^2 - b^2))*(a + b)*(a - b))/d - (a*b*log(tan(c + d*x)^2 + 1))/d + (a*b*tan(c + d*x)^2)/d
Time = 0.20 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.29 \[ \int \tan ^2(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {-3 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) a b +\tan \left (d x +c \right )^{3} b^{2}+3 \tan \left (d x +c \right )^{2} a b +3 \tan \left (d x +c \right ) a^{2}-3 \tan \left (d x +c \right ) b^{2}-3 a^{2} d x +3 b^{2} d x}{3 d} \] Input:
int(tan(d*x+c)^2*(a+b*tan(d*x+c))^2,x)
Output:
( - 3*log(tan(c + d*x)**2 + 1)*a*b + tan(c + d*x)**3*b**2 + 3*tan(c + d*x) **2*a*b + 3*tan(c + d*x)*a**2 - 3*tan(c + d*x)*b**2 - 3*a**2*d*x + 3*b**2* d*x)/(3*d)