I'm struggling with this question: $ \max \{ \ln(y) - (x-1)^2 \} $
s.t. $x + y \leq t$ and $y > 0$
I'm trying to use the Lagrange/Kuhn-Tucker method but don't know how to progress after getting first order conditions $1/y = \lambda$ and $-2(x-1) = \lambda$ since there are two possible values for $x/y$ when I solve these in terms of my first constraint.
Reformulating your problem as a minimization problem yields
$$ \begin{align} & \min_{\mathbf{x}} \: (x_1-1)^2-\ln x_2 \\ \text{s.t.} \quad & c_1(\mathbf{x}) = t - x_1 - x_2 \ge 0 \\ & c_2(\mathbf{x}) = x_2 \ge 0. \end{align} $$
KKT conditions:
$$ \begin{align} & \nabla_x \mathcal{L} = \mathbf{0} \\ & \lambda_i \ge 0 \quad i=1,2 \\ & \lambda_i c_i(\mathbf{x}) = 0 \quad i=1,2. \end{align} $$
Stationarity of the Lagrangian requires that
$$ \begin{align} & \lambda_1 = 2(1-x_1) \\ & \lambda_2 = 2(1-x_1) - x_2^{-1}, \end{align} $$
and from the complementarity condition we have that
$$ \begin{align} & 0 = 2(1-x_1)(t-x_1-x_2) \\ & 0 = (2(1-x_1)-x_2^{-1})x_2, \end{align} $$
which holds for
$$ \begin{align} & x_1 = t - x_2 \\ & x_2 = \frac{1}{2} \left( -(1-t)+ \left( (1-t)^2 + 2 \right)^{\frac{1}{2}} \right) > 0 \quad \forall t \in \mathbb{R}. \end{align} $$
Since $\lambda_i$ needs to be nonnegative for the $1^{\text{st}}$-order necessary conditions for a local minimum to hold, we check
$$ \begin{align} & \lambda_1 = (1-t)+ \left( (1-t)^2 + 2 \right)^{\frac{1}{2}} > 0 \quad \forall t \in \mathbb{R} \\ & \lambda_2 = \lambda_1 - x_2^{-1} \ge 0 \: \longleftrightarrow \: \lambda_1 x_2 - 1 = 0. \end{align} $$
Hence, for all $t \in \mathbb{R}$
$$ \mathbf{x}^* = \frac{1}{2} \left( \begin{array}{l} (1+t)- \left( (1-t)^2 + 2 \right)^{\frac{1}{2}} \\ -(1-t)+ \left( (1-t)^2 + 2 \right)^{\frac{1}{2}} \end{array} \right) $$
is a candidate for the solution to the optimization problem.
The $2^{\text{nd}}$-order sufficient condition for $\mathbf{x}^*$ to be a local minimum is that (given the $1^{\text{st}}$-order necessary conditions hold)
$$\mathbf{s}^T H \mathbf{s} > 0 \quad \forall \mathbf{s} \in G^*,$$
where $G^*$ is the set of feasible directions and $H$ is the cost function's Hessian
$$ H = \left( \begin{array}{c} 2 & 0 \\ 0 & x_2^{-2} \end{array} \right). $$
From this it follows that
$$\mathbf{s}^T H \mathbf{s} = 2s_1^2 + s_2^2x_2^{-2} > 0 \quad \forall \mathbf{s} \in \mathbb{R}^2.$$
The following plot shows the isoclines of the cost function, $c_1(\mathbf{x})=0$ for $t=5$ and the minimum $x^*=\left[3(1-\sqrt{\frac{1}{2}}), 2+3\sqrt{\frac{1}{2}} \right]^T$.