# Why is this function differentiable?

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!

-

3
Your second $f$ is the same as $x\mapsto x+1$ which is clearly differentiable everywhere. – LostInMath Oct 12 '11 at 10:22

5
$\displaystyle f(x)=\left\{\begin{array}{}2x&\text{if }x<1\\x+1&\text{if }x\ge1\end{array}\right.$ is not differentiable at $x=1$. $\displaystyle\lim_{h\to0}\frac{f(1+h)-f(1)}{h}$ does not exist. – robjohn♦ Oct 12 '11 at 10:37

## 1 Answer

Don't be tricked by the seemingly complicated piecewise definition of the function $f:\mathbb{R}\to\mathbb{R}$, $$f(x) = \left\{ \begin{array}{lr} \frac{x^2-1}{x-1} & , x \neq 1\\ 2 & , x=1. \end{array} \right.$$ It is exactly the same function as $g:\mathbb{R}\to\mathbb{R}$, $g(x)=x+1$, since $$\left\{ \begin{array}{lr} \frac{x^2-1}{x-1}=\frac{(x+1)(x-1)}{x-1}=x+1=g(x) & , x \neq 1\\ 2 = 1+1 = x+1 = g(x)& , x=1. \end{array} \right.$$ Obviously the function $g$ is differentiable everywhere, and hence $f$ is too, since they are the one and same.

-

Oh, okay thanks! I got stuck there for a while. – Juan de la John Oct 13 '11 at 6:59
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 14, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9692583680152893, "perplexity_flag": "head"}