# How Do You Determine if a Function Is Differentiable?

Along with continuity, you can also talk about whether or not a function is differentiable. A function is differentiable at a point when it is both continuous at the point and doesn’t have a “cusp”. A cusp shows up if the slope of the function suddenly changes. An example of this can be seen in the image below.

Functions with a “cusp” may come up when you have what is called a piecewise-defined function. That means the function has one expression on one interval, and a different expression on another interval. In the figure below, you can see that $f\left(x\right)={x}^{2}+2$ when $x\le 1$ (the blue graph) and that $f\left(x\right)=-2x+5$ when $x>1$ (the green graph). Mathematically, this is written as

 $f\left(x\right)=\left\{\begin{array}{cc}{x}^{2}+2\phantom{\rule{1em}{0ex}}\hfill & \text{when x ≤ 1,}\hfill \\ -2x+5\phantom{\rule{1em}{0ex}}\hfill & \text{when x > 1.}\hfill \end{array}$

Even though the graph in this case is continuous at $x=1$, it’s not differentiable at $x=1$. A cusp occurs where you can draw several tangents to the graph. At points on the graph where you can draw many tangents, the derivative is not defined, and you can say that the function isn’t differentiable.

To explain differentiability properly, you need to know what right and left limits mean.

Theory

### RightandLeftLimits

• A limit of $f\left(a\right)$ is a right limit when you approach the point $x=a$ from $x$-values greater than $a$. You write

 $\underset{x\to {a}^{+}}{\mathrm{lim}}f\left(x\right)=f\left(a\right)$
• A limit of $f\left(a\right)$ is a left limit when you approach the point $x=a$ from $x$-values smaller than $a$. You write

 $\underset{x\to {a}^{-}}{\mathrm{lim}}f\left(x\right)=f\left(a\right)$

Now let’s take a look at the definition of differentiability.

Theory

### Differentiability

You say that a function is differentiable at a point $x=a$ if $f\left(x\right)$ is continuous at $x=a$ and

 $\underset{x\to {a}^{-}}{\mathrm{lim}}{f}^{\prime }\left(x\right)=\underset{x\to {a}^{+}}{\mathrm{lim}}{f}^{\prime }\left(x\right)$

Note! When you are checking the differentiability of a piecewise-defined function, you use the expression for values less than $a$ in $\underset{x\to {a}^{-}}{\mathrm{lim}}{f}^{\prime }\left(x\right)$ and the expression for values greater than $a$ in $\underset{x\to {a}^{+}}{\mathrm{lim}}{f}^{\prime }\left(x\right)$.

Example 1

Decide whether

 $f\left(x\right)=\left\{\begin{array}{cc}{x}^{2}+2\phantom{\rule{1em}{0ex}}\hfill & \text{when x ≤ 1,}\hfill \\ -2x+5\phantom{\rule{1em}{0ex}}\hfill & \text{when x > 1}\hfill \end{array}$

from the image above is differentiable

To answer this, you first have to check whether $f\left(x\right)$ is continuous. Is $\underset{x\to a}{\mathrm{lim}}f\left(x\right)=f\left(a\right)$ for all $a\in ℝ$? For $a\le 1$, you have

 $\underset{x\to a}{\mathrm{lim}}f\left(x\right)=\underset{x\to a}{\mathrm{lim}}{x}^{2}+2={a}^{2}+2=f\left(a\right),$

and for $a>1$, you have

 $\underset{x\to a}{\mathrm{lim}}f\left(x\right)=\underset{x\to a}{\mathrm{lim}}-2x+5=-2a+5=f\left(a\right)$

 $\underset{x\to a}{\mathrm{lim}}f\left(x\right)=\underset{x\to a}{\mathrm{lim}}-2x+5=-2a+5=f\left(a\right)$

The limits exist and you can conclude that $f\left(x\right)$ is continuous.

Now you need to check whether

 $\underset{x\to {a}^{-}}{\mathrm{lim}}{f}^{\prime }\left(x\right)=\underset{x\to {a}^{+}}{\mathrm{lim}}{f}^{\prime }\left(x\right)$

for all $x\in ℝ$. You begin by finding ${f}^{\prime }\left(x\right)$:

 ${f}^{\prime }\left(x\right)=\left\{\begin{array}{cc}2x\phantom{\rule{1em}{0ex}}\hfill & \text{when x ≤ 1}\hfill \\ -2\phantom{\rule{1em}{0ex}}\hfill & \text{when x > 1}\hfill \end{array}$

You check if $f$ is differentiable at the point $x=1$. You begin with the left limit:

 $\underset{x\to {1}^{-}}{\mathrm{lim}}{f}^{\prime }\left(x\right)=\underset{x\to {1}^{-}}{\mathrm{lim}}2x=2\cdot 1=2$

Next, the right limit:

 $\underset{x\to {1}^{+}}{\mathrm{lim}}{f}^{\prime }\left(x\right)=\underset{x\to {1}^{+}}{\mathrm{lim}}-2=-2$

Because

 $\underset{x\to {1}^{-}}{\mathrm{lim}}{f}^{\prime }\left(x\right)=2\ne -2=\underset{x\to {1}^{+}}{\mathrm{lim}}{f}^{\prime }\left(x\right),$

you know that $f\left(x\right)$ is not differentiable at $x=1$.

Example 2

Find out where the function

 $f\left(x\right)=\frac{2{x}^{2}-3}{{x}^{2}-4}$

is both continuous and differentiable

As this is a rational function, you know that it is discontinuous where it has vertical asymptotes, which is where its denominator equals 0. That means you have to solve this: $\begin{array}{llll}\hfill {x}^{2}-4& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {x}^{2}& =4\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill x& =±\sqrt{4}=±2\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

That means the function $f\left(x\right)$ is continuous for all values of $x$ except $x=2$ and $x=-2$. You write this mathematically as $x\in ℝ\setminus \phantom{\rule{-0.17em}{0ex}}\left\{-2,2\right\}$ (all $x$ in $ℝ$ except $x=-2$ and $x=2$).

A function has to be continuous at a given point to be differentiable at that point, so you can conclude that the function is not differentiable at the points $x=-2$ and $x=2$. The question is if there are other points where $f\left(x\right)$ is not differentiable. You check that by finding out whether

 $\underset{x\to {a}^{-}}{\mathrm{lim}}{f}^{\prime }\left(x\right)=\underset{x\to {a}^{+}}{\mathrm{lim}}{f}^{\prime }\left(x\right)$

for all $x$. First, you find an expression for the derivative: $\begin{array}{llll}\hfill {f}^{\prime }\left(x\right)& =\frac{4x\cdot \phantom{\rule{-0.17em}{0ex}}\left({x}^{2}-4\right)-\phantom{\rule{-0.17em}{0ex}}\left(2{x}^{2}-3\right)\cdot 2x}{\phantom{\rule{-0.17em}{0ex}}{\left({x}^{2}-4\right)}^{2}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{4{x}^{3}-16x-4{x}^{3}+6x}{\phantom{\rule{-0.17em}{0ex}}{\left({x}^{2}-4\right)}^{2}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\frac{-10x}{\phantom{\rule{-0.17em}{0ex}}{\left({x}^{2}-4\right)}^{2}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {f}^{\prime }\left(a\right)& =\frac{-10a}{\phantom{\rule{-0.17em}{0ex}}{\left({a}^{2}-4\right)}^{2}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

You know that ${f}^{\prime }\left(a\right)$ is defined for all $a$ except where the denominator of ${f}^{\prime }\left(a\right)$ is not defined. This happens when the denominator is 0. You set the denominator equal to 0 and solve for $a$: $\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}{\left({a}^{2}-4\right)}^{2}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {a}^{2}-4& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {a}^{2}& =4\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill a& =±\sqrt{4}=±2\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

That means $f\left(x\right)$ is differentiable for all $x\in ℝ\setminus \phantom{\rule{-0.17em}{0ex}}\left\{-2,2\right\}$ (all $x$ in $ℝ$ except $x=-2$ and $x=2$).