This is my first question on this community. I am a applied scientist, not a mathematician. 


I have the following simplified problem:


Let $u: [0,1] \rightarrow \mathbb{R}\_+$ a real valued function and $k\in \mathbb{R}$.
The function $u(\cdot)$ is decreasing and may be continuous or not.
Let $x^\*(k)$ the value that satisfies $$ u\left(x^\*(k)\right) = k. $$


I need to get the numerical value $x^\*(k)$ for any arbitrary $u(\cdot)$, using a computational `Rscript`. 


Intuitively, I have decided to follow this procedure: 
I define a deviation $e(x) = k - u(x)$. Valued at $x^\*(k)$, $e\left(x^\*(k)\right) = 0$. Then, $x^\*(k)$ minimizes the squared deviation or the absolute value deviation.
$$ x^\*(k) = \arg \min\_{x\in [0,1]} e(x)^2. $$


The code is not the problem. I wrote a script that return the graph of function $x^\*(k)$ using any decreasing function $u$, i.e. $u=ae^{-bx}$, $u=a - bx^2$, ..., or other more complicated examples.


Now, I want to known:


1. What is the mathematical/theoretical name of this procedure?
2. In which bibliography can I learn about that?


Thanks.



Need help with computational and numerical methods for solve equations
squaring a function to find its zeroes is generally no good idea; first you can't exploit sign changes of the function values to conclude that a certain intervall must contain a zero (or discontinuity with sign change for left and right limit); another problem is that numeric precision gets worse because the slopes vanish at the zeros of the squared function. 


Worst case scenario is that a sign transition may not result in a zero of the squared function, e.g.
$$
 f(x) =
\begin{cases}
-\sqrt{-(x-0.5)}, & x < 0.5 \\
+\sqrt{+(x-0.5)}+2k, & x \ge 0.5
\end{cases}
 $$
squaring yields
$$
(f(x)-k)^2=abs(x-0.5)+k
$$


the original transition from $0$ to $2k$ doesn't generate a zero and applying a derivative-based method like Newton-Raphson produces a ping pong between $0.5-k$ and $0.5+k$.


The Numerical Recipes book is probably the best resource to recommend to you.


