Integrand size = 15, antiderivative size = 51 \[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=-\frac {2 \text {arctanh}\left (\frac {b-(a-c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\sqrt {a^2+b^2-c^2}} \] Output:
-2*arctanh((b-(a-c)*tan(1/2*x))/(a^2+b^2-c^2)^(1/2))/(a^2+b^2-c^2)^(1/2)
Time = 0.04 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.98 \[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=-\frac {2 \text {arctanh}\left (\frac {b+(-a+c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\sqrt {a^2+b^2-c^2}} \] Input:
Integrate[Sec[x]/(a + c*Sec[x] + b*Tan[x]),x]
Output:
(-2*ArcTanh[(b + (-a + c)*Tan[x/2])/Sqrt[a^2 + b^2 - c^2]])/Sqrt[a^2 + b^2 - c^2]
Time = 0.28 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.10, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3042, 3644, 3042, 3603, 1083, 219}
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 {\sec (x)}{a+b \tan (x)+c \sec (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sec (x)}{a+b \tan (x)+c \sec (x)}dx\) |
\(\Big \downarrow \) 3644 |
\(\displaystyle \int \frac {1}{a \cos (x)+b \sin (x)+c}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{a \cos (x)+b \sin (x)+c}dx\) |
\(\Big \downarrow \) 3603 |
\(\displaystyle 2 \int \frac {1}{-\left ((a-c) \tan ^2\left (\frac {x}{2}\right )\right )+2 b \tan \left (\frac {x}{2}\right )+a+c}d\tan \left (\frac {x}{2}\right )\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle -4 \int \frac {1}{4 \left (a^2+b^2-c^2\right )-\left (2 b-2 (a-c) \tan \left (\frac {x}{2}\right )\right )^2}d\left (2 b-2 (a-c) \tan \left (\frac {x}{2}\right )\right )\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {2 \text {arctanh}\left (\frac {2 b-2 (a-c) \tan \left (\frac {x}{2}\right )}{2 \sqrt {a^2+b^2-c^2}}\right )}{\sqrt {a^2+b^2-c^2}}\) |
Input:
Int[Sec[x]/(a + c*Sec[x] + b*Tan[x]),x]
Output:
(-2*ArcTanh[(2*b - 2*(a - c)*Tan[x/2])/(2*Sqrt[a^2 + b^2 - c^2])])/Sqrt[a^ 2 + b^2 - c^2]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^ (-1), x_Symbol] :> Module[{f = FreeFactors[Tan[(d + e*x)/2], x]}, Simp[2*(f /e) Subst[Int[1/(a + b + 2*c*f*x + (a - b)*f^2*x^2), x], x, Tan[(d + e*x) /2]/f], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0]
Int[sec[(d_.) + (e_.)*(x_)]^(n_.)*((a_.) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*tan[(d_.) + (e_.)*(x_)])^(m_), x_Symbol] :> Int[1/(b + a*Cos[d + e*x] + c*Sin[d + e*x])^n, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[m + n, 0] && I ntegerQ[n]
Time = 0.46 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.04
method | result | size |
default | \(-\frac {2 \arctan \left (\frac {2 \left (a -c \right ) \tan \left (\frac {x}{2}\right )-2 b}{2 \sqrt {-a^{2}-b^{2}+c^{2}}}\right )}{\sqrt {-a^{2}-b^{2}+c^{2}}}\) | \(53\) |
risch | \(\frac {\ln \left ({\mathrm e}^{i x}+\frac {i b c \sqrt {a^{2}+b^{2}-c^{2}}+i a^{3}+i a \,b^{2}-i a \,c^{2}+a c \sqrt {a^{2}+b^{2}-c^{2}}-a^{2} b -b^{3}+b \,c^{2}}{\left (a^{2}+b^{2}\right ) \sqrt {a^{2}+b^{2}-c^{2}}}\right )}{\sqrt {a^{2}+b^{2}-c^{2}}}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {i b c \sqrt {a^{2}+b^{2}-c^{2}}-i a^{3}-i a \,b^{2}+i a \,c^{2}+a c \sqrt {a^{2}+b^{2}-c^{2}}+a^{2} b +b^{3}-b \,c^{2}}{\left (a^{2}+b^{2}\right ) \sqrt {a^{2}+b^{2}-c^{2}}}\right )}{\sqrt {a^{2}+b^{2}-c^{2}}}\) | \(239\) |
Input:
int(sec(x)/(a+c*sec(x)+b*tan(x)),x,method=_RETURNVERBOSE)
Output:
-2/(-a^2-b^2+c^2)^(1/2)*arctan(1/2*(2*(a-c)*tan(1/2*x)-2*b)/(-a^2-b^2+c^2) ^(1/2))
Leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (47) = 94\).
Time = 0.13 (sec) , antiderivative size = 349, normalized size of antiderivative = 6.84 \[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=\left [\frac {\log \left (-\frac {2 \, a^{4} + 3 \, a^{2} b^{2} + b^{4} - {\left (a^{2} - b^{2}\right )} c^{2} + 2 \, {\left (a^{3} + a b^{2}\right )} c \cos \left (x\right ) - {\left (a^{4} - b^{4} - 2 \, {\left (a^{2} - b^{2}\right )} c^{2}\right )} \cos \left (x\right )^{2} + 2 \, {\left ({\left (a^{2} b + b^{3}\right )} c - {\left (a^{3} b + a b^{3} - 2 \, a b c^{2}\right )} \cos \left (x\right )\right )} \sin \left (x\right ) - 2 \, {\left (2 \, a b c \cos \left (x\right )^{2} - a b c + {\left (a^{2} b + b^{3}\right )} \cos \left (x\right ) - {\left (a^{3} + a b^{2} + {\left (a^{2} - b^{2}\right )} c \cos \left (x\right )\right )} \sin \left (x\right )\right )} \sqrt {a^{2} + b^{2} - c^{2}}}{2 \, a c \cos \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2} + c^{2} + 2 \, {\left (a b \cos \left (x\right ) + b c\right )} \sin \left (x\right )}\right )}{2 \, \sqrt {a^{2} + b^{2} - c^{2}}}, \frac {\sqrt {-a^{2} - b^{2} + c^{2}} \arctan \left (\frac {{\left (a c \cos \left (x\right ) + b c \sin \left (x\right ) + a^{2} + b^{2}\right )} \sqrt {-a^{2} - b^{2} + c^{2}}}{{\left (a^{2} b + b^{3} - b c^{2}\right )} \cos \left (x\right ) - {\left (a^{3} + a b^{2} - a c^{2}\right )} \sin \left (x\right )}\right )}{a^{2} + b^{2} - c^{2}}\right ] \] Input:
integrate(sec(x)/(a+c*sec(x)+b*tan(x)),x, algorithm="fricas")
Output:
[1/2*log(-(2*a^4 + 3*a^2*b^2 + b^4 - (a^2 - b^2)*c^2 + 2*(a^3 + a*b^2)*c*c os(x) - (a^4 - b^4 - 2*(a^2 - b^2)*c^2)*cos(x)^2 + 2*((a^2*b + b^3)*c - (a ^3*b + a*b^3 - 2*a*b*c^2)*cos(x))*sin(x) - 2*(2*a*b*c*cos(x)^2 - a*b*c + ( a^2*b + b^3)*cos(x) - (a^3 + a*b^2 + (a^2 - b^2)*c*cos(x))*sin(x))*sqrt(a^ 2 + b^2 - c^2))/(2*a*c*cos(x) + (a^2 - b^2)*cos(x)^2 + b^2 + c^2 + 2*(a*b* cos(x) + b*c)*sin(x)))/sqrt(a^2 + b^2 - c^2), sqrt(-a^2 - b^2 + c^2)*arcta n((a*c*cos(x) + b*c*sin(x) + a^2 + b^2)*sqrt(-a^2 - b^2 + c^2)/((a^2*b + b ^3 - b*c^2)*cos(x) - (a^3 + a*b^2 - a*c^2)*sin(x)))/(a^2 + b^2 - c^2)]
\[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=\int \frac {\sec {\left (x \right )}}{a + b \tan {\left (x \right )} + c \sec {\left (x \right )}}\, dx \] Input:
integrate(sec(x)/(a+c*sec(x)+b*tan(x)),x)
Output:
Integral(sec(x)/(a + b*tan(x) + c*sec(x)), x)
Exception generated. \[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(sec(x)/(a+c*sec(x)+b*tan(x)),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(c^2-b^2-a^2>0)', see `assume?` f or more de
Time = 0.35 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.43 \[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=-\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, c\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, x\right ) - c \tan \left (\frac {1}{2} \, x\right ) - b}{\sqrt {-a^{2} - b^{2} + c^{2}}}\right )\right )}}{\sqrt {-a^{2} - b^{2} + c^{2}}} \] Input:
integrate(sec(x)/(a+c*sec(x)+b*tan(x)),x, algorithm="giac")
Output:
-2*(pi*floor(1/2*x/pi + 1/2)*sgn(2*a - 2*c) + arctan((a*tan(1/2*x) - c*tan (1/2*x) - b)/sqrt(-a^2 - b^2 + c^2)))/sqrt(-a^2 - b^2 + c^2)
Time = 16.12 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.92 \[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=-\frac {2\,\mathrm {atanh}\left (\frac {b-\frac {\mathrm {tan}\left (\frac {x}{2}\right )\,\left (2\,a-2\,c\right )}{2}}{\sqrt {a^2+b^2-c^2}}\right )}{\sqrt {a^2+b^2-c^2}} \] Input:
int(1/(cos(x)*(a + b*tan(x) + c/cos(x))),x)
Output:
-(2*atanh((b - (tan(x/2)*(2*a - 2*c))/2)/(a^2 + b^2 - c^2)^(1/2)))/(a^2 + b^2 - c^2)^(1/2)
Time = 0.18 (sec) , antiderivative size = 322, normalized size of antiderivative = 6.31 \[ \int \frac {\sec (x)}{a+c \sec (x)+b \tan (x)} \, dx=\frac {4 \sqrt {-a^{2}-b^{2}+c^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) a -\tan \left (\frac {x}{2}\right ) c -b}{\sqrt {-a^{2}-b^{2}+c^{2}}}\right ) a c +2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) a^{2} b +2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b^{3}-2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b \,c^{2}-\mathrm {log}\left (\tan \left (x \right )^{2}+1\right ) a^{2} b -\mathrm {log}\left (\tan \left (x \right )^{2}+1\right ) b^{3}+\mathrm {log}\left (\tan \left (x \right )^{2}+1\right ) b \,c^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} c -2 \tan \left (\frac {x}{2}\right ) b -a -c \right ) a^{2} b -2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} c -2 \tan \left (\frac {x}{2}\right ) b -a -c \right ) b^{3}+2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} c -2 \tan \left (\frac {x}{2}\right ) b -a -c \right ) b \,c^{2}+2 \,\mathrm {log}\left (\sec \left (x \right ) c +\tan \left (x \right ) b +a \right ) a^{2} b +2 \,\mathrm {log}\left (\sec \left (x \right ) c +\tan \left (x \right ) b +a \right ) b^{3}-2 \,\mathrm {log}\left (\sec \left (x \right ) c +\tan \left (x \right ) b +a \right ) b \,c^{2}}{2 a c \left (a^{2}+b^{2}-c^{2}\right )} \] Input:
int(sec(x)/(a+c*sec(x)+b*tan(x)),x)
Output:
(4*sqrt( - a**2 - b**2 + c**2)*atan((tan(x/2)*a - tan(x/2)*c - b)/sqrt( - a**2 - b**2 + c**2))*a*c + 2*log(tan(x/2)**2 + 1)*a**2*b + 2*log(tan(x/2)* *2 + 1)*b**3 - 2*log(tan(x/2)**2 + 1)*b*c**2 - log(tan(x)**2 + 1)*a**2*b - log(tan(x)**2 + 1)*b**3 + log(tan(x)**2 + 1)*b*c**2 - 2*log(tan(x/2)**2*a - tan(x/2)**2*c - 2*tan(x/2)*b - a - c)*a**2*b - 2*log(tan(x/2)**2*a - ta n(x/2)**2*c - 2*tan(x/2)*b - a - c)*b**3 + 2*log(tan(x/2)**2*a - tan(x/2)* *2*c - 2*tan(x/2)*b - a - c)*b*c**2 + 2*log(sec(x)*c + tan(x)*b + a)*a**2* b + 2*log(sec(x)*c + tan(x)*b + a)*b**3 - 2*log(sec(x)*c + tan(x)*b + a)*b *c**2)/(2*a*c*(a**2 + b**2 - c**2))