suppose we have a function f(x)=$\sqrt{\left(\ x\ \right)}\ +\ \left(\frac{C-x}{4}\right)$ and we want to maximize the function when C=<4 and x<C. How do we procede with the problem?
Note that I've never studied optimization, I'm just trying to solve a budget constraint problem in microeconomics.
Calling
$$ f(x,C) = \sqrt{x}+\frac{C-x}{4} $$
In the following plot in blue we have the feasible region $(0 < x < C, C\le 4)$ to the maximization problem, and in black the level curves to the surface $f(x,C)$
As we can easily verify, the maximum is located at $x = C = 4$