Is $f$ differentiable at $0$, where $f(x) = x$ if $x$ is rational and $f(x) = 0$ otherwise?











up vote
4
down vote

favorite
1












This is the function:
$$f(x)=begin{cases}x& text{if $x$ is rational}\0 &text{if $x$ is irrational}end{cases}$$



My attempt:



It's easy to verify that $f$ is continuous at $x=0$ using the sequential definition of continuity. I claim that $f$ is not differentiable at $x=0$. Assume the contrary and let $f'(0)=L$. Now, we pick an $varepsilon$ such that $0<varepsilon < |L|$. For this choice of $varepsilon$ there is a $delta >0$ such that if $0<|x-0|<delta$ then we have $left| frac{f(x)-f(0)}{x-0} -Lright| < varepsilon $. Now, pick $x' in mathbb{R}setminusmathbb{Q}$ with $0<|x'| <delta$. Then we have $left| frac{f(x')-f(0)}{x'-0} -Lright| = |L| > varepsilon$. A contradiction!



Is this proof correct?










share|cite|improve this question




















  • 2




    The proof looks correct to me.
    – b00n heT
    Sep 30 at 7:17












  • en.wikipedia.org/wiki/Nowhere_continuous_function
    – georg
    Sep 30 at 7:27










  • @b00nheT. The $<$ in the last line should have been $>$ (a typo) so I fixed it. But the flaw is assuming $Lne 0$. The proposer has only shown that if $f'(0)=L$ exists then $L=0.$ But $f'(0$) does not exist
    – DanielWainfleet
    Nov 17 at 7:05










  • @DanielWainfleet You are indeed correct, thanks for pointing it out. My bad for missing it! I've added the correction in my answer
    – b00n heT
    Nov 17 at 8:16















up vote
4
down vote

favorite
1












This is the function:
$$f(x)=begin{cases}x& text{if $x$ is rational}\0 &text{if $x$ is irrational}end{cases}$$



My attempt:



It's easy to verify that $f$ is continuous at $x=0$ using the sequential definition of continuity. I claim that $f$ is not differentiable at $x=0$. Assume the contrary and let $f'(0)=L$. Now, we pick an $varepsilon$ such that $0<varepsilon < |L|$. For this choice of $varepsilon$ there is a $delta >0$ such that if $0<|x-0|<delta$ then we have $left| frac{f(x)-f(0)}{x-0} -Lright| < varepsilon $. Now, pick $x' in mathbb{R}setminusmathbb{Q}$ with $0<|x'| <delta$. Then we have $left| frac{f(x')-f(0)}{x'-0} -Lright| = |L| > varepsilon$. A contradiction!



Is this proof correct?










share|cite|improve this question




















  • 2




    The proof looks correct to me.
    – b00n heT
    Sep 30 at 7:17












  • en.wikipedia.org/wiki/Nowhere_continuous_function
    – georg
    Sep 30 at 7:27










  • @b00nheT. The $<$ in the last line should have been $>$ (a typo) so I fixed it. But the flaw is assuming $Lne 0$. The proposer has only shown that if $f'(0)=L$ exists then $L=0.$ But $f'(0$) does not exist
    – DanielWainfleet
    Nov 17 at 7:05










  • @DanielWainfleet You are indeed correct, thanks for pointing it out. My bad for missing it! I've added the correction in my answer
    – b00n heT
    Nov 17 at 8:16













up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





This is the function:
$$f(x)=begin{cases}x& text{if $x$ is rational}\0 &text{if $x$ is irrational}end{cases}$$



My attempt:



It's easy to verify that $f$ is continuous at $x=0$ using the sequential definition of continuity. I claim that $f$ is not differentiable at $x=0$. Assume the contrary and let $f'(0)=L$. Now, we pick an $varepsilon$ such that $0<varepsilon < |L|$. For this choice of $varepsilon$ there is a $delta >0$ such that if $0<|x-0|<delta$ then we have $left| frac{f(x)-f(0)}{x-0} -Lright| < varepsilon $. Now, pick $x' in mathbb{R}setminusmathbb{Q}$ with $0<|x'| <delta$. Then we have $left| frac{f(x')-f(0)}{x'-0} -Lright| = |L| > varepsilon$. A contradiction!



Is this proof correct?










share|cite|improve this question















This is the function:
$$f(x)=begin{cases}x& text{if $x$ is rational}\0 &text{if $x$ is irrational}end{cases}$$



My attempt:



It's easy to verify that $f$ is continuous at $x=0$ using the sequential definition of continuity. I claim that $f$ is not differentiable at $x=0$. Assume the contrary and let $f'(0)=L$. Now, we pick an $varepsilon$ such that $0<varepsilon < |L|$. For this choice of $varepsilon$ there is a $delta >0$ such that if $0<|x-0|<delta$ then we have $left| frac{f(x)-f(0)}{x-0} -Lright| < varepsilon $. Now, pick $x' in mathbb{R}setminusmathbb{Q}$ with $0<|x'| <delta$. Then we have $left| frac{f(x')-f(0)}{x'-0} -Lright| = |L| > varepsilon$. A contradiction!



Is this proof correct?







real-analysis derivatives






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 17 at 6:59









DanielWainfleet

33.5k31647




33.5k31647










asked Sep 30 at 7:14









Ashish K

775513




775513








  • 2




    The proof looks correct to me.
    – b00n heT
    Sep 30 at 7:17












  • en.wikipedia.org/wiki/Nowhere_continuous_function
    – georg
    Sep 30 at 7:27










  • @b00nheT. The $<$ in the last line should have been $>$ (a typo) so I fixed it. But the flaw is assuming $Lne 0$. The proposer has only shown that if $f'(0)=L$ exists then $L=0.$ But $f'(0$) does not exist
    – DanielWainfleet
    Nov 17 at 7:05










  • @DanielWainfleet You are indeed correct, thanks for pointing it out. My bad for missing it! I've added the correction in my answer
    – b00n heT
    Nov 17 at 8:16














  • 2




    The proof looks correct to me.
    – b00n heT
    Sep 30 at 7:17












  • en.wikipedia.org/wiki/Nowhere_continuous_function
    – georg
    Sep 30 at 7:27










  • @b00nheT. The $<$ in the last line should have been $>$ (a typo) so I fixed it. But the flaw is assuming $Lne 0$. The proposer has only shown that if $f'(0)=L$ exists then $L=0.$ But $f'(0$) does not exist
    – DanielWainfleet
    Nov 17 at 7:05










  • @DanielWainfleet You are indeed correct, thanks for pointing it out. My bad for missing it! I've added the correction in my answer
    – b00n heT
    Nov 17 at 8:16








2




2




The proof looks correct to me.
– b00n heT
Sep 30 at 7:17






The proof looks correct to me.
– b00n heT
Sep 30 at 7:17














en.wikipedia.org/wiki/Nowhere_continuous_function
– georg
Sep 30 at 7:27




en.wikipedia.org/wiki/Nowhere_continuous_function
– georg
Sep 30 at 7:27












@b00nheT. The $<$ in the last line should have been $>$ (a typo) so I fixed it. But the flaw is assuming $Lne 0$. The proposer has only shown that if $f'(0)=L$ exists then $L=0.$ But $f'(0$) does not exist
– DanielWainfleet
Nov 17 at 7:05




@b00nheT. The $<$ in the last line should have been $>$ (a typo) so I fixed it. But the flaw is assuming $Lne 0$. The proposer has only shown that if $f'(0)=L$ exists then $L=0.$ But $f'(0$) does not exist
– DanielWainfleet
Nov 17 at 7:05












@DanielWainfleet You are indeed correct, thanks for pointing it out. My bad for missing it! I've added the correction in my answer
– b00n heT
Nov 17 at 8:16




@DanielWainfleet You are indeed correct, thanks for pointing it out. My bad for missing it! I've added the correction in my answer
– b00n heT
Nov 17 at 8:16










1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










EDIT: As @DanielWainfleet pointed out in the comments, your proof does not apply in the case $L=0$. The proof basically goes exactly like the one you have written: first you choose an $0<varepsilon<1$ small enough, then you take $delta$ as you please and look at the difference quotient for any $|x|<delta$. If $f$ was differentiable, then it should hold that
$$left|frac{f(x)-f(0)}{x-0}right|<varepsilon$$
but by density of the irrationals, you can find an irrational $x$ such that $|x|<delta$ and for that one
$$left|frac{f(x)-f(0)}{x-0}right|=left|frac{x-0}{x-0}right|=1>varepsilon$$
contradicting the assumption.





Another working approach is showing that approaching $0$ via irrationals and via rationals leads to different difference quotients:



Indeed :




  • choose a sequence of irrational numbers ($a_n=sqrt{2}/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=0$ for all $n$

  • choose a sequence of rational numbers ($a_n=1/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=1$ for all $n$






share|cite|improve this answer























  • The flaw in the proposer's proof is assuming that if $L$ exists then $Lne 0.$ If $L=0$ then we cannot take any $epsilon$ such that $0<epsilon <|L|.$
    – DanielWainfleet
    Nov 17 at 7:07










  • @DanielWainfleet You are indeed correct. My bad for missing it! I'll add the correction in my answer
    – b00n heT
    Nov 17 at 8:08










  • Much of performance-magic depends on how easily we make or overlook unwarranted assumptions.
    – DanielWainfleet
    Nov 17 at 11:34











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2936349%2fis-f-differentiable-at-0-where-fx-x-if-x-is-rational-and-fx-0%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote



accepted










EDIT: As @DanielWainfleet pointed out in the comments, your proof does not apply in the case $L=0$. The proof basically goes exactly like the one you have written: first you choose an $0<varepsilon<1$ small enough, then you take $delta$ as you please and look at the difference quotient for any $|x|<delta$. If $f$ was differentiable, then it should hold that
$$left|frac{f(x)-f(0)}{x-0}right|<varepsilon$$
but by density of the irrationals, you can find an irrational $x$ such that $|x|<delta$ and for that one
$$left|frac{f(x)-f(0)}{x-0}right|=left|frac{x-0}{x-0}right|=1>varepsilon$$
contradicting the assumption.





Another working approach is showing that approaching $0$ via irrationals and via rationals leads to different difference quotients:



Indeed :




  • choose a sequence of irrational numbers ($a_n=sqrt{2}/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=0$ for all $n$

  • choose a sequence of rational numbers ($a_n=1/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=1$ for all $n$






share|cite|improve this answer























  • The flaw in the proposer's proof is assuming that if $L$ exists then $Lne 0.$ If $L=0$ then we cannot take any $epsilon$ such that $0<epsilon <|L|.$
    – DanielWainfleet
    Nov 17 at 7:07










  • @DanielWainfleet You are indeed correct. My bad for missing it! I'll add the correction in my answer
    – b00n heT
    Nov 17 at 8:08










  • Much of performance-magic depends on how easily we make or overlook unwarranted assumptions.
    – DanielWainfleet
    Nov 17 at 11:34















up vote
4
down vote



accepted










EDIT: As @DanielWainfleet pointed out in the comments, your proof does not apply in the case $L=0$. The proof basically goes exactly like the one you have written: first you choose an $0<varepsilon<1$ small enough, then you take $delta$ as you please and look at the difference quotient for any $|x|<delta$. If $f$ was differentiable, then it should hold that
$$left|frac{f(x)-f(0)}{x-0}right|<varepsilon$$
but by density of the irrationals, you can find an irrational $x$ such that $|x|<delta$ and for that one
$$left|frac{f(x)-f(0)}{x-0}right|=left|frac{x-0}{x-0}right|=1>varepsilon$$
contradicting the assumption.





Another working approach is showing that approaching $0$ via irrationals and via rationals leads to different difference quotients:



Indeed :




  • choose a sequence of irrational numbers ($a_n=sqrt{2}/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=0$ for all $n$

  • choose a sequence of rational numbers ($a_n=1/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=1$ for all $n$






share|cite|improve this answer























  • The flaw in the proposer's proof is assuming that if $L$ exists then $Lne 0.$ If $L=0$ then we cannot take any $epsilon$ such that $0<epsilon <|L|.$
    – DanielWainfleet
    Nov 17 at 7:07










  • @DanielWainfleet You are indeed correct. My bad for missing it! I'll add the correction in my answer
    – b00n heT
    Nov 17 at 8:08










  • Much of performance-magic depends on how easily we make or overlook unwarranted assumptions.
    – DanielWainfleet
    Nov 17 at 11:34













up vote
4
down vote



accepted







up vote
4
down vote



accepted






EDIT: As @DanielWainfleet pointed out in the comments, your proof does not apply in the case $L=0$. The proof basically goes exactly like the one you have written: first you choose an $0<varepsilon<1$ small enough, then you take $delta$ as you please and look at the difference quotient for any $|x|<delta$. If $f$ was differentiable, then it should hold that
$$left|frac{f(x)-f(0)}{x-0}right|<varepsilon$$
but by density of the irrationals, you can find an irrational $x$ such that $|x|<delta$ and for that one
$$left|frac{f(x)-f(0)}{x-0}right|=left|frac{x-0}{x-0}right|=1>varepsilon$$
contradicting the assumption.





Another working approach is showing that approaching $0$ via irrationals and via rationals leads to different difference quotients:



Indeed :




  • choose a sequence of irrational numbers ($a_n=sqrt{2}/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=0$ for all $n$

  • choose a sequence of rational numbers ($a_n=1/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=1$ for all $n$






share|cite|improve this answer














EDIT: As @DanielWainfleet pointed out in the comments, your proof does not apply in the case $L=0$. The proof basically goes exactly like the one you have written: first you choose an $0<varepsilon<1$ small enough, then you take $delta$ as you please and look at the difference quotient for any $|x|<delta$. If $f$ was differentiable, then it should hold that
$$left|frac{f(x)-f(0)}{x-0}right|<varepsilon$$
but by density of the irrationals, you can find an irrational $x$ such that $|x|<delta$ and for that one
$$left|frac{f(x)-f(0)}{x-0}right|=left|frac{x-0}{x-0}right|=1>varepsilon$$
contradicting the assumption.





Another working approach is showing that approaching $0$ via irrationals and via rationals leads to different difference quotients:



Indeed :




  • choose a sequence of irrational numbers ($a_n=sqrt{2}/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=0$ for all $n$

  • choose a sequence of rational numbers ($a_n=1/n$) tending to zero. Then $frac{f(a_n)-0}{a_n-0}=1$ for all $n$







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Nov 17 at 8:15

























answered Sep 30 at 7:20









b00n heT

10.2k12134




10.2k12134












  • The flaw in the proposer's proof is assuming that if $L$ exists then $Lne 0.$ If $L=0$ then we cannot take any $epsilon$ such that $0<epsilon <|L|.$
    – DanielWainfleet
    Nov 17 at 7:07










  • @DanielWainfleet You are indeed correct. My bad for missing it! I'll add the correction in my answer
    – b00n heT
    Nov 17 at 8:08










  • Much of performance-magic depends on how easily we make or overlook unwarranted assumptions.
    – DanielWainfleet
    Nov 17 at 11:34


















  • The flaw in the proposer's proof is assuming that if $L$ exists then $Lne 0.$ If $L=0$ then we cannot take any $epsilon$ such that $0<epsilon <|L|.$
    – DanielWainfleet
    Nov 17 at 7:07










  • @DanielWainfleet You are indeed correct. My bad for missing it! I'll add the correction in my answer
    – b00n heT
    Nov 17 at 8:08










  • Much of performance-magic depends on how easily we make or overlook unwarranted assumptions.
    – DanielWainfleet
    Nov 17 at 11:34
















The flaw in the proposer's proof is assuming that if $L$ exists then $Lne 0.$ If $L=0$ then we cannot take any $epsilon$ such that $0<epsilon <|L|.$
– DanielWainfleet
Nov 17 at 7:07




The flaw in the proposer's proof is assuming that if $L$ exists then $Lne 0.$ If $L=0$ then we cannot take any $epsilon$ such that $0<epsilon <|L|.$
– DanielWainfleet
Nov 17 at 7:07












@DanielWainfleet You are indeed correct. My bad for missing it! I'll add the correction in my answer
– b00n heT
Nov 17 at 8:08




@DanielWainfleet You are indeed correct. My bad for missing it! I'll add the correction in my answer
– b00n heT
Nov 17 at 8:08












Much of performance-magic depends on how easily we make or overlook unwarranted assumptions.
– DanielWainfleet
Nov 17 at 11:34




Much of performance-magic depends on how easily we make or overlook unwarranted assumptions.
– DanielWainfleet
Nov 17 at 11:34


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2936349%2fis-f-differentiable-at-0-where-fx-x-if-x-is-rational-and-fx-0%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

QoS: MAC-Priority for clients behind a repeater

Ивакино (Тотемский район)

Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)