Integrand size = 35, antiderivative size = 101 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\frac {2 (B c-A d) \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{a (c-d) \sqrt {c^2-d^2} f}-\frac {(A-B) \cos (e+f x)}{(c-d) f (a+a \sin (e+f x))} \] Output:
2*(-A*d+B*c)*arctan((d+c*tan(1/2*f*x+1/2*e))/(c^2-d^2)^(1/2))/a/(c-d)/(c^2 -d^2)^(1/2)/f-(A-B)*cos(f*x+e)/(c-d)/f/(a+a*sin(f*x+e))
Time = 6.97 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.47 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\frac {2 \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left ((A-B) \sqrt {c^2-d^2} \sin \left (\frac {1}{2} (e+f x)\right )+(B c-A d) \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{a (c-d) \sqrt {c^2-d^2} f (1+\sin (e+f x))} \] Input:
Integrate[(A + B*Sin[e + f*x])/((a + a*Sin[e + f*x])*(c + d*Sin[e + f*x])) ,x]
Output:
(2*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*((A - B)*Sqrt[c^2 - d^2]*Sin[(e + f*x)/2] + (B*c - A*d)*ArcTan[(d + c*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]]*(C os[(e + f*x)/2] + Sin[(e + f*x)/2])))/(a*(c - d)*Sqrt[c^2 - d^2]*f*(1 + Si n[e + f*x]))
Time = 0.46 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.06, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.229, Rules used = {3042, 3457, 25, 27, 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 {A+B \sin (e+f x)}{(a \sin (e+f x)+a) (c+d \sin (e+f x))} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin (e+f x)}{(a \sin (e+f x)+a) (c+d \sin (e+f x))}dx\) |
\(\Big \downarrow \) 3457 |
\(\displaystyle -\frac {\int -\frac {a (B c-A d)}{c+d \sin (e+f x)}dx}{a^2 (c-d)}-\frac {(A-B) \cos (e+f x)}{f (c-d) (a \sin (e+f x)+a)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \frac {a (B c-A d)}{c+d \sin (e+f x)}dx}{a^2 (c-d)}-\frac {(A-B) \cos (e+f x)}{f (c-d) (a \sin (e+f x)+a)}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {(B c-A d) \int \frac {1}{c+d \sin (e+f x)}dx}{a (c-d)}-\frac {(A-B) \cos (e+f x)}{f (c-d) (a \sin (e+f x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(B c-A d) \int \frac {1}{c+d \sin (e+f x)}dx}{a (c-d)}-\frac {(A-B) \cos (e+f x)}{f (c-d) (a \sin (e+f x)+a)}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle \frac {2 (B c-A d) \int \frac {1}{c \tan ^2\left (\frac {1}{2} (e+f x)\right )+2 d \tan \left (\frac {1}{2} (e+f x)\right )+c}d\tan \left (\frac {1}{2} (e+f x)\right )}{a f (c-d)}-\frac {(A-B) \cos (e+f x)}{f (c-d) (a \sin (e+f x)+a)}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle -\frac {4 (B c-A d) \int \frac {1}{-\left (2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )^2-4 \left (c^2-d^2\right )}d\left (2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{a f (c-d)}-\frac {(A-B) \cos (e+f x)}{f (c-d) (a \sin (e+f x)+a)}\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {2 (B c-A d) \arctan \left (\frac {2 c \tan \left (\frac {1}{2} (e+f x)\right )+2 d}{2 \sqrt {c^2-d^2}}\right )}{a f (c-d) \sqrt {c^2-d^2}}-\frac {(A-B) \cos (e+f x)}{f (c-d) (a \sin (e+f x)+a)}\) |
Input:
Int[(A + B*Sin[e + f*x])/((a + a*Sin[e + f*x])*(c + d*Sin[e + f*x])),x]
Output:
(2*(B*c - A*d)*ArcTan[(2*d + 2*c*Tan[(e + f*x)/2])/(2*Sqrt[c^2 - d^2])])/( a*(c - d)*Sqrt[c^2 - d^2]*f) - ((A - B)*Cos[e + f*x])/((c - d)*f*(a + a*Si n[e + f*x]))
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[b*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^( n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/(a*(2*m + 1)*(b*c - a*d)) Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b *d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*(m + n + 2)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ [b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -2^(-1)] && !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
Time = 0.54 (sec) , antiderivative size = 94, normalized size of antiderivative = 0.93
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (A -B \right )}{\left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}+\frac {2 \left (-A d +B c \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c -d \right ) \sqrt {c^{2}-d^{2}}}}{a f}\) | \(94\) |
default | \(\frac {-\frac {2 \left (A -B \right )}{\left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}+\frac {2 \left (-A d +B c \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c -d \right ) \sqrt {c^{2}-d^{2}}}}{a f}\) | \(94\) |
risch | \(-\frac {2 A}{f a \left (c -d \right ) \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}+\frac {2 B}{f a \left (c -d \right ) \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c +c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) A d}{\sqrt {-c^{2}+d^{2}}\, \left (c -d \right ) f a}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c +c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) B c}{\sqrt {-c^{2}+d^{2}}\, \left (c -d \right ) f a}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c -c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) A d}{\sqrt {-c^{2}+d^{2}}\, \left (c -d \right ) f a}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i \sqrt {-c^{2}+d^{2}}\, c -c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) B c}{\sqrt {-c^{2}+d^{2}}\, \left (c -d \right ) f a}\) | \(372\) |
Input:
int((A+B*sin(f*x+e))/(a+a*sin(f*x+e))/(c+d*sin(f*x+e)),x,method=_RETURNVER BOSE)
Output:
2/f/a*(-(A-B)/(c-d)/(tan(1/2*f*x+1/2*e)+1)+1/(c-d)*(-A*d+B*c)/(c^2-d^2)^(1 /2)*arctan(1/2*(2*c*tan(1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 255 vs. \(2 (96) = 192\).
Time = 0.11 (sec) , antiderivative size = 595, normalized size of antiderivative = 5.89 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\left [-\frac {2 \, {\left (A - B\right )} c^{2} - 2 \, {\left (A - B\right )} d^{2} + {\left (B c - A d + {\left (B c - A d\right )} \cos \left (f x + e\right ) + {\left (B c - A d\right )} \sin \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}} \log \left (\frac {{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \, {\left (c \cos \left (f x + e\right ) \sin \left (f x + e\right ) + d \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right ) + 2 \, {\left ({\left (A - B\right )} c^{2} - {\left (A - B\right )} d^{2}\right )} \cos \left (f x + e\right ) - 2 \, {\left ({\left (A - B\right )} c^{2} - {\left (A - B\right )} d^{2}\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \cos \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \sin \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f\right )}}, -\frac {{\left (A - B\right )} c^{2} - {\left (A - B\right )} d^{2} + {\left (B c - A d + {\left (B c - A d\right )} \cos \left (f x + e\right ) + {\left (B c - A d\right )} \sin \left (f x + e\right )\right )} \sqrt {c^{2} - d^{2}} \arctan \left (-\frac {c \sin \left (f x + e\right ) + d}{\sqrt {c^{2} - d^{2}} \cos \left (f x + e\right )}\right ) + {\left ({\left (A - B\right )} c^{2} - {\left (A - B\right )} d^{2}\right )} \cos \left (f x + e\right ) - {\left ({\left (A - B\right )} c^{2} - {\left (A - B\right )} d^{2}\right )} \sin \left (f x + e\right )}{{\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \cos \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f \sin \left (f x + e\right ) + {\left (a c^{3} - a c^{2} d - a c d^{2} + a d^{3}\right )} f}\right ] \] Input:
integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))/(c+d*sin(f*x+e)),x, algorithm= "fricas")
Output:
[-1/2*(2*(A - B)*c^2 - 2*(A - B)*d^2 + (B*c - A*d + (B*c - A*d)*cos(f*x + e) + (B*c - A*d)*sin(f*x + e))*sqrt(-c^2 + d^2)*log(((2*c^2 - d^2)*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2 + 2*(c*cos(f*x + e)*sin(f*x + e) + d*cos(f*x + e))*sqrt(-c^2 + d^2))/(d^2*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2)) + 2*((A - B)*c^2 - (A - B)*d^2)*cos(f*x + e) - 2*((A - B) *c^2 - (A - B)*d^2)*sin(f*x + e))/((a*c^3 - a*c^2*d - a*c*d^2 + a*d^3)*f*c os(f*x + e) + (a*c^3 - a*c^2*d - a*c*d^2 + a*d^3)*f*sin(f*x + e) + (a*c^3 - a*c^2*d - a*c*d^2 + a*d^3)*f), -((A - B)*c^2 - (A - B)*d^2 + (B*c - A*d + (B*c - A*d)*cos(f*x + e) + (B*c - A*d)*sin(f*x + e))*sqrt(c^2 - d^2)*arc tan(-(c*sin(f*x + e) + d)/(sqrt(c^2 - d^2)*cos(f*x + e))) + ((A - B)*c^2 - (A - B)*d^2)*cos(f*x + e) - ((A - B)*c^2 - (A - B)*d^2)*sin(f*x + e))/((a *c^3 - a*c^2*d - a*c*d^2 + a*d^3)*f*cos(f*x + e) + (a*c^3 - a*c^2*d - a*c* d^2 + a*d^3)*f*sin(f*x + e) + (a*c^3 - a*c^2*d - a*c*d^2 + a*d^3)*f)]
Timed out. \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\text {Timed out} \] Input:
integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))/(c+d*sin(f*x+e)),x)
Output:
Timed out
Exception generated. \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\text {Exception raised: ValueError} \] Input:
integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))/(c+d*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*d^2-4*c^2>0)', see `assume?` f or more de
Time = 0.23 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.09 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )} {\left (B c - A d\right )}}{{\left (a c - a d\right )} \sqrt {c^{2} - d^{2}}} - \frac {A - B}{{\left (a c - a d\right )} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}}\right )}}{f} \] Input:
integrate((A+B*sin(f*x+e))/(a+a*sin(f*x+e))/(c+d*sin(f*x+e)),x, algorithm= "giac")
Output:
2*((pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(c) + arctan((c*tan(1/2*f*x + 1/2* e) + d)/sqrt(c^2 - d^2)))*(B*c - A*d)/((a*c - a*d)*sqrt(c^2 - d^2)) - (A - B)/((a*c - a*d)*(tan(1/2*f*x + 1/2*e) + 1)))/f
Time = 36.24 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.52 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\frac {2\,\mathrm {atan}\left (\frac {\frac {\left (A\,d-B\,c\right )\,\left (2\,a\,d^2-2\,a\,c\,d\right )}{a\,\sqrt {c+d}\,{\left (c-d\right )}^{3/2}}-\frac {2\,c\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (A\,d-B\,c\right )\,\left (a\,c-a\,d\right )}{a\,\sqrt {c+d}\,{\left (c-d\right )}^{3/2}}}{2\,A\,d-2\,B\,c}\right )\,\left (A\,d-B\,c\right )}{a\,f\,\sqrt {c+d}\,{\left (c-d\right )}^{3/2}}-\frac {2\,\left (A-B\right )}{f\,\left (a+a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (c-d\right )} \] Input:
int((A + B*sin(e + f*x))/((a + a*sin(e + f*x))*(c + d*sin(e + f*x))),x)
Output:
(2*atan((((A*d - B*c)*(2*a*d^2 - 2*a*c*d))/(a*(c + d)^(1/2)*(c - d)^(3/2)) - (2*c*tan(e/2 + (f*x)/2)*(A*d - B*c)*(a*c - a*d))/(a*(c + d)^(1/2)*(c - d)^(3/2)))/(2*A*d - 2*B*c))*(A*d - B*c))/(a*f*(c + d)^(1/2)*(c - d)^(3/2)) - (2*(A - B))/(f*(a + a*tan(e/2 + (f*x)/2))*(c - d))
Time = 0.20 (sec) , antiderivative size = 324, normalized size of antiderivative = 3.21 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) (c+d \sin (e+f x))} \, dx=\frac {-2 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a d +2 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) b c -2 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) a d +2 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) b c +2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a \,c^{2}-2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) a \,d^{2}-2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) b \,c^{2}+2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) b \,d^{2}}{a f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{3}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2} d -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c \,d^{2}+\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{3}+c^{3}-c^{2} d -c \,d^{2}+d^{3}\right )} \] Input:
int((A+B*sin(f*x+e))/(a+a*sin(f*x+e))/(c+d*sin(f*x+e)),x)
Output:
(2*( - sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))* tan((e + f*x)/2)*a*d + sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqr t(c**2 - d**2))*tan((e + f*x)/2)*b*c - sqrt(c**2 - d**2)*atan((tan((e + f* x)/2)*c + d)/sqrt(c**2 - d**2))*a*d + sqrt(c**2 - d**2)*atan((tan((e + f*x )/2)*c + d)/sqrt(c**2 - d**2))*b*c + tan((e + f*x)/2)*a*c**2 - tan((e + f* x)/2)*a*d**2 - tan((e + f*x)/2)*b*c**2 + tan((e + f*x)/2)*b*d**2))/(a*f*(t an((e + f*x)/2)*c**3 - tan((e + f*x)/2)*c**2*d - tan((e + f*x)/2)*c*d**2 + tan((e + f*x)/2)*d**3 + c**3 - c**2*d - c*d**2 + d**3))