I am studying past exam answers for a remote econ math exam, but I don't understand the given solution for this question:
$$ \begin{array}{ll} \text{Maximize}& z(x,y) = y e^{5x} \\ \text{Subject to}& ax + by = 8 \\ \text{Where} & x\geq 0~\text{and}~ y \geq 0 \end{array} $$ The maximum location of this problem is $(x,y) = \left(\frac{1}{5}, 1\right)$. Determine $a$ and $b$.
In the solution they use "first order condition"":
$5y\cdot e^{5x} / e^{5x} = a/b$
$ax + by = 9$
To come to $5y = a/b$
and $ax + by = 8$, see image.
But I don't understand where this "first order condition" comes from and how they come to these conclusions, could somebody explain it to me please? I searched online but can't find anything.