Integrand size = 16, antiderivative size = 102 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\frac {a x^3}{3}-\frac {b x \cos \left (c+d x^2\right )}{2 d}+\frac {b \sqrt {\frac {\pi }{2}} \cos (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{2 d^{3/2}}-\frac {b \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)}{2 d^{3/2}} \] Output:
1/3*a*x^3-1/2*b*x*cos(d*x^2+c)/d+1/4*b*2^(1/2)*Pi^(1/2)*cos(c)*FresnelC(d^ (1/2)*2^(1/2)/Pi^(1/2)*x)/d^(3/2)-1/4*b*2^(1/2)*Pi^(1/2)*FresnelS(d^(1/2)* 2^(1/2)/Pi^(1/2)*x)*sin(c)/d^(3/2)
Time = 0.25 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.02 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\frac {a x^3}{3}-\frac {b x \cos (c) \cos \left (d x^2\right )}{2 d}+\frac {b \sqrt {\frac {\pi }{2}} \left (\cos (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-\operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)\right )}{2 d^{3/2}}+\frac {b x \sin (c) \sin \left (d x^2\right )}{2 d} \] Input:
Integrate[x^2*(a + b*Sin[c + d*x^2]),x]
Output:
(a*x^3)/3 - (b*x*Cos[c]*Cos[d*x^2])/(2*d) + (b*Sqrt[Pi/2]*(Cos[c]*FresnelC [Sqrt[d]*Sqrt[2/Pi]*x] - FresnelS[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c]))/(2*d^(3/2 )) + (b*x*Sin[c]*Sin[d*x^2])/(2*d)
Time = 0.24 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2010, 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 ) \, dx\) |
\(\Big \downarrow \) 2010 |
\(\displaystyle \int \left (a x^2+b x^2 \sin \left (c+d x^2\right )\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a x^3}{3}+\frac {\sqrt {\frac {\pi }{2}} b \cos (c) \operatorname {FresnelC}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{2 d^{3/2}}-\frac {\sqrt {\frac {\pi }{2}} b \sin (c) \operatorname {FresnelS}\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )}{2 d^{3/2}}-\frac {b x \cos \left (c+d x^2\right )}{2 d}\) |
Input:
Int[x^2*(a + b*Sin[c + d*x^2]),x]
Output:
(a*x^3)/3 - (b*x*Cos[c + d*x^2])/(2*d) + (b*Sqrt[Pi/2]*Cos[c]*FresnelC[Sqr t[d]*Sqrt[2/Pi]*x])/(2*d^(3/2)) - (b*Sqrt[Pi/2]*FresnelS[Sqrt[d]*Sqrt[2/Pi ]*x]*Sin[c])/(2*d^(3/2))
Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x] , x] /; FreeQ[{c, m}, x] && SumQ[u] && !LinearQ[u, x] && !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]
Time = 0.70 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.67
method | result | size |
default | \(\frac {a \,x^{3}}{3}+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 )\) | \(68\) |
parts | \(\frac {a \,x^{3}}{3}+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 )\) | \(68\) |
risch | \(\frac {b \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-i d}\, x \right ) {\mathrm e}^{i c}}{8 d \sqrt {-i d}}+\frac {b \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {i d}\, x \right ) {\mathrm e}^{-i c}}{8 d \sqrt {i d}}+\frac {a \,x^{3}}{3}-\frac {b x \cos \left (d \,x^{2}+c \right )}{2 d}\) | \(81\) |
Input:
int(x^2*(a+b*sin(d*x^2+c)),x,method=_RETURNVERBOSE)
Output:
1/3*a*x^3+b*(-1/2/d*x*cos(d*x^2+c)+1/4/d^(3/2)*2^(1/2)*Pi^(1/2)*(cos(c)*Fr esnelC(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.08 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.84 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\frac {4 \, a d^{2} x^{3} + 3 \, \sqrt {2} \pi b \sqrt {\frac {d}{\pi }} \cos \left (c\right ) \operatorname {C}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) - 3 \, \sqrt {2} \pi b \sqrt {\frac {d}{\pi }} \operatorname {S}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) \sin \left (c\right ) - 6 \, b d x \cos \left (d x^{2} + c\right )}{12 \, d^{2}} \] Input:
integrate(x^2*(a+b*sin(d*x^2+c)),x, algorithm="fricas")
Output:
1/12*(4*a*d^2*x^3 + 3*sqrt(2)*pi*b*sqrt(d/pi)*cos(c)*fresnel_cos(sqrt(2)*x *sqrt(d/pi)) - 3*sqrt(2)*pi*b*sqrt(d/pi)*fresnel_sin(sqrt(2)*x*sqrt(d/pi)) *sin(c) - 6*b*d*x*cos(d*x^2 + c))/d^2
Leaf count of result is larger than twice the leaf count of optimal. 223 vs. \(2 (102) = 204\).
Time = 1.74 (sec) , antiderivative size = 223, normalized size of antiderivative = 2.19 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\frac {a x^{3}}{3} - \frac {b d^{\frac {3}{2}} x^{5} \sqrt {\frac {1}{d}} \cos {\left (c \right )} \Gamma \left (\frac {3}{4}\right ) \Gamma \left (\frac {5}{4}\right ) {{}_{2}F_{3}\left (\begin {matrix} \frac {3}{4}, \frac {5}{4} \\ \frac {3}{2}, \frac {7}{4}, \frac {9}{4} \end {matrix}\middle | {- \frac {d^{2} x^{4}}{4}} \right )}}{8 \Gamma \left (\frac {7}{4}\right ) \Gamma \left (\frac {9}{4}\right )} - \frac {b \sqrt {d} x^{3} \sqrt {\frac {1}{d}} \sin {\left (c \right )} \Gamma \left (\frac {1}{4}\right ) \Gamma \left (\frac {3}{4}\right ) {{}_{2}F_{3}\left (\begin {matrix} \frac {1}{4}, \frac {3}{4} \\ \frac {1}{2}, \frac {5}{4}, \frac {7}{4} \end {matrix}\middle | {- \frac {d^{2} x^{4}}{4}} \right )}}{8 \Gamma \left (\frac {5}{4}\right ) \Gamma \left (\frac {7}{4}\right )} + \frac {\sqrt {2} \sqrt {\pi } b x^{2} \sqrt {\frac {1}{d}} \sin {\left (c \right )} C\left (\frac {\sqrt {2} \sqrt {d} x}{\sqrt {\pi }}\right )}{2} + \frac {\sqrt {2} \sqrt {\pi } b x^{2} \sqrt {\frac {1}{d}} \cos {\left (c \right )} S\left (\frac {\sqrt {2} \sqrt {d} x}{\sqrt {\pi }}\right )}{2} \] Input:
integrate(x**2*(a+b*sin(d*x**2+c)),x)
Output:
a*x**3/3 - b*d**(3/2)*x**5*sqrt(1/d)*cos(c)*gamma(3/4)*gamma(5/4)*hyper((3 /4, 5/4), (3/2, 7/4, 9/4), -d**2*x**4/4)/(8*gamma(7/4)*gamma(9/4)) - b*sqr t(d)*x**3*sqrt(1/d)*sin(c)*gamma(1/4)*gamma(3/4)*hyper((1/4, 3/4), (1/2, 5 /4, 7/4), -d**2*x**4/4)/(8*gamma(5/4)*gamma(7/4)) + sqrt(2)*sqrt(pi)*b*x** 2*sqrt(1/d)*sin(c)*fresnelc(sqrt(2)*sqrt(d)*x/sqrt(pi))/2 + sqrt(2)*sqrt(p i)*b*x**2*sqrt(1/d)*cos(c)*fresnels(sqrt(2)*sqrt(d)*x/sqrt(pi))/2
Result contains complex when optimal does not.
Time = 0.04 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.74 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\frac {1}{3} \, a 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 )} b}{16 \, d^{3}} \] Input:
integrate(x^2*(a+b*sin(d*x^2+c)),x, algorithm="maxima")
Output:
1/3*a*x^3 - 1/16*(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))*b/d^3
Result contains complex when optimal does not.
Time = 0.14 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.42 \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\frac {1}{3} \, a x^{3} - \frac {b x e^{\left (i \, d x^{2} + i \, c\right )}}{4 \, d} - \frac {b x e^{\left (-i \, d x^{2} - i \, c\right )}}{4 \, d} - \frac {\sqrt {2} \sqrt {\pi } 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 )}}{8 \, d {\left (-\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} - \frac {\sqrt {2} \sqrt {\pi } 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 )}}{8 \, d {\left (\frac {i \, d}{{\left | d \right |}} + 1\right )} \sqrt {{\left | d \right |}}} \] Input:
integrate(x^2*(a+b*sin(d*x^2+c)),x, algorithm="giac")
Output:
1/3*a*x^3 - 1/4*b*x*e^(I*d*x^2 + I*c)/d - 1/4*b*x*e^(-I*d*x^2 - I*c)/d - 1 /8*sqrt(2)*sqrt(pi)*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/8*sqrt(2)*sqrt(pi)*b*erf(-1/ 2*sqrt(2)*x*(I*d/abs(d) + 1)*sqrt(abs(d)))*e^(-I*c)/(d*(I*d/abs(d) + 1)*sq rt(abs(d)))
Timed out. \[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\int x^2\,\left (a+b\,\sin \left (d\,x^2+c\right )\right ) \,d x \] Input:
int(x^2*(a + b*sin(c + d*x^2)),x)
Output:
int(x^2*(a + b*sin(c + d*x^2)), x)
\[ \int x^2 \left (a+b \sin \left (c+d x^2\right )\right ) \, dx=\left (\int \sin \left (d \,x^{2}+c \right ) x^{2}d x \right ) b +\frac {a \,x^{3}}{3} \] Input:
int(x^2*(a+b*sin(d*x^2+c)),x)
Output:
(3*int(sin(c + d*x**2)*x**2,x)*b + a*x**3)/3