add freeze

This commit is contained in:
jverzani committed 2022-08-26 14:45:24 -04:00
1 parent 3862d89a69
commit 954f9a96d5
675 files changed
+572480 -2

No files matched your search

@@ -0,0 +1,15 @@
{
"hash": "c64bc216d5098d5e1a6dce94ce1bd1ac",
"result": {
"markdown": "# The mean value theorem for differentiable functions.\n\n\n\nThis section uses these add-on packages:\n\n``` {.julia .cell-code}\nusing CalculusWithJulia\nusing Plots\nusing Roots\n```\n\n\n\n\n---\n\n\nA function is *continuous* at $c$ if $f(c+h) - f(c) \\rightarrow 0$ as $h$ goes to $0$. We can write that as $f(c+h) - f(x) = \\epsilon_h$, with $\\epsilon_h$ denoting a function going to $0$ as $h \\rightarrow 0$. With this notion, differentiability could be written as $f(c+h) - f(c) - f'(c)h = \\epsilon_h \\cdot h$. This is clearly a more demanding requirement that mere continuity at $c$.\n\n\nWe defined a function to be *continuous* on an interval $I=(a,b)$ if it was continuous at each point $c$ in $I$. Similarly, we define a function to be *differentiable* on the interval $I$ it it is differentiable at each point $c$ in $I$.\n\n\nThis section looks at properties of differentiable functions. As there is a more stringent definition, perhaps more properties are a consequence of the definition.\n\n\n## Differentiable is more restrictive than continuous.\n\n\nLet $f$ be a differentiable function on $I=(a,b)$. We see that $f(c+h) - f(c) = f'(c)h + \\epsilon_h\\cdot h = h(f'(c) + \\epsilon_h)$. The right hand side will clearly go to $0$ as $h\\rightarrow 0$, so $f$ will be continuous. In short:\n\n\n> A differentiable function on $I=(a,b)$ is continuous on $I$.\n\n\n\nIs it possible that all continuous functions are differentiable?\n\n\nThe fact that the derivative is related to the tangent line's slope might give an indication that this won't be the case - we just need a function which is continuous but has a point with no tangent line. The usual suspect is $f(x) = \\lvert x\\rvert$ at $0$.\n\n::: {.cell hold='true' execution_count=4}\n``` {.julia .cell-code}\nf(x) = abs(x)\nplot(f, -1,1)\n```\n\n::: {.cell-output .cell-output-display execution_count=5}\n![](mean_value_theorem_files/figure-html/cell-5-output-1.svg){}\n:::\n:::\n\n\nWe can see formally that the secant line expression will not have a limit when $c=0$ (the left limit is $-1$, the right limit $1$). But more insight is gained by looking a the shape of the graph. At the origin, the graph always is vee-shaped. There is no linear function that approximates this function well. The function is just not smooth enough, as it has a kink.\n\n\nThere are other functions that have kinks. These are often associated with powers. For example, at $x=0$ this function will not have a derivative:\n\n::: {.cell hold='true' execution_count=5}\n``` {.julia .cell-code}\nf(x) = (x^2)^(1/3)\nplot(f, -1, 1)\n```\n\n::: {.cell-output .cell-output-display execution_count=6}\n![](mean_value_theorem_files/figure-html/cell-6-output-1.svg){}\n:::\n:::\n\n\nOther functions have tangent lines that become vertical. The natural slope would be $\\infty$, but this isn't a limiting answer (except in the extended sense we don't apply to the definition of derivatives). A candidate for this case is the cube root function:\n\n::: {.cell execution_count=6}\n``` {.julia .cell-code}\nplot(cbrt, -1, 1)\n```\n\n::: {.cell-output .cell-output-display execution_count=7}\n![](mean_value_theorem_files/figure-html/cell-7-output-1.svg){}\n:::\n:::\n\n\nThe derivative at $0$ would need to be $+\\infty$ to match the graph. This is implied by the formula for the derivative from the power rule: $f'(x) = 1/3 \\cdot x^{-2/3}$, which has a vertical asymptote at $x=0$.\n\n\n:::{.callout-note}\n## Note\nThe `cbrt` function is used above, instead of `f(x) = x^(1/3)`, as the latter is not defined for negative `x`. Though it can be for the exact power `1/3`, it can't be for an exact power like `1/2`. This means the value of the argument is important in determining the type of the output - and not just the type of the argument. Having type-stable functions is part of the magic to making `Julia` run fast, so `x^c` is not defined for negative `x` and most floating point exponents.\n\n:::\n\nLest you think that continuous functions always have derivatives except perhaps at exceptional points, this isn't the case. The functions used to [model](http://tinyurl.com/cpdpheb) the stock market are continuous but have no points where they are differentiable.\n\n\n## Derivatives and maxima.\n\n\nWe have defined an *absolute maximum* of $f(x)$ over an interval to be a value $f(c)$ for a point $c$ in the interval that is as large as any other value in the interval. Just specifying a function and an interval does not guarantee an absolute maximum, but specifying a *continuous* function and a *closed* interval does, by the extreme value theorem.\n\n\n> *A relative maximum*: We say $f(x)$ has a *relative maximum* at $c$ if there exists *some* interval $I=(a,b)$ with $a < c < b$ for which $f(c)$ is an absolute maximum for $f$ and $I$.\n\n\n\nThe difference is a bit subtle, for an absolute maximum the interval must also be specified, for a relative maximum there just needs to exist some interval, possibly reallLine truncated
"supporting": [
"mean_value_theorem_files"
],
"filters": [],
"includes": {
"include-in-header": [
"<script src=\"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\" integrity=\"sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js\" integrity=\"sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==\" crossorigin=\"anonymous\"></script>\n<script type=\"application/javascript\">define('jquery', [],function() {return window.jQuery;})</script>\n"
]
}
}
}