# Differentiation rule for piecewise definition by interval

## Contents

## Statement

### Everywhere version

Suppose and are functions of one variable, such that *both* of the functions are defined and differentiable everywhere. Consider a function , defined as follows:

Then, we have the following for continuity:

- The left hand limit of at equals .
- The right hand limit of at equals .
- is left continuous at iff .
- is right continuous at iff .
- is continuous at iff .

We have the following for differentiability:

- is left differentiable at iff , and in this case, the left hand derivative equals .
- is right differentiable at iff , and in this case, the right hand derivative equals .
- is differentiable at iff (
*and*), and in this case, the derivative equals the equal values and .

### Piecewise definition of derivative

If the conditions for differentiability at are violated, we get the following piecewise definition for , which excludes the point from its domain:

If the conditions for differentiability at are satisfied, we get the following piecewise definition for , which includes the point in its domain:

where . In particular, the value at can be included in either the left side or the right side definition.

### Version for higher derivatives

Suppose and are functions of one variable, such that *both* of the functions are defined and times differentiable everywhere (and hence in particular the functions and their first derivatives are continuous), for some positive integer . Consider the function:

Then, is times differentiable at if we have *all* these conditions: , , . In other words, the values should match, and the values of each of the derivatives up to the derivative should match. In that case, the derivative of at math>c</math> equals the equal values .

The general piecewise definition of is, in this case:

where .

### Local generalization

The above holds with the following modification: we only require to be defined as on the *immediate* left of (i.e., on some interval of the form for and as on the *immediate* right of (i.e., on some interval of the form for ). Further, we only require that and be defined and differentiable on open intervals containing , not necessarily on all of .