Integrand size = 19, antiderivative size = 55 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\frac {a x}{2}-\frac {b \cos (e+f x)}{f}+\frac {b \cos ^3(e+f x)}{3 f}-\frac {a \cos (e+f x) \sin (e+f x)}{2 f} \] Output:
1/2*a*x-b*cos(f*x+e)/f+1/3*b*cos(f*x+e)^3/f-1/2*a*cos(f*x+e)*sin(f*x+e)/f
Time = 0.15 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.09 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\frac {a (e+f x)}{2 f}-\frac {3 b \cos (e+f x)}{4 f}+\frac {b \cos (3 (e+f x))}{12 f}-\frac {a \sin (2 (e+f x))}{4 f} \] Input:
Integrate[Sin[e + f*x]^2*(a + b*Sin[e + f*x]),x]
Output:
(a*(e + f*x))/(2*f) - (3*b*Cos[e + f*x])/(4*f) + (b*Cos[3*(e + f*x)])/(12* f) - (a*Sin[2*(e + f*x)])/(4*f)
Time = 0.31 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.96, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3042, 3227, 3042, 3113, 2009, 3115, 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 \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (e+f x)^2 (a+b \sin (e+f x))dx\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle a \int \sin ^2(e+f x)dx+b \int \sin ^3(e+f x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a \int \sin (e+f x)^2dx+b \int \sin (e+f x)^3dx\) |
\(\Big \downarrow \) 3113 |
\(\displaystyle a \int \sin (e+f x)^2dx-\frac {b \int \left (1-\cos ^2(e+f x)\right )d\cos (e+f x)}{f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle a \int \sin (e+f x)^2dx-\frac {b \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle a \left (\frac {\int 1dx}{2}-\frac {\sin (e+f x) \cos (e+f x)}{2 f}\right )-\frac {b \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle a \left (\frac {x}{2}-\frac {\sin (e+f x) \cos (e+f x)}{2 f}\right )-\frac {b \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\) |
Input:
Int[Sin[e + f*x]^2*(a + b*Sin[e + f*x]),x]
Output:
-((b*(Cos[e + f*x] - Cos[e + f*x]^3/3))/f) + a*(x/2 - (Cos[e + f*x]*Sin[e + f*x])/(2*f))
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Time = 1.43 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.85
method | result | size |
parallelrisch | \(\frac {6 a x f -9 \cos \left (f x +e \right ) b +b \cos \left (3 f x +3 e \right )-3 a \sin \left (2 f x +2 e \right )-8 b}{12 f}\) | \(47\) |
risch | \(\frac {a x}{2}-\frac {3 b \cos \left (f x +e \right )}{4 f}+\frac {b \cos \left (3 f x +3 e \right )}{12 f}-\frac {a \sin \left (2 f x +2 e \right )}{4 f}\) | \(48\) |
derivativedivides | \(\frac {-\frac {b \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}+a \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(49\) |
default | \(\frac {-\frac {b \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}+a \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) | \(49\) |
parts | \(\frac {a \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {b \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3 f}\) | \(51\) |
norman | \(\frac {\frac {a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{f}+\frac {a x}{2}-\frac {4 b}{3 f}-\frac {a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {3 a x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{2}+\frac {3 a x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{2}+\frac {a x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{2}-\frac {4 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{3}}\) | \(121\) |
orering | \(x \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right )-\frac {49 \left (2 \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) f \cos \left (f x +e \right )+\sin \left (f x +e \right )^{2} \cos \left (f x +e \right ) b f \right )}{36 f^{2}}+\frac {49 x \left (2 f^{2} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right )+4 \sin \left (f x +e \right ) b \,f^{2} \cos \left (f x +e \right )^{2}-2 \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) f^{2}-\sin \left (f x +e \right )^{3} b \,f^{2}\right )}{36 f^{2}}-\frac {7 \left (-8 f^{3} \cos \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) \sin \left (f x +e \right )+6 f^{3} \cos \left (f x +e \right )^{3} b -13 \sin \left (f x +e \right )^{2} b \,f^{3} \cos \left (f x +e \right )\right )}{18 f^{4}}+\frac {7 x \left (8 f^{4} \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right )-52 f^{4} \cos \left (f x +e \right )^{2} b \sin \left (f x +e \right )-8 f^{4} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right )+13 \sin \left (f x +e \right )^{3} b \,f^{4}\right )}{18 f^{4}}-\frac {32 f^{5} \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) \cos \left (f x +e \right )+151 f^{5} \sin \left (f x +e \right )^{2} b \cos \left (f x +e \right )-60 f^{5} \cos \left (f x +e \right )^{3} b}{36 f^{6}}+\frac {x \left (32 f^{6} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right )+514 f^{6} \sin \left (f x +e \right ) b \cos \left (f x +e \right )^{2}-32 f^{6} \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right )-151 f^{6} \sin \left (f x +e \right )^{3} b \right )}{36 f^{6}}\) | \(465\) |
Input:
int(sin(f*x+e)^2*(a+b*sin(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/12*(6*a*x*f-9*cos(f*x+e)*b+b*cos(3*f*x+3*e)-3*a*sin(2*f*x+2*e)-8*b)/f
Time = 0.09 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.84 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\frac {2 \, b \cos \left (f x + e\right )^{3} + 3 \, a f x - 3 \, a \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 6 \, b \cos \left (f x + e\right )}{6 \, f} \] Input:
integrate(sin(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="fricas")
Output:
1/6*(2*b*cos(f*x + e)^3 + 3*a*f*x - 3*a*cos(f*x + e)*sin(f*x + e) - 6*b*co s(f*x + e))/f
Time = 0.11 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.67 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\begin {cases} \frac {a x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {a \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {b \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right ) \sin ^{2}{\left (e \right )} & \text {otherwise} \end {cases} \] Input:
integrate(sin(f*x+e)**2*(a+b*sin(f*x+e)),x)
Output:
Piecewise((a*x*sin(e + f*x)**2/2 + a*x*cos(e + f*x)**2/2 - a*sin(e + f*x)* cos(e + f*x)/(2*f) - b*sin(e + f*x)**2*cos(e + f*x)/f - 2*b*cos(e + f*x)** 3/(3*f), Ne(f, 0)), (x*(a + b*sin(e))*sin(e)**2, True))
Time = 0.03 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.87 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\frac {3 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a + 4 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b}{12 \, f} \] Input:
integrate(sin(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="maxima")
Output:
1/12*(3*(2*f*x + 2*e - sin(2*f*x + 2*e))*a + 4*(cos(f*x + e)^3 - 3*cos(f*x + e))*b)/f
Time = 0.13 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.85 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\frac {1}{2} \, a x + \frac {b \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {3 \, b \cos \left (f x + e\right )}{4 \, f} - \frac {a \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \] Input:
integrate(sin(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="giac")
Output:
1/2*a*x + 1/12*b*cos(3*f*x + 3*e)/f - 3/4*b*cos(f*x + e)/f - 1/4*a*sin(2*f *x + 2*e)/f
Time = 18.20 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.24 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\frac {a\,x}{2}-\frac {-a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+4\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+\frac {4\,b}{3}}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}^3} \] Input:
int(sin(e + f*x)^2*(a + b*sin(e + f*x)),x)
Output:
(a*x)/2 - ((4*b)/3 + a*tan(e/2 + (f*x)/2) - a*tan(e/2 + (f*x)/2)^5 + 4*b*t an(e/2 + (f*x)/2)^2)/(f*(tan(e/2 + (f*x)/2)^2 + 1)^3)
Time = 0.17 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00 \[ \int \sin ^2(e+f x) (a+b \sin (e+f x)) \, dx=\frac {-2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b -3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a -4 \cos \left (f x +e \right ) b +3 a f x +4 b}{6 f} \] Input:
int(sin(f*x+e)^2*(a+b*sin(f*x+e)),x)
Output:
( - 2*cos(e + f*x)*sin(e + f*x)**2*b - 3*cos(e + f*x)*sin(e + f*x)*a - 4*c os(e + f*x)*b + 3*a*f*x + 4*b)/(6*f)