Help to resolve this optimization problem with lagrangians? Cheeers! 
So I have this problem, and what I do is to set up the max problem.( for Lambda Ill use the letter "L" and for what it looks like gamma Ill use letter "g" )
Objective function is Bln(x-t) and the constraint is Px=y
I set up the Lagrangian as follows  Bln(x-g)+L(y-Px).
I then write the FOC , so derivatives of the Langrangian in respect to x , y and L.
(1)      respect to x   =>  ((b)/(x-g))-L*P = 0 
(2)      respect to y   =>   L =0
(3)      respect to L   =>   y-P*x = 0
So I made it up to here, I thinkI have made some mistakes as equation number 2 doesnt really make sense, I had never done an optimization problem with paramters. Any help please?
 A: 
Objective function is B*ln(x-t) and the constraint is P*x=y

Either you are ignoring the presence of multiple goods, or are using some vectorized notation. I won't do either, so for me the objective is 
$$\sum_{i=1}^n \beta_i \ln(x_i-\gamma_i)$$
and the constraint is 
$$\sum_{i=1}^n p_i x_i = y$$
The Lagrangian is
$$L=\sum_{i=1}^n \beta_i \ln(x_i-\gamma_i) + \lambda \left(\sum_{i=1}^n p_i x_i - y \right)$$
By the way, what are we optimizing over? Over amounts $x_i$, I think. The quantity $y$ is not consumer's to choose: of course, if s/he could choose the income to have, the optimization problem becomes pointless: just have yourself a lot of money and buy all you want. This is why taking the derivative with respect to $y$ leads to an absurd equation. 
The relevant partial derivatives are those with respect to variables: $x_i$ and the Lagrange multiplier $\lambda$. 
$$\frac{\partial L}{\partial x_i} = \frac{\beta_i}{x_i-\gamma_i} + \lambda p_i$$
$$\frac{\partial L}{\partial \lambda} = \sum_{i=1}^n p_i x_i - y$$ 
These should be equated to $0$, etc. 
