Integrand size = 18, antiderivative size = 198 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {1}{6} \left (2 a^2+b^2\right ) x^3-\frac {a b x \cos \left (c+d x^2\right )}{d}+\frac {a b \sqrt {\frac {\pi }{2}} \cos (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{d^{3/2}}+\frac {b^2 \sqrt {\pi } \cos (2 c) \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{16 d^{3/2}}-\frac {a b \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)}{d^{3/2}}+\frac {b^2 \sqrt {\pi } \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right ) \sin (2 c)}{16 d^{3/2}}-\frac {b^2 x \sin \left (2 c+2 d x^2\right )}{8 d} \] Output:
1/6*(2*a^2+b^2)*x^3-a*b*x*cos(d*x^2+c)/d+1/2*a*b*2^(1/2)*Pi^(1/2)*cos(c)*F resnelC(d^(1/2)*2^(1/2)/Pi^(1/2)*x)/d^(3/2)+1/16*b^2*Pi^(1/2)*cos(2*c)*Fre snelS(2*d^(1/2)*x/Pi^(1/2))/d^(3/2)-1/2*a*b*2^(1/2)*Pi^(1/2)*FresnelS(d^(1 /2)*2^(1/2)/Pi^(1/2)*x)*sin(c)/d^(3/2)+1/16*b^2*Pi^(1/2)*FresnelC(2*d^(1/2 )*x/Pi^(1/2))*sin(2*c)/d^(3/2)-1/8*b^2*x*sin(2*d*x^2+2*c)/d
Time = 0.55 (sec) , antiderivative size = 191, normalized size of antiderivative = 0.96 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {16 a^2 d^{3/2} x^3+8 b^2 d^{3/2} x^3-48 a b \sqrt {d} x \cos \left (c+d x^2\right )+24 a b \sqrt {2 \pi } \cos (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )+3 b^2 \sqrt {\pi } \cos (2 c) \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )-24 a b \sqrt {2 \pi } \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)+3 b^2 \sqrt {\pi } \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right ) \sin (2 c)-6 b^2 \sqrt {d} x \sin \left (2 \left (c+d x^2\right )\right )}{48 d^{3/2}} \] Input:
Integrate[x^2*(a + b*Sin[c + d*x^2])^2,x]
Output:
(16*a^2*d^(3/2)*x^3 + 8*b^2*d^(3/2)*x^3 - 48*a*b*Sqrt[d]*x*Cos[c + d*x^2] + 24*a*b*Sqrt[2*Pi]*Cos[c]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x] + 3*b^2*Sqrt[Pi] *Cos[2*c]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]] - 24*a*b*Sqrt[2*Pi]*FresnelS[Sq rt[d]*Sqrt[2/Pi]*x]*Sin[c] + 3*b^2*Sqrt[Pi]*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi ]]*Sin[2*c] - 6*b^2*Sqrt[d]*x*Sin[2*(c + d*x^2)])/(48*d^(3/2))
Time = 0.36 (sec) , antiderivative size = 198, 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 = {3884, 6, 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 x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx\) |
\(\Big \downarrow \) 3884 |
\(\displaystyle \int \left (a^2 x^2+2 a b x^2 \sin \left (c+d x^2\right )-\frac {1}{2} b^2 x^2 \cos \left (2 c+2 d x^2\right )+\frac {b^2 x^2}{2}\right )dx\) |
\(\Big \downarrow \) 6 |
\(\displaystyle \int \left (x^2 \left (a^2+\frac {b^2}{2}\right )+2 a b x^2 \sin \left (c+d x^2\right )-\frac {1}{2} b^2 x^2 \cos \left (2 c+2 d x^2\right )\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{6} x^3 \left (2 a^2+b^2\right )+\frac {\sqrt {\frac {\pi }{2}} a b \cos (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{d^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} a b \sin (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{d^{3/2}}-\frac {a b x \cos \left (c+d x^2\right )}{d}+\frac {\sqrt {\pi } b^2 \sin (2 c) \operatorname {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{16 d^{3/2}}+\frac {\sqrt {\pi } b^2 \cos (2 c) \operatorname {FresnelS}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )}{16 d^{3/2}}-\frac {b^2 x \sin \left (2 c+2 d x^2\right )}{8 d}\) |
Input:
Int[x^2*(a + b*Sin[c + d*x^2])^2,x]
Output:
((2*a^2 + b^2)*x^3)/6 - (a*b*x*Cos[c + d*x^2])/d + (a*b*Sqrt[Pi/2]*Cos[c]* FresnelC[Sqrt[d]*Sqrt[2/Pi]*x])/d^(3/2) + (b^2*Sqrt[Pi]*Cos[2*c]*FresnelS[ (2*Sqrt[d]*x)/Sqrt[Pi]])/(16*d^(3/2)) - (a*b*Sqrt[Pi/2]*FresnelS[Sqrt[d]*S qrt[2/Pi]*x]*Sin[c])/d^(3/2) + (b^2*Sqrt[Pi]*FresnelC[(2*Sqrt[d]*x)/Sqrt[P i]]*Sin[2*c])/(16*d^(3/2)) - (b^2*x*Sin[2*c + 2*d*x^2])/(8*d)
Int[(u_.)*((v_.) + (a_.)*(Fx_) + (b_.)*(Fx_))^(p_.), x_Symbol] :> Int[u*(v + (a + b)*Fx)^p, x] /; FreeQ[{a, b}, x] && !FreeQ[Fx, x]
Int[((e_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_), x _Symbol] :> Int[ExpandTrigReduce[(e*x)^m, (a + b*Sin[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]
Time = 1.82 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.70
method | result | size |
parts | \(\frac {x^{3} a^{2}}{3}+b^{2} \left (\frac {x^{3}}{6}-\frac {x \sin \left (2 d \,x^{2}+2 c \right )}{8 d}+\frac {\sqrt {\pi }\, \left (\cos \left (2 c \right ) \operatorname {FresnelS}\left (\frac {2 \sqrt {d}\, x}{\sqrt {\pi }}\right )+\sin \left (2 c \right ) \operatorname {FresnelC}\left (\frac {2 \sqrt {d}\, x}{\sqrt {\pi }}\right )\right )}{16 d^{\frac {3}{2}}}\right )+2 a b \left (-\frac {x \cos \left (d \,x^{2}+c \right )}{2 d}+\frac {\sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (c \right ) \operatorname {FresnelC}\left (\frac {\sqrt {d}\, \sqrt {2}\, x}{\sqrt {\pi }}\right )-\sin \left (c \right ) \operatorname {FresnelS}\left (\frac {\sqrt {d}\, \sqrt {2}\, x}{\sqrt {\pi }}\right )\right )}{4 d^{\frac {3}{2}}}\right )\) | \(138\) |
default | \(\frac {\left (a^{2}+\frac {b^{2}}{2}\right ) x^{3}}{3}-\frac {b^{2} \left (\frac {x \sin \left (2 d \,x^{2}+2 c \right )}{4 d}-\frac {\sqrt {\pi }\, \left (\cos \left (2 c \right ) \operatorname {FresnelS}\left (\frac {2 \sqrt {d}\, x}{\sqrt {\pi }}\right )+\sin \left (2 c \right ) \operatorname {FresnelC}\left (\frac {2 \sqrt {d}\, x}{\sqrt {\pi }}\right )\right )}{8 d^{\frac {3}{2}}}\right )}{2}+2 a b \left (-\frac {x \cos \left (d \,x^{2}+c \right )}{2 d}+\frac {\sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (c \right ) \operatorname {FresnelC}\left (\frac {\sqrt {d}\, \sqrt {2}\, x}{\sqrt {\pi }}\right )-\sin \left (c \right ) \operatorname {FresnelS}\left (\frac {\sqrt {d}\, \sqrt {2}\, x}{\sqrt {\pi }}\right )\right )}{4 d^{\frac {3}{2}}}\right )\) | \(140\) |
risch | \(\frac {i b^{2} \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\sqrt {2}\, \sqrt {i d}\, x \right ) {\mathrm e}^{-2 i c}}{64 d \sqrt {i d}}-\frac {i b^{2} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-2 i d}\, x \right ) {\mathrm e}^{2 i c}}{32 d \sqrt {-2 i d}}+\frac {a b \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-i d}\, x \right ) {\mathrm e}^{i c}}{4 d \sqrt {-i d}}+\frac {a b \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {i d}\, x \right ) {\mathrm e}^{-i c}}{4 d \sqrt {i d}}+\frac {x^{3} a^{2}}{3}+\frac {x^{3} b^{2}}{6}-\frac {a b x \cos \left (d \,x^{2}+c \right )}{d}-\frac {b^{2} x \sin \left (2 d \,x^{2}+2 c \right )}{8 d}\) | \(184\) |
Input:
int(x^2*(a+b*sin(d*x^2+c))^2,x,method=_RETURNVERBOSE)
Output:
1/3*x^3*a^2+b^2*(1/6*x^3-1/8/d*x*sin(2*d*x^2+2*c)+1/16/d^(3/2)*Pi^(1/2)*(c os(2*c)*FresnelS(2*d^(1/2)*x/Pi^(1/2))+sin(2*c)*FresnelC(2*d^(1/2)*x/Pi^(1 /2))))+2*a*b*(-1/2/d*x*cos(d*x^2+c)+1/4/d^(3/2)*2^(1/2)*Pi^(1/2)*(cos(c)*F resnelC(d^(1/2)*2^(1/2)/Pi^(1/2)*x)-sin(c)*FresnelS(d^(1/2)*2^(1/2)/Pi^(1/ 2)*x)))
Time = 0.13 (sec) , antiderivative size = 176, normalized size of antiderivative = 0.89 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {8 \, {\left (2 \, a^{2} + b^{2}\right )} d^{2} x^{3} + 24 \, \sqrt {2} \pi a b \sqrt {\frac {d}{\pi }} \cos \left (c\right ) \operatorname {C}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) - 12 \, b^{2} d x \cos \left (d x^{2} + c\right ) \sin \left (d x^{2} + c\right ) - 24 \, \sqrt {2} \pi a b \sqrt {\frac {d}{\pi }} \operatorname {S}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) \sin \left (c\right ) + 3 \, \pi b^{2} \sqrt {\frac {d}{\pi }} \cos \left (2 \, c\right ) \operatorname {S}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) + 3 \, \pi b^{2} \sqrt {\frac {d}{\pi }} \operatorname {C}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) \sin \left (2 \, c\right ) - 48 \, a b d x \cos \left (d x^{2} + c\right )}{48 \, d^{2}} \] Input:
integrate(x^2*(a+b*sin(d*x^2+c))^2,x, algorithm="fricas")
Output:
1/48*(8*(2*a^2 + b^2)*d^2*x^3 + 24*sqrt(2)*pi*a*b*sqrt(d/pi)*cos(c)*fresne l_cos(sqrt(2)*x*sqrt(d/pi)) - 12*b^2*d*x*cos(d*x^2 + c)*sin(d*x^2 + c) - 2 4*sqrt(2)*pi*a*b*sqrt(d/pi)*fresnel_sin(sqrt(2)*x*sqrt(d/pi))*sin(c) + 3*p i*b^2*sqrt(d/pi)*cos(2*c)*fresnel_sin(2*x*sqrt(d/pi)) + 3*pi*b^2*sqrt(d/pi )*fresnel_cos(2*x*sqrt(d/pi))*sin(2*c) - 48*a*b*d*x*cos(d*x^2 + c))/d^2
\[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\int x^{2} \left (a + b \sin {\left (c + d x^{2} \right )}\right )^{2}\, dx \] Input:
integrate(x**2*(a+b*sin(d*x**2+c))**2,x)
Output:
Integral(x**2*(a + b*sin(c + d*x**2))**2, x)
Result contains complex when optimal does not.
Time = 0.15 (sec) , antiderivative size = 171, normalized size of antiderivative = 0.86 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {1}{3} \, a^{2} x^{3} - \frac {{\left (8 \, d^{2} x \cos \left (d x^{2} + c\right ) + \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i - 1\right ) \, \cos \left (c\right ) + \left (i + 1\right ) \, \sin \left (c\right )\right )} \operatorname {erf}\left (\sqrt {i \, d} x\right ) + {\left (-\left (i + 1\right ) \, \cos \left (c\right ) - \left (i - 1\right ) \, \sin \left (c\right )\right )} \operatorname {erf}\left (\sqrt {-i \, d} x\right )\right )} d^{\frac {3}{2}}\right )} a b}{8 \, d^{3}} + \frac {{\left (64 \, d^{3} x^{3} - 48 \, d^{2} x \sin \left (2 \, d x^{2} + 2 \, c\right ) + 3 \cdot 4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i + 1\right ) \, \cos \left (2 \, c\right ) - \left (i - 1\right ) \, \sin \left (2 \, c\right )\right )} \operatorname {erf}\left (\sqrt {2 i \, d} x\right ) + {\left (-\left (i - 1\right ) \, \cos \left (2 \, c\right ) + \left (i + 1\right ) \, \sin \left (2 \, c\right )\right )} \operatorname {erf}\left (\sqrt {-2 i \, d} x\right )\right )} d^{\frac {3}{2}}\right )} b^{2}}{384 \, d^{3}} \] Input:
integrate(x^2*(a+b*sin(d*x^2+c))^2,x, algorithm="maxima")
Output:
1/3*a^2*x^3 - 1/8*(8*d^2*x*cos(d*x^2 + c) + sqrt(2)*sqrt(pi)*(((I - 1)*cos (c) + (I + 1)*sin(c))*erf(sqrt(I*d)*x) + (-(I + 1)*cos(c) - (I - 1)*sin(c) )*erf(sqrt(-I*d)*x))*d^(3/2))*a*b/d^3 + 1/384*(64*d^3*x^3 - 48*d^2*x*sin(2 *d*x^2 + 2*c) + 3*4^(1/4)*sqrt(2)*sqrt(pi)*(((I + 1)*cos(2*c) - (I - 1)*si n(2*c))*erf(sqrt(2*I*d)*x) + (-(I - 1)*cos(2*c) + (I + 1)*sin(2*c))*erf(sq rt(-2*I*d)*x))*d^(3/2))*b^2/d^3
Result contains complex when optimal does not.
Time = 0.15 (sec) , antiderivative size = 283, normalized size of antiderivative = 1.43 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\frac {1}{3} \, a^{2} x^{3} + \frac {1}{6} \, b^{2} x^{3} + \frac {i \, b^{2} x e^{\left (2 i \, d x^{2} + 2 i \, c\right )}}{16 \, d} - \frac {a b x e^{\left (i \, d x^{2} + i \, c\right )}}{2 \, d} - \frac {a b x e^{\left (-i \, d x^{2} - i \, c\right )}}{2 \, d} - \frac {i \, b^{2} x e^{\left (-2 i \, d x^{2} - 2 i \, c\right )}}{16 \, d} - \frac {\sqrt {2} \sqrt {\pi } a b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} x {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}\right ) e^{\left (i \, c\right )}}{4 \, d {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} - \frac {\sqrt {2} \sqrt {\pi } a b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {2} x {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}\right ) e^{\left (-i \, c\right )}}{4 \, d {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} + \frac {i \, \sqrt {\pi } b^{2} \operatorname {erf}\left (-\sqrt {d} x {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (2 i \, c\right )}}{32 \, d^{\frac {3}{2}} {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )}} - \frac {i \, \sqrt {\pi } b^{2} \operatorname {erf}\left (-\sqrt {d} x {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (-2 i \, c\right )}}{32 \, d^{\frac {3}{2}} {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )}} \] Input:
integrate(x^2*(a+b*sin(d*x^2+c))^2,x, algorithm="giac")
Output:
1/3*a^2*x^3 + 1/6*b^2*x^3 + 1/16*I*b^2*x*e^(2*I*d*x^2 + 2*I*c)/d - 1/2*a*b *x*e^(I*d*x^2 + I*c)/d - 1/2*a*b*x*e^(-I*d*x^2 - I*c)/d - 1/16*I*b^2*x*e^( -2*I*d*x^2 - 2*I*c)/d - 1/4*sqrt(2)*sqrt(pi)*a*b*erf(-1/2*sqrt(2)*x*(-I*d/ abs(d) + 1)*sqrt(abs(d)))*e^(I*c)/(d*(-I*d/abs(d) + 1)*sqrt(abs(d))) - 1/4 *sqrt(2)*sqrt(pi)*a*b*erf(-1/2*sqrt(2)*x*(I*d/abs(d) + 1)*sqrt(abs(d)))*e^ (-I*c)/(d*(I*d/abs(d) + 1)*sqrt(abs(d))) + 1/32*I*sqrt(pi)*b^2*erf(-sqrt(d )*x*(-I*d/abs(d) + 1))*e^(2*I*c)/(d^(3/2)*(-I*d/abs(d) + 1)) - 1/32*I*sqrt (pi)*b^2*erf(-sqrt(d)*x*(I*d/abs(d) + 1))*e^(-2*I*c)/(d^(3/2)*(I*d/abs(d) + 1))
Timed out. \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\int x^2\,{\left (a+b\,\sin \left (d\,x^2+c\right )\right )}^2 \,d x \] Input:
int(x^2*(a + b*sin(c + d*x^2))^2,x)
Output:
int(x^2*(a + b*sin(c + d*x^2))^2, x)
\[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx=\left (\int \sin \left (d \,x^{2}+c \right )^{2} x^{2}d x \right ) b^{2}+2 \left (\int \sin \left (d \,x^{2}+c \right ) x^{2}d x \right ) a b +\frac {a^{2} x^{3}}{3} \] Input:
int(x^2*(a+b*sin(d*x^2+c))^2,x)
Output:
(3*int(sin(c + d*x**2)**2*x**2,x)*b**2 + 6*int(sin(c + d*x**2)*x**2,x)*a*b + a**2*x**3)/3