How do I obtain a correlation between two variables?
For the above equation is differentiable, and hence the partial derivatives will exist:
$\frac{\partial Y}{\partial X_2}= 2\beta_2X_2$.
Adding a dummy variable should not affect the above derivative for all practical purposes - the function will be differentiable a.e.
(note that you can't differentiate with respect to a dummy variable though)
Edit:
After the question was modified, the new expression of the partial derivative would be:
$\frac{\partial Y}{\partial X_1}=\beta_1+ 2\beta_2X_1$.