Public Goods - Voluntary provision
Given

$$\max_{x_2^h} \quad U^h(\phi(\bar z + y^h - x_2^h), x_2^h)$$

You have to find FOCs by taking the chain rule twice for the first argument. Denote the argument for function $\phi$ as $(\cdot)$.

$$\frac{\partial U^h}{\partial x_2^h} = \frac{\partial U^h}{\partial \phi} \cdot \frac{\partial \phi}{\partial x_2^h}$$
$$\frac{\partial \phi}{\partial x_2^h} = \frac{\partial \phi}{\partial (\cdot)} \cdot \frac{\partial (\cdot)}{\partial x_2^h}$$
$$\implies \frac{\partial U^h}{\partial x_2^h} = \frac{\partial U^h}{\partial \phi} \cdot \frac{\partial \phi}{\partial (\cdot)} \cdot \frac{\partial (\cdot)}{\partial x_2^h}$$

Thus, letting $U^h_{1,2}$ represent the partial derivative with respect to the first and second arguments of $U^h$ respectively:

$$\begin{align}
\frac{\partial U^h}{\partial x_2^h} &amp; = U_1^h(\phi(\bar z + y^h - x_2^h), x_2^h) \cdot \phi_z(\bar z + y^h - x_2^h) \cdot -1 \\
&amp; + U_2^h(\phi(\bar z + y^h - x_2^h), x_2^h) \cdot 1
\end{align}$$

The second argument in $U$ has no $\phi$, so only chain rule should be applied there.