Integrand size = 25, antiderivative size = 62 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=\frac {(2 c-d) d x}{a}-\frac {d^2 \cos (e+f x)}{a f}-\frac {(c-d)^2 \cos (e+f x)}{a f (1+\sin (e+f x))} \] Output:
(2*c-d)*d*x/a-d^2*cos(f*x+e)/a/f-(c-d)^2*cos(f*x+e)/a/f/(1+sin(f*x+e))
Time = 0.66 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.97 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (d \cos \left (\frac {1}{2} (e+f x)\right ) (-((2 c-d) (e+f x))+d \cos (e+f x))+\left (-2 c^2-2 c d (-2+e+f x)+d^2 (-2+e+f x)+d^2 \cos (e+f x)\right ) \sin \left (\frac {1}{2} (e+f x)\right )\right )}{a f (1+\sin (e+f x))} \] Input:
Integrate[(c + d*Sin[e + f*x])^2/(a + a*Sin[e + f*x]),x]
Output:
-(((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(d*Cos[(e + f*x)/2]*(-((2*c - d)* (e + f*x)) + d*Cos[e + f*x]) + (-2*c^2 - 2*c*d*(-2 + e + f*x) + d^2*(-2 + e + f*x) + d^2*Cos[e + f*x])*Sin[(e + f*x)/2]))/(a*f*(1 + Sin[e + f*x])))
Time = 0.43 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.03, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3042, 3225, 3042, 3214, 3042, 3127}
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))^2}{a \sin (e+f x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(c+d \sin (e+f x))^2}{a \sin (e+f x)+a}dx\) |
\(\Big \downarrow \) 3225 |
\(\displaystyle \frac {\int \frac {a c^2+a (2 c-d) d \sin (e+f x)}{\sin (e+f x) a+a}dx}{a}-\frac {d^2 \cos (e+f x)}{a f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a c^2+a (2 c-d) d \sin (e+f x)}{\sin (e+f x) a+a}dx}{a}-\frac {d^2 \cos (e+f x)}{a f}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {a (c-d)^2 \int \frac {1}{\sin (e+f x) a+a}dx+d x (2 c-d)}{a}-\frac {d^2 \cos (e+f x)}{a f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a (c-d)^2 \int \frac {1}{\sin (e+f x) a+a}dx+d x (2 c-d)}{a}-\frac {d^2 \cos (e+f x)}{a f}\) |
\(\Big \downarrow \) 3127 |
\(\displaystyle \frac {d x (2 c-d)-\frac {a (c-d)^2 \cos (e+f x)}{f (a \sin (e+f x)+a)}}{a}-\frac {d^2 \cos (e+f x)}{a f}\) |
Input:
Int[(c + d*Sin[e + f*x])^2/(a + a*Sin[e + f*x]),x]
Output:
-((d^2*Cos[e + f*x])/(a*f)) + ((2*c - d)*d*x - (a*(c - d)^2*Cos[e + f*x])/ (f*(a + a*Sin[e + f*x])))/a
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x] /; FreeQ[{a, b, c, d}, x] && EqQ[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]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^2/((c_.) + (d_.)*sin[(e_.) + (f _.)*(x_)]), x_Symbol] :> Simp[(-b^2)*(Cos[e + f*x]/(d*f)), x] + Simp[1/d Int[Simp[a^2*d - b*(b*c - 2*a*d)*Sin[e + f*x], x]/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Time = 0.64 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.21
method | result | size |
derivativedivides | \(\frac {2 d \left (-\frac {d}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}+\left (2 c -d \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )-\frac {2 \left (c^{2}-2 c d +d^{2}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}}{a f}\) | \(75\) |
default | \(\frac {2 d \left (-\frac {d}{1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}+\left (2 c -d \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )-\frac {2 \left (c^{2}-2 c d +d^{2}\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}}{a f}\) | \(75\) |
parallelrisch | \(\frac {4 \left (c -\frac {d}{2}\right ) \left (\left (f x -\frac {3}{2}\right ) d +c \right ) \sin \left (\frac {f x}{2}+\frac {e}{2}\right )-d \left (\left (-4 f x c +2 f x d +3 d \right ) \cos \left (\frac {f x}{2}+\frac {e}{2}\right )+d \left (\sin \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )+\cos \left (\frac {3 f x}{2}+\frac {3 e}{2}\right )\right )\right )}{2 \left (\cos \left (\frac {f x}{2}+\frac {e}{2}\right )+\sin \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) f a}\) | \(105\) |
risch | \(\frac {2 d x c}{a}-\frac {d^{2} x}{a}-\frac {d^{2} {\mathrm e}^{i \left (f x +e \right )}}{2 a f}-\frac {d^{2} {\mathrm e}^{-i \left (f x +e \right )}}{2 a f}-\frac {2 c^{2}}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}+\frac {4 c d}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}-\frac {2 d^{2}}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}\) | \(133\) |
norman | \(\frac {\frac {-2 c^{2}+4 c d -4 d^{2}}{a f}+\frac {\left (2 c -d \right ) d x}{a}-\frac {2 d^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}+\frac {\left (-2 c^{2}+4 c d -2 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a f}+\frac {\left (2 c -d \right ) d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a}+\frac {\left (2 c -d \right ) d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{a}+\frac {\left (2 c -d \right ) d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a}-\frac {2 d^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a f}+\frac {2 \left (-2 c^{2}+4 c d -3 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a f}+\frac {2 \left (2 c -d \right ) d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{a}+\frac {2 \left (2 c -d \right ) d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a}}{\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}}\) | \(295\) |
Input:
int((c+d*sin(f*x+e))^2/(a+sin(f*x+e)*a),x,method=_RETURNVERBOSE)
Output:
2/f/a*(d*(-d/(1+tan(1/2*f*x+1/2*e)^2)+(2*c-d)*arctan(tan(1/2*f*x+1/2*e)))- (c^2-2*c*d+d^2)/(tan(1/2*f*x+1/2*e)+1))
Leaf count of result is larger than twice the leaf count of optimal. 142 vs. \(2 (62) = 124\).
Time = 0.08 (sec) , antiderivative size = 142, normalized size of antiderivative = 2.29 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {d^{2} \cos \left (f x + e\right )^{2} - {\left (2 \, c d - d^{2}\right )} f x + c^{2} - 2 \, c d + d^{2} - {\left ({\left (2 \, c d - d^{2}\right )} f x - c^{2} + 2 \, c d - 2 \, d^{2}\right )} \cos \left (f x + e\right ) - {\left ({\left (2 \, c d - d^{2}\right )} f x - d^{2} \cos \left (f x + e\right ) + c^{2} - 2 \, c d + d^{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+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="fricas")
Output:
-(d^2*cos(f*x + e)^2 - (2*c*d - d^2)*f*x + c^2 - 2*c*d + d^2 - ((2*c*d - d ^2)*f*x - c^2 + 2*c*d - 2*d^2)*cos(f*x + e) - ((2*c*d - d^2)*f*x - d^2*cos (f*x + e) + c^2 - 2*c*d + d^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. 940 vs. \(2 (46) = 92\).
Time = 1.13 (sec) , antiderivative size = 940, normalized size of antiderivative = 15.16 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=\text {Too large to display} \] Input:
integrate((c+d*sin(f*x+e))**2/(a+a*sin(f*x+e)),x)
Output:
Piecewise((-2*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/(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*d*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) + 2*c*d*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) + 2*c*d* 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) + 2*c*d*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) + 4*c*d*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) + 4*c*d/(a*f*tan(e/2 + f*x/2)**3 + a*f*tan(e/2 + f*x/2)**2 + a*f*t an(e/2 + f*x/2) + a*f) - d**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) - d**2*f*x*ta n(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) - d**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) - d**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) - 2*d**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*d**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...
Leaf count of result is larger than twice the leaf count of optimal. 209 vs. \(2 (62) = 124\).
Time = 0.11 (sec) , antiderivative size = 209, normalized size of antiderivative = 3.37 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {2 \, {\left (d^{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 d {\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+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="maxima")
Output:
-2*(d^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*d*(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
Leaf count of result is larger than twice the leaf count of optimal. 135 vs. \(2 (62) = 124\).
Time = 0.13 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.18 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=\frac {\frac {{\left (2 \, c d - d^{2}\right )} {\left (f x + e\right )}}{a} - \frac {2 \, {\left (c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + c^{2} - 2 \, c d + 2 \, d^{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+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x, algorithm="giac")
Output:
((2*c*d - d^2)*(f*x + e)/a - 2*(c^2*tan(1/2*f*x + 1/2*e)^2 - 2*c*d*tan(1/2 *f*x + 1/2*e)^2 + d^2*tan(1/2*f*x + 1/2*e)^2 + d^2*tan(1/2*f*x + 1/2*e) + c^2 - 2*c*d + 2*d^2)/((tan(1/2*f*x + 1/2*e)^3 + tan(1/2*f*x + 1/2*e)^2 + t an(1/2*f*x + 1/2*e) + 1)*a))/f
Time = 16.78 (sec) , antiderivative size = 124, normalized size of antiderivative = 2.00 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=-\frac {d^2\,f\,x-2\,c\,d\,f\,x}{a\,f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,c^2-4\,c\,d+2\,d^2\right )-4\,c\,d+2\,c^2+4\,d^2+2\,d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left (a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a\right )} \] Input:
int((c + d*sin(e + f*x))^2/(a + a*sin(e + f*x)),x)
Output:
- (d^2*f*x - 2*c*d*f*x)/(a*f) - (tan(e/2 + (f*x)/2)^2*(2*c^2 - 4*c*d + 2*d ^2) - 4*c*d + 2*c^2 + 4*d^2 + 2*d^2*tan(e/2 + (f*x)/2))/(f*(a + a*tan(e/2 + (f*x)/2) + a*tan(e/2 + (f*x)/2)^2 + a*tan(e/2 + (f*x)/2)^3))
Time = 0.17 (sec) , antiderivative size = 137, normalized size of antiderivative = 2.21 \[ \int \frac {(c+d \sin (e+f x))^2}{a+a \sin (e+f x)} \, dx=\frac {-\cos \left (f x +e \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2}-\cos \left (f x +e \right ) d^{2}+2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2}+2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d f x -4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d -\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2} f x +2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2}+2 c d f x -d^{2} f x}{a f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )} \] Input:
int((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e)),x)
Output:
( - cos(e + f*x)*tan((e + f*x)/2)*d**2 - cos(e + f*x)*d**2 + 2*tan((e + f* x)/2)*c**2 + 2*tan((e + f*x)/2)*c*d*f*x - 4*tan((e + f*x)/2)*c*d - tan((e + f*x)/2)*d**2*f*x + 2*tan((e + f*x)/2)*d**2 + 2*c*d*f*x - d**2*f*x)/(a*f* (tan((e + f*x)/2) + 1))