Integrand size = 19, antiderivative size = 71 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=a b x-\frac {2 \left (a^2+b^2\right ) \cos (e+f x)}{3 f}-\frac {a b \cos (e+f x) \sin (e+f x)}{3 f}-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f} \] Output:
a*b*x-2/3*(a^2+b^2)*cos(f*x+e)/f-1/3*a*b*cos(f*x+e)*sin(f*x+e)/f-1/3*cos(f *x+e)*(a+b*sin(f*x+e))^2/f
Time = 0.55 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.83 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {-3 \left (4 a^2+3 b^2\right ) \cos (e+f x)+b (12 a (e+f x)+b \cos (3 (e+f x))-6 a \sin (2 (e+f x)))}{12 f} \] Input:
Integrate[Sin[e + f*x]*(a + b*Sin[e + f*x])^2,x]
Output:
(-3*(4*a^2 + 3*b^2)*Cos[e + f*x] + b*(12*a*(e + f*x) + b*Cos[3*(e + f*x)] - 6*a*Sin[2*(e + f*x)]))/(12*f)
Time = 0.31 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.08, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 3232, 27, 3042, 3213}
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 \sin (e+f x) (a+b \sin (e+f x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (e+f x) (a+b \sin (e+f x))^2dx\) |
\(\Big \downarrow \) 3232 |
\(\displaystyle \frac {1}{3} \int 2 (b+a \sin (e+f x)) (a+b \sin (e+f x))dx-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {2}{3} \int (b+a \sin (e+f x)) (a+b \sin (e+f x))dx-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2}{3} \int (b+a \sin (e+f x)) (a+b \sin (e+f x))dx-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {2}{3} \left (-\frac {\left (a^2+b^2\right ) \cos (e+f x)}{f}-\frac {a b \sin (e+f x) \cos (e+f x)}{2 f}+\frac {3 a b x}{2}\right )-\frac {\cos (e+f x) (a+b \sin (e+f x))^2}{3 f}\) |
Input:
Int[Sin[e + f*x]*(a + b*Sin[e + f*x])^2,x]
Output:
-1/3*(Cos[e + f*x]*(a + b*Sin[e + f*x])^2)/f + (2*((3*a*b*x)/2 - ((a^2 + b ^2)*Cos[e + f*x])/f - (a*b*Cos[e + f*x]*Sin[e + f*x])/(2*f)))/3
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_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[1/(m + 1) Int[(a + b*Sin[e + f*x])^(m - 1)*Simp[b* d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ [{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]
Time = 1.86 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.90
method | result | size |
derivativedivides | \(\frac {-\cos \left (f x +e \right ) a^{2}+2 a b \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(64\) |
default | \(\frac {-\cos \left (f x +e \right ) a^{2}+2 a b \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {b^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}}{f}\) | \(64\) |
risch | \(a b x -\frac {a^{2} \cos \left (f x +e \right )}{f}-\frac {3 b^{2} \cos \left (f x +e \right )}{4 f}+\frac {\cos \left (3 f x +3 e \right ) b^{2}}{12 f}-\frac {a b \sin \left (2 f x +2 e \right )}{2 f}\) | \(67\) |
parallelrisch | \(\frac {\cos \left (3 f x +3 e \right ) b^{2}-6 a b \sin \left (2 f x +2 e \right )+\left (-12 a^{2}-9 b^{2}\right ) \cos \left (f x +e \right )+12 a b x f -12 a^{2}-8 b^{2}}{12 f}\) | \(67\) |
parts | \(-\frac {a^{2} \cos \left (f x +e \right )}{f}-\frac {b^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3 f}+\frac {2 a b \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(69\) |
norman | \(\frac {a b x +a b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}-\frac {6 a^{2}+4 b^{2}}{3 f}-\frac {2 a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{f}-\frac {\left (4 a^{2}+4 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f}-\frac {2 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {2 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{f}+3 a b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+3 a b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{3}}\) | \(165\) |
orering | \(x \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right )^{2}-\frac {49 \left (f \cos \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right )^{2}+2 \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) b f \cos \left (f x +e \right )\right )}{36 f^{2}}+\frac {49 x \left (-f^{2} \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right )^{2}+4 f^{2} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) b +2 \cos \left (f x +e \right )^{2} \sin \left (f x +e \right ) b^{2} f^{2}-2 \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) b \,f^{2}\right )}{36 f^{2}}-\frac {7 \left (-f^{3} \cos \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right )^{2}-14 f^{3} \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) b \cos \left (f x +e \right )+6 \cos \left (f x +e \right )^{3} b^{2} f^{3}-6 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2} f^{3}\right )}{18 f^{4}}+\frac {7 x \left (f^{4} \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right )^{2}-16 f^{4} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) b -44 f^{4} \sin \left (f x +e \right ) b^{2} \cos \left (f x +e \right )^{2}+14 f^{4} \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) b +6 f^{4} \sin \left (f x +e \right )^{3} b^{2}\right )}{18 f^{4}}-\frac {f^{5} \cos \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right )^{2}+62 f^{5} \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) b \cos \left (f x +e \right )-60 f^{5} \cos \left (f x +e \right )^{3} b^{2}+120 f^{5} \sin \left (f x +e \right )^{2} b^{2} \cos \left (f x +e \right )}{36 f^{6}}+\frac {x \left (-f^{6} \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right )^{2}+64 f^{6} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) b +482 f^{6} \sin \left (f x +e \right ) b^{2} \cos \left (f x +e \right )^{2}-62 f^{6} \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) b -120 f^{6} \sin \left (f x +e \right )^{3} b^{2}\right )}{36 f^{6}}\) | \(594\) |
Input:
int(sin(f*x+e)*(a+b*sin(f*x+e))^2,x,method=_RETURNVERBOSE)
Output:
1/f*(-cos(f*x+e)*a^2+2*a*b*(-1/2*cos(f*x+e)*sin(f*x+e)+1/2*f*x+1/2*e)-1/3* b^2*(2+sin(f*x+e)^2)*cos(f*x+e))
Time = 0.09 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.77 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {b^{2} \cos \left (f x + e\right )^{3} + 3 \, a b f x - 3 \, a b \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 3 \, {\left (a^{2} + b^{2}\right )} \cos \left (f x + e\right )}{3 \, f} \] Input:
integrate(sin(f*x+e)*(a+b*sin(f*x+e))^2,x, algorithm="fricas")
Output:
1/3*(b^2*cos(f*x + e)^3 + 3*a*b*f*x - 3*a*b*cos(f*x + e)*sin(f*x + e) - 3* (a^2 + b^2)*cos(f*x + e))/f
Time = 0.12 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.51 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\begin {cases} - \frac {a^{2} \cos {\left (e + f x \right )}}{f} + a b x \sin ^{2}{\left (e + f x \right )} + a b x \cos ^{2}{\left (e + f x \right )} - \frac {a b \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {b^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{2} \sin {\left (e \right )} & \text {otherwise} \end {cases} \] Input:
integrate(sin(f*x+e)*(a+b*sin(f*x+e))**2,x)
Output:
Piecewise((-a**2*cos(e + f*x)/f + a*b*x*sin(e + f*x)**2 + a*b*x*cos(e + f* x)**2 - a*b*sin(e + f*x)*cos(e + f*x)/f - b**2*sin(e + f*x)**2*cos(e + f*x )/f - 2*b**2*cos(e + f*x)**3/(3*f), Ne(f, 0)), (x*(a + b*sin(e))**2*sin(e) , True))
Time = 0.03 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.87 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {3 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b + 2 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{2} - 6 \, a^{2} \cos \left (f x + e\right )}{6 \, f} \] Input:
integrate(sin(f*x+e)*(a+b*sin(f*x+e))^2,x, algorithm="maxima")
Output:
1/6*(3*(2*f*x + 2*e - sin(2*f*x + 2*e))*a*b + 2*(cos(f*x + e)^3 - 3*cos(f* x + e))*b^2 - 6*a^2*cos(f*x + e))/f
Time = 0.12 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.85 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=a b x + \frac {b^{2} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {a b \sin \left (2 \, f x + 2 \, e\right )}{2 \, f} - \frac {{\left (4 \, a^{2} + 3 \, b^{2}\right )} \cos \left (f x + e\right )}{4 \, f} \] Input:
integrate(sin(f*x+e)*(a+b*sin(f*x+e))^2,x, algorithm="giac")
Output:
a*b*x + 1/12*b^2*cos(3*f*x + 3*e)/f - 1/2*a*b*sin(2*f*x + 2*e)/f - 1/4*(4* a^2 + 3*b^2)*cos(f*x + e)/f
Time = 18.48 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.45 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=a\,b\,x-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (4\,a^2+4\,b^2\right )+2\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+2\,a^2+\frac {4\,b^2}{3}-2\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+2\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}^3} \] Input:
int(sin(e + f*x)*(a + b*sin(e + f*x))^2,x)
Output:
a*b*x - (tan(e/2 + (f*x)/2)^2*(4*a^2 + 4*b^2) + 2*a^2*tan(e/2 + (f*x)/2)^4 + 2*a^2 + (4*b^2)/3 - 2*a*b*tan(e/2 + (f*x)/2)^5 + 2*a*b*tan(e/2 + (f*x)/ 2))/(f*(tan(e/2 + (f*x)/2)^2 + 1)^3)
Time = 0.17 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.11 \[ \int \sin (e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {-\cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2}-3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a b -3 \cos \left (f x +e \right ) a^{2}-2 \cos \left (f x +e \right ) b^{2}+3 a^{2}+3 a b f x +2 b^{2}}{3 f} \] Input:
int(sin(f*x+e)*(a+b*sin(f*x+e))^2,x)
Output:
( - cos(e + f*x)*sin(e + f*x)**2*b**2 - 3*cos(e + f*x)*sin(e + f*x)*a*b - 3*cos(e + f*x)*a**2 - 2*cos(e + f*x)*b**2 + 3*a**2 + 3*a*b*f*x + 2*b**2)/( 3*f)