Discontinuous derivative: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 25: | Line 25: | ||
var f = board.create('functiongraph', ["x^2*sin(1/x)"], {strokeWidth:2}); | var f = board.create('functiongraph', ["x^2*sin(1/x)"], {strokeWidth:2}); | ||
</jsxgraph> | </jsxgraph> | ||
Here is another example: | |||
:<math> | |||
g: \mathbb{R} \to \mathbb{R}, x \mapsto | |||
\begin{cases} | |||
x^2(1-x)^2\sin(1/(\pi x(1-x)),& 0<x< 1\\ | |||
0,& \mbox{otherwise} | |||
\end{cases}\,. | |||
</math> | |||
<jsxgraph width="500" height="500"> | |||
var board = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-1/2,0.01,1.5,-0.005]}); | |||
//var g = board.create('functiongraph', ["2*sin(1/x) - cos(1/x)"], {strokeColor: 'red'}); | |||
var f = board.create('functiongraph', ["x^2*(1-x)^2*sin(1/(PI* x*(1-x))"], {strokeWidth:2}); | |||
</jsxgraph> | |||
===The underlying JavaScript code=== | ===The underlying JavaScript code=== | ||
First example: | |||
<source lang="javascript"> | <source lang="javascript"> | ||
var board = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-1/2,1/2,1/2,-1/2]}); | var board = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-1/2,1/2,1/2,-1/2]}); |
Revision as of 09:14, 13 February 2019
Consider the function (blue curve)
- [math]\displaystyle{ f: \mathbb{R} \to \mathbb{R}, x \mapsto \begin{cases} x^2\sin(1/x),& x\neq 0\\ 0,& x=0 \end{cases}\,. }[/math]
[math]\displaystyle{ f }[/math] is a continous and differentiable. The derivative of [math]\displaystyle{ f }[/math] is the function (red curve)
- [math]\displaystyle{ f': \mathbb{R} \to \mathbb{R}, x \mapsto \begin{cases} 2\sin(1/x) - \cos(1/x), &x \neq 0\\ 0,& x=0 \end{cases}\,. }[/math]
We observe that [math]\displaystyle{ f'(0) = 0 }[/math], but [math]\displaystyle{ \lim_{x\to0}f'(x) }[/math] does not exist.
Therefore, [math]\displaystyle{ f' }[/math] is an example of a derivative which is not continuous.
Here is another example:
- [math]\displaystyle{ g: \mathbb{R} \to \mathbb{R}, x \mapsto \begin{cases} x^2(1-x)^2\sin(1/(\pi x(1-x)),& 0\lt x\lt 1\\ 0,& \mbox{otherwise} \end{cases}\,. }[/math]
The underlying JavaScript code
First example:
var board = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-1/2,1/2,1/2,-1/2]});
var g = board.create('functiongraph', ["2*sin(1/x) - cos(1/x)"], {strokeColor: 'red'});
var f = board.create('functiongraph', ["x^2*sin(1/x)"], {strokeWidth:2});