Integrand size = 18, antiderivative size = 98 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, dx=\frac {3 a^2 (c+d x)^2}{4 d}-\frac {2 a^2 (c+d x) \cos (e+f x)}{f}+\frac {2 a^2 d \sin (e+f x)}{f^2}-\frac {a^2 (c+d x) \cos (e+f x) \sin (e+f x)}{2 f}+\frac {a^2 d \sin ^2(e+f x)}{4 f^2} \] Output:
3/4*a^2*(d*x+c)^2/d-2*a^2*(d*x+c)*cos(f*x+e)/f+2*a^2*d*sin(f*x+e)/f^2-1/2* a^2*(d*x+c)*cos(f*x+e)*sin(f*x+e)/f+1/4*a^2*d*sin(f*x+e)^2/f^2
Time = 12.60 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.82 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, dx=-\frac {a^2 (6 (e+f x) (-2 c f+d (e-f x))+16 f (c+d x) \cos (e+f x)+d \cos (2 (e+f x))-16 d \sin (e+f x)+2 f (c+d x) \sin (2 (e+f x)))}{8 f^2} \] Input:
Integrate[(c + d*x)*(a + a*Sin[e + f*x])^2,x]
Output:
-1/8*(a^2*(6*(e + f*x)*(-2*c*f + d*(e - f*x)) + 16*f*(c + d*x)*Cos[e + f*x ] + d*Cos[2*(e + f*x)] - 16*d*Sin[e + f*x] + 2*f*(c + d*x)*Sin[2*(e + f*x) ]))/f^2
Time = 0.32 (sec) , antiderivative size = 98, 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.167, 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) (a \sin (e+f x)+a)^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x) (a \sin (e+f x)+a)^2dx\) |
\(\Big \downarrow \) 3798 |
\(\displaystyle \int \left (a^2 (c+d x) \sin ^2(e+f x)+2 a^2 (c+d x) \sin (e+f x)+a^2 (c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2 a^2 (c+d x) \cos (e+f x)}{f}-\frac {a^2 (c+d x) \sin (e+f x) \cos (e+f x)}{2 f}+\frac {3 a^2 (c+d x)^2}{4 d}+\frac {a^2 d \sin ^2(e+f x)}{4 f^2}+\frac {2 a^2 d \sin (e+f x)}{f^2}\) |
Input:
Int[(c + d*x)*(a + a*Sin[e + f*x])^2,x]
Output:
(3*a^2*(c + d*x)^2)/(4*d) - (2*a^2*(c + d*x)*Cos[e + f*x])/f + (2*a^2*d*Si n[e + f*x])/f^2 - (a^2*(c + d*x)*Cos[e + f*x]*Sin[e + f*x])/(2*f) + (a^2*d *Sin[e + f*x]^2)/(4*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.48 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.85
method | result | size |
parallelrisch | \(-\frac {a^{2} \left (f \left (d x +c \right ) \sin \left (2 f x +2 e \right )+\frac {d \cos \left (2 f x +2 e \right )}{2}+8 f \left (d x +c \right ) \cos \left (f x +e \right )-8 d \sin \left (f x +e \right )+\left (-3 d \,x^{2}-6 c x \right ) f^{2}+8 c f -\frac {d}{2}\right )}{4 f^{2}}\) | \(83\) |
risch | \(\frac {3 a^{2} d \,x^{2}}{4}+\frac {3 a^{2} c x}{2}-\frac {2 a^{2} \left (d x +c \right ) \cos \left (f x +e \right )}{f}+\frac {2 a^{2} d \sin \left (f x +e \right )}{f^{2}}-\frac {a^{2} d \cos \left (2 f x +2 e \right )}{8 f^{2}}-\frac {a^{2} \left (d x +c \right ) \sin \left (2 f x +2 e \right )}{4 f}\) | \(92\) |
parts | \(a^{2} \left (\frac {1}{2} d \,x^{2}+c x \right )+\frac {a^{2} \left (\frac {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}+c \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {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}\right )}{f}+\frac {2 a^{2} \left (\frac {d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}-c \cos \left (f x +e \right )+\frac {d e \cos \left (f x +e \right )}{f}\right )}{f}\) | \(185\) |
derivativedivides | \(\frac {a^{2} c \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {a^{2} 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 {a^{2} 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}-2 a^{2} c \cos \left (f x +e \right )+\frac {2 a^{2} d e \cos \left (f x +e \right )}{f}+\frac {2 a^{2} d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}+a^{2} c \left (f x +e \right )-\frac {a^{2} d e \left (f x +e \right )}{f}+\frac {a^{2} d \left (f x +e \right )^{2}}{2 f}}{f}\) | \(219\) |
default | \(\frac {a^{2} c \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {a^{2} 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 {a^{2} 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}-2 a^{2} c \cos \left (f x +e \right )+\frac {2 a^{2} d e \cos \left (f x +e \right )}{f}+\frac {2 a^{2} d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}+a^{2} c \left (f x +e \right )-\frac {a^{2} d e \left (f x +e \right )}{f}+\frac {a^{2} d \left (f x +e \right )^{2}}{2 f}}{f}\) | \(219\) |
norman | \(\frac {\frac {a^{2} \left (c f +4 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{f^{2}}+\frac {a^{2} d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{f}-\frac {4 a^{2} c}{f}+\frac {3 a^{2} d \,x^{2}}{4}-\frac {\left (4 a^{2} c f -a^{2} d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f^{2}}+3 a^{2} c x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\frac {3 a^{2} d \,x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{2}+\frac {3 a^{2} d \,x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{4}-\frac {a^{2} \left (c f -4 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}+\frac {a^{2} \left (3 c f -4 d \right ) x}{2 f}-\frac {a^{2} d x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {a^{2} \left (3 c f +4 d \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{2 f}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{2}}\) | \(257\) |
orering | \(\frac {\left (2 d^{5} f^{4} x^{6}+12 c \,d^{4} f^{4} x^{5}+28 c^{2} d^{3} f^{4} x^{4}+32 c^{3} d^{2} f^{4} x^{3}+18 c^{4} d \,f^{4} x^{2}+15 d^{5} f^{2} x^{4}+4 c^{5} f^{4} x +60 c \,d^{4} f^{2} x^{3}+85 c^{2} d^{3} f^{2} x^{2}+50 c^{3} d^{2} f^{2} x +10 c^{4} d \,f^{2}+20 d^{5} x^{2}+40 d^{4} c x +8 c^{2} d^{3}\right ) \left (a +a \sin \left (f x +e \right )\right )^{2}}{4 f^{4} \left (d x +c \right )^{4}}-\frac {\left (10 d^{4} f^{2} x^{4}+40 c \,d^{3} f^{2} x^{3}+55 c^{2} d^{2} f^{2} x^{2}+30 c^{3} d \,f^{2} x +5 c^{4} f^{2}+20 d^{4} x^{2}+40 c \,d^{3} x +8 c^{2} d^{2}\right ) \left (d \left (a +a \sin \left (f x +e \right )\right )^{2}+2 \left (d x +c \right ) \left (a +a \sin \left (f x +e \right )\right ) a f \cos \left (f x +e \right )\right )}{4 f^{4} \left (d x +c \right )^{4}}+\frac {\left (5 d^{3} f^{2} x^{4}+20 c \,d^{2} f^{2} x^{3}+25 c^{2} d \,f^{2} x^{2}+10 c^{3} f^{2} x +20 d^{3} x^{2}+40 c \,d^{2} x +8 c^{2} d \right ) \left (4 d \left (a +a \sin \left (f x +e \right )\right ) a f \cos \left (f x +e \right )+2 \left (d x +c \right ) a^{2} f^{2} \cos \left (f x +e \right )^{2}-2 \left (d x +c \right ) \left (a +a \sin \left (f x +e \right )\right ) a \,f^{2} \sin \left (f x +e \right )\right )}{8 f^{4} \left (d x +c \right )^{3}}-\frac {\left (3 x^{2} d^{2}+6 c d x +c^{2}\right ) \left (6 d \,a^{2} f^{2} \cos \left (f x +e \right )^{2}-6 d \left (a +a \sin \left (f x +e \right )\right ) a \,f^{2} \sin \left (f x +e \right )-6 \sin \left (f x +e \right ) \cos \left (f x +e \right ) a^{2} f^{3} \left (d x +c \right )-2 \left (d x +c \right ) \left (a +a \sin \left (f x +e \right )\right ) a \,f^{3} \cos \left (f x +e \right )\right )}{4 f^{4} \left (d x +c \right )^{2}}+\frac {x \left (d x +2 c \right ) \left (-24 d \,a^{2} f^{3} \cos \left (f x +e \right ) \sin \left (f x +e \right )-8 d \left (a +a \sin \left (f x +e \right )\right ) a \,f^{3} \cos \left (f x +e \right )-8 f^{4} \cos \left (f x +e \right )^{2} a^{2} \left (d x +c \right )+6 \sin \left (f x +e \right )^{2} f^{4} a^{2} \left (d x +c \right )+2 \left (d x +c \right ) \left (a +a \sin \left (f x +e \right )\right ) a \,f^{4} \sin \left (f x +e \right )\right )}{8 f^{4} \left (d x +c \right )}\) | \(715\) |
Input:
int((d*x+c)*(a+a*sin(f*x+e))^2,x,method=_RETURNVERBOSE)
Output:
-1/4*a^2*(f*(d*x+c)*sin(2*f*x+2*e)+1/2*d*cos(2*f*x+2*e)+8*f*(d*x+c)*cos(f* x+e)-8*d*sin(f*x+e)+(-3*d*x^2-6*c*x)*f^2+8*c*f-1/2*d)/f^2
Time = 0.08 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.03 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, dx=\frac {3 \, a^{2} d f^{2} x^{2} + 6 \, a^{2} c f^{2} x - a^{2} d \cos \left (f x + e\right )^{2} - 8 \, {\left (a^{2} d f x + a^{2} c f\right )} \cos \left (f x + e\right ) + 2 \, {\left (4 \, a^{2} d - {\left (a^{2} d f x + a^{2} c f\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, f^{2}} \] Input:
integrate((d*x+c)*(a+a*sin(f*x+e))^2,x, algorithm="fricas")
Output:
1/4*(3*a^2*d*f^2*x^2 + 6*a^2*c*f^2*x - a^2*d*cos(f*x + e)^2 - 8*(a^2*d*f*x + a^2*c*f)*cos(f*x + e) + 2*(4*a^2*d - (a^2*d*f*x + a^2*c*f)*cos(f*x + e) )*sin(f*x + e))/f^2
Leaf count of result is larger than twice the leaf count of optimal. 219 vs. \(2 (94) = 188\).
Time = 0.21 (sec) , antiderivative size = 219, normalized size of antiderivative = 2.23 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, 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} + \frac {a^{2} d x^{2} \sin ^{2}{\left (e + f x \right )}}{4} + \frac {a^{2} d x^{2} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {a^{2} d x^{2}}{2} - \frac {a^{2} d x \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {2 a^{2} d x \cos {\left (e + f x \right )}}{f} + \frac {a^{2} d \sin ^{2}{\left (e + f x \right )}}{4 f^{2}} + \frac {2 a^{2} d \sin {\left (e + f x \right )}}{f^{2}} & \text {for}\: f \neq 0 \\\left (a \sin {\left (e \right )} + a\right )^{2} \left (c x + \frac {d x^{2}}{2}\right ) & \text {otherwise} \end {cases} \] Input:
integrate((d*x+c)*(a+a*sin(f*x+e))**2,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**2*sin(e + f*x)**2/4 + a**2*d*x**2*cos(e + f*x)**2/4 + a**2*d*x**2 /2 - a**2*d*x*sin(e + f*x)*cos(e + f*x)/(2*f) - 2*a**2*d*x*cos(e + f*x)/f + a**2*d*sin(e + f*x)**2/(4*f**2) + 2*a**2*d*sin(e + f*x)/f**2, Ne(f, 0)), ((a*sin(e) + a)**2*(c*x + d*x**2/2), True))
Leaf count of result is larger than twice the leaf count of optimal. 205 vs. \(2 (92) = 184\).
Time = 0.04 (sec) , antiderivative size = 205, normalized size of antiderivative = 2.09 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, dx=\frac {2 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} c + 8 \, {\left (f x + e\right )} a^{2} c + \frac {4 \, {\left (f x + e\right )}^{2} a^{2} d}{f} - \frac {2 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} d e}{f} - \frac {8 \, {\left (f x + e\right )} a^{2} d e}{f} - 16 \, a^{2} c \cos \left (f x + e\right ) + \frac {16 \, a^{2} d e \cos \left (f x + e\right )}{f} + \frac {{\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 )} a^{2} d}{f} - \frac {16 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} a^{2} d}{f}}{8 \, f} \] Input:
integrate((d*x+c)*(a+a*sin(f*x+e))^2,x, algorithm="maxima")
Output:
1/8*(2*(2*f*x + 2*e - sin(2*f*x + 2*e))*a^2*c + 8*(f*x + e)*a^2*c + 4*(f*x + e)^2*a^2*d/f - 2*(2*f*x + 2*e - sin(2*f*x + 2*e))*a^2*d*e/f - 8*(f*x + e)*a^2*d*e/f - 16*a^2*c*cos(f*x + e) + 16*a^2*d*e*cos(f*x + e)/f + (2*(f*x + e)^2 - 2*(f*x + e)*sin(2*f*x + 2*e) - cos(2*f*x + 2*e))*a^2*d/f - 16*(( f*x + e)*cos(f*x + e) - sin(f*x + e))*a^2*d/f)/f
Time = 0.31 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.05 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, dx=\frac {3}{4} \, a^{2} d x^{2} + \frac {3}{2} \, a^{2} c x - \frac {a^{2} d \cos \left (2 \, f x + 2 \, e\right )}{8 \, f^{2}} + \frac {2 \, a^{2} d \sin \left (f x + e\right )}{f^{2}} - \frac {2 \, {\left (a^{2} d f x + a^{2} c f\right )} \cos \left (f x + e\right )}{f^{2}} - \frac {{\left (a^{2} d f x + a^{2} c f\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f^{2}} \] Input:
integrate((d*x+c)*(a+a*sin(f*x+e))^2,x, algorithm="giac")
Output:
3/4*a^2*d*x^2 + 3/2*a^2*c*x - 1/8*a^2*d*cos(2*f*x + 2*e)/f^2 + 2*a^2*d*sin (f*x + e)/f^2 - 2*(a^2*d*f*x + a^2*c*f)*cos(f*x + e)/f^2 - 1/4*(a^2*d*f*x + a^2*c*f)*sin(2*f*x + 2*e)/f^2
Time = 35.93 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.30 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, dx=\frac {a^2\,d\,{\sin \left (e+f\,x\right )}^2+8\,a^2\,d\,\sin \left (e+f\,x\right )+16\,a^2\,c\,f\,{\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+3\,a^2\,d\,f^2\,x^2-a^2\,c\,f\,\sin \left (2\,e+2\,f\,x\right )+6\,a^2\,c\,f^2\,x-a^2\,d\,f\,x\,\sin \left (2\,e+2\,f\,x\right )+8\,a^2\,d\,f\,x\,\left (2\,{\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}{4\,f^2} \] Input:
int((a + a*sin(e + f*x))^2*(c + d*x),x)
Output:
(a^2*d*sin(e + f*x)^2 + 8*a^2*d*sin(e + f*x) + 16*a^2*c*f*sin(e/2 + (f*x)/ 2)^2 + 3*a^2*d*f^2*x^2 - a^2*c*f*sin(2*e + 2*f*x) + 6*a^2*c*f^2*x - a^2*d* f*x*sin(2*e + 2*f*x) + 8*a^2*d*f*x*(2*sin(e/2 + (f*x)/2)^2 - 1))/(4*f^2)
Time = 0.17 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.12 \[ \int (c+d x) (a+a \sin (e+f x))^2 \, dx=\frac {a^{2} \left (-2 \cos \left (f x +e \right ) \sin \left (f x +e \right ) c f -2 \cos \left (f x +e \right ) \sin \left (f x +e \right ) d f x -8 \cos \left (f x +e \right ) c f -8 \cos \left (f x +e \right ) d f x +\sin \left (f x +e \right )^{2} d +8 \sin \left (f x +e \right ) d +2 c e f +6 c \,f^{2} x -8 d e +3 d \,f^{2} x^{2}-2 d \right )}{4 f^{2}} \] Input:
int((d*x+c)*(a+a*sin(f*x+e))^2,x)
Output:
(a**2*( - 2*cos(e + f*x)*sin(e + f*x)*c*f - 2*cos(e + f*x)*sin(e + f*x)*d* f*x - 8*cos(e + f*x)*c*f - 8*cos(e + f*x)*d*f*x + sin(e + f*x)**2*d + 8*si n(e + f*x)*d + 2*c*e*f + 6*c*f**2*x - 8*d*e + 3*d*f**2*x**2 - 2*d))/(4*f** 2)