Integrand size = 23, antiderivative size = 94 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=\frac {1}{2} a^2 (3 c+2 d) x-\frac {2 a^2 (3 c+2 d) \cos (e+f x)}{3 f}-\frac {a^2 (3 c+2 d) \cos (e+f x) \sin (e+f x)}{6 f}-\frac {d \cos (e+f x) (a+a \sin (e+f x))^2}{3 f} \] Output:
1/2*a^2*(3*c+2*d)*x-2/3*a^2*(3*c+2*d)*cos(f*x+e)/f-1/6*a^2*(3*c+2*d)*cos(f *x+e)*sin(f*x+e)/f-1/3*d*cos(f*x+e)*(a+a*sin(f*x+e))^2/f
Time = 0.38 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.13 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=-\frac {a^2 \cos (e+f x) \left (6 (3 c+2 d) \arcsin \left (\frac {\sqrt {1-\sin (e+f x)}}{\sqrt {2}}\right )+\sqrt {\cos ^2(e+f x)} \left (2 (6 c+5 d)+3 (c+2 d) \sin (e+f x)+2 d \sin ^2(e+f x)\right )\right )}{6 f \sqrt {\cos ^2(e+f x)}} \] Input:
Integrate[(a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x]),x]
Output:
-1/6*(a^2*Cos[e + f*x]*(6*(3*c + 2*d)*ArcSin[Sqrt[1 - Sin[e + f*x]]/Sqrt[2 ]] + Sqrt[Cos[e + f*x]^2]*(2*(6*c + 5*d) + 3*(c + 2*d)*Sin[e + f*x] + 2*d* Sin[e + f*x]^2)))/(f*Sqrt[Cos[e + f*x]^2])
Time = 0.30 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.88, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3042, 3230, 3042, 3123}
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 (a \sin (e+f x)+a)^2 (c+d \sin (e+f x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))dx\) |
\(\Big \downarrow \) 3230 |
\(\displaystyle \frac {1}{3} (3 c+2 d) \int (\sin (e+f x) a+a)^2dx-\frac {d \cos (e+f x) (a \sin (e+f x)+a)^2}{3 f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} (3 c+2 d) \int (\sin (e+f x) a+a)^2dx-\frac {d \cos (e+f x) (a \sin (e+f x)+a)^2}{3 f}\) |
\(\Big \downarrow \) 3123 |
\(\displaystyle \frac {1}{3} (3 c+2 d) \left (-\frac {2 a^2 \cos (e+f x)}{f}-\frac {a^2 \sin (e+f x) \cos (e+f x)}{2 f}+\frac {3 a^2 x}{2}\right )-\frac {d \cos (e+f x) (a \sin (e+f x)+a)^2}{3 f}\) |
Input:
Int[(a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x]),x]
Output:
-1/3*(d*Cos[e + f*x]*(a + a*Sin[e + f*x])^2)/f + ((3*c + 2*d)*((3*a^2*x)/2 - (2*a^2*Cos[e + f*x])/f - (a^2*Cos[e + f*x]*Sin[e + f*x])/(2*f)))/3
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(2*a^2 + b^ 2)*(x/2), x] + (-Simp[2*a*b*(Cos[c + d*x]/d), x] - Simp[b^2*Cos[c + d*x]*(S in[c + d*x]/(2*d)), x]) /; FreeQ[{a, b, c, d}, x]
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[(a*d*m + b*c*(m + 1))/(b*(m + 1)) Int[(a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)]
Time = 0.41 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.24
\[\frac {a^{2} c \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {a^{2} d \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}-2 a^{2} c \cos \left (f x +e \right )+2 a^{2} d \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+a^{2} c \left (f x +e \right )-a^{2} d \cos \left (f x +e \right )}{f}\]
Input:
int((a+sin(f*x+e)*a)^2*(c+d*sin(f*x+e)),x)
Output:
1/f*(a^2*c*(-1/2*cos(f*x+e)*sin(f*x+e)+1/2*f*x+1/2*e)-1/3*a^2*d*(2+sin(f*x +e)^2)*cos(f*x+e)-2*a^2*c*cos(f*x+e)+2*a^2*d*(-1/2*cos(f*x+e)*sin(f*x+e)+1 /2*f*x+1/2*e)+a^2*c*(f*x+e)-a^2*d*cos(f*x+e))
Time = 0.09 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.87 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=\frac {2 \, a^{2} d \cos \left (f x + e\right )^{3} + 3 \, {\left (3 \, a^{2} c + 2 \, a^{2} d\right )} f x - 3 \, {\left (a^{2} c + 2 \, a^{2} d\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 12 \, {\left (a^{2} c + a^{2} d\right )} \cos \left (f x + e\right )}{6 \, f} \] Input:
integrate((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e)),x, algorithm="fricas")
Output:
1/6*(2*a^2*d*cos(f*x + e)^3 + 3*(3*a^2*c + 2*a^2*d)*f*x - 3*(a^2*c + 2*a^2 *d)*cos(f*x + e)*sin(f*x + e) - 12*(a^2*c + a^2*d)*cos(f*x + e))/f
Leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (85) = 170\).
Time = 0.15 (sec) , antiderivative size = 199, normalized size of antiderivative = 2.12 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=\begin {cases} \frac {a^{2} c x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {a^{2} c x \cos ^{2}{\left (e + f x \right )}}{2} + a^{2} c x - \frac {a^{2} c \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {2 a^{2} c \cos {\left (e + f x \right )}}{f} + a^{2} d x \sin ^{2}{\left (e + f x \right )} + a^{2} d x \cos ^{2}{\left (e + f x \right )} - \frac {a^{2} d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {a^{2} d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a^{2} d \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {a^{2} d \cos {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (c + d \sin {\left (e \right )}\right ) \left (a \sin {\left (e \right )} + a\right )^{2} & \text {otherwise} \end {cases} \] Input:
integrate((a+a*sin(f*x+e))**2*(c+d*sin(f*x+e)),x)
Output:
Piecewise((a**2*c*x*sin(e + f*x)**2/2 + a**2*c*x*cos(e + f*x)**2/2 + a**2* c*x - a**2*c*sin(e + f*x)*cos(e + f*x)/(2*f) - 2*a**2*c*cos(e + f*x)/f + a **2*d*x*sin(e + f*x)**2 + a**2*d*x*cos(e + f*x)**2 - a**2*d*sin(e + f*x)** 2*cos(e + f*x)/f - a**2*d*sin(e + f*x)*cos(e + f*x)/f - 2*a**2*d*cos(e + f *x)**3/(3*f) - a**2*d*cos(e + f*x)/f, Ne(f, 0)), (x*(c + d*sin(e))*(a*sin( e) + a)**2, True))
Time = 0.04 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.21 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=\frac {3 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} c + 12 \, {\left (f x + e\right )} a^{2} c + 4 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} d + 6 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} d - 24 \, a^{2} c \cos \left (f x + e\right ) - 12 \, a^{2} d \cos \left (f x + e\right )}{12 \, f} \] Input:
integrate((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e)),x, algorithm="maxima")
Output:
1/12*(3*(2*f*x + 2*e - sin(2*f*x + 2*e))*a^2*c + 12*(f*x + e)*a^2*c + 4*(c os(f*x + e)^3 - 3*cos(f*x + e))*a^2*d + 6*(2*f*x + 2*e - sin(2*f*x + 2*e)) *a^2*d - 24*a^2*c*cos(f*x + e) - 12*a^2*d*cos(f*x + e))/f
Time = 0.13 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.12 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=a^{2} c x + \frac {a^{2} d \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {a^{2} d \cos \left (f x + e\right )}{f} + \frac {1}{2} \, {\left (a^{2} c + 2 \, a^{2} d\right )} x - \frac {{\left (8 \, a^{2} c + 3 \, a^{2} d\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {{\left (a^{2} c + 2 \, a^{2} d\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \] Input:
integrate((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e)),x, algorithm="giac")
Output:
a^2*c*x + 1/12*a^2*d*cos(3*f*x + 3*e)/f - a^2*d*cos(f*x + e)/f + 1/2*(a^2* c + 2*a^2*d)*x - 1/4*(8*a^2*c + 3*a^2*d)*cos(f*x + e)/f - 1/4*(a^2*c + 2*a ^2*d)*sin(2*f*x + 2*e)/f
Time = 16.56 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.97 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=-\frac {\frac {3\,a^2\,c\,\sin \left (2\,e+2\,f\,x\right )}{2}-\frac {a^2\,d\,\cos \left (3\,e+3\,f\,x\right )}{2}+3\,a^2\,d\,\sin \left (2\,e+2\,f\,x\right )+12\,a^2\,c\,\cos \left (e+f\,x\right )+\frac {21\,a^2\,d\,\cos \left (e+f\,x\right )}{2}-9\,a^2\,c\,f\,x-6\,a^2\,d\,f\,x}{6\,f} \] Input:
int((a + a*sin(e + f*x))^2*(c + d*sin(e + f*x)),x)
Output:
-((3*a^2*c*sin(2*e + 2*f*x))/2 - (a^2*d*cos(3*e + 3*f*x))/2 + 3*a^2*d*sin( 2*e + 2*f*x) + 12*a^2*c*cos(e + f*x) + (21*a^2*d*cos(e + f*x))/2 - 9*a^2*c *f*x - 6*a^2*d*f*x)/(6*f)
Time = 0.19 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.96 \[ \int (a+a \sin (e+f x))^2 (c+d \sin (e+f x)) \, dx=\frac {a^{2} \left (-2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} d -3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) c -6 \cos \left (f x +e \right ) \sin \left (f x +e \right ) d -12 \cos \left (f x +e \right ) c -10 \cos \left (f x +e \right ) d +9 c f x +12 c +6 d f x +10 d \right )}{6 f} \] Input:
int((a+a*sin(f*x+e))^2*(c+d*sin(f*x+e)),x)
Output:
(a**2*( - 2*cos(e + f*x)*sin(e + f*x)**2*d - 3*cos(e + f*x)*sin(e + f*x)*c - 6*cos(e + f*x)*sin(e + f*x)*d - 12*cos(e + f*x)*c - 10*cos(e + f*x)*d + 9*c*f*x + 12*c + 6*d*f*x + 10*d))/(6*f)