Integrand size = 14, antiderivative size = 50 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx=\frac {x}{a-b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b) d} \] Output:
x/(a-b)-b^(1/2)*arctan(b^(1/2)*tan(d*x+c)/a^(1/2))/a^(1/2)/(a-b)/d
Time = 0.06 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.98 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx=\frac {\arctan (\tan (c+d x))-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a}}\right )}{\sqrt {a}}}{a d-b d} \] Input:
Integrate[(a + b*Tan[c + d*x]^2)^(-1),x]
Output:
(ArcTan[Tan[c + d*x]] - (Sqrt[b]*ArcTan[(Sqrt[b]*Tan[c + d*x])/Sqrt[a]])/S qrt[a])/(a*d - b*d)
Time = 0.50 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3042, 4143, 3042, 4158, 218}
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 \frac {1}{a+b \tan ^2(c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{a+b \tan (c+d x)^2}dx\) |
\(\Big \downarrow \) 4143 |
\(\displaystyle \frac {x}{a-b}-\frac {b \int \frac {\sec ^2(c+d x)}{b \tan ^2(c+d x)+a}dx}{a-b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x}{a-b}-\frac {b \int \frac {\sec (c+d x)^2}{b \tan (c+d x)^2+a}dx}{a-b}\) |
\(\Big \downarrow \) 4158 |
\(\displaystyle \frac {x}{a-b}-\frac {b \int \frac {1}{b \tan ^2(c+d x)+a}d\tan (c+d x)}{d (a-b)}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {x}{a-b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} d (a-b)}\) |
Input:
Int[(a + b*Tan[c + d*x]^2)^(-1),x]
Output:
x/(a - b) - (Sqrt[b]*ArcTan[(Sqrt[b]*Tan[c + d*x])/Sqrt[a]])/(Sqrt[a]*(a - b)*d)
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> Simp[x/(a - b), x] - Simp[b/(a - b) Int[Sec[e + f*x]^2/(a + b*Tan[e + f*x]^2), x], x ] /; FreeQ[{a, b, e, f}, x] && NeQ[a, b]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ )])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim p[ff/(c^(m - 1)*f) Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)^n)^ p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && I ntegerQ[m/2] && (IntegersQ[n, p] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])
Time = 0.71 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00
method | result | size |
derivativedivides | \(\frac {\frac {\arctan \left (\tan \left (d x +c \right )\right )}{a -b}-\frac {b \arctan \left (\frac {b \tan \left (d x +c \right )}{\sqrt {a b}}\right )}{\left (a -b \right ) \sqrt {a b}}}{d}\) | \(50\) |
default | \(\frac {\frac {\arctan \left (\tan \left (d x +c \right )\right )}{a -b}-\frac {b \arctan \left (\frac {b \tan \left (d x +c \right )}{\sqrt {a b}}\right )}{\left (a -b \right ) \sqrt {a b}}}{d}\) | \(50\) |
risch | \(\frac {x}{a -b}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{2 a \left (a -b \right ) d}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{2 a \left (a -b \right ) d}\) | \(120\) |
Input:
int(1/(a+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)
Output:
1/d*(1/(a-b)*arctan(tan(d*x+c))-b/(a-b)/(a*b)^(1/2)*arctan(b*tan(d*x+c)/(a *b)^(1/2)))
Time = 0.10 (sec) , antiderivative size = 182, normalized size of antiderivative = 3.64 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx=\left [\frac {4 \, d x - \sqrt {-\frac {b}{a}} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{4} - 6 \, a b \tan \left (d x + c\right )^{2} + a^{2} + 4 \, {\left (a b \tan \left (d x + c\right )^{3} - a^{2} \tan \left (d x + c\right )\right )} \sqrt {-\frac {b}{a}}}{b^{2} \tan \left (d x + c\right )^{4} + 2 \, a b \tan \left (d x + c\right )^{2} + a^{2}}\right )}{4 \, {\left (a - b\right )} d}, \frac {2 \, d x - \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left (b \tan \left (d x + c\right )^{2} - a\right )} \sqrt {\frac {b}{a}}}{2 \, b \tan \left (d x + c\right )}\right )}{2 \, {\left (a - b\right )} d}\right ] \] Input:
integrate(1/(a+b*tan(d*x+c)^2),x, algorithm="fricas")
Output:
[1/4*(4*d*x - sqrt(-b/a)*log((b^2*tan(d*x + c)^4 - 6*a*b*tan(d*x + c)^2 + a^2 + 4*(a*b*tan(d*x + c)^3 - a^2*tan(d*x + c))*sqrt(-b/a))/(b^2*tan(d*x + c)^4 + 2*a*b*tan(d*x + c)^2 + a^2)))/((a - b)*d), 1/2*(2*d*x - sqrt(b/a)* arctan(1/2*(b*tan(d*x + c)^2 - a)*sqrt(b/a)/(b*tan(d*x + c))))/((a - b)*d) ]
Leaf count of result is larger than twice the leaf count of optimal. 240 vs. \(2 (37) = 74\).
Time = 1.23 (sec) , antiderivative size = 240, normalized size of antiderivative = 4.80 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx=\begin {cases} \frac {\tilde {\infty } x}{\tan ^{2}{\left (c \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x}{a} & \text {for}\: b = 0 \\\frac {- x - \frac {1}{d \tan {\left (c + d x \right )}}}{b} & \text {for}\: a = 0 \\\frac {d x \tan ^{2}{\left (c + d x \right )}}{2 b d \tan ^{2}{\left (c + d x \right )} + 2 b d} + \frac {d x}{2 b d \tan ^{2}{\left (c + d x \right )} + 2 b d} + \frac {\tan {\left (c + d x \right )}}{2 b d \tan ^{2}{\left (c + d x \right )} + 2 b d} & \text {for}\: a = b \\\frac {x}{a + b \tan ^{2}{\left (c \right )}} & \text {for}\: d = 0 \\\frac {2 d x \sqrt {- \frac {a}{b}}}{2 a d \sqrt {- \frac {a}{b}} - 2 b d \sqrt {- \frac {a}{b}}} - \frac {\log {\left (- \sqrt {- \frac {a}{b}} + \tan {\left (c + d x \right )} \right )}}{2 a d \sqrt {- \frac {a}{b}} - 2 b d \sqrt {- \frac {a}{b}}} + \frac {\log {\left (\sqrt {- \frac {a}{b}} + \tan {\left (c + d x \right )} \right )}}{2 a d \sqrt {- \frac {a}{b}} - 2 b d \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \] Input:
integrate(1/(a+b*tan(d*x+c)**2),x)
Output:
Piecewise((zoo*x/tan(c)**2, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (x/a, Eq(b, 0 )), ((-x - 1/(d*tan(c + d*x)))/b, Eq(a, 0)), (d*x*tan(c + d*x)**2/(2*b*d*t an(c + d*x)**2 + 2*b*d) + d*x/(2*b*d*tan(c + d*x)**2 + 2*b*d) + tan(c + d* x)/(2*b*d*tan(c + d*x)**2 + 2*b*d), Eq(a, b)), (x/(a + b*tan(c)**2), Eq(d, 0)), (2*d*x*sqrt(-a/b)/(2*a*d*sqrt(-a/b) - 2*b*d*sqrt(-a/b)) - log(-sqrt( -a/b) + tan(c + d*x))/(2*a*d*sqrt(-a/b) - 2*b*d*sqrt(-a/b)) + log(sqrt(-a/ b) + tan(c + d*x))/(2*a*d*sqrt(-a/b) - 2*b*d*sqrt(-a/b)), True))
Time = 0.12 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.96 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx=-\frac {\frac {b \arctan \left (\frac {b \tan \left (d x + c\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a - b\right )}} - \frac {d x + c}{a - b}}{d} \] Input:
integrate(1/(a+b*tan(d*x+c)^2),x, algorithm="maxima")
Output:
-(b*arctan(b*tan(d*x + c)/sqrt(a*b))/(sqrt(a*b)*(a - b)) - (d*x + c)/(a - b))/d
Time = 0.48 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.98 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx=-\frac {b \arctan \left (\frac {b \tan \left (d x + c\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a d - b d\right )}} + \frac {d x + c}{a d - b d} \] Input:
integrate(1/(a+b*tan(d*x+c)^2),x, algorithm="giac")
Output:
-b*arctan(b*tan(d*x + c)/sqrt(a*b))/(sqrt(a*b)*(a*d - b*d)) + (d*x + c)/(a *d - b*d)
Time = 7.70 (sec) , antiderivative size = 948, normalized size of antiderivative = 18.96 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx =\text {Too large to display} \] Input:
int(1/(a + b*tan(c + d*x)^2),x)
Output:
(atan((((-a*b)^(1/2)*(2*b^3*tan(c + d*x) - ((-a*b)^(1/2)*(2*b^4 - 4*a*b^3 + 2*a^2*b^2 + (tan(c + d*x)*(-a*b)^(1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8* a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2)))*1i)/(a*b - a^2) + ((-a*b)^(1/ 2)*(2*b^3*tan(c + d*x) - ((-a*b)^(1/2)*(4*a*b^3 - 2*b^4 - 2*a^2*b^2 + (tan (c + d*x)*(-a*b)^(1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2)))*1i)/(a*b - a^2))/(((-a*b)^(1/2)*(2*b^3*tan(c + d*x) - ((-a*b)^(1/2)*(2*b^4 - 4*a*b^3 + 2*a^2*b^2 + (tan(c + d*x)*(-a*b)^( 1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2))))/(a*b - a^2) - ((-a*b)^(1/2)*(2*b^3*tan(c + d*x) - ((-a*b)^(1/2)* (4*a*b^3 - 2*b^4 - 2*a^2*b^2 + (tan(c + d*x)*(-a*b)^(1/2)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b - a^2))))/(2*(a*b - a^2))))/(a*b - a^2) ))*(-a*b)^(1/2)*1i)/(a*d*(a - b)) - atan(((((4*b^4 - 8*a*b^3 + 4*a^2*b^2 + (tan(c + d*x)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2)*1i)/(2*a - 2*b))* 1i)/(2*a - 2*b) - 4*b^3*tan(c + d*x))/(2*a - 2*b) + (((8*a*b^3 - 4*b^4 - 4 *a^2*b^2 + (tan(c + d*x)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b^2)*1i)/(2* a - 2*b))*1i)/(2*a - 2*b) - 4*b^3*tan(c + d*x))/(2*a - 2*b))/(((((4*b^4 - 8*a*b^3 + 4*a^2*b^2 + (tan(c + d*x)*(8*a*b^4 - 8*b^5 + 8*a^2*b^3 - 8*a^3*b ^2)*1i)/(2*a - 2*b))*1i)/(2*a - 2*b) - 4*b^3*tan(c + d*x))*1i)/(2*a - 2*b) - ((((8*a*b^3 - 4*b^4 - 4*a^2*b^2 + (tan(c + d*x)*(8*a*b^4 - 8*b^5 + 8*a^ 2*b^3 - 8*a^3*b^2)*1i)/(2*a - 2*b))*1i)/(2*a - 2*b) - 4*b^3*tan(c + d*x...
Time = 0.17 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.84 \[ \int \frac {1}{a+b \tan ^2(c+d x)} \, dx=\frac {-\sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tan \left (d x +c \right ) b}{\sqrt {b}\, \sqrt {a}}\right )+a d x}{a d \left (a -b \right )} \] Input:
int(1/(a+b*tan(d*x+c)^2),x)
Output:
( - sqrt(b)*sqrt(a)*atan((tan(c + d*x)*b)/(sqrt(b)*sqrt(a))) + a*d*x)/(a*d *(a - b))