# Differentiable

How to determine whether a function is differentiable: definition, 2 examples, and their solutions.

## Definition

### Definition

y = f(x) is differentiable at a point when
the left-hand derivative and the right-hand derivative are equal.

This is true because
the limit value is defined
when the left-hand limit and the right-hand limit are equal.

One-Sided Limits

In plain words,
y = f(x) is differentiable
when its graph changes smoothly:
connected continuously
and without any sharp points.

## Example 1

### Solution

Before determining whether y = f(x) is differentiable,
first show that y = f(x) is continuous.

Find the left-hand limit of f(x) at x = 1.

f(x) = x2 + 2 at x = 1-.

One-sided Limits

So limx → 1- f(x) = limx → 1- (x2 + 2).
This is equal to 3.

Find the right-hand limit of f(x) at x = 1.

f(x) = -x2 + 4x at x = 1+.

So limx → 1+ f(x) = limx → 1+ (-x2 + 4x).
This is equal to 3.

Find f(1).

f(x) = -x2 + 4x at x = 1.

So f(1) = -12 + 4⋅1 = 3.

The left-hand limit is 3.
The right hand limit is 3.
And f(1) = 3.

The left-hand limit, the right-hand limit, and the funtion value of f(x) at x = 1 are all equal.

So f(x) is continuous at x = 1.

Next, determine whether f(x) is differentiable at x = 1.

Find the left-hand derivative of f(x) at x = 1.

limx → 1- f'(x) = limh → 0 [f(1- + h) - f(1-)]/h.

Derivative: Definition

If you learned the derivative formula,
you can use the formula in this step.

Derivative of a Polynomial

f(x) = x2 + 2 at x = 1-.

So f(1- + h) = (1- + h)2 + 2.
And f(1-) = (1-)2 + 2.

(1- + h)2
= (1 + h)2
= 1 + 2⋅1⋅h + h2
= 1 + 2h + h2
Square of a Sum

-[(1-)2 + 2] = -[1 + 2] = -1 - 2

Cancel 1 and -1.
Cancel +2 and -2.

Then limh → 0 [h2 + 2h]/h.

Divide both of the numerator and the denominator by h.
Then limh → 0 [h + 2]/1.

Then limh → 0 [h + 2]/1 = [0 + 2]/1 = 2.

So the left-hand derivative of f(x) at x = 1 is 2.

Next, find the right-hand derivative of f(x) at x = 1.

limx → 1+ f'(x) =limh → 0 [f(1+ + h) - f(1+)]/h.

f(x) = -x2 + 4x at x = 1+.

So f(1+ + h) = -(1+ + h)2 + 4(1+ + h).
And f(1+) = -(1+)2 + 4⋅(1+).

-(1+ + h)2
= -(1 + h)2
= -(1 + 2⋅1⋅h + h2)
= -(1 + 2h + h2)

+4(1+ + h) = +4 + 4h

-[-(1+)2 + 4(1+)] = -[-1 + 4]

-(1 + 2h + h2) = -1 - 2h - h2

-[-1 + 4] = +1 - 4

Cancel -1 and +1.
Cancel +4 and -4.
-2h + 4h = +2h

Then limh → 0 [-h2 + 2h]/h.

Divide both of the numerator and the denominator by h.
Then limh → 0 [-h + 2]/1.

Then limh → 0 [-h + 2]/1 = [0 + 2]/1 = 2.

So the right-hand derivative of f(x) at x = 1 is 2.

The left-hand derivative is 2.
The right-hand derivative is 2.

The left-hand derivative and the right-hand derivative at x = 1 are equal.

So f(x) is differentiable.

So f(x) is differentiable at x = 1.

### Graph

This curve is the graph of y = f(x).

The graph is connected continuously at x = 1.
So f(x) is continuous at x = 1.

The left-hand slope and the right-hand slope at x = 1 are both 2.
So the slope of y = f(x) exist.
So y = f(x) is differentiable at x = 1.

## Example 2

### Solution

Write f(x) = |x| as a piecewise function.

First show that y = f(x) is continuous.

Find the left-hand limit of f(x) at x = 0.

f(x) = -x at x = 0-.

So limx → 0- f(x) = limx → 0- -x.
This is equal to 0.

Find the right-hand limit of f(x) at x = 0.

f(x) = x at x = 0+.

So limx → 0+ f(x) = limx → 0+ x.
This is equal to 0.

Find f(0).

f(x) = x at x = 0.

So f(0) = 0.

The left-hand limit is 0.
The right hand limit is 0.
And f(0) = 0.

The left-hand limit, the right-hand limit, and the funtion value of f(x) at x = 0 are all equal.

So f(x) is continuous at x = 0.

Next, determine whether f(x) is differentiable at x = 0.

Find the left-hand derivative of f(x) at x = 0.

limx → 0- f'(x) = limh → 0 [f(0- + h) - f(0-)]/h.

f(x) = -x at x = 0-.

So f(0- + h) = -(0- + h).
And f(0-) = (-0-).

Solve the limit.
Then the limit value is -1.

So the left-hand derivative of f(x) at x = 0 is -1.

Next, find the right-hand derivative of f(x) at x = 0.

limx → 0+ f'(x) = limh → 0 [f(0+ + h) - f(0+)]/h.

f(x) = x at x = 0+.

So f(0+ + h) = 0+ + h.
And f(0+) = 0+.

Solve the limit.
Then the limit value is 1.

So the right-hand derivative of f(x) at x = 0 is 1.

The left-hand derivative is -1.
The right-hand derivative is 1.

The left-hand derivative and the right-hand derivative at x = 1 are not equal.

So f(x) is not differentiable.

So f(x) is not differentiable at x = 0.

### Graph

This is the graph of y = f(x): y = |x|.

Absolute Value Function: Graph

The graph is connected continuously at x = 0.
So f(x) is continuous at x = 0.

The the left-hand slope at x = 0 is -1.
And the right-hand slope at x = 0 is 1.

The left-hand slope and the right-hand slope are not equal.
So there's a sharp point at x = 0.

So the slope of y = f(x) doesn't exist.
So y = f(x) is not differentiable at x = 0.