# Perfect substitutes and Lagrange

How does one solve utility maximization of perfect substitutes using Lagrangian function?

Consider the problem $$\max_{x,y} ax +by$$

subject to the constraint that

$$px + qy \leq I$$

where $$a,b,p,q,I>0$$.

Note problem statement are subject to the standard implicit assumptions that consumption cannot be negative.

Your Lagrangian would be $$L = (ax+by)+\lambda (I−p_x x−p_y y) +\mu_x(x−0)+\mu_y(y-0),$$ where the final two terms represent the restriction that $$x,y\geq0$$.
You then arrive at conditions $$\frac{\partial L}{\partial x}= a -\lambda p_x +\mu_x=0$$ $$\frac{\partial L}{\partial y}= b -\lambda p_y +\mu_y=0$$ $$I=p_x x+p_y y$$ and complementary slackness conditions $$\mu_x x =0 , \quad \mu_y y =0.$$
You then consider many different cases: $$(\mu_x>0,x=0,\mu_y=0,y>0),(\mu_x=0,x>0,\mu_y=0,y>0), (\mu_x=0,x=0,\mu_y=0,y>0), ....$$ and for each of them you look at your conditions:
Suppose $$(\mu_x>0,x=0,\mu_y=0,y>0)$$. Then, $$a -\lambda p_x +\mu_x=0 \Rightarrow a -\lambda p_x <0$$ $$b -\lambda p_y +\mu_y=b -\lambda p_y=0$$ $$\Rightarrow a -\frac{b}{p_y} p_x <0 \iff \frac{a}{p_x} <\frac{b}{p_y}$$ This condition can be checked as $$a,b,p_x,p_y$$ are given. If it does not hold, $$x=0,y>0$$ cannot be the solution. If it does hold, it means that the utility per dollar is higher for good $$y$$ and all money should be spend on $$y$$ (which $$x=0,y>0$$ and the budget constraint imply).