Given, $f(x)=x^{2} e^{2 x}$
Differentiating w.r.t. $x$, we get
$f'(x) =2 e^{2 x} x^{2}+2 x e^{2 x}=2 e^{2 x}\left(x^{2}+x\right)$
$\Rightarrow f'(x) =0 \Rightarrow 2 e^{2 x}\left(x^{2}+x\right)=0 $
$\Rightarrow e^{2 x} =0 $ or $ x^{2}+x=0 \Rightarrow x=0,-1$
So, maxima and minima can be attain at either of
$-2,-1,0,2$ as the function bound.
$\therefore f(-2)=(-2)^{2} e^{-4}=4 e^{-4}$
$f(-1) =(-1)^{2} e^{-2} $
$f(0) =0 $
$f(2) =(2)^{2} e^{4}=4 e^{4} $
$\therefore p=4 e^{4} $ and $ q= 0$
Therefore, $p e^{-4}+q e^{4}=4 e^{4}\left(e^{-4}\right)+0=4 e^{0}$
$=4 \times 1=4$