Integrand size = 14, antiderivative size = 91 \[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\frac {x^3}{6}-\frac {\sqrt {\pi } \cos (2 a) \operatorname {FresnelS}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{16 b^{3/2}}-\frac {\sqrt {\pi } \operatorname {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a)}{16 b^{3/2}}+\frac {x \sin \left (2 a+2 b x^2\right )}{8 b} \] Output:
1/6*x^3-1/16*Pi^(1/2)*cos(2*a)*FresnelS(2*b^(1/2)*x/Pi^(1/2))/b^(3/2)-1/16 *Pi^(1/2)*FresnelC(2*b^(1/2)*x/Pi^(1/2))*sin(2*a)/b^(3/2)+1/8*x*sin(2*b*x^ 2+2*a)/b
Time = 0.18 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.96 \[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\frac {-3 \sqrt {\pi } \cos (2 a) \operatorname {FresnelS}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )-3 \sqrt {\pi } \operatorname {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a)+2 \sqrt {b} x \left (4 b x^2+3 \sin \left (2 \left (a+b x^2\right )\right )\right )}{48 b^{3/2}} \] Input:
Integrate[x^2*Cos[a + b*x^2]^2,x]
Output:
(-3*Sqrt[Pi]*Cos[2*a]*FresnelS[(2*Sqrt[b]*x)/Sqrt[Pi]] - 3*Sqrt[Pi]*Fresne lC[(2*Sqrt[b]*x)/Sqrt[Pi]]*Sin[2*a] + 2*Sqrt[b]*x*(4*b*x^2 + 3*Sin[2*(a + b*x^2)]))/(48*b^(3/2))
Time = 0.25 (sec) , antiderivative size = 91, 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.143, Rules used = {3885, 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 \cos ^2\left (a+b x^2\right ) \, dx\) |
\(\Big \downarrow \) 3885 |
\(\displaystyle \int \left (\frac {1}{2} x^2 \cos \left (2 a+2 b x^2\right )+\frac {x^2}{2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\sqrt {\pi } \sin (2 a) \operatorname {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{16 b^{3/2}}-\frac {\sqrt {\pi } \cos (2 a) \operatorname {FresnelS}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{16 b^{3/2}}+\frac {x \sin \left (2 a+2 b x^2\right )}{8 b}+\frac {x^3}{6}\) |
Input:
Int[x^2*Cos[a + b*x^2]^2,x]
Output:
x^3/6 - (Sqrt[Pi]*Cos[2*a]*FresnelS[(2*Sqrt[b]*x)/Sqrt[Pi]])/(16*b^(3/2)) - (Sqrt[Pi]*FresnelC[(2*Sqrt[b]*x)/Sqrt[Pi]]*Sin[2*a])/(16*b^(3/2)) + (x*S in[2*a + 2*b*x^2])/(8*b)
Int[((a_.) + Cos[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_)*((e_.)*(x_))^(m_.), x _Symbol] :> Int[ExpandTrigReduce[(e*x)^m, (a + b*Cos[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]
Time = 1.12 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.69
method | result | size |
default | \(\frac {x^{3}}{6}+\frac {x \sin \left (2 b \,x^{2}+2 a \right )}{8 b}-\frac {\sqrt {\pi }\, \left (\cos \left (2 a \right ) \operatorname {FresnelS}\left (\frac {2 \sqrt {b}\, x}{\sqrt {\pi }}\right )+\sin \left (2 a \right ) \operatorname {FresnelC}\left (\frac {2 \sqrt {b}\, x}{\sqrt {\pi }}\right )\right )}{16 b^{\frac {3}{2}}}\) | \(63\) |
risch | \(\frac {x^{3}}{6}-\frac {i {\mathrm e}^{-2 i a} \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\sqrt {2}\, \sqrt {i b}\, x \right )}{64 b \sqrt {i b}}+\frac {i {\mathrm e}^{2 i a} \sqrt {\pi }\, \operatorname {erf}\left (\sqrt {-2 i b}\, x \right )}{32 b \sqrt {-2 i b}}+\frac {x \sin \left (2 b \,x^{2}+2 a \right )}{8 b}\) | \(88\) |
Input:
int(x^2*cos(b*x^2+a)^2,x,method=_RETURNVERBOSE)
Output:
1/6*x^3+1/8*x*sin(2*b*x^2+2*a)/b-1/16/b^(3/2)*Pi^(1/2)*(cos(2*a)*FresnelS( 2*b^(1/2)*x/Pi^(1/2))+sin(2*a)*FresnelC(2*b^(1/2)*x/Pi^(1/2)))
Time = 0.08 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.92 \[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\frac {8 \, b^{2} x^{3} + 12 \, b x \cos \left (b x^{2} + a\right ) \sin \left (b x^{2} + a\right ) - 3 \, \pi \sqrt {\frac {b}{\pi }} \cos \left (2 \, a\right ) \operatorname {S}\left (2 \, x \sqrt {\frac {b}{\pi }}\right ) - 3 \, \pi \sqrt {\frac {b}{\pi }} \operatorname {C}\left (2 \, x \sqrt {\frac {b}{\pi }}\right ) \sin \left (2 \, a\right )}{48 \, b^{2}} \] Input:
integrate(x^2*cos(b*x^2+a)^2,x, algorithm="fricas")
Output:
1/48*(8*b^2*x^3 + 12*b*x*cos(b*x^2 + a)*sin(b*x^2 + a) - 3*pi*sqrt(b/pi)*c os(2*a)*fresnel_sin(2*x*sqrt(b/pi)) - 3*pi*sqrt(b/pi)*fresnel_cos(2*x*sqrt (b/pi))*sin(2*a))/b^2
Leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (85) = 170\).
Time = 1.15 (sec) , antiderivative size = 201, normalized size of antiderivative = 2.21 \[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\frac {b^{\frac {3}{2}} x^{5} \sqrt {\frac {1}{b}} \sin {\left (2 a \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 | {- b^{2} x^{4}} \right )}}{8 \Gamma \left (\frac {7}{4}\right ) \Gamma \left (\frac {9}{4}\right )} - \frac {\sqrt {b} x^{3} \sqrt {\frac {1}{b}} \cos {\left (2 a \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 | {- b^{2} x^{4}} \right )}}{16 \Gamma \left (\frac {5}{4}\right ) \Gamma \left (\frac {7}{4}\right )} + \frac {x^{3}}{6} - \frac {\sqrt {\pi } x^{2} \sqrt {\frac {1}{b}} \sin {\left (2 a \right )} S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{4} + \frac {\sqrt {\pi } x^{2} \sqrt {\frac {1}{b}} \cos {\left (2 a \right )} C\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )}{4} \] Input:
integrate(x**2*cos(b*x**2+a)**2,x)
Output:
b**(3/2)*x**5*sqrt(1/b)*sin(2*a)*gamma(3/4)*gamma(5/4)*hyper((3/4, 5/4), ( 3/2, 7/4, 9/4), -b**2*x**4)/(8*gamma(7/4)*gamma(9/4)) - sqrt(b)*x**3*sqrt( 1/b)*cos(2*a)*gamma(1/4)*gamma(3/4)*hyper((1/4, 3/4), (1/2, 5/4, 7/4), -b* *2*x**4)/(16*gamma(5/4)*gamma(7/4)) + x**3/6 - sqrt(pi)*x**2*sqrt(1/b)*sin (2*a)*fresnels(2*sqrt(b)*x/sqrt(pi))/4 + sqrt(pi)*x**2*sqrt(1/b)*cos(2*a)* fresnelc(2*sqrt(b)*x/sqrt(pi))/4
Result contains complex when optimal does not.
Time = 0.12 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.99 \[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\frac {64 \, b^{3} x^{3} + 48 \, b^{2} x \sin \left (2 \, b x^{2} + 2 \, a\right ) - 3 \cdot 4^{\frac {1}{4}} \sqrt {2} \sqrt {\pi } {\left ({\left (\left (i + 1\right ) \, \cos \left (2 \, a\right ) - \left (i - 1\right ) \, \sin \left (2 \, a\right )\right )} \operatorname {erf}\left (\sqrt {2 i \, b} x\right ) + {\left (-\left (i - 1\right ) \, \cos \left (2 \, a\right ) + \left (i + 1\right ) \, \sin \left (2 \, a\right )\right )} \operatorname {erf}\left (\sqrt {-2 i \, b} x\right )\right )} b^{\frac {3}{2}}}{384 \, b^{3}} \] Input:
integrate(x^2*cos(b*x^2+a)^2,x, algorithm="maxima")
Output:
1/384*(64*b^3*x^3 + 48*b^2*x*sin(2*b*x^2 + 2*a) - 3*4^(1/4)*sqrt(2)*sqrt(p i)*(((I + 1)*cos(2*a) - (I - 1)*sin(2*a))*erf(sqrt(2*I*b)*x) + (-(I - 1)*c os(2*a) + (I + 1)*sin(2*a))*erf(sqrt(-2*I*b)*x))*b^(3/2))/b^3
Result contains complex when optimal does not.
Time = 0.40 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.30 \[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\frac {1}{6} \, x^{3} - \frac {i \, x e^{\left (2 i \, b x^{2} + 2 i \, a\right )}}{16 \, b} + \frac {i \, x e^{\left (-2 i \, b x^{2} - 2 i \, a\right )}}{16 \, b} - \frac {i \, \sqrt {\pi } \operatorname {erf}\left (-\sqrt {b} x {\left (-\frac {i \, b}{{\left | b \right |}} + 1\right )}\right ) e^{\left (2 i \, a\right )}}{32 \, b^{\frac {3}{2}} {\left (-\frac {i \, b}{{\left | b \right |}} + 1\right )}} + \frac {i \, \sqrt {\pi } \operatorname {erf}\left (-\sqrt {b} x {\left (\frac {i \, b}{{\left | b \right |}} + 1\right )}\right ) e^{\left (-2 i \, a\right )}}{32 \, b^{\frac {3}{2}} {\left (\frac {i \, b}{{\left | b \right |}} + 1\right )}} \] Input:
integrate(x^2*cos(b*x^2+a)^2,x, algorithm="giac")
Output:
1/6*x^3 - 1/16*I*x*e^(2*I*b*x^2 + 2*I*a)/b + 1/16*I*x*e^(-2*I*b*x^2 - 2*I* a)/b - 1/32*I*sqrt(pi)*erf(-sqrt(b)*x*(-I*b/abs(b) + 1))*e^(2*I*a)/(b^(3/2 )*(-I*b/abs(b) + 1)) + 1/32*I*sqrt(pi)*erf(-sqrt(b)*x*(I*b/abs(b) + 1))*e^ (-2*I*a)/(b^(3/2)*(I*b/abs(b) + 1))
Timed out. \[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\int x^2\,{\cos \left (b\,x^2+a\right )}^2 \,d x \] Input:
int(x^2*cos(a + b*x^2)^2,x)
Output:
int(x^2*cos(a + b*x^2)^2, x)
\[ \int x^2 \cos ^2\left (a+b x^2\right ) \, dx=\frac {\cos \left (b \,x^{2}+a \right ) \sin \left (b \,x^{2}+a \right ) x -4 \left (\int \frac {x^{2}}{\tan \left (\frac {b \,x^{2}}{2}+\frac {a}{2}\right )^{4}+2 \tan \left (\frac {b \,x^{2}}{2}+\frac {a}{2}\right )^{2}+1}d x \right ) b -4 \left (\int \frac {\tan \left (\frac {b \,x^{2}}{2}+\frac {a}{2}\right )}{\tan \left (\frac {b \,x^{2}}{2}+\frac {a}{2}\right )^{4}+2 \tan \left (\frac {b \,x^{2}}{2}+\frac {a}{2}\right )^{2}+1}d x \right )+\sin \left (b \,x^{2}+a \right ) x +b \,x^{3}}{3 b} \] Input:
int(x^2*cos(b*x^2+a)^2,x)
Output:
(cos(a + b*x**2)*sin(a + b*x**2)*x - 4*int(x**2/(tan((a + b*x**2)/2)**4 + 2*tan((a + b*x**2)/2)**2 + 1),x)*b - 4*int(tan((a + b*x**2)/2)/(tan((a + b *x**2)/2)**4 + 2*tan((a + b*x**2)/2)**2 + 1),x) + sin(a + b*x**2)*x + b*x* *3)/(3*b)