# Non-traded goods in Two Country New Keynesian Model

I am working on a two-country New Keynesian model, where I include traded and non-traded goods. The final good is produced using traded and non-traded inputs:

$$Z_t=\bigg[a^\frac{1}{\kappa}Z_{T,t}^{\frac{\kappa-1}{\kappa}}+(1-a)^{\frac{1}{\kappa}}Z_{N,t}^{\frac{\kappa-1}{\kappa}}\bigg]^{\frac{\kappa}{\kappa-1}}$$

and the traded component is produced using home and foreign produced traded goods:

$$Z_{T,t}=\bigg[b^\frac{1}{\theta}Z_{H,t}^{\frac{\theta-1}{\theta}}+(1-b)^{\frac{1}{\theta}}Z_{F,t}^{\frac{\theta-1}{\theta}}\bigg]^{\frac{\theta}{\theta-1}}$$

I am looking to derive the demand schedule for each intermediate good by the final good producer and the producer of the composite traded goods.

I understand that when there are only traded goods, the final good is produced by a competitive firm who uses a CES production function to aggregate all the differentiated intermediate goods in the economy

$$Y_t=\bigg[\int_0^1y_t(i)^{\frac{\epsilon-1}{\epsilon}}\bigg]^{\frac{\epsilon}{\epsilon-1}}$$

so that the final good producer aims to maximize profit

\begin{equation*} \begin{aligned} & \underset{y_t(i)}{\text{max}} & & P_tY_t-\int_0^1p_t(i)y_t(i)di \\ & \text{s.t.} & & Y_t=\bigg[\int_0^1y_t(i)^{\frac{\epsilon-1}{\epsilon}}\bigg]^{\frac{\epsilon}{\epsilon-1}} \end{aligned} \end{equation*}

My question is, how can I write this latter optimization problem, under the assumption of traded and non-traded goods (i.e. for the final good producer and the producer of the composite traded goods)? How can I derive the individual demands for the final good producer?