The inflection points of $f(x)=(x^2-4x+1)e^{-x}$ I got the function $f(x)=(x^2-4x+1)e^{-x}$. The task is to find the inflection points. The correct answer is $x=4-\sqrt{5}$ and $ x=4+\sqrt{5} $. I got the second derivative to $f(x)$.
But when I equal it to zero I got $x=2+\sqrt{5}$ and $ x=2 - \sqrt{5} $. 
What am I doing wrong?
 A: We have
$$\eqalign{
  f(x)&=(x^2-4x+1)e^x\cr
  f'(x)&=(x^2-2x-3)e^x\cr
  f''(x)&=(x^2-5)e^x\ .\cr}$$
There are


*

*zeros at $f(x)=0$, that is, $x=2\pm\sqrt3$;

*stationary points at $f'(x)=0$, that is, $x=-1,3$;

*inflection points at $f''(x)=0$, that is, $x=\pm\sqrt5$.


I can't explain where the answer of $x=4\pm\sqrt5$ came from, are you sure you copied the question correctly?
Edit.  As we can now see, $f(x)=(x^2-4x+1)e^x$ as originally posed in the question was not the function that the OP intended.
A: We have:
$$f(x) = P(x) e^x,$$ 
so $f'' = P'' e^x + 2 P' e^x + e^x P = e^x (2 + 4 x - 8 + x^2- 4x +1  ) = (x^2- 5) e^x$. Since $e^x > 0 $ for  $x \in (-\infty,\infty)$, the solution of $f''(x) = 0$ is given by $x^2 -5 =0 $, so the inflection points are $x_i = \pm \sqrt{5}$.
Hope this helps.
Cheers!
Edit: have a look of the graph of $f(x)$ here.
A: Edit: The answer below was written when the question asked about $f(x)=(x^2-4x+1)e^x$.

Consider the function $g(x)=(x^2-4x+1)e^{-x}$, a little minus sign away from $f(x)$. 
The first derivative is $(-x^2+6x-5)e^{-x}$, so the stationary points are at $x=1$ and $x=5$.  
The second derivative is $(x^2-8x+11)e^{-x}$. Thus the inflection points of $g(x)$ are at $x=4\pm\sqrt{5}$.
This may account for the reported book answer.  
