Integrand size = 23, antiderivative size = 65 \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\frac {d x}{b}+\frac {2 (b c-a d) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2} f} \] Output:
d*x/b+2*(-a*d+b*c)*arctan((b+a*tan(1/2*f*x+1/2*e))/(a^2-b^2)^(1/2))/b/(a^2 -b^2)^(1/2)/f
Time = 0.16 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.03 \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\frac {d (e+f x)+\frac {2 (b c-a d) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}}{b f} \] Input:
Integrate[(c + d*Sin[e + f*x])/(a + b*Sin[e + f*x]),x]
Output:
(d*(e + f*x) + (2*(b*c - a*d)*ArcTan[(b + a*Tan[(e + f*x)/2])/Sqrt[a^2 - b ^2]])/Sqrt[a^2 - b^2])/(b*f)
Time = 0.32 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.09, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 3214, 3042, 3139, 1083, 217}
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 {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)}dx\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {(b c-a d) \int \frac {1}{a+b \sin (e+f x)}dx}{b}+\frac {d x}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(b c-a d) \int \frac {1}{a+b \sin (e+f x)}dx}{b}+\frac {d x}{b}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle \frac {2 (b c-a d) \int \frac {1}{a \tan ^2\left (\frac {1}{2} (e+f x)\right )+2 b \tan \left (\frac {1}{2} (e+f x)\right )+a}d\tan \left (\frac {1}{2} (e+f x)\right )}{b f}+\frac {d x}{b}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {d x}{b}-\frac {4 (b c-a d) \int \frac {1}{-\left (2 b+2 a \tan \left (\frac {1}{2} (e+f x)\right )\right )^2-4 \left (a^2-b^2\right )}d\left (2 b+2 a \tan \left (\frac {1}{2} (e+f x)\right )\right )}{b f}\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {2 (b c-a d) \arctan \left (\frac {2 a \tan \left (\frac {1}{2} (e+f x)\right )+2 b}{2 \sqrt {a^2-b^2}}\right )}{b f \sqrt {a^2-b^2}}+\frac {d x}{b}\) |
Input:
Int[(c + d*Sin[e + f*x])/(a + b*Sin[e + f*x]),x]
Output:
(d*x)/b + (2*(b*c - a*d)*ArcTan[(2*b + 2*a*Tan[(e + f*x)/2])/(2*Sqrt[a^2 - b^2])])/(b*Sqrt[a^2 - b^2]*f)
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( -1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & & (LtQ[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + 2*b*e*x + a *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 = 0.62 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.17
method | result | size |
derivativedivides | \(\frac {\frac {2 d \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{b}+\frac {2 \left (-a d +b c \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{b \sqrt {a^{2}-b^{2}}}}{f}\) | \(76\) |
default | \(\frac {\frac {2 d \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{b}+\frac {2 \left (-a d +b c \right ) \arctan \left (\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{b \sqrt {a^{2}-b^{2}}}}{f}\) | \(76\) |
risch | \(\frac {d x}{b}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a +a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) a d}{\sqrt {-a^{2}+b^{2}}\, f b}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a +a^{2}-b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) c}{\sqrt {-a^{2}+b^{2}}\, f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a -a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) a d}{\sqrt {-a^{2}+b^{2}}\, f b}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-a^{2}+b^{2}}\, a -a^{2}+b^{2}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) c}{\sqrt {-a^{2}+b^{2}}\, f}\) | \(282\) |
Input:
int((c+d*sin(f*x+e))/(a+b*sin(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/f*(2*d/b*arctan(tan(1/2*f*x+1/2*e))+2*(-a*d+b*c)/b/(a^2-b^2)^(1/2)*arcta n(1/2*(2*a*tan(1/2*f*x+1/2*e)+2*b)/(a^2-b^2)^(1/2)))
Time = 0.12 (sec) , antiderivative size = 253, normalized size of antiderivative = 3.89 \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\left [\frac {2 \, {\left (a^{2} - b^{2}\right )} d f x + \sqrt {-a^{2} + b^{2}} {\left (b c - a d\right )} \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (f x + e\right ) \sin \left (f x + e\right ) + b \cos \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2}}\right )}{2 \, {\left (a^{2} b - b^{3}\right )} f}, \frac {{\left (a^{2} - b^{2}\right )} d f x - \sqrt {a^{2} - b^{2}} {\left (b c - a d\right )} \arctan \left (-\frac {a \sin \left (f x + e\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (f x + e\right )}\right )}{{\left (a^{2} b - b^{3}\right )} f}\right ] \] Input:
integrate((c+d*sin(f*x+e))/(a+b*sin(f*x+e)),x, algorithm="fricas")
Output:
[1/2*(2*(a^2 - b^2)*d*f*x + sqrt(-a^2 + b^2)*(b*c - a*d)*log(-((2*a^2 - b^ 2)*cos(f*x + e)^2 - 2*a*b*sin(f*x + e) - a^2 - b^2 - 2*(a*cos(f*x + e)*sin (f*x + e) + b*cos(f*x + e))*sqrt(-a^2 + b^2))/(b^2*cos(f*x + e)^2 - 2*a*b* sin(f*x + e) - a^2 - b^2)))/((a^2*b - b^3)*f), ((a^2 - b^2)*d*f*x - sqrt(a ^2 - b^2)*(b*c - a*d)*arctan(-(a*sin(f*x + e) + b)/(sqrt(a^2 - b^2)*cos(f* x + e))))/((a^2*b - b^3)*f)]
Leaf count of result is larger than twice the leaf count of optimal. 425 vs. \(2 (53) = 106\).
Time = 15.51 (sec) , antiderivative size = 425, normalized size of antiderivative = 6.54 \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\begin {cases} \frac {\tilde {\infty } x \left (c + d \sin {\left (e \right )}\right )}{\sin {\left (e \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {\frac {c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} \right )}}{f} + d x}{b} & \text {for}\: a = 0 \\\frac {c x - \frac {d \cos {\left (e + f x \right )}}{f}}{a} & \text {for}\: b = 0 \\\frac {x \left (c + d \sin {\left (e \right )}\right )}{a + b \sin {\left (e \right )}} & \text {for}\: f = 0 \\\frac {2 c}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} + \frac {d f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} - \frac {d f x}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} + \frac {2 d}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - b f} & \text {for}\: a = - b \\- \frac {2 c}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} + \frac {d f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} + \frac {d f x}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} + \frac {2 d}{b f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + b f} & \text {for}\: a = b \\- \frac {a d \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} - \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{b f \sqrt {- a^{2} + b^{2}}} + \frac {a d \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} + \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{b f \sqrt {- a^{2} + b^{2}}} + \frac {c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} - \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{f \sqrt {- a^{2} + b^{2}}} - \frac {c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {b}{a} + \frac {\sqrt {- a^{2} + b^{2}}}{a} \right )}}{f \sqrt {- a^{2} + b^{2}}} + \frac {d x}{b} & \text {otherwise} \end {cases} \] Input:
integrate((c+d*sin(f*x+e))/(a+b*sin(f*x+e)),x)
Output:
Piecewise((zoo*x*(c + d*sin(e))/sin(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ( (c*log(tan(e/2 + f*x/2))/f + d*x)/b, Eq(a, 0)), ((c*x - d*cos(e + f*x)/f)/ a, Eq(b, 0)), (x*(c + d*sin(e))/(a + b*sin(e)), Eq(f, 0)), (2*c/(b*f*tan(e /2 + f*x/2) - b*f) + d*f*x*tan(e/2 + f*x/2)/(b*f*tan(e/2 + f*x/2) - b*f) - d*f*x/(b*f*tan(e/2 + f*x/2) - b*f) + 2*d/(b*f*tan(e/2 + f*x/2) - b*f), Eq (a, -b)), (-2*c/(b*f*tan(e/2 + f*x/2) + b*f) + d*f*x*tan(e/2 + f*x/2)/(b*f *tan(e/2 + f*x/2) + b*f) + d*f*x/(b*f*tan(e/2 + f*x/2) + b*f) + 2*d/(b*f*t an(e/2 + f*x/2) + b*f), Eq(a, b)), (-a*d*log(tan(e/2 + f*x/2) + b/a - sqrt (-a**2 + b**2)/a)/(b*f*sqrt(-a**2 + b**2)) + a*d*log(tan(e/2 + f*x/2) + b/ a + sqrt(-a**2 + b**2)/a)/(b*f*sqrt(-a**2 + b**2)) + c*log(tan(e/2 + f*x/2 ) + b/a - sqrt(-a**2 + b**2)/a)/(f*sqrt(-a**2 + b**2)) - c*log(tan(e/2 + f *x/2) + b/a + sqrt(-a**2 + b**2)/a)/(f*sqrt(-a**2 + b**2)) + d*x/b, True))
Exception generated. \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((c+d*sin(f*x+e))/(a+b*sin(f*x+e)),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
Time = 0.36 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.28 \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\frac {\frac {{\left (f x + e\right )} d}{b} + \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} {\left (b c - a d\right )}}{\sqrt {a^{2} - b^{2}} b}}{f} \] Input:
integrate((c+d*sin(f*x+e))/(a+b*sin(f*x+e)),x, algorithm="giac")
Output:
((f*x + e)*d/b + 2*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(a) + arctan((a*ta n(1/2*f*x + 1/2*e) + b)/sqrt(a^2 - b^2)))*(b*c - a*d)/(sqrt(a^2 - b^2)*b)) /f
Time = 18.79 (sec) , antiderivative size = 343, normalized size of antiderivative = 5.28 \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\frac {2\,d\,\mathrm {atan}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{b\,f}-\frac {a\,\left (d\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}-d\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}\right )-b\,c\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}+b\,c\,\ln \left (\frac {b\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {b^2-a^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}}{b\,f\,\left (a^2-b^2\right )} \] Input:
int((c + d*sin(e + f*x))/(a + b*sin(e + f*x)),x)
Output:
(2*d*atan(sin(e/2 + (f*x)/2)/cos(e/2 + (f*x)/2)))/(b*f) - (a*(d*log((b*cos (e/2 + (f*x)/2) + a*sin(e/2 + (f*x)/2) + cos(e/2 + (f*x)/2)*(b^2 - a^2)^(1 /2))/cos(e/2 + (f*x)/2))*(-(a + b)*(a - b))^(1/2) - d*log((b*cos(e/2 + (f* x)/2) + a*sin(e/2 + (f*x)/2) - cos(e/2 + (f*x)/2)*(b^2 - a^2)^(1/2))/cos(e /2 + (f*x)/2))*(b^2 - a^2)^(1/2)) - b*c*log((b*cos(e/2 + (f*x)/2) + a*sin( e/2 + (f*x)/2) + cos(e/2 + (f*x)/2)*(b^2 - a^2)^(1/2))/cos(e/2 + (f*x)/2)) *(-(a + b)*(a - b))^(1/2) + b*c*log((b*cos(e/2 + (f*x)/2) + a*sin(e/2 + (f *x)/2) - cos(e/2 + (f*x)/2)*(b^2 - a^2)^(1/2))/cos(e/2 + (f*x)/2))*(b^2 - a^2)^(1/2))/(b*f*(a^2 - b^2))
Time = 0.19 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.78 \[ \int \frac {c+d \sin (e+f x)}{a+b \sin (e+f x)} \, dx=\frac {-2 \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a +b}{\sqrt {a^{2}-b^{2}}}\right ) a d +2 \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a +b}{\sqrt {a^{2}-b^{2}}}\right ) b c +a^{2} d f x -b^{2} d f x}{b f \left (a^{2}-b^{2}\right )} \] Input:
int((c+d*sin(f*x+e))/(a+b*sin(f*x+e)),x)
Output:
( - 2*sqrt(a**2 - b**2)*atan((tan((e + f*x)/2)*a + b)/sqrt(a**2 - b**2))*a *d + 2*sqrt(a**2 - b**2)*atan((tan((e + f*x)/2)*a + b)/sqrt(a**2 - b**2))* b*c + a**2*d*f*x - b**2*d*f*x)/(b*f*(a**2 - b**2))