a) \(A=2x^2+3x+1=\left(2x^2+2x\right)+\left(x+1\right)\)
\(=2x\left(x+1\right)+\left(x+1\right)=\left(x+1\right)\left(2x+1\right)\)
Ta có: \(\left|x\right|=\frac{1}{2}\)\(\Leftrightarrow\orbr{\begin{cases}x=\frac{-1}{2}\\x=\frac{1}{2}\end{cases}}\)
TH1: Nếu \(x=\frac{-1}{2}\)\(\Rightarrow A=\left(\frac{-1}{2}+1\right)\left(2.\frac{-1}{2}+1\right)=\left(\frac{-1}{2}+1\right)\left(-1+1\right)=0\)
TH2: Nếu \(x=\frac{1}{2}\)\(\Rightarrow A=\left(\frac{1}{2}+1\right)\left(2.\frac{1}{2}+1\right)=\frac{3}{2}.\left(1+1\right)=\frac{3}{2}.2=3\)
Vậy \(A=0\)hoặc \(A=3\)
b) Thay \(x=-1\)và \(y=2\)vào biểu thức ta được:
\(B=\left(-1\right)^2.2-3.\left(-1\right).2^2+\left(-1\right)^2.2^2=2+12+4=18\)