I was checking a list of elementary math problems, and one of them was of the kind "a factory produces products $A$ and $B$, the profit of each product is $P_A$ and $P_B$ (The values were given numbers, but I'm omitting them here to focus on the general idea), product $A$ cost $M_{a1}$ material 1 and $M_{a2}$ material 2, and similar for product 2 and the factory has a limitation of materials 1 and 2 called $R_i$.
Anyway... This can be translating to the linear programming problem
$\max P_ax + P_By$
$s.t M_{a1}x + M_{b1}y \leq R_1,$ $M_{a2}x + M_{b2}y \leq R_2$ $x,y \geq 0$
Now, I know there are a lot of methods for solving this such as simplex, or Lagrangean and all, but I did find this in a list of elementary math problems, so I doubt they'd be needing to use undergraduate maths for solving this.
So... Which is the way one solves this using elementary maths? I thought of drawing the restriction lines and vary the lines $50x+40y=c$ until they touch the tip of the region delimited by the restrictions, in order to find the maximum $c$, but that seems a bit too relying on graph. Is there a more algebraic way of solving this?
Think about the region of feasibility (where your solution can probably sit). The maximum value sits on a vertex - why? Due to the convexity of the function, the value at extremum is higher than any internal point. So the maximum value must lie on the boundary. Now in particular, the vertex refers to the extreme points along the boundary
Hence if you find a vertex with the highest value, it will also be the optimal point
The critical points of this region are at boundaries, and form the vertices of the polygon formed by the intersection of the following lines
$$M_{a1}x + M_{b1}y = R_1$$ $$M_{a2}x + M_{b2}y = R_2$$ $$x = 0$$ $$y = 0$$
The vertices you get are $(0,0), (\min(\frac{R_1}{M_{a1}},\frac{R_2}{M_{a2}}), 0) ,(0, \min(\frac{R_1}{M_{b1}},\frac{R_2}{M_{b2}})), (\frac{R_1M_{b2} - R_2M_{b1}}{M_{a1}M_{b2} - M_{a2}M_{b1}}, \frac{R_1M_{a2} - R_2M_{a1}}{M_{b1}M_{a2} - M_{b2}M_{a1}})$
Now, just check for these points which one maximises your function