Integrand size = 19, antiderivative size = 45 \[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=-a x-\frac {b \text {arctanh}(\sin (c+d x))}{2 d}+\frac {(2 a+b \sec (c+d x)) \tan (c+d x)}{2 d} \] Output:
-a*x-1/2*b*arctanh(sin(d*x+c))/d+1/2*(2*a+b*sec(d*x+c))*tan(d*x+c)/d
Time = 0.01 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.33 \[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=-\frac {a \arctan (\tan (c+d x))}{d}-\frac {b \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a \tan (c+d x)}{d}+\frac {b \sec (c+d x) \tan (c+d x)}{2 d} \] Input:
Integrate[(a + b*Sec[c + d*x])*Tan[c + d*x]^2,x]
Output:
-((a*ArcTan[Tan[c + d*x]])/d) - (b*ArcTanh[Sin[c + d*x]])/(2*d) + (a*Tan[c + d*x])/d + (b*Sec[c + d*x]*Tan[c + d*x])/(2*d)
Time = 0.24 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.07, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 4369, 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 \tan ^2(c+d x) (a+b \sec (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cot \left (c+d x+\frac {\pi }{2}\right )^2 \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx\) |
\(\Big \downarrow \) 4369 |
\(\displaystyle \frac {\tan (c+d x) (2 a+b \sec (c+d x))}{2 d}-\frac {1}{2} \int (2 a+b \sec (c+d x))dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{2} \left (-2 a x-\frac {b \text {arctanh}(\sin (c+d x))}{d}\right )+\frac {\tan (c+d x) (2 a+b \sec (c+d x))}{2 d}\) |
Input:
Int[(a + b*Sec[c + d*x])*Tan[c + d*x]^2,x]
Output:
(-2*a*x - (b*ArcTanh[Sin[c + d*x]])/d)/2 + ((2*a + b*Sec[c + d*x])*Tan[c + d*x])/(2*d)
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( a_)), x_Symbol] :> Simp[(-e)*(e*Cot[c + d*x])^(m - 1)*((a*m + b*(m - 1)*Csc [c + d*x])/(d*m*(m - 1))), x] - Simp[e^2/m Int[(e*Cot[c + d*x])^(m - 2)*( a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m , 1]
Time = 0.22 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.49
method | result | size |
derivativedivides | \(\frac {a \left (\tan \left (d x +c \right )-d x -c \right )+b \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(67\) |
default | \(\frac {a \left (\tan \left (d x +c \right )-d x -c \right )+b \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(67\) |
parts | \(\frac {a \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {b \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(71\) |
risch | \(-a x -\frac {i \left (b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 a \,{\mathrm e}^{2 i \left (d x +c \right )}-b \,{\mathrm e}^{i \left (d x +c \right )}-2 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}\) | \(102\) |
Input:
int((a+b*sec(d*x+c))*tan(d*x+c)^2,x,method=_RETURNVERBOSE)
Output:
1/d*(a*(tan(d*x+c)-d*x-c)+b*(1/2*sin(d*x+c)^3/cos(d*x+c)^2+1/2*sin(d*x+c)- 1/2*ln(sec(d*x+c)+tan(d*x+c))))
Leaf count of result is larger than twice the leaf count of optimal. 87 vs. \(2 (41) = 82\).
Time = 0.12 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.93 \[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=-\frac {4 \, a d x \cos \left (d x + c\right )^{2} + b \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - b \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \] Input:
integrate((a+b*sec(d*x+c))*tan(d*x+c)^2,x, algorithm="fricas")
Output:
-1/4*(4*a*d*x*cos(d*x + c)^2 + b*cos(d*x + c)^2*log(sin(d*x + c) + 1) - b* cos(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*(2*a*cos(d*x + c) + b)*sin(d*x + c))/(d*cos(d*x + c)^2)
\[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right ) \tan ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate((a+b*sec(d*x+c))*tan(d*x+c)**2,x)
Output:
Integral((a + b*sec(c + d*x))*tan(c + d*x)**2, x)
Time = 0.11 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.44 \[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=-\frac {4 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a + b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \] Input:
integrate((a+b*sec(d*x+c))*tan(d*x+c)^2,x, algorithm="maxima")
Output:
-1/4*(4*(d*x + c - tan(d*x + c))*a + b*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1 ) + log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)))/d
Leaf count of result is larger than twice the leaf count of optimal. 115 vs. \(2 (41) = 82\).
Time = 0.23 (sec) , antiderivative size = 115, normalized size of antiderivative = 2.56 \[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=-\frac {2 \, {\left (d x + c\right )} a + b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \] Input:
integrate((a+b*sec(d*x+c))*tan(d*x+c)^2,x, algorithm="giac")
Output:
-1/2*(2*(d*x + c)*a + b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - b*log(abs(tan (1/2*d*x + 1/2*c) - 1)) + 2*(2*a*tan(1/2*d*x + 1/2*c)^3 - b*tan(1/2*d*x + 1/2*c)^3 - 2*a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d
Time = 10.72 (sec) , antiderivative size = 96, normalized size of antiderivative = 2.13 \[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=\frac {a\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}-\frac {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}-\frac {2\,a\,\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 {b\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2} \] Input:
int(tan(c + d*x)^2*(a + b/cos(c + d*x)),x)
Output:
(a*sin(c + d*x))/(d*cos(c + d*x)) - (b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d - (2*a*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (b*si n(c + d*x))/(2*d*cos(c + d*x)^2)
Time = 0.16 (sec) , antiderivative size = 145, normalized size of antiderivative = 3.22 \[ \int (a+b \sec (c+d x)) \tan ^2(c+d x) \, dx=\frac {\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2} b -\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b -\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2} b +\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b +2 \sin \left (d x +c \right )^{2} \tan \left (d x +c \right ) a -2 \sin \left (d x +c \right )^{2} a d x -\sin \left (d x +c \right ) b -2 \tan \left (d x +c \right ) a +2 a d x}{2 d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:
int((a+b*sec(d*x+c))*tan(d*x+c)^2,x)
Output:
(log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2*b - log(tan((c + d*x)/2) - 1)*b - log(tan((c + d*x)/2) + 1)*sin(c + d*x)**2*b + log(tan((c + d*x)/2) + 1) *b + 2*sin(c + d*x)**2*tan(c + d*x)*a - 2*sin(c + d*x)**2*a*d*x - sin(c + d*x)*b - 2*tan(c + d*x)*a + 2*a*d*x)/(2*d*(sin(c + d*x)**2 - 1))