# Finding a differentiable function

I need to find an infinitely differentiable function from $\mathbb{R}$ to $\mathbb{R}$ which is zero for all negative values and nonzero fo all positive values.

Thank you in advance

-

– Babak S. Oct 31 '12 at 11:21
A standard example is $f(x)=e^{-1/x}$ if $x>0$ and $f(x)=0$ otherwise. – wj32 Oct 31 '12 at 11:22

## 1 Answer

$$f(x)=\left\{\begin{array}{rcl} 0 &\mbox{if} & x\leq 0 \\ \exp\left(-\frac{1}{x^2}\right)&\mbox{if}&x>0\end{array}\right.$$ is a good candidate. For any $n\in\mathbb{N}$ we have: $$\frac{d^n}{dx^n}\exp\left(-1/x^2\right) = p(1/x) \exp\left(-1/x^2\right)$$ where $p$ is a polynomial, so: $$\lim_{x\to 0^+} \frac{d^n}{dx^n}\exp\left(-1/x^2\right) = \lim_{z\to +\infty} p(z)\,e^{-z^2} = 0.$$

-

Is there a way to show that this function is infinitely differentiable ? – user43418 Oct 31 '12 at 11:23
– wj32 Oct 31 '12 at 11:26
{"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": 7, "mathjax_display_tex": 3, "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": 5, "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.8308566212654114, "perplexity_flag": "head"}