Utility = $\ln (x_i) + 0.5 (g_1 + g_2)$ subject to $x_i + g_i = 15$.
I have substitued the budget constraint into the utility function:
Utility = $\ln (15 - g_i) + 0.5 (g_1 + g_2)$
I have tried differentiating the budget constraint but am unable to get anywhere.
You differentiate $U_i$ w.r.t. $g_i$ and set it equal to zero. Let´s differentiate $U_1=\ln(15-g_1)+0.5(g_1+g_2)$ w.r.t $g_1$. For $\ln(15-g_1)$ we have to apply the chain rule.
Let´s say we differentiate $\ln(f(x))$ w.r.t. x. Then the derivative is $\frac1{f(x)}\cdot f^{'}(x)$. That means that the derivative of $U_1$ w.r.t. $g_1$ is
$$\frac{\partial U_1}{\partial g_1}=\frac1{15-g_1}\cdot (-1)+0.5=0$$
It remains to solve the equation for $g_1$.