Try
Y = A k^a L^b;
PROF = P Y - r k - w L;
z1 = D[PROF, k];
z2 = D[PROF, L];
sol=Together[Simplify[Solve[{z1 == 0, z2 == 0}, {k, L}], {0 <= a <= 1 && 0 <= b <= 1 && a + b + c == 1 && A > 0 && k > 0 && L > 0 && P > 0 && r > 0 && w > 0 && PROF > 0}][[1]]]
{k, L} /. sol // FullSimplify