HELP please with Optimization with constrain using lagrangian I am reading this book on optimization and they present the following problem: Lisa wants to maximize her utility U(q1,q2) subject to a budget constrain, budget constrain is $p1*q1+p2*q2=I$.
Ok , I know that the point in which she will maximize her utility is when both gradients, so the one of the Utility function and the constrain function are the same. 
So to sort this out I'll use the Lagrangian method so I take the first derivative of
$ L= U(q1,q2)+ λ(I-p1*q1-p2*q2)$. 
so $q1*q2+ λ(I-p1*q1-p2*q2)$.
I take the partial derivatives in respect to 
$ q1>> q2-λ*p1=0 $
$q2>> q1-λ*p2=0$
$ λ>> I-p1*q1-p2*q2=0$
then I isolate λ in the first equation i.e $λ=p1/q2$ and I plug this $λ$ into the second equation so I get $q1-((p2*p1)/(q2))=0$ now I know I should set a linear system of equations between this last equation and $λ> I-p1*q1-p2*q2=0.$
At this stage though, I realize I am totally wrong... and to be honest I dont understand what the book shows..it is sounds alien to me..could anyone please explain to me where I am wrong and how to proceed? 
 A: When you solve for $\lambda$ in the first FOC, you should arrive at $\lambda=q_2/p_1$. You made a mistake there. Substituting into the second equation gives $$q1-q_2/p_1*p_2=0\Leftrightarrow q_1=p_2q_2/p_1.$$
Substitute this into the third equation to get
$$I-q_2p_2-p_2q_2=0\Leftrightarrow q_2=I/(2p_2).$$
This is the optimal demand for good 2. Now substitute this back into the expression for $q_1$
$$q_1=p_2q_2/p_1=I/(2p_1)$$
and you have your solution. It is symmetric if prices are equal, so it seems to be correct. In terms of interpretation, demand increases in income and it decreases in price - so we have normal goods. It's just a bit unusual that the price of the other good does not show up in the demand (e.g., $q_2$ independent of $p_1$).
After you did this, you should always check whether the optimal demand $q_1,q_2$ really fulfills the budget constraint with equality. Here, it does: $I=I/2+I/2$. That is, you spend half your income on either good.
To put it bluntly, what you have to do in these optimal demand exercises is set up the lagrangian, compute all derivatives, and start solving for all decision variables and lagrange parameters. Since you have as many of those variables as equations, you need to use all equations. That is what we did above.
