Integrand size = 17, antiderivative size = 68 \[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=\frac {2 B \text {arctanh}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {a+a \cos (x)}}\right )}{\sqrt {a}}+\frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {2} \sqrt {a+a \cos (x)}}\right )}{\sqrt {a}} \] Output:
2*B*arctanh(a^(1/2)*sin(x)/(a+a*cos(x))^(1/2))/a^(1/2)+2^(1/2)*(A-B)*arcta nh(1/2*a^(1/2)*sin(x)*2^(1/2)/(a+a*cos(x))^(1/2))/a^(1/2)
Time = 0.03 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.76 \[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=\frac {2 \left ((A-B) \text {arctanh}\left (\sin \left (\frac {x}{2}\right )\right )+\sqrt {2} B \text {arctanh}\left (\sqrt {2} \sin \left (\frac {x}{2}\right )\right )\right ) \cos \left (\frac {x}{2}\right )}{\sqrt {a (1+\cos (x))}} \] Input:
Integrate[(A + B*Sec[x])/Sqrt[a + a*Cos[x]],x]
Output:
(2*((A - B)*ArcTanh[Sin[x/2]] + Sqrt[2]*B*ArcTanh[Sqrt[2]*Sin[x/2]])*Cos[x /2])/Sqrt[a*(1 + Cos[x])]
Time = 0.50 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.529, Rules used = {3042, 3307, 3042, 3464, 3042, 3128, 219, 3252, 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 {A+B \sec (x)}{\sqrt {a \cos (x)+a}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \csc \left (x+\frac {\pi }{2}\right )}{\sqrt {a \sin \left (x+\frac {\pi }{2}\right )+a}}dx\) |
\(\Big \downarrow \) 3307 |
\(\displaystyle \int \frac {\sec (x) (A \cos (x)+B)}{\sqrt {a \cos (x)+a}}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A \sin \left (x+\frac {\pi }{2}\right )+B}{\sin \left (x+\frac {\pi }{2}\right ) \sqrt {a \sin \left (x+\frac {\pi }{2}\right )+a}}dx\) |
\(\Big \downarrow \) 3464 |
\(\displaystyle (A-B) \int \frac {1}{\sqrt {\cos (x) a+a}}dx+\frac {B \int \sqrt {\cos (x) a+a} \sec (x)dx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (A-B) \int \frac {1}{\sqrt {\sin \left (x+\frac {\pi }{2}\right ) a+a}}dx+\frac {B \int \frac {\sqrt {\sin \left (x+\frac {\pi }{2}\right ) a+a}}{\sin \left (x+\frac {\pi }{2}\right )}dx}{a}\) |
\(\Big \downarrow \) 3128 |
\(\displaystyle \frac {B \int \frac {\sqrt {\sin \left (x+\frac {\pi }{2}\right ) a+a}}{\sin \left (x+\frac {\pi }{2}\right )}dx}{a}-2 (A-B) \int \frac {1}{2 a-\frac {a^2 \sin ^2(x)}{\cos (x) a+a}}d\left (-\frac {a \sin (x)}{\sqrt {\cos (x) a+a}}\right )\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {B \int \frac {\sqrt {\sin \left (x+\frac {\pi }{2}\right ) a+a}}{\sin \left (x+\frac {\pi }{2}\right )}dx}{a}+\frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {2} \sqrt {a \cos (x)+a}}\right )}{\sqrt {a}}\) |
\(\Big \downarrow \) 3252 |
\(\displaystyle \frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {2} \sqrt {a \cos (x)+a}}\right )}{\sqrt {a}}-2 B \int \frac {1}{a-\frac {a^2 \sin ^2(x)}{\cos (x) a+a}}d\left (-\frac {a \sin (x)}{\sqrt {\cos (x) a+a}}\right )\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\sqrt {2} (A-B) \text {arctanh}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {2} \sqrt {a \cos (x)+a}}\right )}{\sqrt {a}}+\frac {2 B \text {arctanh}\left (\frac {\sqrt {a} \sin (x)}{\sqrt {a \cos (x)+a}}\right )}{\sqrt {a}}\) |
Input:
Int[(A + B*Sec[x])/Sqrt[a + a*Cos[x]],x]
Output:
(2*B*ArcTanh[(Sqrt[a]*Sin[x])/Sqrt[a + a*Cos[x]]])/Sqrt[a] + (Sqrt[2]*(A - B)*ArcTanh[(Sqrt[a]*Sin[x])/(Sqrt[2]*Sqrt[a + a*Cos[x]])])/Sqrt[a]
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[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2/d Subst[Int[1/(2*a - x^2), x], x, b*(Cos[c + d*x]/Sqrt[a + b*Sin[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]
Int[Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]/((c_.) + (d_.)*sin[(e_.) + ( f_.)*(x_)]), x_Symbol] :> Simp[-2*(b/f) Subst[Int[1/(b*c + a*d - d*x^2), x], x, b*(Cos[e + f*x]/Sqrt[a + b*Sin[e + f*x]])], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*((d + c*Sin[e + f*x])^n/Sin[e + f*x]^n), x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IntegerQ [n]
Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[(A *b - a*B)/(b*c - a*d) Int[1/Sqrt[a + b*Sin[e + f*x]], x], x] + Simp[(B*c - A*d)/(b*c - a*d) Int[Sqrt[a + b*Sin[e + f*x]]/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.31 (sec) , antiderivative size = 189, normalized size of antiderivative = 2.78
method | result | size |
parts | \(\frac {A \sqrt {2}\, \sqrt {\cos \left (x \right )+1}\, \operatorname {InverseJacobiAM}\left (\frac {x}{2}, 1\right )}{\sqrt {a \left (\cos \left (x \right )+1\right )}}-\frac {B \cos \left (\frac {x}{2}\right ) \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}\, \left (\sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}+4 a}{\cos \left (\frac {x}{2}\right )}\right )-\ln \left (-\frac {4 \left (a \sqrt {2}\, \cos \left (\frac {x}{2}\right )-\sqrt {a}\, \sqrt {2}\, \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}-2 a \right )}{2 \cos \left (\frac {x}{2}\right )-\sqrt {2}}\right )-\ln \left (\frac {4 a \sqrt {2}\, \cos \left (\frac {x}{2}\right )+4 \sqrt {a}\, \sqrt {2}\, \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}+8 a}{2 \cos \left (\frac {x}{2}\right )+\sqrt {2}}\right )\right )}{\sqrt {a}\, \sin \left (\frac {x}{2}\right ) \sqrt {a \cos \left (\frac {x}{2}\right )^{2}}}\) | \(189\) |
default | \(\frac {\cos \left (\frac {x}{2}\right ) \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}\, \left (\sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}+4 a}{\cos \left (\frac {x}{2}\right )}\right ) A -\sqrt {2}\, \ln \left (\frac {4 \sqrt {a}\, \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}+4 a}{\cos \left (\frac {x}{2}\right )}\right ) B +B \ln \left (-\frac {4 \left (a \sqrt {2}\, \cos \left (\frac {x}{2}\right )-\sqrt {a}\, \sqrt {2}\, \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}-2 a \right )}{2 \cos \left (\frac {x}{2}\right )-\sqrt {2}}\right )+B \ln \left (\frac {4 a \sqrt {2}\, \cos \left (\frac {x}{2}\right )+4 \sqrt {a}\, \sqrt {2}\, \sqrt {a \sin \left (\frac {x}{2}\right )^{2}}+8 a}{2 \cos \left (\frac {x}{2}\right )+\sqrt {2}}\right )\right )}{\sqrt {a}\, \sin \left (\frac {x}{2}\right ) \sqrt {a \cos \left (\frac {x}{2}\right )^{2}}}\) | \(194\) |
Input:
int((A+B*sec(x))/(a+a*cos(x))^(1/2),x,method=_RETURNVERBOSE)
Output:
A*2^(1/2)/(a*(cos(x)+1))^(1/2)*(cos(x)+1)^(1/2)*InverseJacobiAM(1/2*x,1)-B *cos(1/2*x)*(a*sin(1/2*x)^2)^(1/2)*(2^(1/2)*ln(4/cos(1/2*x)*(a^(1/2)*(a*si n(1/2*x)^2)^(1/2)+a))-ln(-4/(2*cos(1/2*x)-2^(1/2))*(a*2^(1/2)*cos(1/2*x)-a ^(1/2)*2^(1/2)*(a*sin(1/2*x)^2)^(1/2)-2*a))-ln(4/(2*cos(1/2*x)+2^(1/2))*(a *2^(1/2)*cos(1/2*x)+a^(1/2)*2^(1/2)*(a*sin(1/2*x)^2)^(1/2)+2*a)))/a^(1/2)/ sin(1/2*x)/(a*cos(1/2*x)^2)^(1/2)
Leaf count of result is larger than twice the leaf count of optimal. 116 vs. \(2 (53) = 106\).
Time = 0.08 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.71 \[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=-\frac {\sqrt {2} {\left (A - B\right )} \sqrt {a} \log \left (-\frac {\cos \left (x\right )^{2} + \frac {2 \, \sqrt {2} \sqrt {a \cos \left (x\right ) + a} \sin \left (x\right )}{\sqrt {a}} - 2 \, \cos \left (x\right ) - 3}{\cos \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1}\right ) - B \sqrt {a} \log \left (\frac {a \cos \left (x\right )^{3} - 7 \, a \cos \left (x\right )^{2} - 4 \, \sqrt {a \cos \left (x\right ) + a} \sqrt {a} {\left (\cos \left (x\right ) - 2\right )} \sin \left (x\right ) + 8 \, a}{\cos \left (x\right )^{3} + \cos \left (x\right )^{2}}\right )}{2 \, a} \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))^(1/2),x, algorithm="fricas")
Output:
-1/2*(sqrt(2)*(A - B)*sqrt(a)*log(-(cos(x)^2 + 2*sqrt(2)*sqrt(a*cos(x) + a )*sin(x)/sqrt(a) - 2*cos(x) - 3)/(cos(x)^2 + 2*cos(x) + 1)) - B*sqrt(a)*lo g((a*cos(x)^3 - 7*a*cos(x)^2 - 4*sqrt(a*cos(x) + a)*sqrt(a)*(cos(x) - 2)*s in(x) + 8*a)/(cos(x)^3 + cos(x)^2)))/a
\[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=\int \frac {A + B \sec {\left (x \right )}}{\sqrt {a \left (\cos {\left (x \right )} + 1\right )}}\, dx \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))**(1/2),x)
Output:
Integral((A + B*sec(x))/sqrt(a*(cos(x) + 1)), x)
Time = 0.17 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.85 \[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=\frac {{\left (\sqrt {2} \log \left (\cos \left (\frac {1}{2} \, x\right )^{2} + \sin \left (\frac {1}{2} \, x\right )^{2} + 2 \, \sin \left (\frac {1}{2} \, x\right ) + 1\right ) - \sqrt {2} \log \left (\cos \left (\frac {1}{2} \, x\right )^{2} + \sin \left (\frac {1}{2} \, x\right )^{2} - 2 \, \sin \left (\frac {1}{2} \, x\right ) + 1\right )\right )} A}{2 \, \sqrt {a}} \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))^(1/2),x, algorithm="maxima")
Output:
1/2*(sqrt(2)*log(cos(1/2*x)^2 + sin(1/2*x)^2 + 2*sin(1/2*x) + 1) - sqrt(2) *log(cos(1/2*x)^2 + sin(1/2*x)^2 - 2*sin(1/2*x) + 1))*A/sqrt(a)
Exception generated. \[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=\text {Exception raised: TypeError} \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))^(1/2),x, algorithm="giac")
Output:
Exception raised: TypeError >> an error occurred running a Giac command:IN PUT:sage2:=int(sage0,sageVARx):;OUTPUT:sym2poly/r2sym(const gen & e,const index_m & i,const vecteur & l) Error: Bad Argument Value
Timed out. \[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=\int \frac {A+\frac {B}{\cos \left (x\right )}}{\sqrt {a+a\,\cos \left (x\right )}} \,d x \] Input:
int((A + B/cos(x))/(a + a*cos(x))^(1/2),x)
Output:
int((A + B/cos(x))/(a + a*cos(x))^(1/2), x)
\[ \int \frac {A+B \sec (x)}{\sqrt {a+a \cos (x)}} \, dx=\frac {\sqrt {a}\, \left (\left (\int \frac {\sqrt {\cos \left (x \right )+1}}{\cos \left (x \right )+1}d x \right ) a +\left (\int \frac {\sqrt {\cos \left (x \right )+1}\, \sec \left (x \right )}{\cos \left (x \right )+1}d x \right ) b \right )}{a} \] Input:
int((A+B*sec(x))/(a+a*cos(x))^(1/2),x)
Output:
(sqrt(a)*(int(sqrt(cos(x) + 1)/(cos(x) + 1),x)*a + int((sqrt(cos(x) + 1)*s ec(x))/(cos(x) + 1),x)*b))/a