Integrand size = 19, antiderivative size = 285 \[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=\frac {(2 c d-b e)^2 \sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{4 c^{5/2}}-\frac {e^2 \sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{2 c^{3/2}}-\frac {e^2 \sqrt {\frac {\pi }{2}} \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{2 c^{3/2}}-\frac {(2 c d-b e)^2 \sqrt {\frac {\pi }{2}} \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{4 c^{5/2}}+\frac {e (2 c d-b e) \sin \left (a+b x+c x^2\right )}{4 c^2}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c} \] Output:
1/8*(-b*e+2*c*d)^2*2^(1/2)*Pi^(1/2)*cos(a-1/4*b^2/c)*FresnelC(1/2*(2*c*x+b )/c^(1/2)*2^(1/2)/Pi^(1/2))/c^(5/2)-1/4*e^2*2^(1/2)*Pi^(1/2)*cos(a-1/4*b^2 /c)*FresnelS(1/2*(2*c*x+b)/c^(1/2)*2^(1/2)/Pi^(1/2))/c^(3/2)-1/4*e^2*2^(1/ 2)*Pi^(1/2)*FresnelC(1/2*(2*c*x+b)/c^(1/2)*2^(1/2)/Pi^(1/2))*sin(a-1/4*b^2 /c)/c^(3/2)-1/8*(-b*e+2*c*d)^2*2^(1/2)*Pi^(1/2)*FresnelS(1/2*(2*c*x+b)/c^( 1/2)*2^(1/2)/Pi^(1/2))*sin(a-1/4*b^2/c)/c^(5/2)+1/4*e*(-b*e+2*c*d)*sin(c*x ^2+b*x+a)/c^2+1/2*e*(e*x+d)*sin(c*x^2+b*x+a)/c
Time = 1.38 (sec) , antiderivative size = 187, normalized size of antiderivative = 0.66 \[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=\frac {\sqrt {2 \pi } \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \left ((-2 c d+b e)^2 \cos \left (a-\frac {b^2}{4 c}\right )-2 c e^2 \sin \left (a-\frac {b^2}{4 c}\right )\right )-\sqrt {2 \pi } \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \left (2 c e^2 \cos \left (a-\frac {b^2}{4 c}\right )+(-2 c d+b e)^2 \sin \left (a-\frac {b^2}{4 c}\right )\right )+2 \sqrt {c} e (4 c d-b e+2 c e x) \sin (a+x (b+c x))}{8 c^{5/2}} \] Input:
Integrate[(d + e*x)^2*Cos[a + b*x + c*x^2],x]
Output:
(Sqrt[2*Pi]*FresnelC[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])]*((-2*c*d + b*e)^2*C os[a - b^2/(4*c)] - 2*c*e^2*Sin[a - b^2/(4*c)]) - Sqrt[2*Pi]*FresnelS[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])]*(2*c*e^2*Cos[a - b^2/(4*c)] + (-2*c*d + b*e) ^2*Sin[a - b^2/(4*c)]) + 2*Sqrt[c]*e*(4*c*d - b*e + 2*c*e*x)*Sin[a + x*(b + c*x)])/(8*c^(5/2))
Time = 0.79 (sec) , antiderivative size = 282, normalized size of antiderivative = 0.99, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.421, Rules used = {3945, 3928, 3832, 3833, 3943, 3929, 3832, 3833}
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 (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx\) |
\(\Big \downarrow \) 3945 |
\(\displaystyle \frac {(2 c d-b e) \int (d+e x) \cos \left (c x^2+b x+a\right )dx}{2 c}-\frac {e^2 \int \sin \left (c x^2+b x+a\right )dx}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
\(\Big \downarrow \) 3928 |
\(\displaystyle -\frac {e^2 \left (\sin \left (a-\frac {b^2}{4 c}\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right )dx+\cos \left (a-\frac {b^2}{4 c}\right ) \int \sin \left (\frac {(b+2 c x)^2}{4 c}\right )dx\right )}{2 c}+\frac {(2 c d-b e) \int (d+e x) \cos \left (c x^2+b x+a\right )dx}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
\(\Big \downarrow \) 3832 |
\(\displaystyle -\frac {e^2 \left (\sin \left (a-\frac {b^2}{4 c}\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right )dx+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {(2 c d-b e) \int (d+e x) \cos \left (c x^2+b x+a\right )dx}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
\(\Big \downarrow \) 3833 |
\(\displaystyle \frac {(2 c d-b e) \int (d+e x) \cos \left (c x^2+b x+a\right )dx}{2 c}-\frac {e^2 \left (\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
\(\Big \downarrow \) 3943 |
\(\displaystyle \frac {(2 c d-b e) \left (\frac {(2 c d-b e) \int \cos \left (c x^2+b x+a\right )dx}{2 c}+\frac {e \sin \left (a+b x+c x^2\right )}{2 c}\right )}{2 c}-\frac {e^2 \left (\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
\(\Big \downarrow \) 3929 |
\(\displaystyle \frac {(2 c d-b e) \left (\frac {(2 c d-b e) \left (\cos \left (a-\frac {b^2}{4 c}\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right )dx-\sin \left (a-\frac {b^2}{4 c}\right ) \int \sin \left (\frac {(b+2 c x)^2}{4 c}\right )dx\right )}{2 c}+\frac {e \sin \left (a+b x+c x^2\right )}{2 c}\right )}{2 c}-\frac {e^2 \left (\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
\(\Big \downarrow \) 3832 |
\(\displaystyle \frac {(2 c d-b e) \left (\frac {(2 c d-b e) \left (\cos \left (a-\frac {b^2}{4 c}\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right )dx-\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {e \sin \left (a+b x+c x^2\right )}{2 c}\right )}{2 c}-\frac {e^2 \left (\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
\(\Big \downarrow \) 3833 |
\(\displaystyle \frac {(2 c d-b e) \left (\frac {(2 c d-b e) \left (\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}-\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {e \sin \left (a+b x+c x^2\right )}{2 c}\right )}{2 c}-\frac {e^2 \left (\frac {\sqrt {\frac {\pi }{2}} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}+\frac {\sqrt {\frac {\pi }{2}} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )}{\sqrt {c}}\right )}{2 c}+\frac {e (d+e x) \sin \left (a+b x+c x^2\right )}{2 c}\) |
Input:
Int[(d + e*x)^2*Cos[a + b*x + c*x^2],x]
Output:
-1/2*(e^2*((Sqrt[Pi/2]*Cos[a - b^2/(4*c)]*FresnelS[(b + 2*c*x)/(Sqrt[c]*Sq rt[2*Pi])])/Sqrt[c] + (Sqrt[Pi/2]*FresnelC[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi] )]*Sin[a - b^2/(4*c)])/Sqrt[c]))/c + (e*(d + e*x)*Sin[a + b*x + c*x^2])/(2 *c) + ((2*c*d - b*e)*(((2*c*d - b*e)*((Sqrt[Pi/2]*Cos[a - b^2/(4*c)]*Fresn elC[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])])/Sqrt[c] - (Sqrt[Pi/2]*FresnelS[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])]*Sin[a - b^2/(4*c)])/Sqrt[c]))/(2*c) + (e*Sin [a + b*x + c*x^2])/(2*c)))/(2*c)
Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[ d, 2]))*FresnelS[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]
Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[ d, 2]))*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]
Int[Sin[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[Cos[(b^2 - 4* a*c)/(4*c)] Int[Sin[(b + 2*c*x)^2/(4*c)], x], x] - Simp[Sin[(b^2 - 4*a*c) /(4*c)] Int[Cos[(b + 2*c*x)^2/(4*c)], x], x] /; FreeQ[{a, b, c}, x] && Ne Q[b^2 - 4*a*c, 0]
Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Simp[Cos[(b^2 - 4* a*c)/(4*c)] Int[Cos[(b + 2*c*x)^2/(4*c)], x], x] + Simp[Sin[(b^2 - 4*a*c) /(4*c)] Int[Sin[(b + 2*c*x)^2/(4*c)], x], x] /; FreeQ[{a, b, c}, x] && Ne Q[b^2 - 4*a*c, 0]
Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[e*(Sin[a + b*x + c*x^2]/(2*c)), x] + Simp[(2*c*d - b*e)/(2*c) Int [Cos[a + b*x + c*x^2], x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b *e, 0]
Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_))^(m_), x_Sym bol] :> Simp[e*(d + e*x)^(m - 1)*(Sin[a + b*x + c*x^2]/(2*c)), x] + (-Simp[ (b*e - 2*c*d)/(2*c) Int[(d + e*x)^(m - 1)*Cos[a + b*x + c*x^2], x], x] - Simp[e^2*((m - 1)/(2*c)) Int[(d + e*x)^(m - 2)*Sin[a + b*x + c*x^2], x], x]) /; FreeQ[{a, b, c, d, e}, x] && NeQ[b*e - 2*c*d, 0] && GtQ[m, 1]
Time = 1.98 (sec) , antiderivative size = 396, normalized size of antiderivative = 1.39
method | result | size |
default | \(\frac {e^{2} x \sin \left (c \,x^{2}+b x +a \right )}{2 c}-\frac {e^{2} b \left (\frac {\sin \left (c \,x^{2}+b x +a \right )}{2 c}-\frac {b \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelC}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelS}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}}\right )}{2 c}-\frac {e^{2} \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelS}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )-\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelC}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{4 c^{\frac {3}{2}}}+\frac {d e \sin \left (c \,x^{2}+b x +a \right )}{c}-\frac {d e b \sqrt {2}\, \sqrt {\pi }\, \left (\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelC}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelS}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{2 c^{\frac {3}{2}}}+\frac {\sqrt {2}\, \sqrt {\pi }\, d^{2} \left (\cos \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelC}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )+\sin \left (\frac {\frac {b^{2}}{4}-a c}{c}\right ) \operatorname {FresnelS}\left (\frac {\sqrt {2}\, \left (c x +\frac {b}{2}\right )}{\sqrt {\pi }\, \sqrt {c}}\right )\right )}{2 \sqrt {c}}\) | \(396\) |
risch | \(\frac {\operatorname {erf}\left (\sqrt {i c}\, x +\frac {i b}{2 \sqrt {i c}}\right ) \sqrt {\pi }\, d^{2} {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{4 \sqrt {i c}}+\frac {e^{2} \operatorname {erf}\left (\sqrt {i c}\, x +\frac {i b}{2 \sqrt {i c}}\right ) \sqrt {\pi }\, b^{2} {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{16 \sqrt {i c}\, c^{2}}-\frac {i e^{2} \operatorname {erf}\left (\sqrt {i c}\, x +\frac {i b}{2 \sqrt {i c}}\right ) \sqrt {\pi }\, {\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{8 \sqrt {i c}\, c}-\frac {d e \,\operatorname {erf}\left (\sqrt {i c}\, x +\frac {i b}{2 \sqrt {i c}}\right ) \sqrt {\pi }\, b \,{\mathrm e}^{-\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{4 \sqrt {i c}\, c}-\frac {\operatorname {erf}\left (-\sqrt {-i c}\, x +\frac {i b}{2 \sqrt {-i c}}\right ) \sqrt {\pi }\, d^{2} {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{4 \sqrt {-i c}}-\frac {e^{2} \operatorname {erf}\left (-\sqrt {-i c}\, x +\frac {i b}{2 \sqrt {-i c}}\right ) \sqrt {\pi }\, b^{2} {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{16 \sqrt {-i c}\, c^{2}}-\frac {i e^{2} \operatorname {erf}\left (-\sqrt {-i c}\, x +\frac {i b}{2 \sqrt {-i c}}\right ) \sqrt {\pi }\, {\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{8 \sqrt {-i c}\, c}+\frac {d e \,\operatorname {erf}\left (-\sqrt {-i c}\, x +\frac {i b}{2 \sqrt {-i c}}\right ) \sqrt {\pi }\, b \,{\mathrm e}^{\frac {i \left (4 a c -b^{2}\right )}{4 c}}}{4 \sqrt {-i c}\, c}-2 i \left (\frac {e^{2} \left (\frac {i x}{2 c}-\frac {i b}{4 c^{2}}\right )}{2}+\frac {i d e}{2 c}\right ) \sin \left (c \,x^{2}+b x +a \right )\) | \(483\) |
parts | \(\text {Expression too large to display}\) | \(875\) |
Input:
int((e*x+d)^2*cos(c*x^2+b*x+a),x,method=_RETURNVERBOSE)
Output:
1/2*e^2/c*x*sin(c*x^2+b*x+a)-1/2*e^2*b/c*(1/2*sin(c*x^2+b*x+a)/c-1/4*b/c^( 3/2)*2^(1/2)*Pi^(1/2)*(cos((1/4*b^2-a*c)/c)*FresnelC(2^(1/2)/Pi^(1/2)/c^(1 /2)*(c*x+1/2*b))+sin((1/4*b^2-a*c)/c)*FresnelS(2^(1/2)/Pi^(1/2)/c^(1/2)*(c *x+1/2*b))))-1/4*e^2/c^(3/2)*2^(1/2)*Pi^(1/2)*(cos((1/4*b^2-a*c)/c)*Fresne lS(2^(1/2)/Pi^(1/2)/c^(1/2)*(c*x+1/2*b))-sin((1/4*b^2-a*c)/c)*FresnelC(2^( 1/2)/Pi^(1/2)/c^(1/2)*(c*x+1/2*b)))+d*e/c*sin(c*x^2+b*x+a)-1/2*d*e*b/c^(3/ 2)*2^(1/2)*Pi^(1/2)*(cos((1/4*b^2-a*c)/c)*FresnelC(2^(1/2)/Pi^(1/2)/c^(1/2 )*(c*x+1/2*b))+sin((1/4*b^2-a*c)/c)*FresnelS(2^(1/2)/Pi^(1/2)/c^(1/2)*(c*x +1/2*b)))+1/2*2^(1/2)*Pi^(1/2)/c^(1/2)*d^2*(cos((1/4*b^2-a*c)/c)*FresnelC( 2^(1/2)/Pi^(1/2)/c^(1/2)*(c*x+1/2*b))+sin((1/4*b^2-a*c)/c)*FresnelS(2^(1/2 )/Pi^(1/2)/c^(1/2)*(c*x+1/2*b)))
Time = 0.11 (sec) , antiderivative size = 230, normalized size of antiderivative = 0.81 \[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=-\frac {\sqrt {2} {\left (2 \, \pi c e^{2} \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) - \pi {\left (4 \, c^{2} d^{2} - 4 \, b c d e + b^{2} e^{2}\right )} \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) + \sqrt {2} {\left (2 \, \pi c e^{2} \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + \pi {\left (4 \, c^{2} d^{2} - 4 \, b c d e + b^{2} e^{2}\right )} \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) - 2 \, {\left (2 \, c^{2} e^{2} x + 4 \, c^{2} d e - b c e^{2}\right )} \sin \left (c x^{2} + b x + a\right )}{8 \, c^{3}} \] Input:
integrate((e*x+d)^2*cos(c*x^2+b*x+a),x, algorithm="fricas")
Output:
-1/8*(sqrt(2)*(2*pi*c*e^2*sin(-1/4*(b^2 - 4*a*c)/c) - pi*(4*c^2*d^2 - 4*b* c*d*e + b^2*e^2)*cos(-1/4*(b^2 - 4*a*c)/c))*sqrt(c/pi)*fresnel_cos(1/2*sqr t(2)*(2*c*x + b)*sqrt(c/pi)/c) + sqrt(2)*(2*pi*c*e^2*cos(-1/4*(b^2 - 4*a*c )/c) + pi*(4*c^2*d^2 - 4*b*c*d*e + b^2*e^2)*sin(-1/4*(b^2 - 4*a*c)/c))*sqr t(c/pi)*fresnel_sin(1/2*sqrt(2)*(2*c*x + b)*sqrt(c/pi)/c) - 2*(2*c^2*e^2*x + 4*c^2*d*e - b*c*e^2)*sin(c*x^2 + b*x + a))/c^3
\[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=\int \left (d + e x\right )^{2} \cos {\left (a + b x + c x^{2} \right )}\, dx \] Input:
integrate((e*x+d)**2*cos(c*x**2+b*x+a),x)
Output:
Integral((d + e*x)**2*cos(a + b*x + c*x**2), x)
Result contains complex when optimal does not.
Time = 1.06 (sec) , antiderivative size = 2271, normalized size of antiderivative = 7.97 \[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=\text {Too large to display} \] Input:
integrate((e*x+d)^2*cos(c*x^2+b*x+a),x, algorithm="maxima")
Output:
-1/8*sqrt(2)*sqrt(pi)*(((I - 1)*cos(-1/4*(b^2 - 4*a*c)/c) + (I + 1)*sin(-1 /4*(b^2 - 4*a*c)/c))*erf(1/2*(2*I*c*x + I*b)/sqrt(I*c)) + ((I + 1)*cos(-1/ 4*(b^2 - 4*a*c)/c) + (I - 1)*sin(-1/4*(b^2 - 4*a*c)/c))*erf(1/2*(2*I*c*x + I*b)/sqrt(-I*c)))*d^2/sqrt(c) + 1/8*(((I - 1)*sqrt(2)*sqrt(pi)*(erf(1/2*s qrt((4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1) - (I + 1)*sqrt(2)*sqrt(pi)* (erf(1/2*sqrt(-(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1))*b^2*cos(-1/4*(b ^2 - 4*a*c)/c) + ((I + 1)*sqrt(2)*sqrt(pi)*(erf(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(1/2*sqrt(-(4*I*c ^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1))*b^2*sin(-1/4*(b^2 - 4*a*c)/c) - 2*(( -(I - 1)*sqrt(2)*sqrt(pi)*(erf(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(1/2*sqrt(-(4*I*c^2*x^2 + 4*I*b*c* x + I*b^2)/c)) - 1))*b*c*cos(-1/4*(b^2 - 4*a*c)/c) + (-(I + 1)*sqrt(2)*sqr t(pi)*(erf(1/2*sqrt((4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1) + (I - 1)*s qrt(2)*sqrt(pi)*(erf(1/2*sqrt(-(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c)) - 1)) *b*c*sin(-1/4*(b^2 - 4*a*c)/c))*x - 4*(c*(I*e^(1/4*(4*I*c^2*x^2 + 4*I*b*c* x + I*b^2)/c) - I*e^(-1/4*(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c))*cos(-1/4*( b^2 - 4*a*c)/c) - c*(e^(1/4*(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c) + e^(-1/4 *(4*I*c^2*x^2 + 4*I*b*c*x + I*b^2)/c))*sin(-1/4*(b^2 - 4*a*c)/c))*sqrt((4* c^2*x^2 + 4*b*c*x + b^2)/c))*d*e/(c^2*sqrt((4*c^2*x^2 + 4*b*c*x + b^2)/c)) + 1/32*(8*(((-(I - 1)*sqrt(2)*sqrt(pi)*(erf(1/2*sqrt((4*I*c^2*x^2 + 4*...
Result contains complex when optimal does not.
Time = 0.38 (sec) , antiderivative size = 291, normalized size of antiderivative = 1.02 \[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=-\frac {\frac {i \, \sqrt {2} \sqrt {\pi } {\left (-4 i \, c^{2} d^{2} + 4 i \, b c d e - i \, b^{2} e^{2} + 2 \, c e^{2}\right )} \operatorname {erf}\left (-\frac {1}{4} \, \sqrt {2} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c}{4 \, c}\right )}}{{\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} + 2 i \, {\left (c e^{2} {\left (2 \, x + \frac {b}{c}\right )} + 4 \, c d e - 2 \, b e^{2}\right )} e^{\left (i \, c x^{2} + i \, b x + i \, a\right )}}{16 \, c^{2}} - \frac {-\frac {i \, \sqrt {2} \sqrt {\pi } {\left (4 i \, c^{2} d^{2} - 4 i \, b c d e + i \, b^{2} e^{2} + 2 \, c e^{2}\right )} \operatorname {erf}\left (-\frac {1}{4} \, \sqrt {2} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c}{4 \, c}\right )}}{{\left (\frac {i \, c}{{\left | c \right |}} + 1\right )} \sqrt {{\left | c \right |}}} - 2 i \, {\left (c e^{2} {\left (2 \, x + \frac {b}{c}\right )} + 4 \, c d e - 2 \, b e^{2}\right )} e^{\left (-i \, c x^{2} - i \, b x - i \, a\right )}}{16 \, c^{2}} \] Input:
integrate((e*x+d)^2*cos(c*x^2+b*x+a),x, algorithm="giac")
Output:
-1/16*(I*sqrt(2)*sqrt(pi)*(-4*I*c^2*d^2 + 4*I*b*c*d*e - I*b^2*e^2 + 2*c*e^ 2)*erf(-1/4*sqrt(2)*(2*x + b/c)*(-I*c/abs(c) + 1)*sqrt(abs(c)))*e^(-1/4*(I *b^2 - 4*I*a*c)/c)/((-I*c/abs(c) + 1)*sqrt(abs(c))) + 2*I*(c*e^2*(2*x + b/ c) + 4*c*d*e - 2*b*e^2)*e^(I*c*x^2 + I*b*x + I*a))/c^2 - 1/16*(-I*sqrt(2)* sqrt(pi)*(4*I*c^2*d^2 - 4*I*b*c*d*e + I*b^2*e^2 + 2*c*e^2)*erf(-1/4*sqrt(2 )*(2*x + b/c)*(I*c/abs(c) + 1)*sqrt(abs(c)))*e^(-1/4*(-I*b^2 + 4*I*a*c)/c) /((I*c/abs(c) + 1)*sqrt(abs(c))) - 2*I*(c*e^2*(2*x + b/c) + 4*c*d*e - 2*b* e^2)*e^(-I*c*x^2 - I*b*x - I*a))/c^2
Timed out. \[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=\int \cos \left (c\,x^2+b\,x+a\right )\,{\left (d+e\,x\right )}^2 \,d x \] Input:
int(cos(a + b*x + c*x^2)*(d + e*x)^2,x)
Output:
int(cos(a + b*x + c*x^2)*(d + e*x)^2, x)
\[ \int (d+e x)^2 \cos \left (a+b x+c x^2\right ) \, dx=\frac {6 \left (\int \frac {x^{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 \,e^{2}-6 \left (\int \frac {1}{\tan \left (\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{2}+1}d x \right ) b d e +6 \left (\int \frac {1}{\tan \left (\frac {1}{2} c \,x^{2}+\frac {1}{2} b x +\frac {1}{2} a \right )^{2}+1}d x \right ) c \,d^{2}+3 \sin \left (c \,x^{2}+b x +a \right ) d e +3 b d e x -3 c \,d^{2} x -c \,e^{2} x^{3}}{3 c} \] Input:
int((e*x+d)^2*cos(c*x^2+b*x+a),x)
Output:
(6*int(x**2/(tan((a + b*x + c*x**2)/2)**2 + 1),x)*c*e**2 - 6*int(1/(tan((a + b*x + c*x**2)/2)**2 + 1),x)*b*d*e + 6*int(1/(tan((a + b*x + c*x**2)/2)* *2 + 1),x)*c*d**2 + 3*sin(a + b*x + c*x**2)*d*e + 3*b*d*e*x - 3*c*d**2*x - c*e**2*x**3)/(3*c)