Constrained maximization of Leontif utility function $\min(x_1, x_2)$

The maximization problem is:

Maximize $u(x_1, x_2) = \min[a_1x_1, a_2x_2]\; \ \text{s.t.}\;\; p_1x_1 + p_2x_2 \leq$ $w$, in which $x_i, p_i$ is the amount and price of good $i$, $w$ is the total budget available.

What I have been told to deal with this $\min[.,.]$ function is to solve it graphically. It's very easy to see on the graph that the maximization happens when $a_1x_1 = a_2x_2$. But I wonder if there is a way to solve this algebraically? I'm stumped at the first step, which is to derive $\dfrac{\partial u(x_i)}{\partial x_i}$.

Since the utility function has the Leontief form, then the two goods are perfect complements. Therefore the consumer will always choose the kink point where $a_1x_1 = a_2x_2$, i.e. the maxima $(x_1^*,x_2^*)$ satises $a_1x_1^* = a_2x_2^*$.
Also since the consumer will spend all his/her income, we can have two variables $(x_1^*,x_2^*)$ and two equalities: \left\{ \begin{align} a_1x_1^* &= a_2x_2^*\\ p_1x_1^* +p_2x_2^*&=w\\ \end{align}\right. Therefore by solving the two equations, we can nd the demand function for each good: \left\{ \begin{align} x_1^* &= \frac{a_2 w}{a_2p_1+a_1p_2}\\ x_2^*&=\frac{a_1 w}{a_2p_1+a_1p_2}\\ \end{align}\right.
Note that we cannot equate the MRS with the slope of the budget line here, because the MRS is not deﬁned at the point where $a_1x_1 = a_2x_2$.
• Thanks for your help. As indicated in my question, I already knew how to this. The part that troubles me is Therefore the consumer will always choose the kink point. I can very easily see this on graph and by tuition. But is there a way to show this algebraically, i.e. via partial derivative of the $min[.,.]$ function? Dec 13, 2013 at 22:03
• The answer at this is "Note that we cannot equate the MRS with the slope of the budget line here, because the MRS is not deﬁned at the point where $a_1x_1=a_2x_2$. So you cannot use the method with partial derivatives... Dec 13, 2013 at 22:13