'Destruction' of $x$ in second derivative? Can you tell whether I've taken this second derivative and determined its inflection points correctly?
$$f'(x) = (1-x)e^{ x-\frac{1}{2}x^2}$$
Now for the second derivative:
$$f''(x)=(1-x)[e^{ x-\frac{1}{2}x^2}]' + (e^{ x-\frac{1}{2}x^2} [1-x]')$$
$$(1-x)(e^{x-\frac{1}{2}x^2} - e^{x-\frac{1}{2}x^2}x) + (-e^{x-\frac{1}{2}x^2})$$
Let $e^{ x-\frac{1}{2}x^2} = \psi$
$$(1-x)(\psi-\psi x) - \psi$$
$$\psi - 2\psi x + \psi x^2 - \psi$$
$$-2\psi x + \psi x^2 $$
Now determine inflection points:
$$-2\psi x + \psi x^2 =0$$
$$\psi x(-2+x)=0$$
$$\psi x = 0  \text{  or  } -2 +x = 0$$
$$e^{ x-\frac{1}{2}x^2}x = 0\text{  or  } x = 2 $$
$$x = 0  \text{  or  } x = 2$$
When I determine the inflection point I 'destroy' $e^{ x-\frac{1}{2}x^2}x $ by dividing on both sides by it. Is this a valid operation? Or should I have factored out only $e^{ x-\frac{1}{2}x^2}$ (without $x$)? $e^{ x-\frac{1}{2}x^2}= 0 $ doesn't have a solution and $-2x+x^2 = 0$ gives the desired inflection points (which are the same as I get using the method above ($x=0 \wedge x = 2$.)
Thank you,
Cro-Magnon

So, you arrived at the step $e^{x-\frac{1}{2}x^{2}}x=0$ and you want to solve for $x$. Dividing both sides of this equation by $e^{x-\frac{1}{2}x^{2}}$ to conclude that $x=0$ is indeed a legal operation. This is because for all real numbers $r$, $e^{r}>0$. Therefore, for any $x$, $e^{x-\frac{1}{2}x^{2}}>0$. Since you are not dividing by $0$, you are okay.
