[Math] show if function is even or odd

functions

Suppose that we have equation:
$$f(x)=\frac{2^x+1}{2^x-1}$$

There is question if this function even or odd? I know definitions of even and odd functions, namely
even is if $f(-x)=f(x)$ and odd is if $f(-x)=-f(x)$ and when I put $-$ sign in function, found that this is neither even nor odd function, because $2^{-x}\ne-1 \times 2^x$, but my book says that it is even, so am I wrong? Please help me to clarify book is correct or me? Thanks

Best Answer

Let's see what $f(-x)$ looks like:

$$ f(-x) = \frac{2^{-x} + 1}{2^{-x} - 1} $$

Since $f(x)$ contains $2^x$ and not $2^{-x}$, let's multiply the numerator and denominator by $2^x$:

$$ f(-x) = \frac{2^x(2^{-x} + 1)}{2^x(2^{-x} - 1)} = \frac{1 + 2^x}{1-2^x} = - \frac{2^{x} + 1}{2^{x} - 1} = -f(x) $$

This shows that the function is odd.