Integrand size = 15, antiderivative size = 48 \[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=\frac {B \text {arctanh}(\sin (x))}{a^2}+\frac {(A-4 B) \sin (x)}{3 a^2 (1+\cos (x))}+\frac {(A-B) \sin (x)}{3 (a+a \cos (x))^2} \] Output:
B*arctanh(sin(x))/a^2+1/3*(A-4*B)*sin(x)/a^2/(1+cos(x))+1/3*(A-B)*sin(x)/( a+a*cos(x))^2
Time = 0.29 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.58 \[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=\frac {-12 B \cos ^4\left (\frac {x}{2}\right ) \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )\right )+(2 A-5 B+(A-4 B) \cos (x)) \sin (x)}{3 a^2 (1+\cos (x))^2} \] Input:
Integrate[(A + B*Sec[x])/(a + a*Cos[x])^2,x]
Output:
(-12*B*Cos[x/2]^4*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]]) + (2*A - 5*B + (A - 4*B)*Cos[x])*Sin[x])/(3*a^2*(1 + Cos[x])^2)
Time = 0.50 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.600, Rules used = {3042, 3307, 3042, 3457, 3042, 3457, 27, 3042, 4257}
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)}{(a \cos (x)+a)^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \csc \left (x+\frac {\pi }{2}\right )}{\left (a \sin \left (x+\frac {\pi }{2}\right )+a\right )^2}dx\) |
\(\Big \downarrow \) 3307 |
\(\displaystyle \int \frac {\sec (x) (A \cos (x)+B)}{(a \cos (x)+a)^2}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A \sin \left (x+\frac {\pi }{2}\right )+B}{\sin \left (x+\frac {\pi }{2}\right ) \left (a \sin \left (x+\frac {\pi }{2}\right )+a\right )^2}dx\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle \frac {\int \frac {(3 a B+a (A-B) \cos (x)) \sec (x)}{\cos (x) a+a}dx}{3 a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {3 a B+a (A-B) \sin \left (x+\frac {\pi }{2}\right )}{\sin \left (x+\frac {\pi }{2}\right ) \left (\sin \left (x+\frac {\pi }{2}\right ) a+a\right )}dx}{3 a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2}\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle \frac {\frac {\int 3 a^2 B \sec (x)dx}{a^2}+\frac {(A-4 B) \sin (x)}{\cos (x)+1}}{3 a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {3 B \int \sec (x)dx+\frac {(A-4 B) \sin (x)}{\cos (x)+1}}{3 a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {3 B \int \csc \left (x+\frac {\pi }{2}\right )dx+\frac {(A-4 B) \sin (x)}{\cos (x)+1}}{3 a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\frac {(A-4 B) \sin (x)}{\cos (x)+1}+3 B \text {arctanh}(\sin (x))}{3 a^2}+\frac {(A-B) \sin (x)}{3 (a \cos (x)+a)^2}\) |
Input:
Int[(A + B*Sec[x])/(a + a*Cos[x])^2,x]
Output:
((A - B)*Sin[x])/(3*(a + a*Cos[x])^2) + (3*B*ArcTanh[Sin[x]] + ((A - 4*B)* Sin[x])/(1 + Cos[x]))/(3*a^2)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[b*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^( n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/(a*(2*m + 1)*(b*c - a*d)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b *d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*(m + n + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ [b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] && !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 0.16 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.06
method | result | size |
parallelrisch | \(\frac {-6 B \ln \left (\tan \left (\frac {x}{2}\right )-1\right )+6 B \ln \left (\tan \left (\frac {x}{2}\right )+1\right )+\left (\left (A -B \right ) \tan \left (\frac {x}{2}\right )^{2}+3 A -9 B \right ) \tan \left (\frac {x}{2}\right )}{6 a^{2}}\) | \(51\) |
default | \(\frac {\frac {A \tan \left (\frac {x}{2}\right )^{3}}{3}-\frac {B \tan \left (\frac {x}{2}\right )^{3}}{3}+A \tan \left (\frac {x}{2}\right )-3 B \tan \left (\frac {x}{2}\right )-2 B \ln \left (\tan \left (\frac {x}{2}\right )-1\right )+2 B \ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{2 a^{2}}\) | \(58\) |
norman | \(\frac {\frac {\left (A -B \right ) \tan \left (\frac {x}{2}\right )^{3}}{6 a}+\frac {\left (-3 B +A \right ) \tan \left (\frac {x}{2}\right )}{2 a}}{a}+\frac {B \ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{a^{2}}-\frac {B \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{a^{2}}\) | \(62\) |
risch | \(-\frac {2 i \left (3 B \,{\mathrm e}^{2 i x}-3 A \,{\mathrm e}^{i x}+9 B \,{\mathrm e}^{i x}-A +4 B \right )}{3 \left ({\mathrm e}^{i x}+1\right )^{3} a^{2}}+\frac {B \ln \left ({\mathrm e}^{i x}+i\right )}{a^{2}}-\frac {B \ln \left ({\mathrm e}^{i x}-i\right )}{a^{2}}\) | \(77\) |
Input:
int((A+B*sec(x))/(a+a*cos(x))^2,x,method=_RETURNVERBOSE)
Output:
1/6*(-6*B*ln(tan(1/2*x)-1)+6*B*ln(tan(1/2*x)+1)+((A-B)*tan(1/2*x)^2+3*A-9* B)*tan(1/2*x))/a^2
Time = 0.08 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.77 \[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=\frac {3 \, {\left (B \cos \left (x\right )^{2} + 2 \, B \cos \left (x\right ) + B\right )} \log \left (\sin \left (x\right ) + 1\right ) - 3 \, {\left (B \cos \left (x\right )^{2} + 2 \, B \cos \left (x\right ) + B\right )} \log \left (-\sin \left (x\right ) + 1\right ) + 2 \, {\left ({\left (A - 4 \, B\right )} \cos \left (x\right ) + 2 \, A - 5 \, B\right )} \sin \left (x\right )}{6 \, {\left (a^{2} \cos \left (x\right )^{2} + 2 \, a^{2} \cos \left (x\right ) + a^{2}\right )}} \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))^2,x, algorithm="fricas")
Output:
1/6*(3*(B*cos(x)^2 + 2*B*cos(x) + B)*log(sin(x) + 1) - 3*(B*cos(x)^2 + 2*B *cos(x) + B)*log(-sin(x) + 1) + 2*((A - 4*B)*cos(x) + 2*A - 5*B)*sin(x))/( a^2*cos(x)^2 + 2*a^2*cos(x) + a^2)
\[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=\frac {\int \frac {A}{\cos ^{2}{\left (x \right )} + 2 \cos {\left (x \right )} + 1}\, dx + \int \frac {B \sec {\left (x \right )}}{\cos ^{2}{\left (x \right )} + 2 \cos {\left (x \right )} + 1}\, dx}{a^{2}} \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))**2,x)
Output:
(Integral(A/(cos(x)**2 + 2*cos(x) + 1), x) + Integral(B*sec(x)/(cos(x)**2 + 2*cos(x) + 1), x))/a**2
Leaf count of result is larger than twice the leaf count of optimal. 93 vs. \(2 (44) = 88\).
Time = 0.04 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.94 \[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=-\frac {1}{6} \, B {\left (\frac {\frac {9 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {\sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}}}{a^{2}} - \frac {6 \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}{a^{2}} + \frac {6 \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right )}{a^{2}}\right )} + \frac {A {\left (\frac {3 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {\sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}}\right )}}{6 \, a^{2}} \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))^2,x, algorithm="maxima")
Output:
-1/6*B*((9*sin(x)/(cos(x) + 1) + sin(x)^3/(cos(x) + 1)^3)/a^2 - 6*log(sin( x)/(cos(x) + 1) + 1)/a^2 + 6*log(sin(x)/(cos(x) + 1) - 1)/a^2) + 1/6*A*(3* sin(x)/(cos(x) + 1) + sin(x)^3/(cos(x) + 1)^3)/a^2
Time = 0.12 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.60 \[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=\frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right )}{a^{2}} - \frac {B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right )}{a^{2}} + \frac {A a^{4} \tan \left (\frac {1}{2} \, x\right )^{3} - B a^{4} \tan \left (\frac {1}{2} \, x\right )^{3} + 3 \, A a^{4} \tan \left (\frac {1}{2} \, x\right ) - 9 \, B a^{4} \tan \left (\frac {1}{2} \, x\right )}{6 \, a^{6}} \] Input:
integrate((A+B*sec(x))/(a+a*cos(x))^2,x, algorithm="giac")
Output:
B*log(abs(tan(1/2*x) + 1))/a^2 - B*log(abs(tan(1/2*x) - 1))/a^2 + 1/6*(A*a ^4*tan(1/2*x)^3 - B*a^4*tan(1/2*x)^3 + 3*A*a^4*tan(1/2*x) - 9*B*a^4*tan(1/ 2*x))/a^6
Time = 15.37 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.04 \[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=\mathrm {tan}\left (\frac {x}{2}\right )\,\left (\frac {A-B}{2\,a^2}-\frac {B}{a^2}\right )+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,\left (A-B\right )}{6\,a^2}+\frac {2\,B\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a^2} \] Input:
int((A + B/cos(x))/(a + a*cos(x))^2,x)
Output:
tan(x/2)*((A - B)/(2*a^2) - B/a^2) + (tan(x/2)^3*(A - B))/(6*a^2) + (2*B*a tanh(tan(x/2)))/a^2
Time = 0.17 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.19 \[ \int \frac {A+B \sec (x)}{(a+a \cos (x))^2} \, dx=\frac {-6 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )-1\right ) b +6 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )+1\right ) b +\tan \left (\frac {x}{2}\right )^{3} a -\tan \left (\frac {x}{2}\right )^{3} b +3 \tan \left (\frac {x}{2}\right ) a -9 \tan \left (\frac {x}{2}\right ) b}{6 a^{2}} \] Input:
int((A+B*sec(x))/(a+a*cos(x))^2,x)
Output:
( - 6*log(tan(x/2) - 1)*b + 6*log(tan(x/2) + 1)*b + tan(x/2)**3*a - tan(x/ 2)**3*b + 3*tan(x/2)*a - 9*tan(x/2)*b)/(6*a**2)