Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to find a formula which creates the following graph:

enter image description here

Assuming the vertical line is y and horizontal is x, I'd like an asymptote at y = 1, at x = 0 the graph should also be '0'.

Any ideas?

share|cite|improve this question
start with the inverse tangent function, translated it up and pinch it as needed. – futurebird Nov 17 '12 at 5:35
Try Lagrange interpolation. – glebovg Nov 17 '12 at 5:36
up vote 3 down vote accepted

This looks very much like the $arctan(x)$ function.

So basically, we want a function that looks like

$ f(x) = A \cdot arctan(B(x-C))-D$, where $A, B, C, D$ are all constants.

Intuitively, $A$ will make the limit at infinity whatever we want. $B$ changes how steep the slope is. $C$ moves the slope around. $D$ changes the "$y$-position" of the graph (which matters if we want $f(0)=0$).

So we have two conditions to work with, one is that $f(0)=0$, the other being $\lim_{x\rightarrow \infty}f(x)=1$

This helps us to eliminate a couple of constants. I also infer from your picture you want the rising part to be "around $.5$", allowing me to remove one more constant. So you get the following:

$f(x) = \frac{2}{\pi-2\cdot arctan(\frac{-B}{2})} \cdot (arctan(B(x-\frac{1}{2}))-arctan(\frac{-B}{2})) $

So, for example, here is a plot of the function with $B = 20$:

Looks a lot like your graph

share|cite|improve this answer

Whenever you see something that rises from a flatline, as your graph does around $x=0$, you should summon $y=e^{-1/x^2}$ (defined to have $y=0$ when $x=0$). It is the ubiquitous example of a smooth, non-analytic function that manages to morph from all-derivatives-are-0 state to monotonically increasing.

In your case, luckily, the function as is indeed has $y=1$ as an asymptote so it's precisely what you're looking for. If you care about the values to the left of $x=0$ you can modify the function by decreeing it to be 0 when $x<0$. Miraculously, it is still perfectly smooth.

This image is of the full, unmodified function:

Graph of $e^{-1/x^2}$ via Google Search.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.