Integrand size = 29, antiderivative size = 99 \[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=\frac {2 (a c-b d) \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{(c-d)^{3/2} (c+d)^{3/2} f}+\frac {(b c-a d) \tan (e+f x)}{\left (c^2-d^2\right ) f (c+d \sec (e+f x))} \] Output:
2*(a*c-b*d)*arctanh((c-d)^(1/2)*tan(1/2*f*x+1/2*e)/(c+d)^(1/2))/(c-d)^(3/2 )/(c+d)^(3/2)/f+(-a*d+b*c)*tan(f*x+e)/(c^2-d^2)/f/(c+d*sec(f*x+e))
Time = 0.40 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.98 \[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=\frac {-\frac {2 (a c-b d) \text {arctanh}\left (\frac {(-c+d) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\left (c^2-d^2\right )^{3/2}}+\frac {(b c-a d) \sin (e+f x)}{(c-d) (c+d) (d+c \cos (e+f x))}}{f} \] Input:
Integrate[(Sec[e + f*x]*(a + b*Sec[e + f*x]))/(c + d*Sec[e + f*x])^2,x]
Output:
((-2*(a*c - b*d)*ArcTanh[((-c + d)*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/(c^ 2 - d^2)^(3/2) + ((b*c - a*d)*Sin[e + f*x])/((c - d)*(c + d)*(d + c*Cos[e + f*x])))/f
Time = 0.50 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.11, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.310, Rules used = {3042, 4491, 25, 27, 3042, 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) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right ) \left (a+b \csc \left (e+f x+\frac {\pi }{2}\right )\right )}{\left (c+d \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 4491 |
\(\displaystyle \frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}-\frac {\int -\frac {(a c-b d) \sec (e+f x)}{c+d \sec (e+f x)}dx}{c^2-d^2}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \frac {(a c-b d) \sec (e+f x)}{c+d \sec (e+f x)}dx}{c^2-d^2}+\frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {(a c-b d) \int \frac {\sec (e+f x)}{c+d \sec (e+f x)}dx}{c^2-d^2}+\frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(a c-b d) \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right )}{c+d \csc \left (e+f x+\frac {\pi }{2}\right )}dx}{c^2-d^2}+\frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}\) |
\(\Big \downarrow \) 4318 |
\(\displaystyle \frac {(a c-b d) \int \frac {1}{\frac {c \cos (e+f x)}{d}+1}dx}{d \left (c^2-d^2\right )}+\frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(a c-b d) \int \frac {1}{\frac {c \sin \left (e+f x+\frac {\pi }{2}\right )}{d}+1}dx}{d \left (c^2-d^2\right )}+\frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {2 (a c-b d) \int \frac {1}{\left (1-\frac {c}{d}\right ) \tan ^2\left (\frac {1}{2} (e+f x)\right )+\frac {c+d}{d}}d\tan \left (\frac {1}{2} (e+f x)\right )}{d f \left (c^2-d^2\right )}+\frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {2 (a c-b d) \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{f \sqrt {c-d} \sqrt {c+d} \left (c^2-d^2\right )}+\frac {(b c-a d) \tan (e+f x)}{f \left (c^2-d^2\right ) (c+d \sec (e+f x))}\) |
Input:
Int[(Sec[e + f*x]*(a + b*Sec[e + f*x]))/(c + d*Sec[e + f*x])^2,x]
Output:
(2*(a*c - b*d)*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/(Sqrt[ c - d]*Sqrt[c + d]*(c^2 - d^2)*f) + ((b*c - a*d)*Tan[e + f*x])/((c^2 - d^2 )*f*(c + d*Sec[e + f*x]))
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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[(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_))^(m_)*(cs c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-(A*b - a*B))*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(f*(m + 1)*(a^2 - b^2))), x] + Simp[1 /((m + 1)*(a^2 - b^2)) Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*Simp [(a*A - b*B)*(m + 1) - (A*b - a*B)*(m + 2)*Csc[e + f*x], x], x], x] /; Free Q[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && LtQ[m , -1]
Time = 0.23 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.33
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c^{2}-d^{2}\right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )}+\frac {2 \left (a c -b d \right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c -d \right ) \left (c +d \right )}}\right )}{\left (c -d \right ) \left (c +d \right ) \sqrt {\left (c -d \right ) \left (c +d \right )}}}{f}\) | \(132\) |
default | \(\frac {\frac {2 \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (c^{2}-d^{2}\right ) \left (c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )}+\frac {2 \left (a c -b d \right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c -d \right ) \left (c +d \right )}}\right )}{\left (c -d \right ) \left (c +d \right ) \sqrt {\left (c -d \right ) \left (c +d \right )}}}{f}\) | \(132\) |
risch | \(\frac {2 i \left (-a d +b c \right ) \left (d \,{\mathrm e}^{i \left (f x +e \right )}+c \right )}{c \left (c^{2}-d^{2}\right ) f \left (c \,{\mathrm e}^{2 i \left (f x +e \right )}+2 d \,{\mathrm e}^{i \left (f x +e \right )}+c \right )}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+d \sqrt {c^{2}-d^{2}}}{\sqrt {c^{2}-d^{2}}\, c}\right ) a c}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right ) \left (c -d \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+d \sqrt {c^{2}-d^{2}}}{\sqrt {c^{2}-d^{2}}\, c}\right ) b d}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right ) \left (c -d \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i c^{2}+i d^{2}+d \sqrt {c^{2}-d^{2}}}{c \sqrt {c^{2}-d^{2}}}\right ) a c}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right ) \left (c -d \right ) f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i c^{2}+i d^{2}+d \sqrt {c^{2}-d^{2}}}{c \sqrt {c^{2}-d^{2}}}\right ) b d}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right ) \left (c -d \right ) f}\) | \(396\) |
Input:
int(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^2,x,method=_RETURNVERBOSE )
Output:
1/f*(2*(a*d-b*c)/(c^2-d^2)*tan(1/2*f*x+1/2*e)/(c*tan(1/2*f*x+1/2*e)^2-tan( 1/2*f*x+1/2*e)^2*d-c-d)+2*(a*c-b*d)/(c-d)/(c+d)/((c-d)*(c+d))^(1/2)*arctan h((c-d)*tan(1/2*f*x+1/2*e)/((c-d)*(c+d))^(1/2)))
Time = 0.16 (sec) , antiderivative size = 389, normalized size of antiderivative = 3.93 \[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=\left [\frac {{\left (a c d - b d^{2} + {\left (a c^{2} - b c d\right )} \cos \left (f x + e\right )\right )} \sqrt {c^{2} - d^{2}} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt {c^{2} - d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) + 2 \, {\left (b c^{3} - a c^{2} d - b c d^{2} + a d^{3}\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (c^{5} - 2 \, c^{3} d^{2} + c d^{4}\right )} f \cos \left (f x + e\right ) + {\left (c^{4} d - 2 \, c^{2} d^{3} + d^{5}\right )} f\right )}}, \frac {{\left (a c d - b d^{2} + {\left (a c^{2} - b c d\right )} \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}} \arctan \left (-\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )}}{{\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}\right ) + {\left (b c^{3} - a c^{2} d - b c d^{2} + a d^{3}\right )} \sin \left (f x + e\right )}{{\left (c^{5} - 2 \, c^{3} d^{2} + c d^{4}\right )} f \cos \left (f x + e\right ) + {\left (c^{4} d - 2 \, c^{2} d^{3} + d^{5}\right )} f}\right ] \] Input:
integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^2,x, algorithm="fri cas")
Output:
[1/2*((a*c*d - b*d^2 + (a*c^2 - b*c*d)*cos(f*x + e))*sqrt(c^2 - d^2)*log(( 2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^2 - d^2)*(d*c os(f*x + e) + c)*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*c os(f*x + e) + d^2)) + 2*(b*c^3 - a*c^2*d - b*c*d^2 + a*d^3)*sin(f*x + e))/ ((c^5 - 2*c^3*d^2 + c*d^4)*f*cos(f*x + e) + (c^4*d - 2*c^2*d^3 + d^5)*f), ((a*c*d - b*d^2 + (a*c^2 - b*c*d)*cos(f*x + e))*sqrt(-c^2 + d^2)*arctan(-s qrt(-c^2 + d^2)*(d*cos(f*x + e) + c)/((c^2 - d^2)*sin(f*x + e))) + (b*c^3 - a*c^2*d - b*c*d^2 + a*d^3)*sin(f*x + e))/((c^5 - 2*c^3*d^2 + c*d^4)*f*co s(f*x + e) + (c^4*d - 2*c^2*d^3 + d^5)*f)]
\[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=\int \frac {\left (a + b \sec {\left (e + f x \right )}\right ) \sec {\left (e + f x \right )}}{\left (c + d \sec {\left (e + f x \right )}\right )^{2}}\, dx \] Input:
integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))**2,x)
Output:
Integral((a + b*sec(e + f*x))*sec(e + f*x)/(c + d*sec(e + f*x))**2, x)
Exception generated. \[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^2,x, algorithm="max ima")
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*c^2-4*d^2>0)', see `assume?` f or more de
Time = 0.15 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.74 \[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=-\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )} {\left (a c - b d\right )}}{{\left (c^{2} - d^{2}\right )} \sqrt {-c^{2} + d^{2}}} + \frac {b c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c - d\right )} {\left (c^{2} - d^{2}\right )}}\right )}}{f} \] Input:
integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^2,x, algorithm="gia c")
Output:
-2*((pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*tan(1/2*f *x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d^2)))*(a*c - b*d)/((c^2 - d^2)*sqrt(-c^2 + d^2)) + (b*c*tan(1/2*f*x + 1/2*e) - a*d*tan(1/2*f*x + 1/2*e))/((c*tan(1/2*f*x + 1/2*e)^2 - d*tan(1/2*f*x + 1/2*e)^2 - c - d)*(c^ 2 - d^2)))/f
Time = 11.16 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.07 \[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c-d}}{\sqrt {c+d}}\right )\,\left (a\,c-b\,d\right )}{f\,{\left (c+d\right )}^{3/2}\,{\left (c-d\right )}^{3/2}}-\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,d-b\,c\right )}{f\,\left (c+d\right )\,\left (c-d\right )\,\left (\left (d-c\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+c+d\right )} \] Input:
int((a + b/cos(e + f*x))/(cos(e + f*x)*(c + d/cos(e + f*x))^2),x)
Output:
(2*atanh((tan(e/2 + (f*x)/2)*(c - d)^(1/2))/(c + d)^(1/2))*(a*c - b*d))/(f *(c + d)^(3/2)*(c - d)^(3/2)) - (2*tan(e/2 + (f*x)/2)*(a*d - b*c))/(f*(c + d)*(c - d)*(c + d - tan(e/2 + (f*x)/2)^2*(c - d)))
Time = 0.18 (sec) , antiderivative size = 333, normalized size of antiderivative = 3.36 \[ \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx=\frac {2 \sqrt {-c^{2}+d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d}{\sqrt {-c^{2}+d^{2}}}\right ) \cos \left (f x +e \right ) a \,c^{2}-2 \sqrt {-c^{2}+d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d}{\sqrt {-c^{2}+d^{2}}}\right ) \cos \left (f x +e \right ) b c d +2 \sqrt {-c^{2}+d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d}{\sqrt {-c^{2}+d^{2}}}\right ) a c d -2 \sqrt {-c^{2}+d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d}{\sqrt {-c^{2}+d^{2}}}\right ) b \,d^{2}-\sin \left (f x +e \right ) a \,c^{2} d +\sin \left (f x +e \right ) a \,d^{3}+\sin \left (f x +e \right ) b \,c^{3}-\sin \left (f x +e \right ) b c \,d^{2}}{f \left (\cos \left (f x +e \right ) c^{5}-2 \cos \left (f x +e \right ) c^{3} d^{2}+\cos \left (f x +e \right ) c \,d^{4}+c^{4} d -2 c^{2} d^{3}+d^{5}\right )} \] Input:
int(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^2,x)
Output:
(2*sqrt( - c**2 + d**2)*atan((tan((e + f*x)/2)*c - tan((e + f*x)/2)*d)/sqr t( - c**2 + d**2))*cos(e + f*x)*a*c**2 - 2*sqrt( - c**2 + d**2)*atan((tan( (e + f*x)/2)*c - tan((e + f*x)/2)*d)/sqrt( - c**2 + d**2))*cos(e + f*x)*b* c*d + 2*sqrt( - c**2 + d**2)*atan((tan((e + f*x)/2)*c - tan((e + f*x)/2)*d )/sqrt( - c**2 + d**2))*a*c*d - 2*sqrt( - c**2 + d**2)*atan((tan((e + f*x) /2)*c - tan((e + f*x)/2)*d)/sqrt( - c**2 + d**2))*b*d**2 - sin(e + f*x)*a* c**2*d + sin(e + f*x)*a*d**3 + sin(e + f*x)*b*c**3 - sin(e + f*x)*b*c*d**2 )/(f*(cos(e + f*x)*c**5 - 2*cos(e + f*x)*c**3*d**2 + cos(e + f*x)*c*d**4 + c**4*d - 2*c**2*d**3 + d**5))