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 need a function that does the following:

  • x can not be greater than 1
  • y can not be greater then 2
  • As x approaches the value 0, then y approaches, but does not reach the value 2.
  • As y approaches the 0, then x appproaches, but does not reach the value 1.

The graph of the function should look something like the following image, except for the part where the x value exceeds the value of 1. I need x to only approach the value of 1.

This is kinda what I'm looking for

share|cite|improve this question
Does the function have to qualify as a nonlinear function also, or will a linear function do? There exist an uncountable infinity of nonlinear functions which satisfy your conditions. – Doug Spoonwood Sep 14 '11 at 17:43
"As x approaches the value 0, then y approaches, but does not reach the value 2." This is ambiguous. What about $y=2*(x-1)^2$? When $x$ "approaches" (but does not reach) 0, $y$ approaches (but does not reach) 1. Or perhaps you meant "when $x$ tends to 0, $y$ tends to some $y_0<1$ – leonbloy Sep 14 '11 at 19:00

Why do you tag this conic sections? Does $y=2(1-x^p)$ , where $0 \lt p \lt 1$ and the smaller $p$ gets, the closer the bend is to the origin meet your needs? As Arturo Magidin suggests, you should state $x \in (0,1)$

Added: if you really want a conic section, you could use $y=\frac{2}{1-x}$ restricted to $(0,1).$ If that doesn't go deep enough into the corner, $y=\frac{2}{(1-x)^p}$, again with $0 \lt p \lt 1,$ is available, but is no longer a conic section.

share|cite|improve this answer
Of course, you want to restrict the domain explicitly; or throw in some "dummy factor" that makes the function undefined for $x\geq 1$ and for $x\leq 0$; perhaps $\frac{\sqrt{x(1-x)}}{\sqrt{x(1-x)}}$? – Arturo Magidin Sep 14 '11 at 17:29
@Arturo: that factor cancels very nicely, no? Probably you intended something like $\sqrt{\mathrm{sign}(x(1-x))}$... – J. M. Sep 14 '11 at 17:32
@J. M., if you pretend you don't know about imaginary numbers, then Arturo's factor cannot cancel outside $[0,1]$, because neither numerator nor denominator even exist. – Henning Makholm Sep 14 '11 at 17:46
@Henning: True, but if this one's going to be for programming purposes, I've seen compilers aggressively optimize out anything of the form x-x and x/x in expressions... – J. M. Sep 14 '11 at 17:53
which is why one should always turn on the "strict floating-point" option in one's compiler. – Henning Makholm Sep 14 '11 at 18:00

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.