Integrand size = 18, antiderivative size = 74 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {c C x}{b^2+c^2}-\frac {A \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}-\frac {b C \log (b \cos (x)+c \sin (x))}{b^2+c^2} \] Output:
c*C*x/(b^2+c^2)-A*arctanh((c*cos(x)-b*sin(x))/(b^2+c^2)^(1/2))/(b^2+c^2)^( 1/2)-b*C*ln(b*cos(x)+c*sin(x))/(b^2+c^2)
Time = 0.23 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.92 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {2 A \text {arctanh}\left (\frac {-c+b \tan \left (\frac {x}{2}\right )}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}+\frac {C (c x-b \log (b \cos (x)+c \sin (x)))}{b^2+c^2} \] Input:
Integrate[(A + C*Sin[x])/(b*Cos[x] + c*Sin[x]),x]
Output:
(2*A*ArcTanh[(-c + b*Tan[x/2])/Sqrt[b^2 + c^2]])/Sqrt[b^2 + c^2] + (C*(c*x - b*Log[b*Cos[x] + c*Sin[x]]))/(b^2 + c^2)
Time = 0.31 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3042, 3616, 3042, 3553, 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+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)}dx\) |
\(\Big \downarrow \) 3616 |
\(\displaystyle A \int \frac {1}{b \cos (x)+c \sin (x)}dx+\frac {c C x}{b^2+c^2}-\frac {b C \log (b \cos (x)+c \sin (x))}{b^2+c^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle A \int \frac {1}{b \cos (x)+c \sin (x)}dx+\frac {c C x}{b^2+c^2}-\frac {b C \log (b \cos (x)+c \sin (x))}{b^2+c^2}\) |
\(\Big \downarrow \) 3553 |
\(\displaystyle -A \int \frac {1}{b^2+c^2-(c \cos (x)-b \sin (x))^2}d(c \cos (x)-b \sin (x))+\frac {c C x}{b^2+c^2}-\frac {b C \log (b \cos (x)+c \sin (x))}{b^2+c^2}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {A \text {arctanh}\left (\frac {c \cos (x)-b \sin (x)}{\sqrt {b^2+c^2}}\right )}{\sqrt {b^2+c^2}}+\frac {c C x}{b^2+c^2}-\frac {b C \log (b \cos (x)+c \sin (x))}{b^2+c^2}\) |
Input:
Int[(A + C*Sin[x])/(b*Cos[x] + c*Sin[x]),x]
Output:
(c*C*x)/(b^2 + c^2) - (A*ArcTanh[(c*Cos[x] - b*Sin[x])/Sqrt[b^2 + c^2]])/S qrt[b^2 + c^2] - (b*C*Log[b*Cos[x] + c*Sin[x]])/(b^2 + c^2)
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[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x _Symbol] :> Simp[-d^(-1) Subst[Int[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]
Int[((A_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_) ]*(b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[c*C*((d + e*x)/ (e*(b^2 + c^2))), x] + (-Simp[b*C*(Log[a + b*Cos[d + e*x] + c*Sin[d + e*x]] /(e*(b^2 + c^2))), x] + Simp[(A*(b^2 + c^2) - a*c*C)/(b^2 + c^2) Int[1/(a + b*Cos[d + e*x] + c*Sin[d + e*x]), x], x]) /; FreeQ[{a, b, c, d, e, A, C} , x] && NeQ[b^2 + c^2, 0] && NeQ[A*(b^2 + c^2) - a*c*C, 0]
Time = 0.40 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.58
method | result | size |
default | \(\frac {2 C \left (\frac {b \ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )}{2}+c \arctan \left (\tan \left (\frac {x}{2}\right )\right )\right )}{b^{2}+c^{2}}+\frac {-b C \ln \left (b \tan \left (\frac {x}{2}\right )^{2}-2 c \tan \left (\frac {x}{2}\right )-b \right )-\frac {2 \left (-A \,b^{2}-A \,c^{2}\right ) \operatorname {arctanh}\left (\frac {2 b \tan \left (\frac {x}{2}\right )-2 c}{2 \sqrt {b^{2}+c^{2}}}\right )}{\sqrt {b^{2}+c^{2}}}}{b^{2}+c^{2}}\) | \(117\) |
risch | \(\frac {i C x}{i c -b}+\frac {2 i C x \,b^{3}}{b^{4}+2 b^{2} c^{2}+c^{4}}+\frac {2 i C x b \,c^{2}}{b^{4}+2 b^{2} c^{2}+c^{4}}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) C b}{b^{2}+c^{2}}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) C b}{b^{2}+c^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {\left (i b -c \right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{A \left (b^{2}+c^{2}\right )}\right ) \sqrt {A^{2} b^{2}+A^{2} c^{2}}}{b^{2}+c^{2}}\) | \(331\) |
Input:
int((A+C*sin(x))/(b*cos(x)+c*sin(x)),x,method=_RETURNVERBOSE)
Output:
2*C/(b^2+c^2)*(1/2*b*ln(1+tan(1/2*x)^2)+c*arctan(tan(1/2*x)))+2/(b^2+c^2)* (-1/2*b*C*ln(b*tan(1/2*x)^2-2*c*tan(1/2*x)-b)-(-A*b^2-A*c^2)/(b^2+c^2)^(1/ 2)*arctanh(1/2*(2*b*tan(1/2*x)-2*c)/(b^2+c^2)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 144 vs. \(2 (70) = 140\).
Time = 0.09 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.95 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {2 \, C c x - C b \log \left (2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} + c^{2}\right ) + \sqrt {b^{2} + c^{2}} A \log \left (-\frac {2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} - 2 \, b^{2} - c^{2} + 2 \, \sqrt {b^{2} + c^{2}} {\left (c \cos \left (x\right ) - b \sin \left (x\right )\right )}}{2 \, b c \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} - c^{2}\right )} \cos \left (x\right )^{2} + c^{2}}\right )}{2 \, {\left (b^{2} + c^{2}\right )}} \] Input:
integrate((A+C*sin(x))/(b*cos(x)+c*sin(x)),x, algorithm="fricas")
Output:
1/2*(2*C*c*x - C*b*log(2*b*c*cos(x)*sin(x) + (b^2 - c^2)*cos(x)^2 + c^2) + sqrt(b^2 + c^2)*A*log(-(2*b*c*cos(x)*sin(x) + (b^2 - c^2)*cos(x)^2 - 2*b^ 2 - c^2 + 2*sqrt(b^2 + c^2)*(c*cos(x) - b*sin(x)))/(2*b*c*cos(x)*sin(x) + (b^2 - c^2)*cos(x)^2 + c^2)))/(b^2 + c^2)
Result contains complex when optimal does not.
Time = 11.96 (sec) , antiderivative size = 638, normalized size of antiderivative = 8.62 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx =\text {Too large to display} \] Input:
integrate((A+C*sin(x))/(b*cos(x)+c*sin(x)),x)
Output:
Piecewise((zoo*(A*log(tan(x/2)) + C*x), Eq(b, 0) & Eq(c, 0)), ((A*log(tan( x/2)) + C*x)/c, Eq(b, 0)), (-2*A/(2*I*c*sin(x) + 2*c*cos(x)) + I*C*x*sin(x )/(2*I*c*sin(x) + 2*c*cos(x)) + C*x*cos(x)/(2*I*c*sin(x) + 2*c*cos(x)) - I *C*cos(x)/(2*I*c*sin(x) + 2*c*cos(x)), Eq(b, -I*c)), (-2*A/(-2*I*c*sin(x) + 2*c*cos(x)) - I*C*x*sin(x)/(-2*I*c*sin(x) + 2*c*cos(x)) + C*x*cos(x)/(-2 *I*c*sin(x) + 2*c*cos(x)) + I*C*cos(x)/(-2*I*c*sin(x) + 2*c*cos(x)), Eq(b, I*c)), (-A*b**2*log(tan(x/2) - c/b - sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) + A*b**2*log(tan(x/2) - c/b + sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) - A*c**2*log (tan(x/2) - c/b - sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt (b**2 + c**2)) + A*c**2*log(tan(x/2) - c/b + sqrt(b**2 + c**2)/b)/(b**2*sq rt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) + C*b*sqrt(b**2 + c**2)*log(tan( x/2)**2 + 1)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) - C*b*sqrt( b**2 + c**2)*log(tan(x/2) - c/b - sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c **2) + c**2*sqrt(b**2 + c**2)) - C*b*sqrt(b**2 + c**2)*log(tan(x/2) - c/b + sqrt(b**2 + c**2)/b)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) + C*c*x*sqrt(b**2 + c**2)/(b**2*sqrt(b**2 + c**2) + c**2*sqrt(b**2 + c**2)) , True))
Leaf count of result is larger than twice the leaf count of optimal. 153 vs. \(2 (70) = 140\).
Time = 0.11 (sec) , antiderivative size = 153, normalized size of antiderivative = 2.07 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=C {\left (\frac {2 \, c \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{b^{2} + c^{2}} - \frac {b \log \left (-b - \frac {2 \, c \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {b \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{b^{2} + c^{2}} + \frac {b \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{b^{2} + c^{2}}\right )} - \frac {A \log \left (\frac {c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \sqrt {b^{2} + c^{2}}}{c - \frac {b \sin \left (x\right )}{\cos \left (x\right ) + 1} - \sqrt {b^{2} + c^{2}}}\right )}{\sqrt {b^{2} + c^{2}}} \] Input:
integrate((A+C*sin(x))/(b*cos(x)+c*sin(x)),x, algorithm="maxima")
Output:
C*(2*c*arctan(sin(x)/(cos(x) + 1))/(b^2 + c^2) - b*log(-b - 2*c*sin(x)/(co s(x) + 1) + b*sin(x)^2/(cos(x) + 1)^2)/(b^2 + c^2) + b*log(sin(x)^2/(cos(x ) + 1)^2 + 1)/(b^2 + c^2)) - A*log((c - b*sin(x)/(cos(x) + 1) + sqrt(b^2 + c^2))/(c - b*sin(x)/(cos(x) + 1) - sqrt(b^2 + c^2)))/sqrt(b^2 + c^2)
Time = 0.15 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.77 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {C c x}{b^{2} + c^{2}} + \frac {C b \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}{b^{2} + c^{2}} - \frac {C b \log \left ({\left | b \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, c \tan \left (\frac {1}{2} \, x\right ) - b \right |}\right )}{b^{2} + c^{2}} - \frac {A \log \left (\frac {{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, c - 2 \, \sqrt {b^{2} + c^{2}} \right |}}{{\left | 2 \, b \tan \left (\frac {1}{2} \, x\right ) - 2 \, c + 2 \, \sqrt {b^{2} + c^{2}} \right |}}\right )}{\sqrt {b^{2} + c^{2}}} \] Input:
integrate((A+C*sin(x))/(b*cos(x)+c*sin(x)),x, algorithm="giac")
Output:
C*c*x/(b^2 + c^2) + C*b*log(tan(1/2*x)^2 + 1)/(b^2 + c^2) - C*b*log(abs(b* tan(1/2*x)^2 - 2*c*tan(1/2*x) - b))/(b^2 + c^2) - A*log(abs(2*b*tan(1/2*x) - 2*c - 2*sqrt(b^2 + c^2))/abs(2*b*tan(1/2*x) - 2*c + 2*sqrt(b^2 + c^2))) /sqrt(b^2 + c^2)
Time = 20.04 (sec) , antiderivative size = 695, normalized size of antiderivative = 9.39 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx =\text {Too large to display} \] Input:
int((A + C*sin(x))/(b*cos(x) + c*sin(x)),x)
Output:
(C*log(tan(x/2) + 1i))/(b - c*1i) - log(- 32*A*C^2*b^2 - ((C*b^3 - A*((b^2 + c^2)^3)^(1/2) + C*b*c^2)*(64*A^2*b^2*c + 32*C^2*b^2*c - 32*b*tan(x/2)*( A^2*b^2 - A^2*c^2 + 2*C^2*c^2 - 4*A*C*b*c) + 64*A*C*b^3 + ((C*b^3 - A*((b^ 2 + c^2)^3)^(1/2) + C*b*c^2)*(32*A*b^4 + 32*A*b^2*c^2 + 32*b*tan(x/2)*(2*A *c^3 - 2*C*b^3 + 2*A*b^2*c + C*b*c^2) - 32*C*b*c^3 + 64*C*b^3*c - (96*b*c* (b + c*tan(x/2))*(C*b^3 - A*((b^2 + c^2)^3)^(1/2) + C*b*c^2))/(b^2 + c^2)) )/(b^2 + c^2)^2))/(b^2 + c^2)^2 - 32*A^2*C*b*c - 32*C*b*tan(x/2)*(2*C^2*b - A^2*b + 2*A*C*c))*((C*b)/(b^2 + c^2) - (A*((b^2 + c^2)^3)^(1/2))/(b^2 + c^2)^2) - log(- 32*A*C^2*b^2 - ((A*((b^2 + c^2)^3)^(1/2) + C*b^3 + C*b*c^2 )*(64*A^2*b^2*c + 32*C^2*b^2*c - 32*b*tan(x/2)*(A^2*b^2 - A^2*c^2 + 2*C^2* c^2 - 4*A*C*b*c) + 64*A*C*b^3 + ((A*((b^2 + c^2)^3)^(1/2) + C*b^3 + C*b*c^ 2)*(32*A*b^4 + 32*A*b^2*c^2 + 32*b*tan(x/2)*(2*A*c^3 - 2*C*b^3 + 2*A*b^2*c + C*b*c^2) - 32*C*b*c^3 + 64*C*b^3*c - (96*b*c*(b + c*tan(x/2))*(A*((b^2 + c^2)^3)^(1/2) + C*b^3 + C*b*c^2))/(b^2 + c^2)))/(b^2 + c^2)^2))/(b^2 + c ^2)^2 - 32*A^2*C*b*c - 32*C*b*tan(x/2)*(2*C^2*b - A^2*b + 2*A*C*c))*((C*b) /(b^2 + c^2) + (A*((b^2 + c^2)^3)^(1/2))/(b^2 + c^2)^2) + (C*log(tan(x/2) - 1i)*1i)/(b*1i - c)
Time = 0.16 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.89 \[ \int \frac {A+C \sin (x)}{b \cos (x)+c \sin (x)} \, dx=\frac {-2 \sqrt {b^{2}+c^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right ) b i -c i}{\sqrt {b^{2}+c^{2}}}\right ) a i -\mathrm {log}\left (\cos \left (x \right ) b +\sin \left (x \right ) c \right ) b c +c^{2} x}{b^{2}+c^{2}} \] Input:
int((A+C*sin(x))/(b*cos(x)+c*sin(x)),x)
Output:
( - 2*sqrt(b**2 + c**2)*atan((tan(x/2)*b*i - c*i)/sqrt(b**2 + c**2))*a*i - log(cos(x)*b + sin(x)*c)*b*c + c**2*x)/(b**2 + c**2)