What is $a$?
$\bullet$ A fixed constant? Then $x^2+x+a=0$ is satisfied by only (at most) two values $x$. So it makes no sense to integrate over $x$.
$\bullet$ A function of $x$, defined implicitly by $x^2+x+a$? Then you can integrate, but $$ \int_{-\infty}^{\infty}e^{x+a}x\;dx \
e e^{a} \int_{-\infty}^{\infty}e^x\:dx $$ because $a$ is a function of $x$ and cannot be factored out.