I am looking for a function $f(x)$ with the following properties:
- Positive for $x\in(-\infty, 0)$ but tangent to the x-axis at $x=-1$
- A root at $x=0$ and negative for $x\in(0, 2)$
- A root at $x=2$ and positive for $x\in(2, \infty)$
I thought $f(x)=x(x-2)(x+1)^2$ would do the trick but it does not. The graph I have drawn on paper has a "w" shape with a local minimum at $x=-1$, a local maximum between $x=-1$ and $x=0$ and a local minimum between $x=0$ and $x=2$.
All help is greatly appreciated!
I believe that your function works: