Integrand size = 14, antiderivative size = 58 \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=\frac {2 (b+c) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}-\frac {\log (a+b \cos (x))}{b} \] Output:
2*(b+c)*arctan((a-b)^(1/2)*tan(1/2*x)/(a+b)^(1/2))/(a-b)^(1/2)/(a+b)^(1/2) -ln(a+b*cos(x))/b
Time = 0.13 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.98 \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=-\frac {2 (b+c) \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}-\frac {\log (a+b \cos (x))}{b} \] Input:
Integrate[(b + c + Sin[x])/(a + b*Cos[x]),x]
Output:
(-2*(b + c)*ArcTanh[((a - b)*Tan[x/2])/Sqrt[-a^2 + b^2]])/Sqrt[-a^2 + b^2] - Log[a + b*Cos[x]]/b
Time = 0.33 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3042, 4901, 2009}
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 {b+c+\sin (x)}{a+b \cos (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {b+c+\sin (x)}{a+b \cos (x)}dx\) |
\(\Big \downarrow \) 4901 |
\(\displaystyle \int \left (\frac {b+c}{a+b \cos (x)}+\frac {\sin (x)}{a+b \cos (x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {2 (b+c) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}-\frac {\log (a+b \cos (x))}{b}\) |
Input:
Int[(b + c + Sin[x])/(a + b*Cos[x]),x]
Output:
(2*(b + c)*ArcTan[(Sqrt[a - b]*Tan[x/2])/Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]) - Log[a + b*Cos[x]]/b
Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /; !InertTrigFreeQ[u]
Time = 0.18 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.67
method | result | size |
default | \(\frac {\frac {2 \left (-a +b \right ) \ln \left (a \tan \left (\frac {x}{2}\right )^{2}-b \tan \left (\frac {x}{2}\right )^{2}+a +b \right )}{2 a -2 b}+\frac {2 \left (b^{2}+c b \right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {x}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}}{b}+\frac {\ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )}{b}\) | \(97\) |
risch | \(-\frac {i x}{b}+\frac {2 i x \,a^{2} b}{b^{2} a^{2}-b^{4}}-\frac {2 i x \,b^{3}}{b^{2} a^{2}-b^{4}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {-a \,b^{2}-c a b +i \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{b^{2} \left (b +c \right )}\right ) a^{2}}{\left (a^{2}-b^{2}\right ) b}+\frac {b \ln \left ({\mathrm e}^{i x}-\frac {-a \,b^{2}-c a b +i \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{b^{2} \left (b +c \right )}\right )}{a^{2}-b^{2}}+\frac {\ln \left ({\mathrm e}^{i x}-\frac {-a \,b^{2}-c a b +i \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{b^{2} \left (b +c \right )}\right ) \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{\left (a^{2}-b^{2}\right ) b}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {a \,b^{2}+c a b +i \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{b^{2} \left (b +c \right )}\right ) a^{2}}{\left (a^{2}-b^{2}\right ) b}+\frac {b \ln \left ({\mathrm e}^{i x}+\frac {a \,b^{2}+c a b +i \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{b^{2} \left (b +c \right )}\right )}{a^{2}-b^{2}}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {a \,b^{2}+c a b +i \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{b^{2} \left (b +c \right )}\right ) \sqrt {-a^{2} b^{4}-2 b^{3} a^{2} c -b^{2} a^{2} c^{2}+b^{6}+2 b^{5} c +b^{4} c^{2}}}{\left (a^{2}-b^{2}\right ) b}\) | \(708\) |
Input:
int((b+c+sin(x))/(a+b*cos(x)),x,method=_RETURNVERBOSE)
Output:
2/b*(1/2*(-a+b)/(a-b)*ln(a*tan(1/2*x)^2-b*tan(1/2*x)^2+a+b)+(b^2+b*c)/((a- b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*x)/((a-b)*(a+b))^(1/2)))+1/b*ln(1+tan (1/2*x)^2)
Time = 0.16 (sec) , antiderivative size = 231, normalized size of antiderivative = 3.98 \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=\left [-\frac {\sqrt {-a^{2} + b^{2}} {\left (b^{2} + b c\right )} \log \left (\frac {2 \, a b \cos \left (x\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (x\right ) + b\right )} \sin \left (x\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}}\right ) + {\left (a^{2} - b^{2}\right )} \log \left (b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}\right )}{2 \, {\left (a^{2} b - b^{3}\right )}}, \frac {2 \, \sqrt {a^{2} - b^{2}} {\left (b^{2} + b c\right )} \arctan \left (-\frac {a \cos \left (x\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (x\right )}\right ) - {\left (a^{2} - b^{2}\right )} \log \left (b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}\right )}{2 \, {\left (a^{2} b - b^{3}\right )}}\right ] \] Input:
integrate((b+c+sin(x))/(a+b*cos(x)),x, algorithm="fricas")
Output:
[-1/2*(sqrt(-a^2 + b^2)*(b^2 + b*c)*log((2*a*b*cos(x) + (2*a^2 - b^2)*cos( x)^2 + 2*sqrt(-a^2 + b^2)*(a*cos(x) + b)*sin(x) - a^2 + 2*b^2)/(b^2*cos(x) ^2 + 2*a*b*cos(x) + a^2)) + (a^2 - b^2)*log(b^2*cos(x)^2 + 2*a*b*cos(x) + a^2))/(a^2*b - b^3), 1/2*(2*sqrt(a^2 - b^2)*(b^2 + b*c)*arctan(-(a*cos(x) + b)/(sqrt(a^2 - b^2)*sin(x))) - (a^2 - b^2)*log(b^2*cos(x)^2 + 2*a*b*cos( x) + a^2))/(a^2*b - b^3)]
Leaf count of result is larger than twice the leaf count of optimal. 804 vs. \(2 (49) = 98\).
Time = 12.19 (sec) , antiderivative size = 804, normalized size of antiderivative = 13.86 \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=\text {Too large to display} \] Input:
integrate((b+c+sin(x))/(a+b*cos(x)),x)
Output:
Piecewise((zoo*(-c*log(tan(x/2) - 1) + c*log(tan(x/2) + 1) - log(tan(x/2) - 1) - log(tan(x/2) + 1) + log(tan(x/2)**2 + 1)), Eq(a, 0) & Eq(b, 0)), (t an(x/2) + c*tan(x/2)/b + log(tan(x/2)**2 + 1)/b, Eq(a, b)), (1/tan(x/2) + c/(b*tan(x/2)) + log(tan(x/2)**2 + 1)/b - 2*log(tan(x/2))/b, Eq(a, -b)), ( (c*x - cos(x))/a, Eq(b, 0)), (-a*sqrt(-a/(a - b) - b/(a - b))*log(-sqrt(-a /(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqrt(-a/(a - b) - b/(a - b)) - b**2 *sqrt(-a/(a - b) - b/(a - b))) - a*sqrt(-a/(a - b) - b/(a - b))*log(sqrt(- a/(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqrt(-a/(a - b) - b/(a - b)) - b** 2*sqrt(-a/(a - b) - b/(a - b))) + a*sqrt(-a/(a - b) - b/(a - b))*log(tan(x /2)**2 + 1)/(a*b*sqrt(-a/(a - b) - b/(a - b)) - b**2*sqrt(-a/(a - b) - b/( a - b))) + b**2*log(-sqrt(-a/(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqrt(-a /(a - b) - b/(a - b)) - b**2*sqrt(-a/(a - b) - b/(a - b))) - b**2*log(sqrt (-a/(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqrt(-a/(a - b) - b/(a - b)) - b **2*sqrt(-a/(a - b) - b/(a - b))) + b*c*log(-sqrt(-a/(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqrt(-a/(a - b) - b/(a - b)) - b**2*sqrt(-a/(a - b) - b/( a - b))) - b*c*log(sqrt(-a/(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqrt(-a/( a - b) - b/(a - b)) - b**2*sqrt(-a/(a - b) - b/(a - b))) + b*sqrt(-a/(a - b) - b/(a - b))*log(-sqrt(-a/(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqrt(-a /(a - b) - b/(a - b)) - b**2*sqrt(-a/(a - b) - b/(a - b))) + b*sqrt(-a/(a - b) - b/(a - b))*log(sqrt(-a/(a - b) - b/(a - b)) + tan(x/2))/(a*b*sqr...
Exception generated. \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((b+c+sin(x))/(a+b*cos(x)),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. 407 vs. \(2 (48) = 96\).
Time = 0.13 (sec) , antiderivative size = 407, normalized size of antiderivative = 7.02 \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=-\frac {{\left (a + b\right )} {\left (a - b\right )}^{2} \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + \frac {2 \, a + \sqrt {-4 \, {\left (a + b\right )} {\left (a - b\right )} + 4 \, a^{2}}}{2 \, {\left (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 (\sqrt {a^{2} - b^{2}} b^{2} {\left | a - b \right |} + \sqrt {a^{2} - b^{2}} b c {\left | a - b \right |} + \sqrt {a^{2} - b^{2}} b {\left | a - b \right |} {\left | b \right |} + \sqrt {a^{2} - b^{2}} c {\left | a - b \right |} {\left | b \right |}\right )} {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {2 \, \sqrt {\frac {1}{2}} \tan \left (\frac {1}{2} \, x\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 (b^{2} + b c - b {\left | b \right |} - c {\left | b \right |}\right )} {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {2 \, \sqrt {\frac {1}{2}} \tan \left (\frac {1}{2} \, x\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 |}} - \frac {{\left (a - b\right )} \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + \frac {2 \, a - \sqrt {-4 \, {\left (a + b\right )} {\left (a - b\right )} + 4 \, a^{2}}}{2 \, {\left (a - b\right )}}\right )}{b^{2} - a {\left | b \right |}} \] Input:
integrate((b+c+sin(x))/(a+b*cos(x)),x, algorithm="giac")
Output:
-(a + b)*(a - b)^2*log(tan(1/2*x)^2 + 1/2*(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 )) + (sqrt(a^2 - b^2)*b^2*abs(a - b) + sqrt(a^2 - b^2)*b*c*abs(a - b) + sq rt(a^2 - b^2)*b*abs(a - b)*abs(b) + sqrt(a^2 - b^2)*c*abs(a - b)*abs(b))*( pi*floor(1/2*x/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*x)/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)) + (b^2 + b*c - b*abs(b) - c*abs(b))*(pi*floor(1/2 *x/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*x)/sqrt((2*a - sqrt(-4*(a + b)*( a - b) + 4*a^2))/(a - b))))/(b^2 - a*abs(b)) - (a - b)*log(tan(1/2*x)^2 + 1/2*(2*a - sqrt(-4*(a + b)*(a - b) + 4*a^2))/(a - b))/(b^2 - a*abs(b))
Time = 6.93 (sec) , antiderivative size = 2219, normalized size of antiderivative = 38.26 \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=\text {Too large to display} \] Input:
int((b + c + sin(x))/(a + b*cos(x)),x)
Output:
log(tan(x/2)^2 + 1)/b - (2*atan((tan(x/2)*((4*b*(b + c)*(32*a*b^3 - 128*a* b - 64*b^3*c + 64*a^2 + 64*b^2 - 32*b^4 - 32*b^2*c^2 + ((b + c)*(((b + c)* (64*b^4 - 128*a*b^3 + 64*a^2*b^2 + ((2*a^2*b - 2*b^3)*(64*a*b^4 - 128*a^2* b^3 + 64*a^3*b^2))/(2*(b^4 - a^2*b^2))))/(a^2 - b^2)^(1/2) + ((2*a^2*b - 2 *b^3)*(b + c)*(64*a*b^4 - 128*a^2*b^3 + 64*a^3*b^2))/(2*(b^4 - a^2*b^2)*(a ^2 - b^2)^(1/2))))/(a^2 - b^2)^(1/2) + ((2*a^2*b - 2*b^3)*(64*a*b^2 - 128* a^2*b - 32*a*b^4 + 64*b^4*c + 64*a^3 + 32*b^5 + 32*b^3*c^2 - ((2*a^2*b - 2 *b^3)*(64*b^4 - 128*a*b^3 + 64*a^2*b^2 + ((2*a^2*b - 2*b^3)*(64*a*b^4 - 12 8*a^2*b^3 + 64*a^3*b^2))/(2*(b^4 - a^2*b^2))))/(2*(b^4 - a^2*b^2)) - 32*a* b^2*c^2 - 64*a*b^3*c))/(2*(b^4 - a^2*b^2)) + 32*a*b*c^2 + 64*a*b^2*c + ((2 *a^2*b - 2*b^3)*(b + c)^2*(64*a*b^4 - 128*a^2*b^3 + 64*a^3*b^2))/(2*(b^4 - a^2*b^2)*(a^2 - b^2))))/((a - b)*(2*b^3*c + 4*a^2 - 4*b^2 + b^4 + b^2*c^2 )^2) - ((((b + c)^3*(64*a*b^4 - 128*a^2*b^3 + 64*a^3*b^2))/(a^2 - b^2)^(3/ 2) - ((2*a^2*b - 2*b^3)*(((b + c)*(64*b^4 - 128*a*b^3 + 64*a^2*b^2 + ((2*a ^2*b - 2*b^3)*(64*a*b^4 - 128*a^2*b^3 + 64*a^3*b^2))/(2*(b^4 - a^2*b^2)))) /(a^2 - b^2)^(1/2) + ((2*a^2*b - 2*b^3)*(b + c)*(64*a*b^4 - 128*a^2*b^3 + 64*a^3*b^2))/(2*(b^4 - a^2*b^2)*(a^2 - b^2)^(1/2))))/(2*(b^4 - a^2*b^2)) + ((b + c)*(64*a*b^2 - 128*a^2*b - 32*a*b^4 + 64*b^4*c + 64*a^3 + 32*b^5 + 32*b^3*c^2 - ((2*a^2*b - 2*b^3)*(64*b^4 - 128*a*b^3 + 64*a^2*b^2 + ((2*a^2 *b - 2*b^3)*(64*a*b^4 - 128*a^2*b^3 + 64*a^3*b^2))/(2*(b^4 - a^2*b^2)))...
Time = 0.23 (sec) , antiderivative size = 179, normalized size of antiderivative = 3.09 \[ \int \frac {b+c+\sin (x)}{a+b \cos (x)} \, dx=\frac {2 \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) a -\tan \left (\frac {x}{2}\right ) b}{\sqrt {a^{2}-b^{2}}}\right ) b^{2}+2 \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) a -\tan \left (\frac {x}{2}\right ) b}{\sqrt {a^{2}-b^{2}}}\right ) b c +\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) a^{2}-\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b^{2}-\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} b +a +b \right ) a^{2}+\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} b +a +b \right ) b^{2}}{b \left (a^{2}-b^{2}\right )} \] Input:
int((b+c+sin(x))/(a+b*cos(x)),x)
Output:
(2*sqrt(a**2 - b**2)*atan((tan(x/2)*a - tan(x/2)*b)/sqrt(a**2 - b**2))*b** 2 + 2*sqrt(a**2 - b**2)*atan((tan(x/2)*a - tan(x/2)*b)/sqrt(a**2 - b**2))* b*c + log(tan(x/2)**2 + 1)*a**2 - log(tan(x/2)**2 + 1)*b**2 - log(tan(x/2) **2*a - tan(x/2)**2*b + a + b)*a**2 + log(tan(x/2)**2*a - tan(x/2)**2*b + a + b)*b**2)/(b*(a**2 - b**2))