Show that this function is one to one

I am trying to show that this function $s:\mathbb R→\mathbb R$ defined by $s(x)=e^x - e^{-x}$ is one to one.

My approach is using the natural $\log$ ($\ln$) to cancel out the $e$'s: $$e^x - e^{-x} = e^y - e^{-y}\\ \ln(e^x - e^{-x}) = \ln(e^y - e^{-y})\\ x + x = y + y\\ 2x = 2y\\ x = y$$ I just wanted to know A. if my algebra is correct and you can do the above operations and B. if it isn't correct, would the next best way to prove its one to one by just plugging in zero for the original functions?

Thanks.


Solution 1:

$$\begin{align} e^x - e^{-x} &= e^y - e^{-y} \\ e^x + e^{-y} &= e^y + e^{-x} \\ e^x(1 + e^{-x-y}) &= e^y(1 + e^{-x-y})\end{align}$$ Since $e^{-x-y} \geq 0$ for all $x,y$ we have $1 + e^{-x-y} \neq 0$, so we can cancel the terms on both sides to get $$e^x = e^y$$ Since $e^x$ is injective, the result follows.

Solution 2:

Perhaps it is enough to observe that since $e^x$ is strictly increasing $x>y \Rightarrow e^x > e^y$

so

$e^{-x} < e^{-y}$

$-e^{-x} > -e^{-y}$

$e^x -e^{-x} > e^y -e^{-y}$