I'm working on a producer theory problem in economics where I'm trying to maximize a firm's profit involving two outputs ($q_1$ and $q_2$ with prices $p_1$ and $p_2$ respectively) and two inputs ($z_2$ and $z_2$ with prices $w_1$ and $w_2$ respectively). My constraint is something called a transformation function.
My main objective is to find $q_1^*$ and $q_2^*$ that maximize the profit (following): $$p_1q_1+p_2q_2-w_1z_1-w_2z_2$$ subject to $$Max(x_1^\gamma,x_2^\gamma) - z_1^\alpha z_2^\beta \leq 0$$
I want to take the first-order condition by taking derivative with respect to $q_1$ and then with $q_2$ but I have no idea how to deal with the $Max$ {$x_1^\gamma,x_2^\gamma $} expression.