How do I find the local minimum/maximum of this function?
$f:{R-2}\to{R}$
$f(x)=\frac{1}{x-2}e^{\left|x\right|}$
I wrote it like this $$f(x)=\left\{\begin{array}{cc} \frac{1}{x-2}e^x & x \ge 0 \\ \frac{1}{x-2}e^{-x} & x<0 \end{array}\right.$$
I differentiated the two parts of the function and equalized them to 0. I get $x=3$ and $x=1$ as points where my derivatives are 0. But as I see it my function is decreasing from $-\infty$ to 1 and then it starts increasing to $\infty$ . I think I'm having a problem with my domain.
I'm really at a loss here, since I can't find any examples of finding local minimum/maximum for these types of functions. What are these functions called in English, conditional functions?