I know that the piecewise function $ f(x) = \left\{ \begin{array}{lr} 2x & , x < 1\\ x+1 & , x \geq 1 \end{array} \right. $ is differentiable because $2x$ and $x + 1$ converge at different rates based on their slope but why is $ f(x) = \left\{ \begin{array}{lr} \frac{x^2-1}{x-1} & , x \neq 1\\ 2 & , x=1 \end{array} \right. $ differentiable? I know that it is continuous but their slopes are different.
Thanks!