Integrand size = 20, antiderivative size = 182 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=-\frac {b^2 d^2 x}{4 f^2}+\frac {a^2 (c+d x)^3}{3 d}+\frac {b^2 (c+d x)^3}{6 d}+\frac {4 a b d^2 \cos (e+f x)}{f^3}-\frac {2 a b (c+d x)^2 \cos (e+f x)}{f}+\frac {4 a b d (c+d x) \sin (e+f x)}{f^2}+\frac {b^2 d^2 \cos (e+f x) \sin (e+f x)}{4 f^3}-\frac {b^2 (c+d x)^2 \cos (e+f x) \sin (e+f x)}{2 f}+\frac {b^2 d (c+d x) \sin ^2(e+f x)}{2 f^2} \] Output:
-1/4*b^2*d^2*x/f^2+1/3*a^2*(d*x+c)^3/d+1/6*b^2*(d*x+c)^3/d+4*a*b*d^2*cos(f *x+e)/f^3-2*a*b*(d*x+c)^2*cos(f*x+e)/f+4*a*b*d*(d*x+c)*sin(f*x+e)/f^2+1/4* b^2*d^2*cos(f*x+e)*sin(f*x+e)/f^3-1/2*b^2*(d*x+c)^2*cos(f*x+e)*sin(f*x+e)/ f+1/2*b^2*d*(d*x+c)*sin(f*x+e)^2/f^2
Time = 0.74 (sec) , antiderivative size = 249, normalized size of antiderivative = 1.37 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=\frac {24 a^2 c^2 f^3 x+12 b^2 c^2 f^3 x+24 a^2 c d f^3 x^2+12 b^2 c d f^3 x^2+8 a^2 d^2 f^3 x^3+4 b^2 d^2 f^3 x^3-48 a b \left (c^2 f^2+2 c d f^2 x+d^2 \left (-2+f^2 x^2\right )\right ) \cos (e+f x)-6 b^2 d f (c+d x) \cos (2 (e+f x))+96 a b c d f \sin (e+f x)+96 a b d^2 f x \sin (e+f x)+3 b^2 d^2 \sin (2 (e+f x))-6 b^2 c^2 f^2 \sin (2 (e+f x))-12 b^2 c d f^2 x \sin (2 (e+f x))-6 b^2 d^2 f^2 x^2 \sin (2 (e+f x))}{24 f^3} \] Input:
Integrate[(c + d*x)^2*(a + b*Sin[e + f*x])^2,x]
Output:
(24*a^2*c^2*f^3*x + 12*b^2*c^2*f^3*x + 24*a^2*c*d*f^3*x^2 + 12*b^2*c*d*f^3 *x^2 + 8*a^2*d^2*f^3*x^3 + 4*b^2*d^2*f^3*x^3 - 48*a*b*(c^2*f^2 + 2*c*d*f^2 *x + d^2*(-2 + f^2*x^2))*Cos[e + f*x] - 6*b^2*d*f*(c + d*x)*Cos[2*(e + f*x )] + 96*a*b*c*d*f*Sin[e + f*x] + 96*a*b*d^2*f*x*Sin[e + f*x] + 3*b^2*d^2*S in[2*(e + f*x)] - 6*b^2*c^2*f^2*Sin[2*(e + f*x)] - 12*b^2*c*d*f^2*x*Sin[2* (e + f*x)] - 6*b^2*d^2*f^2*x^2*Sin[2*(e + f*x)])/(24*f^3)
Time = 0.42 (sec) , antiderivative size = 182, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3042, 3798, 2009}
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 (c+d x)^2 (a+b \sin (e+f x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x)^2 (a+b \sin (e+f x))^2dx\) |
\(\Big \downarrow \) 3798 |
\(\displaystyle \int \left (a^2 (c+d x)^2+2 a b (c+d x)^2 \sin (e+f x)+b^2 (c+d x)^2 \sin ^2(e+f x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 (c+d x)^3}{3 d}+\frac {4 a b d (c+d x) \sin (e+f x)}{f^2}-\frac {2 a b (c+d x)^2 \cos (e+f x)}{f}+\frac {4 a b d^2 \cos (e+f x)}{f^3}+\frac {b^2 d (c+d x) \sin ^2(e+f x)}{2 f^2}-\frac {b^2 (c+d x)^2 \sin (e+f x) \cos (e+f x)}{2 f}+\frac {b^2 (c+d x)^3}{6 d}+\frac {b^2 d^2 \sin (e+f x) \cos (e+f x)}{4 f^3}-\frac {b^2 d^2 x}{4 f^2}\) |
Input:
Int[(c + d*x)^2*(a + b*Sin[e + f*x])^2,x]
Output:
-1/4*(b^2*d^2*x)/f^2 + (a^2*(c + d*x)^3)/(3*d) + (b^2*(c + d*x)^3)/(6*d) + (4*a*b*d^2*Cos[e + f*x])/f^3 - (2*a*b*(c + d*x)^2*Cos[e + f*x])/f + (4*a* b*d*(c + d*x)*Sin[e + f*x])/f^2 + (b^2*d^2*Cos[e + f*x]*Sin[e + f*x])/(4*f ^3) - (b^2*(c + d*x)^2*Cos[e + f*x]*Sin[e + f*x])/(2*f) + (b^2*d*(c + d*x) *Sin[e + f*x]^2)/(2*f^2)
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] || IGtQ[ m, 0] || NeQ[a^2 - b^2, 0])
Time = 1.79 (sec) , antiderivative size = 158, normalized size of antiderivative = 0.87
method | result | size |
parallelrisch | \(\frac {-b^{2} \left (\left (d x +c \right )^{2} f^{2}-\frac {d^{2}}{2}\right ) \sin \left (2 f x +2 e \right )-b^{2} d f \left (d x +c \right ) \cos \left (2 f x +2 e \right )-8 \left (\left (d x +c \right )^{2} f^{2}-2 d^{2}\right ) a b \cos \left (f x +e \right )+16 a b d f \left (d x +c \right ) \sin \left (f x +e \right )+4 x \left (\frac {1}{3} x^{2} d^{2}+c d x +c^{2}\right ) \left (a^{2}+\frac {b^{2}}{2}\right ) f^{3}-8 a b \,c^{2} f^{2}+b^{2} c d f +16 b \,d^{2} a}{4 f^{3}}\) | \(158\) |
risch | \(\frac {d^{2} a^{2} x^{3}}{3}+\frac {d^{2} b^{2} x^{3}}{6}+d \,a^{2} c \,x^{2}+\frac {d \,b^{2} c \,x^{2}}{2}+a^{2} c^{2} x +\frac {b^{2} c^{2} x}{2}+\frac {a^{2} c^{3}}{3 d}+\frac {b^{2} c^{3}}{6 d}-\frac {2 a b \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}-2 d^{2}\right ) \cos \left (f x +e \right )}{f^{3}}+\frac {4 a b d \left (d x +c \right ) \sin \left (f x +e \right )}{f^{2}}-\frac {b^{2} d \left (d x +c \right ) \cos \left (2 f x +2 e \right )}{4 f^{2}}-\frac {b^{2} \left (2 d^{2} x^{2} f^{2}+4 c d \,f^{2} x +2 c^{2} f^{2}-d^{2}\right ) \sin \left (2 f x +2 e \right )}{8 f^{3}}\) | \(218\) |
parts | \(\frac {a^{2} \left (d x +c \right )^{3}}{3 d}+\frac {b^{2} \left (\frac {d^{2} \left (\left (f x +e \right )^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right ) \cos \left (f x +e \right )^{2}}{2}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{4}+\frac {f x}{4}+\frac {e}{4}-\frac {\left (f x +e \right )^{3}}{3}\right )}{f^{2}}+\frac {2 c d \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\sin \left (f x +e \right )^{2}}{4}\right )}{f}-\frac {2 d^{2} e \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\sin \left (f x +e \right )^{2}}{4}\right )}{f^{2}}+c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {2 c d e \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {d^{2} e^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}\right )}{f}+\frac {2 a b \left (\frac {d^{2} \left (-\left (f x +e \right )^{2} \cos \left (f x +e \right )+2 \cos \left (f x +e \right )+2 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {2 c d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-\frac {2 d^{2} e \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}-c^{2} \cos \left (f x +e \right )+\frac {2 c d e \cos \left (f x +e \right )}{f}-\frac {d^{2} e^{2} \cos \left (f x +e \right )}{f^{2}}\right )}{f}\) | \(458\) |
derivativedivides | \(\frac {a^{2} c^{2} \left (f x +e \right )-\frac {2 a^{2} c d e \left (f x +e \right )}{f}+\frac {a^{2} c d \left (f x +e \right )^{2}}{f}+\frac {a^{2} d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {a^{2} d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a^{2} d^{2} \left (f x +e \right )^{3}}{3 f^{2}}-2 a b \,c^{2} \cos \left (f x +e \right )+\frac {4 a b c d e \cos \left (f x +e \right )}{f}+\frac {4 a b c d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-\frac {2 a b \,d^{2} e^{2} \cos \left (f x +e \right )}{f^{2}}-\frac {4 a b \,d^{2} e \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}+\frac {2 a b \,d^{2} \left (-\left (f x +e \right )^{2} \cos \left (f x +e \right )+2 \cos \left (f x +e \right )+2 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+b^{2} c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {2 b^{2} c d e \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {2 b^{2} c d \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\sin \left (f x +e \right )^{2}}{4}\right )}{f}+\frac {b^{2} d^{2} e^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}-\frac {2 b^{2} d^{2} e \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\sin \left (f x +e \right )^{2}}{4}\right )}{f^{2}}+\frac {b^{2} d^{2} \left (\left (f x +e \right )^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right ) \cos \left (f x +e \right )^{2}}{2}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{4}+\frac {f x}{4}+\frac {e}{4}-\frac {\left (f x +e \right )^{3}}{3}\right )}{f^{2}}}{f}\) | \(561\) |
default | \(\frac {a^{2} c^{2} \left (f x +e \right )-\frac {2 a^{2} c d e \left (f x +e \right )}{f}+\frac {a^{2} c d \left (f x +e \right )^{2}}{f}+\frac {a^{2} d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {a^{2} d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a^{2} d^{2} \left (f x +e \right )^{3}}{3 f^{2}}-2 a b \,c^{2} \cos \left (f x +e \right )+\frac {4 a b c d e \cos \left (f x +e \right )}{f}+\frac {4 a b c d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-\frac {2 a b \,d^{2} e^{2} \cos \left (f x +e \right )}{f^{2}}-\frac {4 a b \,d^{2} e \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}+\frac {2 a b \,d^{2} \left (-\left (f x +e \right )^{2} \cos \left (f x +e \right )+2 \cos \left (f x +e \right )+2 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+b^{2} c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {2 b^{2} c d e \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {2 b^{2} c d \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\sin \left (f x +e \right )^{2}}{4}\right )}{f}+\frac {b^{2} d^{2} e^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}-\frac {2 b^{2} d^{2} e \left (\left (f x +e \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right )^{2}}{4}+\frac {\sin \left (f x +e \right )^{2}}{4}\right )}{f^{2}}+\frac {b^{2} d^{2} \left (\left (f x +e \right )^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {\left (f x +e \right ) \cos \left (f x +e \right )^{2}}{2}+\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{4}+\frac {f x}{4}+\frac {e}{4}-\frac {\left (f x +e \right )^{3}}{3}\right )}{f^{2}}}{f}\) | \(561\) |
norman | \(\frac {\left (\frac {1}{3} a^{2} d^{2}+\frac {1}{6} b^{2} d^{2}\right ) x^{3}+\left (\frac {1}{3} a^{2} d^{2}+\frac {1}{6} b^{2} d^{2}\right ) x^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}+\left (\frac {2}{3} a^{2} d^{2}+\frac {1}{3} b^{2} d^{2}\right ) x^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\frac {b^{2} d^{2} x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{f}+d c \left (2 a^{2}+b^{2}\right ) x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-\frac {4 a b \,c^{2} f^{2}+2 b^{2} c d f -8 b \,d^{2} a}{2 f^{3}}+\frac {\left (4 a^{2} c^{2} f^{2}+2 b^{2} c^{2} f^{2}-16 a b c d f -b^{2} d^{2}\right ) x}{4 f^{2}}+\frac {\left (4 a b \,c^{2} f^{2}-2 b^{2} c d f -8 b \,d^{2} a \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{2 f^{3}}+\frac {b \left (-2 b \,c^{2} f^{2}+16 a c d f +d^{2} b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 f^{3}}+\frac {b \left (2 b \,c^{2} f^{2}+16 a c d f -d^{2} b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{2 f^{3}}+\frac {d \left (2 a^{2} c f +b^{2} c f -4 a b d \right ) x^{2}}{2 f}+\frac {\left (4 a^{2} c^{2} f^{2}+2 b^{2} c^{2} f^{2}+3 b^{2} d^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{2 f^{2}}+\frac {\left (4 a^{2} c^{2} f^{2}+2 b^{2} c^{2} f^{2}+16 a b c d f -b^{2} d^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{4 f^{2}}-\frac {b^{2} d^{2} x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {d \left (2 a^{2} c f +b^{2} c f +4 a b d \right ) x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{2 f}+\frac {2 b d \left (b c f +4 a d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{f^{2}}+\frac {2 d b \left (-b c f +4 a d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{2}}\) | \(593\) |
orering | \(\text {Expression too large to display}\) | \(1070\) |
Input:
int((d*x+c)^2*(a+b*sin(f*x+e))^2,x,method=_RETURNVERBOSE)
Output:
1/4*(-b^2*((d*x+c)^2*f^2-1/2*d^2)*sin(2*f*x+2*e)-b^2*d*f*(d*x+c)*cos(2*f*x +2*e)-8*((d*x+c)^2*f^2-2*d^2)*a*b*cos(f*x+e)+16*a*b*d*f*(d*x+c)*sin(f*x+e) +4*x*(1/3*x^2*d^2+c*d*x+c^2)*(a^2+1/2*b^2)*f^3-8*a*b*c^2*f^2+b^2*c*d*f+16* b*d^2*a)/f^3
Time = 0.09 (sec) , antiderivative size = 226, normalized size of antiderivative = 1.24 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=\frac {2 \, {\left (2 \, a^{2} + b^{2}\right )} d^{2} f^{3} x^{3} + 6 \, {\left (2 \, a^{2} + b^{2}\right )} c d f^{3} x^{2} - 6 \, {\left (b^{2} d^{2} f x + b^{2} c d f\right )} \cos \left (f x + e\right )^{2} + 3 \, {\left (2 \, {\left (2 \, a^{2} + b^{2}\right )} c^{2} f^{3} + b^{2} d^{2} f\right )} x - 24 \, {\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2} - 2 \, a b d^{2}\right )} \cos \left (f x + e\right ) + 3 \, {\left (16 \, a b d^{2} f x + 16 \, a b c d f - {\left (2 \, b^{2} d^{2} f^{2} x^{2} + 4 \, b^{2} c d f^{2} x + 2 \, b^{2} c^{2} f^{2} - b^{2} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{12 \, f^{3}} \] Input:
integrate((d*x+c)^2*(a+b*sin(f*x+e))^2,x, algorithm="fricas")
Output:
1/12*(2*(2*a^2 + b^2)*d^2*f^3*x^3 + 6*(2*a^2 + b^2)*c*d*f^3*x^2 - 6*(b^2*d ^2*f*x + b^2*c*d*f)*cos(f*x + e)^2 + 3*(2*(2*a^2 + b^2)*c^2*f^3 + b^2*d^2* f)*x - 24*(a*b*d^2*f^2*x^2 + 2*a*b*c*d*f^2*x + a*b*c^2*f^2 - 2*a*b*d^2)*co s(f*x + e) + 3*(16*a*b*d^2*f*x + 16*a*b*c*d*f - (2*b^2*d^2*f^2*x^2 + 4*b^2 *c*d*f^2*x + 2*b^2*c^2*f^2 - b^2*d^2)*cos(f*x + e))*sin(f*x + e))/f^3
Leaf count of result is larger than twice the leaf count of optimal. 456 vs. \(2 (177) = 354\).
Time = 0.30 (sec) , antiderivative size = 456, normalized size of antiderivative = 2.51 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=\begin {cases} a^{2} c^{2} x + a^{2} c d x^{2} + \frac {a^{2} d^{2} x^{3}}{3} - \frac {2 a b c^{2} \cos {\left (e + f x \right )}}{f} - \frac {4 a b c d x \cos {\left (e + f x \right )}}{f} + \frac {4 a b c d \sin {\left (e + f x \right )}}{f^{2}} - \frac {2 a b d^{2} x^{2} \cos {\left (e + f x \right )}}{f} + \frac {4 a b d^{2} x \sin {\left (e + f x \right )}}{f^{2}} + \frac {4 a b d^{2} \cos {\left (e + f x \right )}}{f^{3}} + \frac {b^{2} c^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {b^{2} c d x^{2} \sin ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c d x^{2} \cos ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c d x \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} + \frac {b^{2} c d \sin ^{2}{\left (e + f x \right )}}{2 f^{2}} + \frac {b^{2} d^{2} x^{3} \sin ^{2}{\left (e + f x \right )}}{6} + \frac {b^{2} d^{2} x^{3} \cos ^{2}{\left (e + f x \right )}}{6} - \frac {b^{2} d^{2} x^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {b^{2} d^{2} x \sin ^{2}{\left (e + f x \right )}}{4 f^{2}} - \frac {b^{2} d^{2} x \cos ^{2}{\left (e + f x \right )}}{4 f^{2}} + \frac {b^{2} d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f^{3}} & \text {for}\: f \neq 0 \\\left (a + b \sin {\left (e \right )}\right )^{2} \left (c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \] Input:
integrate((d*x+c)**2*(a+b*sin(f*x+e))**2,x)
Output:
Piecewise((a**2*c**2*x + a**2*c*d*x**2 + a**2*d**2*x**3/3 - 2*a*b*c**2*cos (e + f*x)/f - 4*a*b*c*d*x*cos(e + f*x)/f + 4*a*b*c*d*sin(e + f*x)/f**2 - 2 *a*b*d**2*x**2*cos(e + f*x)/f + 4*a*b*d**2*x*sin(e + f*x)/f**2 + 4*a*b*d** 2*cos(e + f*x)/f**3 + b**2*c**2*x*sin(e + f*x)**2/2 + b**2*c**2*x*cos(e + f*x)**2/2 - b**2*c**2*sin(e + f*x)*cos(e + f*x)/(2*f) + b**2*c*d*x**2*sin( e + f*x)**2/2 + b**2*c*d*x**2*cos(e + f*x)**2/2 - b**2*c*d*x*sin(e + f*x)* cos(e + f*x)/f + b**2*c*d*sin(e + f*x)**2/(2*f**2) + b**2*d**2*x**3*sin(e + f*x)**2/6 + b**2*d**2*x**3*cos(e + f*x)**2/6 - b**2*d**2*x**2*sin(e + f* x)*cos(e + f*x)/(2*f) + b**2*d**2*x*sin(e + f*x)**2/(4*f**2) - b**2*d**2*x *cos(e + f*x)**2/(4*f**2) + b**2*d**2*sin(e + f*x)*cos(e + f*x)/(4*f**3), Ne(f, 0)), ((a + b*sin(e))**2*(c**2*x + c*d*x**2 + d**2*x**3/3), True))
Leaf count of result is larger than twice the leaf count of optimal. 502 vs. \(2 (170) = 340\).
Time = 0.05 (sec) , antiderivative size = 502, normalized size of antiderivative = 2.76 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=\frac {24 \, {\left (f x + e\right )} a^{2} c^{2} + 6 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c^{2} + \frac {8 \, {\left (f x + e\right )}^{3} a^{2} d^{2}}{f^{2}} - \frac {24 \, {\left (f x + e\right )}^{2} a^{2} d^{2} e}{f^{2}} + \frac {24 \, {\left (f x + e\right )} a^{2} d^{2} e^{2}}{f^{2}} + \frac {6 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} d^{2} e^{2}}{f^{2}} + \frac {24 \, {\left (f x + e\right )}^{2} a^{2} c d}{f} - \frac {48 \, {\left (f x + e\right )} a^{2} c d e}{f} - \frac {12 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} c d e}{f} - 48 \, a b c^{2} \cos \left (f x + e\right ) - \frac {48 \, a b d^{2} e^{2} \cos \left (f x + e\right )}{f^{2}} + \frac {96 \, a b c d e \cos \left (f x + e\right )}{f} + \frac {96 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} a b d^{2} e}{f^{2}} - \frac {6 \, {\left (2 \, {\left (f x + e\right )}^{2} - 2 \, {\left (f x + e\right )} \sin \left (2 \, f x + 2 \, e\right ) - \cos \left (2 \, f x + 2 \, e\right )\right )} b^{2} d^{2} e}{f^{2}} - \frac {96 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} a b c d}{f} + \frac {6 \, {\left (2 \, {\left (f x + e\right )}^{2} - 2 \, {\left (f x + e\right )} \sin \left (2 \, f x + 2 \, e\right ) - \cos \left (2 \, f x + 2 \, e\right )\right )} b^{2} c d}{f} - \frac {48 \, {\left ({\left ({\left (f x + e\right )}^{2} - 2\right )} \cos \left (f x + e\right ) - 2 \, {\left (f x + e\right )} \sin \left (f x + e\right )\right )} a b d^{2}}{f^{2}} + \frac {{\left (4 \, {\left (f x + e\right )}^{3} - 6 \, {\left (f x + e\right )} \cos \left (2 \, f x + 2 \, e\right ) - 3 \, {\left (2 \, {\left (f x + e\right )}^{2} - 1\right )} \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2} d^{2}}{f^{2}}}{24 \, f} \] Input:
integrate((d*x+c)^2*(a+b*sin(f*x+e))^2,x, algorithm="maxima")
Output:
1/24*(24*(f*x + e)*a^2*c^2 + 6*(2*f*x + 2*e - sin(2*f*x + 2*e))*b^2*c^2 + 8*(f*x + e)^3*a^2*d^2/f^2 - 24*(f*x + e)^2*a^2*d^2*e/f^2 + 24*(f*x + e)*a^ 2*d^2*e^2/f^2 + 6*(2*f*x + 2*e - sin(2*f*x + 2*e))*b^2*d^2*e^2/f^2 + 24*(f *x + e)^2*a^2*c*d/f - 48*(f*x + e)*a^2*c*d*e/f - 12*(2*f*x + 2*e - sin(2*f *x + 2*e))*b^2*c*d*e/f - 48*a*b*c^2*cos(f*x + e) - 48*a*b*d^2*e^2*cos(f*x + e)/f^2 + 96*a*b*c*d*e*cos(f*x + e)/f + 96*((f*x + e)*cos(f*x + e) - sin( f*x + e))*a*b*d^2*e/f^2 - 6*(2*(f*x + e)^2 - 2*(f*x + e)*sin(2*f*x + 2*e) - cos(2*f*x + 2*e))*b^2*d^2*e/f^2 - 96*((f*x + e)*cos(f*x + e) - sin(f*x + e))*a*b*c*d/f + 6*(2*(f*x + e)^2 - 2*(f*x + e)*sin(2*f*x + 2*e) - cos(2*f *x + 2*e))*b^2*c*d/f - 48*(((f*x + e)^2 - 2)*cos(f*x + e) - 2*(f*x + e)*si n(f*x + e))*a*b*d^2/f^2 + (4*(f*x + e)^3 - 6*(f*x + e)*cos(2*f*x + 2*e) - 3*(2*(f*x + e)^2 - 1)*sin(2*f*x + 2*e))*b^2*d^2/f^2)/f
Time = 0.73 (sec) , antiderivative size = 225, normalized size of antiderivative = 1.24 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=\frac {1}{3} \, a^{2} d^{2} x^{3} + \frac {1}{6} \, b^{2} d^{2} x^{3} + a^{2} c d x^{2} + \frac {1}{2} \, b^{2} c d x^{2} + a^{2} c^{2} x + \frac {1}{2} \, b^{2} c^{2} x - \frac {{\left (b^{2} d^{2} f x + b^{2} c d f\right )} \cos \left (2 \, f x + 2 \, e\right )}{4 \, f^{3}} - \frac {2 \, {\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2} - 2 \, a b d^{2}\right )} \cos \left (f x + e\right )}{f^{3}} - \frac {{\left (2 \, b^{2} d^{2} f^{2} x^{2} + 4 \, b^{2} c d f^{2} x + 2 \, b^{2} c^{2} f^{2} - b^{2} d^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{8 \, f^{3}} + \frac {4 \, {\left (a b d^{2} f x + a b c d f\right )} \sin \left (f x + e\right )}{f^{3}} \] Input:
integrate((d*x+c)^2*(a+b*sin(f*x+e))^2,x, algorithm="giac")
Output:
1/3*a^2*d^2*x^3 + 1/6*b^2*d^2*x^3 + a^2*c*d*x^2 + 1/2*b^2*c*d*x^2 + a^2*c^ 2*x + 1/2*b^2*c^2*x - 1/4*(b^2*d^2*f*x + b^2*c*d*f)*cos(2*f*x + 2*e)/f^3 - 2*(a*b*d^2*f^2*x^2 + 2*a*b*c*d*f^2*x + a*b*c^2*f^2 - 2*a*b*d^2)*cos(f*x + e)/f^3 - 1/8*(2*b^2*d^2*f^2*x^2 + 4*b^2*c*d*f^2*x + 2*b^2*c^2*f^2 - b^2*d ^2)*sin(2*f*x + 2*e)/f^3 + 4*(a*b*d^2*f*x + a*b*c*d*f)*sin(f*x + e)/f^3
Time = 36.69 (sec) , antiderivative size = 281, normalized size of antiderivative = 1.54 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=a^2\,c^2\,x+\frac {b^2\,c^2\,x}{2}+\frac {a^2\,d^2\,x^3}{3}+\frac {b^2\,d^2\,x^3}{6}-\frac {b^2\,c^2\,\sin \left (2\,e+2\,f\,x\right )}{4\,f}+\frac {b^2\,d^2\,\sin \left (2\,e+2\,f\,x\right )}{8\,f^3}+a^2\,c\,d\,x^2+\frac {b^2\,c\,d\,x^2}{2}-\frac {2\,a\,b\,c^2\,\cos \left (e+f\,x\right )}{f}+\frac {4\,a\,b\,d^2\,\cos \left (e+f\,x\right )}{f^3}-\frac {b^2\,d^2\,x^2\,\sin \left (2\,e+2\,f\,x\right )}{4\,f}-\frac {b^2\,c\,d\,\cos \left (2\,e+2\,f\,x\right )}{4\,f^2}-\frac {b^2\,d^2\,x\,\cos \left (2\,e+2\,f\,x\right )}{4\,f^2}+\frac {4\,a\,b\,c\,d\,\sin \left (e+f\,x\right )}{f^2}+\frac {4\,a\,b\,d^2\,x\,\sin \left (e+f\,x\right )}{f^2}-\frac {2\,a\,b\,d^2\,x^2\,\cos \left (e+f\,x\right )}{f}-\frac {b^2\,c\,d\,x\,\sin \left (2\,e+2\,f\,x\right )}{2\,f}-\frac {4\,a\,b\,c\,d\,x\,\cos \left (e+f\,x\right )}{f} \] Input:
int((a + b*sin(e + f*x))^2*(c + d*x)^2,x)
Output:
a^2*c^2*x + (b^2*c^2*x)/2 + (a^2*d^2*x^3)/3 + (b^2*d^2*x^3)/6 - (b^2*c^2*s in(2*e + 2*f*x))/(4*f) + (b^2*d^2*sin(2*e + 2*f*x))/(8*f^3) + a^2*c*d*x^2 + (b^2*c*d*x^2)/2 - (2*a*b*c^2*cos(e + f*x))/f + (4*a*b*d^2*cos(e + f*x))/ f^3 - (b^2*d^2*x^2*sin(2*e + 2*f*x))/(4*f) - (b^2*c*d*cos(2*e + 2*f*x))/(4 *f^2) - (b^2*d^2*x*cos(2*e + 2*f*x))/(4*f^2) + (4*a*b*c*d*sin(e + f*x))/f^ 2 + (4*a*b*d^2*x*sin(e + f*x))/f^2 - (2*a*b*d^2*x^2*cos(e + f*x))/f - (b^2 *c*d*x*sin(2*e + 2*f*x))/(2*f) - (4*a*b*c*d*x*cos(e + f*x))/f
Time = 0.24 (sec) , antiderivative size = 341, normalized size of antiderivative = 1.87 \[ \int (c+d x)^2 (a+b \sin (e+f x))^2 \, dx=\frac {-6 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b^{2} c^{2} f^{2}-12 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b^{2} c d \,f^{2} x -6 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b^{2} d^{2} f^{2} x^{2}+3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b^{2} d^{2}-24 \cos \left (f x +e \right ) a b \,c^{2} f^{2}-48 \cos \left (f x +e \right ) a b c d \,f^{2} x -24 \cos \left (f x +e \right ) a b \,d^{2} f^{2} x^{2}+48 \cos \left (f x +e \right ) a b \,d^{2}+6 \sin \left (f x +e \right )^{2} b^{2} c d f +6 \sin \left (f x +e \right )^{2} b^{2} d^{2} f x +48 \sin \left (f x +e \right ) a b c d f +48 \sin \left (f x +e \right ) a b \,d^{2} f x +12 a^{2} c^{2} f^{3} x +12 a^{2} c d \,f^{3} x^{2}+4 a^{2} d^{2} f^{3} x^{3}+6 b^{2} c^{2} e \,f^{2}+6 b^{2} c^{2} f^{3} x +6 b^{2} c d \,f^{3} x^{2}-12 b^{2} c d f +9 b^{2} d^{2} e +2 b^{2} d^{2} f^{3} x^{3}-3 b^{2} d^{2} f x}{12 f^{3}} \] Input:
int((d*x+c)^2*(a+b*sin(f*x+e))^2,x)
Output:
( - 6*cos(e + f*x)*sin(e + f*x)*b**2*c**2*f**2 - 12*cos(e + f*x)*sin(e + f *x)*b**2*c*d*f**2*x - 6*cos(e + f*x)*sin(e + f*x)*b**2*d**2*f**2*x**2 + 3* cos(e + f*x)*sin(e + f*x)*b**2*d**2 - 24*cos(e + f*x)*a*b*c**2*f**2 - 48*c os(e + f*x)*a*b*c*d*f**2*x - 24*cos(e + f*x)*a*b*d**2*f**2*x**2 + 48*cos(e + f*x)*a*b*d**2 + 6*sin(e + f*x)**2*b**2*c*d*f + 6*sin(e + f*x)**2*b**2*d **2*f*x + 48*sin(e + f*x)*a*b*c*d*f + 48*sin(e + f*x)*a*b*d**2*f*x + 12*a* *2*c**2*f**3*x + 12*a**2*c*d*f**3*x**2 + 4*a**2*d**2*f**3*x**3 + 6*b**2*c* *2*e*f**2 + 6*b**2*c**2*f**3*x + 6*b**2*c*d*f**3*x**2 - 12*b**2*c*d*f + 9* b**2*d**2*e + 2*b**2*d**2*f**3*x**3 - 3*b**2*d**2*f*x)/(12*f**3)