Integrand size = 26, antiderivative size = 56 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {3 c^2 x}{a}-\frac {3 c^2 \cos (e+f x)}{a f}-\frac {2 a c^2 \cos ^3(e+f x)}{f (a+a \sin (e+f x))^2} \] Output:
-3*c^2*x/a-3*c^2*cos(f*x+e)/a/f-2*a*c^2*cos(f*x+e)^3/f/(a+a*sin(f*x+e))^2
Leaf count is larger than twice the leaf count of optimal. \(129\) vs. \(2(56)=112\).
Time = 6.42 (sec) , antiderivative size = 129, normalized size of antiderivative = 2.30 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {c^2 \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right ) (3 (e+f x)+\cos (e+f x))+(-8+3 e+3 f x+\cos (e+f x)) \sin \left (\frac {1}{2} (e+f x)\right )\right ) (-1+\sin (e+f x))^2}{a f \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^4 (1+\sin (e+f x))} \] Input:
Integrate[(c - c*Sin[e + f*x])^2/(a + a*Sin[e + f*x]),x]
Output:
-((c^2*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(Cos[(e + f*x)/2]*(3*(e + f*x ) + Cos[e + f*x]) + (-8 + 3*e + 3*f*x + Cos[e + f*x])*Sin[(e + f*x)/2])*(- 1 + Sin[e + f*x])^2)/(a*f*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])^4*(1 + Sin [e + f*x])))
Time = 0.42 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.07, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.269, Rules used = {3042, 3215, 3042, 3159, 3042, 3161, 24}
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-c \sin (e+f x))^2}{a \sin (e+f x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(c-c \sin (e+f x))^2}{a \sin (e+f x)+a}dx\) |
\(\Big \downarrow \) 3215 |
\(\displaystyle a^2 c^2 \int \frac {\cos ^4(e+f x)}{(\sin (e+f x) a+a)^3}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a^2 c^2 \int \frac {\cos (e+f x)^4}{(\sin (e+f x) a+a)^3}dx\) |
\(\Big \downarrow \) 3159 |
\(\displaystyle a^2 c^2 \left (-\frac {3 \int \frac {\cos ^2(e+f x)}{\sin (e+f x) a+a}dx}{a^2}-\frac {2 \cos ^3(e+f x)}{a f (a \sin (e+f x)+a)^2}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a^2 c^2 \left (-\frac {3 \int \frac {\cos (e+f x)^2}{\sin (e+f x) a+a}dx}{a^2}-\frac {2 \cos ^3(e+f x)}{a f (a \sin (e+f x)+a)^2}\right )\) |
\(\Big \downarrow \) 3161 |
\(\displaystyle a^2 c^2 \left (-\frac {3 \left (\frac {\int 1dx}{a}+\frac {\cos (e+f x)}{a f}\right )}{a^2}-\frac {2 \cos ^3(e+f x)}{a f (a \sin (e+f x)+a)^2}\right )\) |
\(\Big \downarrow \) 24 |
\(\displaystyle a^2 c^2 \left (-\frac {3 \left (\frac {\cos (e+f x)}{a f}+\frac {x}{a}\right )}{a^2}-\frac {2 \cos ^3(e+f x)}{a f (a \sin (e+f x)+a)^2}\right )\) |
Input:
Int[(c - c*Sin[e + f*x])^2/(a + a*Sin[e + f*x]),x]
Output:
a^2*c^2*((-3*(x/a + Cos[e + f*x]/(a*f)))/a^2 - (2*Cos[e + f*x]^3)/(a*f*(a + a*Sin[e + f*x])^2))
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_), x_Symbol] :> Simp[2*g*(g*Cos[e + f*x])^(p - 1)*((a + b*Sin[e + f *x])^(m + 1)/(b*f*(2*m + p + 1))), x] + Simp[g^2*((p - 1)/(b^2*(2*m + p + 1 ))) Int[(g*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^(m + 2), x], x] /; FreeQ[{a, b, e, f, g}, x] && EqQ[a^2 - b^2, 0] && LeQ[m, -2] && GtQ[p, 1] & & NeQ[2*m + p + 1, 0] && !ILtQ[m + p + 1, 0] && IntegersQ[2*m, 2*p]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[g*((g*Cos[e + f*x])^(p - 1)/(b*f*(p - 1))), x] + Si mp[g^2/a Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g}, x ] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[a^m*c^m Int[Cos[e + f*x]^(2*m)*(c + d*Sin[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && EqQ[ b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && !(IntegerQ[n] && ((Lt Q[m, 0] && GtQ[n, 0]) || LtQ[0, n, m] || LtQ[m, n, 0]))
Time = 0.56 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.02
method | result | size |
derivativedivides | \(\frac {2 c^{2} \left (-\frac {1}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}-3 \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {4}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}\right )}{f a}\) | \(57\) |
default | \(\frac {2 c^{2} \left (-\frac {1}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}-3 \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {4}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}\right )}{f a}\) | \(57\) |
parallelrisch | \(-\frac {c^{2} \left (9+\cos \left (2 f x +2 e \right )-6 \cos \left (f x +e \right )+6 \cos \left (f x +e \right ) f x -8 \sin \left (f x +e \right )\right )}{2 f a \cos \left (f x +e \right )}\) | \(57\) |
risch | \(-\frac {3 c^{2} x}{a}-\frac {c^{2} {\mathrm e}^{i \left (f x +e \right )}}{2 a f}-\frac {c^{2} {\mathrm e}^{-i \left (f x +e \right )}}{2 a f}-\frac {8 c^{2}}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}\) | \(76\) |
norman | \(\frac {-\frac {10 c^{2}}{a f}-\frac {8 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a f}-\frac {2 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}-\frac {3 c^{2} x}{a}-\frac {3 c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a}-\frac {6 c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a}-\frac {6 c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a}-\frac {3 c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a}-\frac {3 c^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a}-\frac {18 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a f}-\frac {2 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right ) \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{2}}\) | \(235\) |
Input:
int((c-c*sin(f*x+e))^2/(a+sin(f*x+e)*a),x,method=_RETURNVERBOSE)
Output:
2/f*c^2/a*(-1/(1+tan(1/2*f*x+1/2*e)^2)-3*arctan(tan(1/2*f*x+1/2*e))-4/(tan (1/2*f*x+1/2*e)+1))
Time = 0.09 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.80 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {3 \, c^{2} f x + c^{2} \cos \left (f x + e\right )^{2} + 4 \, c^{2} + {\left (3 \, c^{2} f x + 5 \, c^{2}\right )} \cos \left (f x + e\right ) + {\left (3 \, c^{2} f x + c^{2} \cos \left (f x + e\right ) - 4 \, c^{2}\right )} \sin \left (f x + e\right )}{a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f} \] Input:
integrate((c-c*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="fricas")
Output:
-(3*c^2*f*x + c^2*cos(f*x + e)^2 + 4*c^2 + (3*c^2*f*x + 5*c^2)*cos(f*x + e ) + (3*c^2*f*x + c^2*cos(f*x + e) - 4*c^2)*sin(f*x + e))/(a*f*cos(f*x + e) + a*f*sin(f*x + e) + a*f)
Leaf count of result is larger than twice the leaf count of optimal. 456 vs. \(2 (53) = 106\).
Time = 1.04 (sec) , antiderivative size = 456, normalized size of antiderivative = 8.14 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=\begin {cases} - \frac {3 c^{2} f x \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {3 c^{2} f x \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {3 c^{2} f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {3 c^{2} f x}{a f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {8 c^{2} \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {2 c^{2} \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {10 c^{2}}{a f \tan ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} & \text {for}\: f \neq 0 \\\frac {x \left (- c \sin {\left (e \right )} + c\right )^{2}}{a \sin {\left (e \right )} + a} & \text {otherwise} \end {cases} \] Input:
integrate((c-c*sin(f*x+e))**2/(a+a*sin(f*x+e)),x)
Output:
Piecewise((-3*c**2*f*x*tan(e/2 + f*x/2)**3/(a*f*tan(e/2 + f*x/2)**3 + a*f* tan(e/2 + f*x/2)**2 + a*f*tan(e/2 + f*x/2) + a*f) - 3*c**2*f*x*tan(e/2 + f *x/2)**2/(a*f*tan(e/2 + f*x/2)**3 + a*f*tan(e/2 + f*x/2)**2 + a*f*tan(e/2 + f*x/2) + a*f) - 3*c**2*f*x*tan(e/2 + f*x/2)/(a*f*tan(e/2 + f*x/2)**3 + a *f*tan(e/2 + f*x/2)**2 + a*f*tan(e/2 + f*x/2) + a*f) - 3*c**2*f*x/(a*f*tan (e/2 + f*x/2)**3 + a*f*tan(e/2 + f*x/2)**2 + a*f*tan(e/2 + f*x/2) + a*f) - 8*c**2*tan(e/2 + f*x/2)**2/(a*f*tan(e/2 + f*x/2)**3 + a*f*tan(e/2 + f*x/2 )**2 + a*f*tan(e/2 + f*x/2) + a*f) - 2*c**2*tan(e/2 + f*x/2)/(a*f*tan(e/2 + f*x/2)**3 + a*f*tan(e/2 + f*x/2)**2 + a*f*tan(e/2 + f*x/2) + a*f) - 10*c **2/(a*f*tan(e/2 + f*x/2)**3 + a*f*tan(e/2 + f*x/2)**2 + a*f*tan(e/2 + f*x /2) + a*f), Ne(f, 0)), (x*(-c*sin(e) + c)**2/(a*sin(e) + a), True))
Leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (56) = 112\).
Time = 0.11 (sec) , antiderivative size = 210, normalized size of antiderivative = 3.75 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {2 \, {\left (c^{2} {\left (\frac {\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 2}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {a \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a}\right )} + 2 \, c^{2} {\left (\frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} + \frac {c^{2}}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )}}{f} \] Input:
integrate((c-c*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="maxima")
Output:
-2*(c^2*((sin(f*x + e)/(cos(f*x + e) + 1) + sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2)/(a + a*sin(f*x + e)/(cos(f*x + e) + 1) + a*sin(f*x + e)^2/(cos( f*x + e) + 1)^2 + a*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a) + 2*c^2*(arctan(sin(f*x + e)/(cos(f*x + e) + 1 ))/a + 1/(a + a*sin(f*x + e)/(cos(f*x + e) + 1))) + c^2/(a + a*sin(f*x + e )/(cos(f*x + e) + 1)))/f
Time = 0.13 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.68 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {\frac {3 \, {\left (f x + e\right )} c^{2}}{a} + \frac {2 \, {\left (4 \, c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 5 \, c^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )} a}}{f} \] Input:
integrate((c-c*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="giac")
Output:
-(3*(f*x + e)*c^2/a + 2*(4*c^2*tan(1/2*f*x + 1/2*e)^2 + c^2*tan(1/2*f*x + 1/2*e) + 5*c^2)/((tan(1/2*f*x + 1/2*e)^3 + tan(1/2*f*x + 1/2*e)^2 + tan(1/ 2*f*x + 1/2*e) + 1)*a))/f
Time = 17.94 (sec) , antiderivative size = 118, normalized size of antiderivative = 2.11 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {3\,c^2\,x}{a}-\frac {3\,\sqrt {2}\,c^2\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (e+f\,x\right )-\frac {\sqrt {2}\,c^2\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (6\,e+6\,f\,x+16\right )}{2}}{a\,f\,\left (\sqrt {2}\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\sqrt {2}\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}-\frac {2\,c^2\,{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{a\,f} \] Input:
int((c - c*sin(e + f*x))^2/(a + a*sin(e + f*x)),x)
Output:
- (3*c^2*x)/a - (3*2^(1/2)*c^2*sin(e/2 + (f*x)/2)*(e + f*x) - (2^(1/2)*c^2 *sin(e/2 + (f*x)/2)*(6*e + 6*f*x + 16))/2)/(a*f*(2^(1/2)*cos(e/2 + (f*x)/2 ) + 2^(1/2)*sin(e/2 + (f*x)/2))) - (2*c^2*cos(e/2 + (f*x)/2)^2)/(a*f)
Time = 0.18 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.38 \[ \int \frac {(c-c \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=\frac {c^{2} \left (-\cos \left (f x +e \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-\cos \left (f x +e \right )-3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) f x +8 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-3 f x \right )}{a f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )} \] Input:
int((c-c*sin(f*x+e))^2/(a+a*sin(f*x+e)),x)
Output:
(c**2*( - cos(e + f*x)*tan((e + f*x)/2) - cos(e + f*x) - 3*tan((e + f*x)/2 )*f*x + 8*tan((e + f*x)/2) - 3*f*x))/(a*f*(tan((e + f*x)/2) + 1))