Integrand size = 29, antiderivative size = 76 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx=\frac {d \text {arctanh}(\sin (e+f x))}{b f}+\frac {2 (b c-a d) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b \sqrt {a+b} f} \] Output:
d*arctanh(sin(f*x+e))/b/f+2*(-a*d+b*c)*arctanh((a-b)^(1/2)*tan(1/2*f*x+1/2 *e)/(a+b)^(1/2))/(a-b)^(1/2)/b/(a+b)^(1/2)/f
Time = 0.43 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.47 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx=\frac {\frac {2 (-b c+a d) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+d \left (-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{b f} \] Input:
Integrate[(Sec[e + f*x]*(c + d*Sec[e + f*x]))/(a + b*Sec[e + f*x]),x]
Output:
((2*(-(b*c) + a*d)*ArcTanh[((-a + b)*Tan[(e + f*x)/2])/Sqrt[a^2 - b^2]])/S qrt[a^2 - b^2] + d*(-Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]]))/(b*f)
Time = 0.48 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {3042, 4486, 3042, 4257, 4318, 3042, 3138, 221}
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 (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right ) \left (c+d \csc \left (e+f x+\frac {\pi }{2}\right )\right )}{a+b \csc \left (e+f x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 4486 |
\(\displaystyle \frac {(b c-a d) \int \frac {\sec (e+f x)}{a+b \sec (e+f x)}dx}{b}+\frac {d \int \sec (e+f x)dx}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(b c-a d) \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right )}{a+b \csc \left (e+f x+\frac {\pi }{2}\right )}dx}{b}+\frac {d \int \csc \left (e+f x+\frac {\pi }{2}\right )dx}{b}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {(b c-a d) \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right )}{a+b \csc \left (e+f x+\frac {\pi }{2}\right )}dx}{b}+\frac {d \text {arctanh}(\sin (e+f x))}{b f}\) |
\(\Big \downarrow \) 4318 |
\(\displaystyle \frac {(b c-a d) \int \frac {1}{\frac {a \cos (e+f x)}{b}+1}dx}{b^2}+\frac {d \text {arctanh}(\sin (e+f x))}{b f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(b c-a d) \int \frac {1}{\frac {a \sin \left (e+f x+\frac {\pi }{2}\right )}{b}+1}dx}{b^2}+\frac {d \text {arctanh}(\sin (e+f x))}{b f}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {2 (b c-a d) \int \frac {1}{\left (1-\frac {a}{b}\right ) \tan ^2\left (\frac {1}{2} (e+f x)\right )+\frac {a+b}{b}}d\tan \left (\frac {1}{2} (e+f x)\right )}{b^2 f}+\frac {d \text {arctanh}(\sin (e+f x))}{b f}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {2 (b c-a d) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{b f \sqrt {a-b} \sqrt {a+b}}+\frac {d \text {arctanh}(\sin (e+f x))}{b f}\) |
Input:
Int[(Sec[e + f*x]*(c + d*Sec[e + f*x]))/(a + b*Sec[e + f*x]),x]
Output:
(d*ArcTanh[Sin[e + f*x]])/(b*f) + (2*(b*c - a*d)*ArcTanh[(Sqrt[a - b]*Tan[ (e + f*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*b*Sqrt[a + b]*f)
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo l] :> Simp[1/b Int[1/(1 + (a/b)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[( e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[B/b Int[Csc[e + f*x], x], x] + Simp[(A*b - a*B)/b Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x ] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]
Time = 0.28 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.21
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (a d -b c \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{b}+\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{b}}{f}\) | \(92\) |
default | \(\frac {-\frac {2 \left (a d -b c \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{b \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{b}+\frac {d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{b}}{f}\) | \(92\) |
risch | \(\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{\sqrt {a^{2}-b^{2}}\, a}\right ) a d}{\sqrt {a^{2}-b^{2}}\, f b}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{\sqrt {a^{2}-b^{2}}\, a}\right ) c}{\sqrt {a^{2}-b^{2}}\, f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{\sqrt {a^{2}-b^{2}}\, a}\right ) a d}{\sqrt {a^{2}-b^{2}}\, f b}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{\sqrt {a^{2}-b^{2}}\, a}\right ) c}{\sqrt {a^{2}-b^{2}}\, f}+\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{b f}-\frac {d \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{b f}\) | \(327\) |
Input:
int(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/f*(-2*(a*d-b*c)/b/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tan(1/2*f*x+1/2*e)/( (a+b)*(a-b))^(1/2))-d/b*ln(tan(1/2*f*x+1/2*e)-1)+d/b*ln(tan(1/2*f*x+1/2*e) +1))
Time = 0.51 (sec) , antiderivative size = 309, normalized size of antiderivative = 4.07 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx=\left [\frac {{\left (a^{2} - b^{2}\right )} d \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (a^{2} - b^{2}\right )} d \log \left (-\sin \left (f x + e\right ) + 1\right ) - \sqrt {a^{2} - b^{2}} {\left (b c - a d\right )} \log \left (\frac {2 \, a b \cos \left (f x + e\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (f x + e\right ) + a\right )} \sin \left (f x + e\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (f x + e\right )^{2} + 2 \, a b \cos \left (f x + e\right ) + b^{2}}\right )}{2 \, {\left (a^{2} b - b^{3}\right )} f}, \frac {{\left (a^{2} - b^{2}\right )} d \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (a^{2} - b^{2}\right )} d \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, \sqrt {-a^{2} + b^{2}} {\left (b c - a d\right )} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (f x + e\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (f x + e\right )}\right )}{2 \, {\left (a^{2} b - b^{3}\right )} f}\right ] \] Input:
integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e)),x, algorithm="frica s")
Output:
[1/2*((a^2 - b^2)*d*log(sin(f*x + e) + 1) - (a^2 - b^2)*d*log(-sin(f*x + e ) + 1) - sqrt(a^2 - b^2)*(b*c - a*d)*log((2*a*b*cos(f*x + e) - (a^2 - 2*b^ 2)*cos(f*x + e)^2 - 2*sqrt(a^2 - b^2)*(b*cos(f*x + e) + a)*sin(f*x + e) + 2*a^2 - b^2)/(a^2*cos(f*x + e)^2 + 2*a*b*cos(f*x + e) + b^2)))/((a^2*b - b ^3)*f), 1/2*((a^2 - b^2)*d*log(sin(f*x + e) + 1) - (a^2 - b^2)*d*log(-sin( f*x + e) + 1) + 2*sqrt(-a^2 + b^2)*(b*c - a*d)*arctan(-sqrt(-a^2 + b^2)*(b *cos(f*x + e) + a)/((a^2 - b^2)*sin(f*x + e))))/((a^2*b - b^3)*f)]
\[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx=\int \frac {\left (c + d \sec {\left (e + f x \right )}\right ) \sec {\left (e + f x \right )}}{a + b \sec {\left (e + f x \right )}}\, dx \] Input:
integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e)),x)
Output:
Integral((c + d*sec(e + f*x))*sec(e + f*x)/(a + b*sec(e + f*x)), x)
Exception generated. \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e)),x, algorithm="maxim a")
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(4*a^2-4*b^2>0)', see `assume?` f or more de
Time = 0.20 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.67 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx=\frac {\frac {d \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{b} - \frac {d \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{b} - \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} {\left (b c - a d\right )}}{\sqrt {-a^{2} + b^{2}} b}}{f} \] Input:
integrate(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e)),x, algorithm="giac" )
Output:
(d*log(abs(tan(1/2*f*x + 1/2*e) + 1))/b - d*log(abs(tan(1/2*f*x + 1/2*e) - 1))/b - 2*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*a - 2*b) + arctan((a*ta n(1/2*f*x + 1/2*e) - b*tan(1/2*f*x + 1/2*e))/sqrt(-a^2 + b^2)))*(b*c - a*d )/(sqrt(-a^2 + b^2)*b))/f
Time = 12.32 (sec) , antiderivative size = 571, normalized size of antiderivative = 7.51 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx =\text {Too large to display} \] Input:
int((c + d/cos(e + f*x))/(cos(e + f*x)*(a + b/cos(e + f*x))),x)
Output:
(b^2*c*log((b*sin(e/2 + (f*x)/2) - a*sin(e/2 + (f*x)/2) + cos(e/2 + (f*x)/ 2)*(a^2 - b^2)^(1/2))/cos(e/2 + (f*x)/2)))/(f*(a^2 - b^2)^(3/2)) - (a^2*c* log((b*sin(e/2 + (f*x)/2) - a*sin(e/2 + (f*x)/2) + cos(e/2 + (f*x)/2)*(a^2 - b^2)^(1/2))/cos(e/2 + (f*x)/2)))/(f*(a^2 - b^2)^(3/2)) - (2*b*d*atanh(s in(e/2 + (f*x)/2)/cos(e/2 + (f*x)/2)))/(f*(a^2 - b^2)) + (c*log((a*cos(e/2 + (f*x)/2) + b*cos(e/2 + (f*x)/2) + sin(e/2 + (f*x)/2)*(a^2 - b^2)^(1/2)) /cos(e/2 + (f*x)/2))*((a + b)*(a - b))^(1/2))/(f*(a^2 - b^2)) - (a*b*d*log ((b*sin(e/2 + (f*x)/2) - a*sin(e/2 + (f*x)/2) + cos(e/2 + (f*x)/2)*(a^2 - b^2)^(1/2))/cos(e/2 + (f*x)/2)))/(f*(a^2 - b^2)^(3/2)) + (2*a^2*d*atanh(si n(e/2 + (f*x)/2)/cos(e/2 + (f*x)/2)))/(b*f*(a^2 - b^2)) + (a^3*d*log((b*si n(e/2 + (f*x)/2) - a*sin(e/2 + (f*x)/2) + cos(e/2 + (f*x)/2)*(a^2 - b^2)^( 1/2))/cos(e/2 + (f*x)/2)))/(b*f*(a^2 - b^2)^(3/2)) - (a*d*log((a*cos(e/2 + (f*x)/2) + b*cos(e/2 + (f*x)/2) + sin(e/2 + (f*x)/2)*(a^2 - b^2)^(1/2))/c os(e/2 + (f*x)/2))*((a + b)*(a - b))^(1/2))/(b*f*(a^2 - b^2))
Time = 0.24 (sec) , antiderivative size = 193, normalized size of antiderivative = 2.54 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{a+b \sec (e+f x)} \, dx=\frac {-2 \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) b}{\sqrt {-a^{2}+b^{2}}}\right ) a d +2 \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) b}{\sqrt {-a^{2}+b^{2}}}\right ) b c -\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) a^{2} d +\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right ) b^{2} d +\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) a^{2} d -\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) b^{2} d}{b f \left (a^{2}-b^{2}\right )} \] Input:
int(sec(f*x+e)*(c+d*sec(f*x+e))/(a+b*sec(f*x+e)),x)
Output:
( - 2*sqrt( - a**2 + b**2)*atan((tan((e + f*x)/2)*a - tan((e + f*x)/2)*b)/ sqrt( - a**2 + b**2))*a*d + 2*sqrt( - a**2 + b**2)*atan((tan((e + f*x)/2)* a - tan((e + f*x)/2)*b)/sqrt( - a**2 + b**2))*b*c - log(tan((e + f*x)/2) - 1)*a**2*d + log(tan((e + f*x)/2) - 1)*b**2*d + log(tan((e + f*x)/2) + 1)* a**2*d - log(tan((e + f*x)/2) + 1)*b**2*d)/(b*f*(a**2 - b**2))