Integrand size = 18, antiderivative size = 248 \[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\frac {x^3}{6}-\frac {b^2 \sqrt {\pi } \cos \left (2 a+\frac {b^2}{2 c}\right ) \operatorname {FresnelC}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{5/2}}+\frac {\sqrt {\pi } \cos \left (2 a+\frac {b^2}{2 c}\right ) \operatorname {FresnelS}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}-\frac {\sqrt {\pi } \operatorname {FresnelC}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a+\frac {b^2}{2 c}\right )}{16 c^{3/2}}-\frac {b^2 \sqrt {\pi } \operatorname {FresnelS}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a+\frac {b^2}{2 c}\right )}{16 c^{5/2}}-\frac {b \sin \left (2 a+2 b x-2 c x^2\right )}{16 c^2}-\frac {x \sin \left (2 a+2 b x-2 c x^2\right )}{8 c} \] Output:
1/6*x^3-1/16*b^2*Pi^(1/2)*cos(2*a+1/2*b^2/c)*FresnelC((-2*c*x+b)/c^(1/2)/P i^(1/2))/c^(5/2)+1/16*Pi^(1/2)*cos(2*a+1/2*b^2/c)*FresnelS((-2*c*x+b)/c^(1 /2)/Pi^(1/2))/c^(3/2)-1/16*Pi^(1/2)*FresnelC((-2*c*x+b)/c^(1/2)/Pi^(1/2))* sin(2*a+1/2*b^2/c)/c^(3/2)-1/16*b^2*Pi^(1/2)*FresnelS((-2*c*x+b)/c^(1/2)/P i^(1/2))*sin(2*a+1/2*b^2/c)/c^(5/2)-1/16*b*sin(-2*c*x^2+2*b*x+2*a)/c^2-1/8 *x*sin(-2*c*x^2+2*b*x+2*a)/c
Time = 0.66 (sec) , antiderivative size = 175, normalized size of antiderivative = 0.71 \[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\frac {-3 \sqrt {\pi } \operatorname {FresnelS}\left (\frac {-b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \left (c \cos \left (2 a+\frac {b^2}{2 c}\right )-b^2 \sin \left (2 a+\frac {b^2}{2 c}\right )\right )+3 \sqrt {\pi } \operatorname {FresnelC}\left (\frac {-b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \left (b^2 \cos \left (2 a+\frac {b^2}{2 c}\right )+c \sin \left (2 a+\frac {b^2}{2 c}\right )\right )+\sqrt {c} \left (8 c^2 x^3-3 (b+2 c x) \sin (2 (a+x (b-c x)))\right )}{48 c^{5/2}} \] Input:
Integrate[x^2*Cos[a + b*x - c*x^2]^2,x]
Output:
(-3*Sqrt[Pi]*FresnelS[(-b + 2*c*x)/(Sqrt[c]*Sqrt[Pi])]*(c*Cos[2*a + b^2/(2 *c)] - b^2*Sin[2*a + b^2/(2*c)]) + 3*Sqrt[Pi]*FresnelC[(-b + 2*c*x)/(Sqrt[ c]*Sqrt[Pi])]*(b^2*Cos[2*a + b^2/(2*c)] + c*Sin[2*a + b^2/(2*c)]) + Sqrt[c ]*(8*c^2*x^3 - 3*(b + 2*c*x)*Sin[2*(a + x*(b - c*x))]))/(48*c^(5/2))
Time = 0.43 (sec) , antiderivative size = 248, 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.111, Rules used = {3949, 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-c x^2\right ) \, dx\) |
\(\Big \downarrow \) 3949 |
\(\displaystyle \int \left (\frac {1}{2} x^2 \cos \left (2 a+2 b x-2 c x^2\right )+\frac {x^2}{2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\sqrt {\pi } \sin \left (2 a+\frac {b^2}{2 c}\right ) \operatorname {FresnelC}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}-\frac {\sqrt {\pi } b^2 \cos \left (2 a+\frac {b^2}{2 c}\right ) \operatorname {FresnelC}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{5/2}}-\frac {\sqrt {\pi } b^2 \sin \left (2 a+\frac {b^2}{2 c}\right ) \operatorname {FresnelS}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{5/2}}+\frac {\sqrt {\pi } \cos \left (2 a+\frac {b^2}{2 c}\right ) \operatorname {FresnelS}\left (\frac {b-2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}-\frac {b \sin \left (2 a+2 b x-2 c x^2\right )}{16 c^2}-\frac {x \sin \left (2 a+2 b x-2 c x^2\right )}{8 c}+\frac {x^3}{6}\) |
Input:
Int[x^2*Cos[a + b*x - c*x^2]^2,x]
Output:
x^3/6 - (b^2*Sqrt[Pi]*Cos[2*a + b^2/(2*c)]*FresnelC[(b - 2*c*x)/(Sqrt[c]*S qrt[Pi])])/(16*c^(5/2)) + (Sqrt[Pi]*Cos[2*a + b^2/(2*c)]*FresnelS[(b - 2*c *x)/(Sqrt[c]*Sqrt[Pi])])/(16*c^(3/2)) - (Sqrt[Pi]*FresnelC[(b - 2*c*x)/(Sq rt[c]*Sqrt[Pi])]*Sin[2*a + b^2/(2*c)])/(16*c^(3/2)) - (b^2*Sqrt[Pi]*Fresne lS[(b - 2*c*x)/(Sqrt[c]*Sqrt[Pi])]*Sin[2*a + b^2/(2*c)])/(16*c^(5/2)) - (b *Sin[2*a + 2*b*x - 2*c*x^2])/(16*c^2) - (x*Sin[2*a + 2*b*x - 2*c*x^2])/(8* c)
Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]^(n_)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandTrigReduce[(d + e*x)^m, Cos[a + b*x + c*x^2]^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 1]
Time = 1.69 (sec) , antiderivative size = 199, normalized size of antiderivative = 0.80
method | result | size |
default | \(\frac {x^{3}}{6}-\frac {x \sin \left (-2 c \,x^{2}+2 b x +2 a \right )}{8 c}+\frac {b \left (-\frac {\sin \left (-2 c \,x^{2}+2 b x +2 a \right )}{4 c}+\frac {b \sqrt {\pi }\, \left (\cos \left (\frac {4 a c +b^{2}}{2 c}\right ) \operatorname {FresnelC}\left (\frac {2 c x -b}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {4 a c +b^{2}}{2 c}\right ) \operatorname {FresnelS}\left (\frac {2 c x -b}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}}\right )}{4 c}-\frac {\sqrt {\pi }\, \left (\cos \left (\frac {4 a c +b^{2}}{2 c}\right ) \operatorname {FresnelS}\left (\frac {2 c x -b}{\sqrt {\pi }\, \sqrt {c}}\right )-\sin \left (\frac {4 a c +b^{2}}{2 c}\right ) \operatorname {FresnelC}\left (\frac {2 c x -b}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{16 c^{\frac {3}{2}}}\) | \(199\) |
risch | \(\frac {x^{3}}{6}+\frac {b^{2} \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c +b^{2}\right )}{2 c}} \operatorname {erf}\left (\sqrt {-2 i c}\, x +\frac {i b}{\sqrt {-2 i c}}\right )}{32 c^{2} \sqrt {-2 i c}}+\frac {i \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c +b^{2}\right )}{2 c}} \operatorname {erf}\left (\sqrt {-2 i c}\, x +\frac {i b}{\sqrt {-2 i c}}\right )}{32 c \sqrt {-2 i c}}-\frac {b^{2} \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c +b^{2}\right )}{2 c}} \sqrt {2}\, \operatorname {erf}\left (-\sqrt {2}\, \sqrt {i c}\, x +\frac {i b \sqrt {2}}{2 \sqrt {i c}}\right )}{64 c^{2} \sqrt {i c}}+\frac {i \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c +b^{2}\right )}{2 c}} \sqrt {2}\, \operatorname {erf}\left (-\sqrt {2}\, \sqrt {i c}\, x +\frac {i b \sqrt {2}}{2 \sqrt {i c}}\right )}{64 c \sqrt {i c}}+2 i \left (\frac {i x}{16 c}+\frac {i b}{32 c^{2}}\right ) \sin \left (-2 c \,x^{2}+2 b x +2 a \right )\) | \(264\) |
Input:
int(x^2*cos(-c*x^2+b*x+a)^2,x,method=_RETURNVERBOSE)
Output:
1/6*x^3-1/8*x*sin(-2*c*x^2+2*b*x+2*a)/c+1/4*b/c*(-1/4*sin(-2*c*x^2+2*b*x+2 *a)/c+1/4*b/c^(3/2)*Pi^(1/2)*(cos(1/2*(4*a*c+b^2)/c)*FresnelC(1/Pi^(1/2)/c ^(1/2)*(2*c*x-b))+sin(1/2*(4*a*c+b^2)/c)*FresnelS(1/Pi^(1/2)/c^(1/2)*(2*c* x-b))))-1/16/c^(3/2)*Pi^(1/2)*(cos(1/2*(4*a*c+b^2)/c)*FresnelS(1/Pi^(1/2)/ c^(1/2)*(2*c*x-b))-sin(1/2*(4*a*c+b^2)/c)*FresnelC(1/Pi^(1/2)/c^(1/2)*(2*c *x-b)))
Time = 0.09 (sec) , antiderivative size = 187, normalized size of antiderivative = 0.75 \[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\frac {8 \, c^{3} x^{3} + 6 \, {\left (2 \, c^{2} x + b c\right )} \cos \left (c x^{2} - b x - a\right ) \sin \left (c x^{2} - b x - a\right ) + 3 \, {\left (\pi b^{2} \cos \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right ) + \pi c \sin \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {C}\left (\frac {{\left (2 \, c x - b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) + 3 \, {\left (\pi b^{2} \sin \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right ) - \pi c \cos \left (\frac {b^{2} + 4 \, a c}{2 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {{\left (2 \, c x - b\right )} \sqrt {\frac {c}{\pi }}}{c}\right )}{48 \, c^{3}} \] Input:
integrate(x^2*cos(-c*x^2+b*x+a)^2,x, algorithm="fricas")
Output:
1/48*(8*c^3*x^3 + 6*(2*c^2*x + b*c)*cos(c*x^2 - b*x - a)*sin(c*x^2 - b*x - a) + 3*(pi*b^2*cos(1/2*(b^2 + 4*a*c)/c) + pi*c*sin(1/2*(b^2 + 4*a*c)/c))* sqrt(c/pi)*fresnel_cos((2*c*x - b)*sqrt(c/pi)/c) + 3*(pi*b^2*sin(1/2*(b^2 + 4*a*c)/c) - pi*c*cos(1/2*(b^2 + 4*a*c)/c))*sqrt(c/pi)*fresnel_sin((2*c*x - b)*sqrt(c/pi)/c))/c^3
\[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\int x^{2} \cos ^{2}{\left (a + b x - c x^{2} \right )}\, dx \] Input:
integrate(x**2*cos(-c*x**2+b*x+a)**2,x)
Output:
Integral(x**2*cos(a + b*x - c*x**2)**2, x)
Result contains complex when optimal does not.
Time = 0.83 (sec) , antiderivative size = 1617, normalized size of antiderivative = 6.52 \[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\text {Too large to display} \] Input:
integrate(x^2*cos(-c*x^2+b*x+a)^2,x, algorithm="maxima")
Output:
-1/384*sqrt(2)*(24*((((I - 1)*sqrt(2)*sqrt(pi)*(erf(sqrt(1/2)*sqrt((4*I*c^ 2*x^2 - 4*I*b*c*x + I*b^2)/c)) - 1) - (I + 1)*sqrt(2)*sqrt(pi)*(erf(sqrt(1 /2)*sqrt(-(4*I*c^2*x^2 - 4*I*b*c*x + I*b^2)/c)) - 1))*b^2*c^3 + 2*(-(I + 1 )*sqrt(2)*gamma(3/2, 1/2*(4*I*c^2*x^2 - 4*I*b*c*x + I*b^2)/c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)/c) - (I + 1)*sqrt(2)*gamma(3/2, -1/2*(4*I*c^2*x^2 - 4*I*b*c*x + I*b^2)/c))*b*c^3)...
Result contains complex when optimal does not.
Time = 0.38 (sec) , antiderivative size = 214, normalized size of antiderivative = 0.86 \[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\frac {1}{6} \, x^{3} - \frac {{\left (c {\left (2 i \, x - \frac {i \, b}{c}\right )} + 2 i \, b\right )} e^{\left (2 i \, c x^{2} - 2 i \, b x - 2 i \, a\right )} + \frac {\sqrt {\pi } {\left (b^{2} + i \, c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} + 4 i \, a c}{2 \, c}\right )}}{\sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}}}{32 \, c^{2}} - \frac {{\left (c {\left (-2 i \, x + \frac {i \, b}{c}\right )} - 2 i \, b\right )} e^{\left (-2 i \, c x^{2} + 2 i \, b x + 2 i \, a\right )} + \frac {\sqrt {\pi } {\left (b^{2} - i \, c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} - 4 i \, a c}{2 \, c}\right )}}{\sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}}}{32 \, c^{2}} \] Input:
integrate(x^2*cos(-c*x^2+b*x+a)^2,x, algorithm="giac")
Output:
1/6*x^3 - 1/32*((c*(2*I*x - I*b/c) + 2*I*b)*e^(2*I*c*x^2 - 2*I*b*x - 2*I*a ) + sqrt(pi)*(b^2 + I*c)*erf(-1/2*sqrt(c)*(2*x - b/c)*(-I*c/abs(c) + 1))*e ^(-1/2*(I*b^2 + 4*I*a*c)/c)/(sqrt(c)*(-I*c/abs(c) + 1)))/c^2 - 1/32*((c*(- 2*I*x + I*b/c) - 2*I*b)*e^(-2*I*c*x^2 + 2*I*b*x + 2*I*a) + sqrt(pi)*(b^2 - I*c)*erf(-1/2*sqrt(c)*(2*x - b/c)*(I*c/abs(c) + 1))*e^(-1/2*(-I*b^2 - 4*I *a*c)/c)/(sqrt(c)*(I*c/abs(c) + 1)))/c^2
Timed out. \[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\int x^2\,{\cos \left (-c\,x^2+b\,x+a\right )}^2 \,d x \] Input:
int(x^2*cos(a + b*x - c*x^2)^2,x)
Output:
int(x^2*cos(a + b*x - c*x^2)^2, x)
\[ \int x^2 \cos ^2\left (a+b x-c x^2\right ) \, dx=\frac {-\cos \left (-c \,x^{2}+b x +a \right ) \sin \left (-c \,x^{2}+b x +a \right ) b -2 \cos \left (-c \,x^{2}+b x +a \right ) \sin \left (-c \,x^{2}+b x +a \right ) c x -6 \left (\int \frac {\tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{2}}{\tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{4}+2 \tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{2}+1}d x \right ) b^{2}-8 \left (\int \frac {x^{2}}{\tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{4}+2 \tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{2}+1}d x \right ) c^{2}+8 \left (\int \frac {\tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )}{\tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{4}+2 \tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{2}+1}d x \right ) c +2 \left (\int \frac {1}{\tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{4}+2 \tan \left (-\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{2}+1}d x \right ) b^{2}-\sin \left (-c \,x^{2}+b x +a \right ) b -2 \sin \left (-c \,x^{2}+b x +a \right ) c x +2 c^{2} x^{3}}{6 c^{2}} \] Input:
int(x^2*cos(-c*x^2+b*x+a)^2,x)
Output:
( - cos(a + b*x - c*x**2)*sin(a + b*x - c*x**2)*b - 2*cos(a + b*x - c*x**2 )*sin(a + b*x - c*x**2)*c*x - 6*int(tan((a + b*x - c*x**2)/2)**2/(tan((a + b*x - c*x**2)/2)**4 + 2*tan((a + b*x - c*x**2)/2)**2 + 1),x)*b**2 - 8*int (x**2/(tan((a + b*x - c*x**2)/2)**4 + 2*tan((a + b*x - c*x**2)/2)**2 + 1), x)*c**2 + 8*int(tan((a + b*x - c*x**2)/2)/(tan((a + b*x - c*x**2)/2)**4 + 2*tan((a + b*x - c*x**2)/2)**2 + 1),x)*c + 2*int(1/(tan((a + b*x - c*x**2) /2)**4 + 2*tan((a + b*x - c*x**2)/2)**2 + 1),x)*b**2 - sin(a + b*x - c*x** 2)*b - 2*sin(a + b*x - c*x**2)*c*x + 2*c**2*x**3)/(6*c**2)