# Looking for a function $f$ that is $n$-differentiable, but $f^{(n)}$ is not continuous

I am looking for a real valued function of real variable that is $n$-differentiable, but whose $n$th derivative is not continuous.

This is my function: $f_n(x) = x^{n+1} \cdot \sin{\frac{1}{x}}$, if $x \neq 0$ and 0, if $x=0$. $n\in \{0,1,2,\ldots\}$ For example, if $n=0$, $f_0$ it's continuous and non diferentiable in $0$.

-

– user17762 Aug 18 '11 at 15:40
@Sivaram: According to his title, Mario is looking for a function that is $n$ times differentiable but has a discontinuous $n$-th derivative. His example, however, suggests that he’s actually looking (for each $n$) for functions that are $C^n$ but not $C^{n-1}$. – Brian M. Scott Aug 18 '11 at 16:04
@Brian M. Scott read my mind. – Mario De León Urbina Aug 18 '11 at 16:06
@Mario: Your post should be self contained. You cannot have part of the question in your title and expect people to understand what is in your mind and answer. – user17762 Aug 18 '11 at 16:10
@Sivaram: You have reason. The next time i'm going to write the question in the title. – Mario De León Urbina Aug 18 '11 at 16:17
show 1 more comment

## 4 Answers

Let $n$ be a positive integer and let

$$f(x) = x^{2n} \cdot \sin\left(\frac{1}{x}\right)$$ $$f(0) = 0$$

Then mathematical induction can be used to prove: (a) The $n$th derivative of $f(x)$ exists for each value of $x$. (b) The $n$th derivative $f(x)$ is not continuous at $x = 0$.

Let $n$ be a positive integer and let

$$g(x) = x^{2n+1} \cdot \sin\left(\frac{1}{x}\right)$$ $$g(0) = 0$$

Then mathematical induction can be used to prove: (a) The $n$th derivative of $g(x)$ is continuous at each value of $x$. (b) The $(n+1)$st derivative of $g(x)$ does not exist at $x = 0$.

More generally, let $a$, $b$ be positive real numbers, let $n$ be a positive integer, and define $h(x)$ by:

$$h(x) = x^a \cdot \sin\left(\frac{1}{x^b}\right)$$ $$h(0) = 0$$

1. The $n$th derivative of $h(x)$ exists for all values of $x$ if and only if $a > n + (n-1)b$.

2. The $n$th derivative of $h(x)$ is bounded on every bounded interval if and only if $a \geq n + nb$.

3. The $n$th derivative of $h(x)$ is continuous at each point if and only if $a > n + nb$.

To prove these statements, you can use mathematical induction to prove that the $n$th derivative of $h(x)$ has the form

$$P_{n}(x) \cdot \cos\left(\frac{1}{x^b}\right) + Q_{n}(x) \cdot \sin\left(\frac{1}{x^b}\right),$$

where $P_n$ and $Q_n$ are polynomials such that at least one of them has a lowest degree term that is a NONZERO multiple of $x^{a-n-nb}$ and neither has a lower degree term. [The added emphasis on nonzero is because this becomes vital for the "only if" halves of the statements above.] To prove the "if" halves, you may want to incorporate into the induction statement the fact that the $n$th derivative at $x = 0$ is zero.

-

Once you do it for the first derivative, indefinitely integrate $n-1$ times. Your original function is continuous (since differentiable), so it is integrable.

-

My question is: $f$ satisfies that $f^{(n)}$ exists and the last it's non continuos in all $\mathbb{R}$? – Mario De León Urbina Aug 18 '11 at 16:03
Once you find an example that does this for $n=1$, get the larger values of $n$ as I said. – GEdgar Aug 19 '11 at 2:18

I think you want $f_n(x) = x^{2n} \sin(1/x)$.

-

Your function works for $n=1$ but not for $n=2$.

For $n=1$, the function is everywhere differentiable, and it holds $f'_1(x) = 2x \sin(1/x) - \cos(1/x)$ for $x \neq 0$, and $f'_1 (0) = 0$; hence $f'_1$ is not continuous at $0$.

For $n=2$, on the other hand, the function is everywhere differentiable but not twice differentiable on $\mathbb{R}$. Indeed, $f'_2$ is given by $$f'_2 (x) = 3x^2 \sin (1/x) - x\cos (1/x),\;\; x \neq 0,$$ and $$f'_2 (0) = 0.$$ However, for $h \neq 0$, $$\frac{{f'_2 (h) - f'_2 (0)}}{{h - 0}} = \frac{{3h^2 \sin (1/h) - h\cos (1/h)}}{h} = 3h\sin (1/h) - \cos (1/h).$$ So, letting $h \to 0$, this shows that $f'_2$ is not differentiable at $0$. Hence $f_2$ is not twice differentiable.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 75, "mathjax_display_tex": 10, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9288505911827087, "perplexity_flag": "head"}