Differentiation rule for piecewise definition by interval: Difference between revisions

From Calculus
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 39: Line 39:
Suppose <math>f_1</math> and <math>f_2</math> are [[function]]s of one variable, such that ''both'' of the functions are defined and <math>k</math> times differentiable everywhere (and hence in particular the functions and their first <math>k-1</math> derivatives are continuous), for some positive integer <math>k</math>. Consider the function:
Suppose <math>f_1</math> and <math>f_2</math> are [[function]]s of one variable, such that ''both'' of the functions are defined and <math>k</math> times differentiable everywhere (and hence in particular the functions and their first <math>k-1</math> derivatives are continuous), for some positive integer <math>k</math>. Consider the function:


<math>f(x) := \left\lbrace \begin{array}{rl} f_1(x), &  x < c \\ f_2(x), & c < x \le a_2 \\v, & x = c \end{array}\right.</math>
<math>f(x) := \left\lbrace \begin{array}{rl} f_1(x), &  x < c \\ f_2(x), & x > c \\v, & x = c \end{array}\right.</math>


Then, <math>f</math> is <math>k</math> times differentiable at <math>c</math> if we have ''all'' these conditions: <math>f_1(c) = f_2(c) = v</math>, <math>f_1'(c) = f_2'(c)</math>, <math>\dots</math>, <math>f_1^{(k)}(c) = f_2^{(k)}(c)</math>. In other words, the values should match, and the values of each of the derivatives up to the <math>k^{th}</math> derivative should match. In that case, the <math>k^{th}</math> derivative of <math>f</math> at math>c</math> equals the equal values <math>f_1^{(k)}(c) = f_2^{(k)}(c)</math>.
Then, <math>f</math> is <math>k</math> times differentiable at <math>c</math> if we have ''all'' these conditions: <math>\! f_1(c) = f_2(c) = v</math>, <math>\! f_1'(c) = f_2'(c)</math>, <math>\! \dots</math>, <math>f_1^{(k)}(c) = f_2^{(k)}(c)</math>. In other words, the values should match, and the values of each of the derivatives up to the <math>k^{th}</math> derivative should match. In that case, the <math>k^{th}</math> derivative of <math>f</math> at <math>c</math> equals the equal values <math>f_1^{(k)}(c) = f_2^{(k)}(c)</math>.


The general piecewise definition of <math>f^{(k)}</math> is, in this case:
The general piecewise definition of <math>f^{(k)}</math> is, in this case:
Line 52: Line 52:


The above holds with the following modification: we only require <math>f</math> to be defined as <math>f_1</math> on the ''immediate'' left of <math>c</math> (i.e., on some interval of the form <math>(c - \delta,c)</math> for <math>\delta > 0</math> and as <math>f_2</math> on the ''immediate'' right of <math>c</math> (i.e., on some interval of the form <math>(c,c + \delta)</math> for <math>\delta > 0</math>). Further, we only require that <math>f_1</math> and <math>f_2</math> be defined and differentiable on [[open interval]]s containing <math>c</math>, not necessarily on all of <math>\R</math>.
The above holds with the following modification: we only require <math>f</math> to be defined as <math>f_1</math> on the ''immediate'' left of <math>c</math> (i.e., on some interval of the form <math>(c - \delta,c)</math> for <math>\delta > 0</math> and as <math>f_2</math> on the ''immediate'' right of <math>c</math> (i.e., on some interval of the form <math>(c,c + \delta)</math> for <math>\delta > 0</math>). Further, we only require that <math>f_1</math> and <math>f_2</math> be defined and differentiable on [[open interval]]s containing <math>c</math>, not necessarily on all of <math>\R</math>.
==Examples==
===Example of piecewise rational function===
This example is covered in the video embedded above.
Consider the function:
<math>f(x) := \left\lbrace \begin{array}{rl} \frac{1}{x - 1}, & x < 0 \\ \frac{-1}{x + 1}, & x > 0 \\ -1, & x = 0 \\\end{array}\right.</math>
Note that here, in the notation we have used, we have:
<math>f_1(x) = \frac{1}{x - 1}, \qquad f_2(x) = \frac{-1}{x + 1}, \qquad c = 0, \qquad v = -1</math>
Note that the function <math>f_1</math> is defined ''around'' zero, i.e., the definition extends to the point zero and the immediate right -- in fact, <math>f_1</math> is defined and infinitely differentiable on the interval <math>(-\infty,1)</math>.
Similarly, <math>f_2</math> is defined ''around'' zero, i.e., i.e., the definition extends to the immediate left of zero -- in fact, <math>f_2</math> is defined and infinitely differentiable on the interval <math>(-1,\infty)</math>.
Thus, we see that:
* <math>f_1(0) = 1/(0 - 1) = -1</math>, <math>f_2(0) = -1/(0 + 1) = -1</math>, and <math>f(0) = v = -1</math>. Thus, we see that <math>f_1(0) = f_2(0) = v = -1</math>, so the function <math>f</math> is continuous at 0.
* We have <math>f_1'(x) = -1/(x - 1)^2</math> and <math>f_2'(x) = 1/(x + 1)^2</math>. We see that <math>f_1'(0) = -1/(0-1)^2 = -1</math> and <math>f_2'(0) = 1/(0 + 1)^2 = 1</math>. We see that <math>f_1'(0) \ne f_2'(0)</math>, so <math>f</matH> is not differentiable at 0.
This means that the first and higher derivatives of <math>f</math> do not exist at 0.
===Example of piecewise polynomial function===
This example is covered in the video embedded above.
Consider the function:
<math>f(x) := \lbrace \begin{array}{rl} x^2, & x < 0 \\ x^3 + x, & x > 0 \\ 0, & x = 0 \\\end{array}</math>
Here:
<math>f_1(x) := x^2, \qquad f_2(x) := x^3 + x, \qquad c = 0, \qquad v = 0</math>
We see that:
* <math>f_1(0) = 0^2 = 0</math>, <math>f_2(0) = 0^3 + 0 = 0</math>, and <math>v = 0</math>. Thus, <math>f_1(0) = f_2(0) = v</math>, so <math>f</math> is continuous at 0.
* <math>f_1'(x) = 2x</math> and <math>f_2'(x) = 3x^2 + 1</math>. Evaluated at 0, we get <math>f_1'(0) = 0</math> and <math>f_2'(0) = 1</math>, so <math>f_1'(0) \ne f_2'(0)</math>. So, <math>f</math> is not differentiable at 0.
===Example of piecewise polynomial function: higher derivatives===
This example is covered in the video embedded above.
Consider the function:
<math>f(x) := \left\lbrace \begin{array}{rl} x^2, & x < 0 \\ x^3 + x^2, & x > 0 \\ 0, & x = 0 \\\end{array}\right.</math>
Here, <math>c = 0, v = 0, f_1(x) = x^2, f_2(x) = x^3 + x^2</math>. To keep track of what we're doing, we make a table:
{| class="sortable" border="1"
! !! Expression for <math>f_1</math> !! Value for <math>f_1</math> at 0 !! Expression for <math>f_2</math> !! Value for <math>f_2</math> at 0 !! Conclusion !! Explanation
|-
| Function || <math>f_1(x) = x^2</math> || <math>f_1(0) = 0^2 = 0</math> || <math>f_2(x) = x^3 + x^2</math> || <math>f_2(0) = 0^3 + 0^2 = 0</math> || <math>f</math> is continuous at 0 || We are also given that the function value at 0 is 0. Thus, <math>f_1(0) = f_2(0) = v = 0</math>. So, <math>f</math> is continuous at 0.
|-
| First derivative || <math>f_1'(x) = 2x</math> ||  <math>f_1'(0) = 2(0) = 0</math> || <math>f_2'(x) = 3x^2 + 2x</math> ||<math>f_2'(0) = 3(0)^2 + 2(0) = 0</math> || <math>f</math> is differentiable at 0, and <math>f'(0) = 0</math> || We already checked continuity, and we have now checked that <math>f_1'(0) = f_2'(0)</math>.
|-
| Second derivative || <math>f_1''(x) = 2</math> || <math>f_1''(0) = 2</math> || <math>f_2''(x) = 6x + 2</math> || <math>f_2''(0) = 6(0) + 2 = 2</math> || <math>f</matH> is twice differentiable at 0, and <math>f''(0)= 2</math> || We already checked differentiability. Thus, it suffices to check that <math>f_1''(0) = f_2''(0)</math>, which is true since both equal 2.
|-
| Third derivative || <math>f_1'''(x) = 0</math> || <math>f_1'''(0) = 0</math> || <math>f_2'''(x) = 6</math> || <math>f_2'''(0) = 6</math> || <math>f</math> is ''not'' thrice differentiable at 0 || We have <math>f_1'''(0) = 0 \ne f_2'''(0) = 6</math>.
|}
Note that ''no higher derivative'' of <math>f</math> exists at zero. For instance, we ''do'' have that <math>f_1^{(4)}(0) = 0 = f_2^{(4)}(0)</math>, but <math>f^{(4)}(0)</math> does not exist.
Here are the explicit piecewise definitions for the derivatives of <math>f</math>:
<math>f'(x) = \left\lbrace\begin{array}{rl} 2x, & x < 0 \\ 3x^2 + 2x, & x > 0 \\ 0, & x = 0 \\\end{array}\right.</math>
<math>f''(x) = \left\lbrace\begin{array}{rl} 2, & x < 0 \\ 6x + 2, & x > 0 \\ 2, & x = 0 \\\end{array}\right.</math>
<math>f'''(x) = \left\lbrace\begin{array}{rl} 0, & x < 0 \\ 6, & x > 0 \\\end{array} \right.</math>
Note that <math>f'''</math> is not defined at 0.
For <math>k \ge 4</math>, we have:
<math>f^{(k)}(x) = \left\lbrace\begin{array}{rl} 0, & x < 0 \\ 0, & x > 0 \\\end{array} \right.</math>
But <math>f^{(k)}(0)</math> does not exist.
==Caveat==
In situations where the definitions given on one side of a point ''do not'' extend naturally to the point, we ''cannot'' use the above methods. In most such cases, we need to go back to the original definition of the derivative as a limit of a difference quotient.

Latest revision as of 20:49, 20 September 2021

This article is about a differentiation rule, i.e., a rule for differentiating a function expressed in terms of other functions whose derivatives are known.
View other differentiation rules

Statement

Everywhere version

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

f(x):={f1(x),x<cf2(x),c<xv,x=c

Then, we have the following for continuity:

  • The left hand limit of f at c equals f1(c).
  • The right hand limit of f at c equals f2(c).
  • f is left continuous at c iff v=f1(c).
  • f is right continuous at c iff v=f2(c).
  • f is continuous at c iff f1(c)=f2(c)=v.

We have the following for differentiability:

  • f is left differentiable at c iff v=f1(c), and in this case, the left hand derivative equals f1(c).
  • f is right differentiable at c iff v=f2(c), and in this case, the right hand derivative equals f2(c).
  • f is differentiable at c iff (v=f1(c)=f2(c) and f1(c)=f2(c)), and in this case, the derivative equals the equal values f1(c) and f2(c).

Piecewise definition of derivative

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

f(x):={f1'(x),x<cf2'(x),x>c

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

f(x):={f1'(x),x<cf2'(x),x>cu,x=c

where u=f1(c)=f2(c). In particular, the value at c can be included in either the left side or the right side definition.

Version for higher derivatives

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

f(x):={f1(x),x<cf2(x),x>cv,x=c

Then, f is k times differentiable at c if we have all these conditions: f1(c)=f2(c)=v, f1(c)=f2(c), , f1(k)(c)=f2(k)(c). In other words, the values should match, and the values of each of the derivatives up to the kth derivative should match. In that case, the kth derivative of f at c equals the equal values f1(k)(c)=f2(k)(c).

The general piecewise definition of f(k) is, in this case:

f(k)(x):={f1(k)(x),x<cf2(k)(x),x>cuk,x=c

where uk=f1(k)(c)=f2(k)(c).

Local generalization

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

Examples

Example of piecewise rational function

This example is covered in the video embedded above.

Consider the function:

f(x):={1x1,x<0,x>01,x=0

Note that here, in the notation we have used, we have:

f1(x)=1x1,f2(x)=1x+1,c=0,v=1

Note that the function f1 is defined around zero, i.e., the definition extends to the point zero and the immediate right -- in fact, f1 is defined and infinitely differentiable on the interval (,1).

Similarly, f2 is defined around zero, i.e., i.e., the definition extends to the immediate left of zero -- in fact, f2 is defined and infinitely differentiable on the interval (1,).

Thus, we see that:

  • f1(0)=1/(01)=1, f2(0)=1/(0+1)=1, and f(0)=v=1. Thus, we see that f1(0)=f2(0)=v=1, so the function f is continuous at 0.
  • We have f1(x)=1/(x1)2 and f2(x)=1/(x+1)2. We see that f1(0)=1/(01)2=1 and f2(0)=1/(0+1)2=1. We see that f1(0)f2(0), so f is not differentiable at 0.

This means that the first and higher derivatives of f do not exist at 0.

Example of piecewise polynomial function

This example is covered in the video embedded above.

Consider the function:

f(x):={x2,x<0x3+x,x>00,x=0

Here:

f1(x):=x2,f2(x):=x3+x,c=0,v=0

We see that:

  • f1(0)=02=0, f2(0)=03+0=0, and v=0. Thus, f1(0)=f2(0)=v, so f is continuous at 0.
  • f1(x)=2x and f2(x)=3x2+1. Evaluated at 0, we get f1(0)=0 and f2(0)=1, so f1(0)f2(0). So, f is not differentiable at 0.

Example of piecewise polynomial function: higher derivatives

This example is covered in the video embedded above.

Consider the function:

f(x):={x2,x<0x3+x2,x>00,x=0

Here, c=0,v=0,f1(x)=x2,f2(x)=x3+x2. To keep track of what we're doing, we make a table:

Expression for f1 Value for f1 at 0 Expression for f2 Value for f2 at 0 Conclusion Explanation
Function f1(x)=x2 f1(0)=02=0 f2(x)=x3+x2 f2(0)=03+02=0 f is continuous at 0 We are also given that the function value at 0 is 0. Thus, f1(0)=f2(0)=v=0. So, f is continuous at 0.
First derivative f1(x)=2x f1(0)=2(0)=0 f2(x)=3x2+2x f2(0)=3(0)2+2(0)=0 f is differentiable at 0, and f(0)=0 We already checked continuity, and we have now checked that f1(0)=f2(0).
Second derivative f1(x)=2 f1(0)=2 f2(x)=6x+2 f2(0)=6(0)+2=2 f is twice differentiable at 0, and f(0)=2 We already checked differentiability. Thus, it suffices to check that f1(0)=f2(0), which is true since both equal 2.
Third derivative f1(x)=0 f1(0)=0 f2(x)=6 f2(0)=6 f is not thrice differentiable at 0 We have f1(0)=0f2(0)=6.

Note that no higher derivative of f exists at zero. For instance, we do have that f1(4)(0)=0=f2(4)(0), but f(4)(0) does not exist.

Here are the explicit piecewise definitions for the derivatives of f:

f(x)={2x,x<03x2+2x,x>00,x=0

f(x)={2,x<06x+2,x>02,x=0

f(x)={0,x<06,x>0

Note that f is not defined at 0.

For k4, we have:

f(k)(x)={0,x<00,x>0

But f(k)(0) does not exist.

Caveat

In situations where the definitions given on one side of a point do not extend naturally to the point, we cannot use the above methods. In most such cases, we need to go back to the original definition of the derivative as a limit of a difference quotient.