Integrand size = 22, antiderivative size = 85 \[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=\frac {(2 a A-i b C) x}{2 a^2}-\frac {C \cos (x)}{2 a}+\frac {\left (2 i a A b-a^2 C+b^2 C\right ) \log (a+b \cos (x)+i b \sin (x))}{2 a^2 b}+\frac {i C \sin (x)}{2 a} \] Output:
1/2*(2*A*a-I*b*C)*x/a^2-1/2*C*cos(x)/a+1/2*(2*I*a*A*b-C*a^2+b^2*C)*ln(a+b* cos(x)+I*b*sin(x))/a^2/b+1/2*I*C*sin(x)/a
Time = 0.32 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.79 \[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=\frac {2 a A b x-i a^2 C x-i b^2 C x+\left (-4 a A b-2 i a^2 C+2 i b^2 C\right ) \arctan \left (\frac {(a+b) \cot \left (\frac {x}{2}\right )}{a-b}\right )-2 a b C \cos (x)+2 i a A b \log \left (a^2+b^2+2 a b \cos (x)\right )-a^2 C \log \left (a^2+b^2+2 a b \cos (x)\right )+b^2 C \log \left (a^2+b^2+2 a b \cos (x)\right )+2 i a b C \sin (x)}{4 a^2 b} \] Input:
Integrate[(A + C*Sin[x])/(a + b*Cos[x] + I*b*Sin[x]),x]
Output:
(2*a*A*b*x - I*a^2*C*x - I*b^2*C*x + (-4*a*A*b - (2*I)*a^2*C + (2*I)*b^2*C )*ArcTan[((a + b)*Cot[x/2])/(a - b)] - 2*a*b*C*Cos[x] + (2*I)*a*A*b*Log[a^ 2 + b^2 + 2*a*b*Cos[x]] - a^2*C*Log[a^2 + b^2 + 2*a*b*Cos[x]] + b^2*C*Log[ a^2 + b^2 + 2*a*b*Cos[x]] + (2*I)*a*b*C*Sin[x])/(4*a^2*b)
Time = 0.24 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3042, 3610}
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)}{a+i b \sin (x)+b \cos (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+C \sin (x)}{a+i b \sin (x)+b \cos (x)}dx\) |
\(\Big \downarrow \) 3610 |
\(\displaystyle \frac {\left (a^2 (-C)+2 i a A b+b^2 C\right ) \log (a+i b \sin (x)+b \cos (x))}{2 a^2 b}+\frac {x (2 a A-i b C)}{2 a^2}+\frac {i C \sin (x)}{2 a}-\frac {C \cos (x)}{2 a}\) |
Input:
Int[(A + C*Sin[x])/(a + b*Cos[x] + I*b*Sin[x]),x]
Output:
((2*a*A - I*b*C)*x)/(2*a^2) - (C*Cos[x])/(2*a) + (((2*I)*a*A*b - a^2*C + b ^2*C)*Log[a + b*Cos[x] + I*b*Sin[x]])/(2*a^2*b) + ((I/2)*C*Sin[x])/a
Int[((A_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[(2*a*A - c*C)*(x /(2*a^2)), x] + (-Simp[C*(Cos[d + e*x]/(2*a*e)), x] + Simp[c*C*(Sin[d + e*x ]/(2*a*b*e)), x] + Simp[((-a^2)*C + 2*a*c*A + b^2*C)*(Log[RemoveContent[a + b*Cos[d + e*x] + c*Sin[d + e*x], x]]/(2*a^2*b*e)), x]) /; FreeQ[{a, b, c, d, e, A, C}, x] && EqQ[b^2 + c^2, 0]
Time = 0.31 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.99
method | result | size |
risch | \(-\frac {C \,{\mathrm e}^{-i x}}{2 a}-\frac {i b x C}{2 a^{2}}+\frac {x A}{a}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {a}{b}\right ) C}{2 b}+\frac {b \ln \left ({\mathrm e}^{i x}+\frac {a}{b}\right ) C}{2 a^{2}}+\frac {i \ln \left ({\mathrm e}^{i x}+\frac {a}{b}\right ) A}{a}\) | \(84\) |
default | \(\frac {C \ln \left (\tan \left (\frac {x}{2}\right )+i\right )}{2 b}+\frac {i C}{a \left (-i+\tan \left (\frac {x}{2}\right )\right )}+\frac {\left (-2 i A a -b C \right ) \ln \left (-i+\tan \left (\frac {x}{2}\right )\right )}{2 a^{2}}+\frac {i \left (i C \,a^{2}-i C \,b^{2}+2 A a b \right ) \ln \left (i a +i b +a \tan \left (\frac {x}{2}\right )-b \tan \left (\frac {x}{2}\right )\right )}{2 a^{2} b}\) | \(107\) |
Input:
int((A+C*sin(x))/(a+b*cos(x)+I*b*sin(x)),x,method=_RETURNVERBOSE)
Output:
-1/2*C/a*exp(-I*x)-1/2*I/a^2*b*x*C+1/a*x*A-1/2/b*ln(exp(I*x)+a/b)*C+1/2/a^ 2*b*ln(exp(I*x)+a/b)*C+I/a*ln(exp(I*x)+a/b)*A
Time = 0.07 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.84 \[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=-\frac {{\left (C a b - {\left (2 \, A a b - i \, C b^{2}\right )} x e^{\left (i \, x\right )} + {\left (C a^{2} - 2 i \, A a b - C b^{2}\right )} e^{\left (i \, x\right )} \log \left (\frac {b e^{\left (i \, x\right )} + a}{b}\right )\right )} e^{\left (-i \, x\right )}}{2 \, a^{2} b} \] Input:
integrate((A+C*sin(x))/(a+b*cos(x)+I*b*sin(x)),x, algorithm="fricas")
Output:
-1/2*(C*a*b - (2*A*a*b - I*C*b^2)*x*e^(I*x) + (C*a^2 - 2*I*A*a*b - C*b^2)* e^(I*x)*log((b*e^(I*x) + a)/b))*e^(-I*x)/(a^2*b)
Time = 0.40 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.18 \[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=\begin {cases} - \frac {C e^{- i x}}{2 a} & \text {for}\: a \neq 0 \\x \left (- \frac {2 A a - i C b}{2 a^{2}} + \frac {2 A a + i C a - i C b}{2 a^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (2 A a - i C b\right )}{2 a^{2}} - \frac {\left (- 2 i A a b + C a^{2} - C b^{2}\right ) \log {\left (\frac {a}{b} + e^{i x} \right )}}{2 a^{2} b} \] Input:
integrate((A+C*sin(x))/(a+b*cos(x)+I*b*sin(x)),x)
Output:
Piecewise((-C*exp(-I*x)/(2*a), Ne(a, 0)), (x*(-(2*A*a - I*C*b)/(2*a**2) + (2*A*a + I*C*a - I*C*b)/(2*a**2)), True)) + x*(2*A*a - I*C*b)/(2*a**2) - ( -2*I*A*a*b + C*a**2 - C*b**2)*log(a/b + exp(I*x))/(2*a**2*b)
Exception generated. \[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate((A+C*sin(x))/(a+b*cos(x)+I*b*sin(x)),x, algorithm="maxima")
Output:
Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati ve exponent.
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 169 vs. \(2 (69) = 138\).
Time = 0.29 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.99 \[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=-\frac {{\left (-2 i \, A a - C b\right )} \log \left (-a \tan \left (\frac {1}{2} \, x\right )^{2} + b \tan \left (\frac {1}{2} \, x\right )^{2} - 2 i \, a \tan \left (\frac {1}{2} \, x\right ) + a + b\right )}{4 \, a^{2}} - \frac {{\left (2 i \, A a + C b\right )} \log \left (\tan \left (\frac {1}{2} \, x\right ) - i\right )}{2 \, a^{2}} - \frac {{\left (2 i \, C a^{2} + 2 \, A a b - i \, C b^{2}\right )} {\left (x + 2 \, \arctan \left (\frac {-i \, a \cos \left (x\right ) - a \sin \left (x\right ) - i \, a}{a \cos \left (x\right ) - i \, a \sin \left (x\right ) - a + 2 \, b}\right )\right )}}{4 \, a^{2} b} - \frac {-2 i \, A a \tan \left (\frac {1}{2} \, x\right ) - C b \tan \left (\frac {1}{2} \, x\right ) - 2 \, A a - 2 i \, C a + i \, C b}{2 \, a^{2} {\left (\tan \left (\frac {1}{2} \, x\right ) - i\right )}} \] Input:
integrate((A+C*sin(x))/(a+b*cos(x)+I*b*sin(x)),x, algorithm="giac")
Output:
-1/4*(-2*I*A*a - C*b)*log(-a*tan(1/2*x)^2 + b*tan(1/2*x)^2 - 2*I*a*tan(1/2 *x) + a + b)/a^2 - 1/2*(2*I*A*a + C*b)*log(tan(1/2*x) - I)/a^2 - 1/4*(2*I* C*a^2 + 2*A*a*b - I*C*b^2)*(x + 2*arctan((-I*a*cos(x) - a*sin(x) - I*a)/(a *cos(x) - I*a*sin(x) - a + 2*b)))/(a^2*b) - 1/2*(-2*I*A*a*tan(1/2*x) - C*b *tan(1/2*x) - 2*A*a - 2*I*C*a + I*C*b)/(a^2*(tan(1/2*x) - I))
Time = 17.22 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.13 \[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=\ln \left (a+b-a\,\mathrm {tan}\left (\frac {x}{2}\right )\,1{}\mathrm {i}+b\,\mathrm {tan}\left (\frac {x}{2}\right )\,1{}\mathrm {i}\right )\,\left (\frac {C\,b}{2\,a^2}-\frac {C}{2\,b}+\frac {A\,1{}\mathrm {i}}{a}\right )+\frac {C\,1{}\mathrm {i}}{a\,\left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )}+\frac {C\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )}{2\,b}-\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )\,\left (\frac {C\,b}{2}+A\,a\,1{}\mathrm {i}\right )}{a^2} \] Input:
int((A + C*sin(x))/(a + b*cos(x) + b*sin(x)*1i),x)
Output:
log(a + b - a*tan(x/2)*1i + b*tan(x/2)*1i)*((A*1i)/a - C/(2*b) + (C*b)/(2* a^2)) + (C*1i)/(a*(tan(x/2) - 1i)) + (C*log(tan(x/2) + 1i))/(2*b) - (log(t an(x/2) - 1i)*(A*a*1i + (C*b)/2))/a^2
\[ \int \frac {A+C \sin (x)}{a+b \cos (x)+i b \sin (x)} \, dx=\frac {\left (\int \frac {\cos \left (x \right )}{\cos \left (x \right ) b +\sin \left (x \right ) b i +a}d x \right ) a b c i +\left (\int \frac {1}{\cos \left (x \right ) b +\sin \left (x \right ) b i +a}d x \right ) a b c i -\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) a b i +\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) a c -2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b c -\mathrm {log}\left (\cos \left (x \right ) b +\sin \left (x \right ) b i +a \right ) b c +\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} b +2 \tan \left (\frac {x}{2}\right ) b i +a +b \right ) a b i -\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} b +2 \tan \left (\frac {x}{2}\right ) b i +a +b \right ) a c +2 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} a -\tan \left (\frac {x}{2}\right )^{2} b +2 \tan \left (\frac {x}{2}\right ) b i +a +b \right ) b c +a b x -b c i x}{a b} \] Input:
int((A+C*sin(x))/(a+b*cos(x)+I*b*sin(x)),x)
Output:
(int(cos(x)/(cos(x)*b + sin(x)*b*i + a),x)*a*b*c*i + int(1/(cos(x)*b + sin (x)*b*i + a),x)*a*b*c*i - log(tan(x/2)**2 + 1)*a*b*i + log(tan(x/2)**2 + 1 )*a*c - 2*log(tan(x/2)**2 + 1)*b*c - log(cos(x)*b + sin(x)*b*i + a)*b*c + log(tan(x/2)**2*a - tan(x/2)**2*b + 2*tan(x/2)*b*i + a + b)*a*b*i - log(ta n(x/2)**2*a - tan(x/2)**2*b + 2*tan(x/2)*b*i + a + b)*a*c + 2*log(tan(x/2) **2*a - tan(x/2)**2*b + 2*tan(x/2)*b*i + a + b)*b*c + a*b*x - b*c*i*x)/(a* b)