Integrand size = 32, antiderivative size = 61 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=\frac {B x}{b}-\frac {2 a B \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b \sqrt {a+b} d} \] Output:
B*x/b-2*a*B*arctan((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(1/2) /b/(a+b)^(1/2)/d
Time = 0.15 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.97 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=\frac {B \left (c+d x+\frac {2 a \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}\right )}{b d} \] Input:
Integrate[(Cos[c + d*x]*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x])^2,x ]
Output:
(B*(c + d*x + (2*a*ArcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]])/S qrt[-a^2 + b^2]))/(b*d)
Time = 0.30 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {2011, 3042, 3214, 3042, 3138, 218}
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 {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 2011 |
\(\displaystyle B \int \frac {\cos (c+d x)}{a+b \cos (c+d x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle B \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right )}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle B \left (\frac {x}{b}-\frac {a \int \frac {1}{a+b \cos (c+d x)}dx}{b}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle B \left (\frac {x}{b}-\frac {a \int \frac {1}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{b}\right )\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle B \left (\frac {x}{b}-\frac {2 a \int \frac {1}{(a-b) \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}d\tan \left (\frac {1}{2} (c+d x)\right )}{b d}\right )\) |
\(\Big \downarrow \) 218 |
\(\displaystyle B \left (\frac {x}{b}-\frac {2 a \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b d \sqrt {a-b} \sqrt {a+b}}\right )\) |
Input:
Int[(Cos[c + d*x]*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x])^2,x]
Output:
B*(x/b - (2*a*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*b*Sqrt[a + b]*d))
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Simp[(b/d)^m Int[u*(c + d*v)^(m + n), x], x] /; FreeQ[{a, b, c, d, n}, x ] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c + d*x , a + b*x])
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[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Time = 2.05 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.08
method | result | size |
derivativedivides | \(\frac {2 B \left (\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b}-\frac {a \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d}\) | \(66\) |
default | \(\frac {2 B \left (\frac {\arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b}-\frac {a \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d}\) | \(66\) |
risch | \(\frac {B x}{b}-\frac {a B \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, d b}+\frac {a B \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, d b}\) | \(155\) |
Input:
int(cos(d*x+c)*(B*a+b*B*cos(d*x+c))/(a+cos(d*x+c)*b)^2,x,method=_RETURNVER BOSE)
Output:
2/d*B*(1/b*arctan(tan(1/2*d*x+1/2*c))-1/b*a/((a-b)*(a+b))^(1/2)*arctan((a- b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b))^(1/2)))
Time = 0.09 (sec) , antiderivative size = 231, normalized size of antiderivative = 3.79 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=\left [-\frac {\sqrt {-a^{2} + b^{2}} B a \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - 2 \, {\left (B a^{2} - B b^{2}\right )} d x}{2 \, {\left (a^{2} b - b^{3}\right )} d}, -\frac {\sqrt {a^{2} - b^{2}} B a \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) - {\left (B a^{2} - B b^{2}\right )} d x}{{\left (a^{2} b - b^{3}\right )} d}\right ] \] Input:
integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,x, algorithm= "fricas")
Output:
[-1/2*(sqrt(-a^2 + b^2)*B*a*log((2*a*b*cos(d*x + c) + (2*a^2 - b^2)*cos(d* x + c)^2 - 2*sqrt(-a^2 + b^2)*(a*cos(d*x + c) + b)*sin(d*x + c) - a^2 + 2* b^2)/(b^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2)) - 2*(B*a^2 - B*b^2)* d*x)/((a^2*b - b^3)*d), -(sqrt(a^2 - b^2)*B*a*arctan(-(a*cos(d*x + c) + b) /(sqrt(a^2 - b^2)*sin(d*x + c))) - (B*a^2 - B*b^2)*d*x)/((a^2*b - b^3)*d)]
Timed out. \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=\text {Timed out} \] Input:
integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))**2,x)
Output:
Timed out
Exception generated. \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,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(4*b^2-4*a^2>0)', see `assume?` f or more de
Leaf count of result is larger than twice the leaf count of optimal. 245 vs. \(2 (52) = 104\).
Time = 0.17 (sec) , antiderivative size = 245, normalized size of antiderivative = 4.02 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=-\frac {\frac {{\left (\sqrt {a^{2} - b^{2}} B {\left (2 \, a - b\right )} {\left | a - b \right |} + \sqrt {a^{2} - b^{2}} B {\left | a - b \right |} {\left | b \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {2 \, \sqrt {\frac {1}{2}} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {\frac {2 \, a + \sqrt {-4 \, {\left (a + b\right )} {\left (a - b\right )} + 4 \, a^{2}}}{a - b}}}\right )\right )}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} b^{2} + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} {\left | b \right |}} + \frac {{\left (2 \, B a - B b - B {\left | b \right |}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {2 \, \sqrt {\frac {1}{2}} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {\frac {2 \, a - \sqrt {-4 \, {\left (a + b\right )} {\left (a - b\right )} + 4 \, a^{2}}}{a - b}}}\right )\right )}}{b^{2} - a {\left | b \right |}}}{d} \] Input:
integrate(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,x, algorithm= "giac")
Output:
-((sqrt(a^2 - b^2)*B*(2*a - b)*abs(a - b) + sqrt(a^2 - b^2)*B*abs(a - b)*a bs(b))*(pi*floor(1/2*(d*x + c)/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*d*x + 1/2*c)/sqrt((2*a + sqrt(-4*(a + b)*(a - b) + 4*a^2))/(a - b))))/((a^2 - 2*a*b + b^2)*b^2 + (a^3 - 2*a^2*b + a*b^2)*abs(b)) + (2*B*a - B*b - B*abs( b))*(pi*floor(1/2*(d*x + c)/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*d*x + 1 /2*c)/sqrt((2*a - sqrt(-4*(a + b)*(a - b) + 4*a^2))/(a - b))))/(b^2 - a*ab s(b)))/d
Time = 25.39 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.66 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=\frac {2\,B\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{b\,d}+\frac {2\,B\,a\,\mathrm {atanh}\left (\frac {a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}\right )}{b\,d\,\sqrt {b^2-a^2}} \] Input:
int((cos(c + d*x)*(B*a + B*b*cos(c + d*x)))/(a + b*cos(c + d*x))^2,x)
Output:
(2*B*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(b*d) + (2*B*a*atanh((a* sin(c/2 + (d*x)/2) - b*sin(c/2 + (d*x)/2))/(cos(c/2 + (d*x)/2)*(b^2 - a^2) ^(1/2))))/(b*d*(b^2 - a^2)^(1/2))
Time = 0.17 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.31 \[ \int \frac {\cos (c+d x) (a B+b B \cos (c+d x))}{(a+b \cos (c+d x))^2} \, dx=\frac {-2 \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b}{\sqrt {a^{2}-b^{2}}}\right ) a +a^{2} d x -b^{2} d x}{d \left (a^{2}-b^{2}\right )} \] Input:
int(cos(d*x+c)*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c))^2,x)
Output:
( - 2*sqrt(a**2 - b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqr t(a**2 - b**2))*a + a**2*d*x - b**2*d*x)/(d*(a**2 - b**2))