I have this simple function:
$$xe^x$$
Is it an even or odd function? How can I prove it?
For even functions, we have:
$$f(x)=f(-x)$$
For odd functions, we have:
$$-f(x)=f(-x)$$
I have only got the hint that it is an even function but my logic says odd.
Note that
$$f(x)=xe^x\neq f(-x)=-xe^{-x}$$
$$f(x)=xe^x\neq -f(-x)=xe^{-x}$$
Indeed
$$xe^x=-xe^{-x}\iff x(e^x+e^{-x})=0 \iff x=0 \quad \lor \quad e^x+e^{-x}=0 $$
$$xe^x=xe^{-x}\iff x(e^x-e^{-x})=0 \iff x=0 \quad \lor \quad e^x-e^{-x}=0 $$
since the equalities hold only for $x=0$, $f(x)$ is neither odd or even.
On the other hand,
$$g(x)=xe^{|x|}$$
is odd.