Find m such that `(x^2+mx+1)e^x` has extrema:

Since the function is continuous everywhere for any choice of m, extrema can only occur where the first derivative is zero.

`y=(x^2+mx+1)e^x` Use the product rule:

`y'=(2x+m)e^x+(x^2+mx+1)e^x`

Setting `y'=0` we get:

`e^x(x^2+(m+2)x+(m+1))=0`

Since `e^x!=0` we can use the quadratic formula:

`x=(-(m+2)+-sqrt((m+2)^2-4(1)(m+1)))/2`

`=(-(m+2)+-sqrt(m^2+4m+4-4m-4))/2`

`=(-(m+2)+-m)/2`

`==>x=-1,-1-m`

So the extrema occur at x=-1 and x=-1-m.

--------------------------------

**Therefore m=-1-x**

--------------------------------

For example, if m=0 there are no extrema -- x=-1 is an inflection point.

If m=-2 the extrema occur at x=-1,1

If m=-4 the extrema occur at x=-1,3

If m=4 the extrema occur at x=-1,-5

Some graphs:

Here is m=4 (it is hard to see that there is an extrema at x=-5 without zooming in):