Max of a profit function: partial derivative of an integral function?
You are really asking about the marginal product of a CES production function.
The LHS of your second equation is $P * dY/dY(i)$ where $Y_t$ is a CES aggregator of the $Y_t(i)$.
Let's define $\rho = \frac{\epsilon-1}{\epsilon}$ so that $Y=[\int Y(i)^\rho]^ {\frac{1}{\rho}}$.
Now apply the chain rule to get the derivative (also available for lookup in any micro text book):
$\partial Y/\partial Y(i) = \frac{1}{\rho} (\int Y(i) di) ^ \left(\frac{1}{\rho}-1\right) \rho Y(i)^{(\rho-1)}$
Cancel a few terms and you have your answer.