Conservation of energy or not? In a process involving capacitor In my textbook, there is a following task (that's my translation and it may not be 100% clear or accurate, so feel free to request additional clarification)

A flat capacitor, charged with charge $Q$, with conductive plates of equal areas $S$, height $h$ and distance between them $d$ was positioned vertically, that is, in the way that the bottom edges of conductive fields touch a dielectric fluid (i.e. water, of density $\rho$ and relative permittivity $\varepsilon_r$). Near the edges of the capacitor, there is a non-homogeneous electric field that causes the fluid to get polarized (that is, particles of the fluid become induced electric dipoles). One of the poles of each dipole will then be in a stronger electric field, which causes the fluid to be ''sucked'' to the inside of the capacitor (i.e. between the plates). 
  What's the charge $Q$, that the capacitor ought to be charged with, so that the fluid fills all space between the plates?

Then, in my textbook, the solution is presented. This solution consists of application of the law of conservation of energy:
$$ \frac{Q^2}{2C}=\frac{Q^2}{2\varepsilon_rC}+Sd\rho g\frac{h}{2}$$
and I find this solution absolutely wrong. Why? Consider the process of water being "sucked" into the capacitor. Then there is - inside of the capacitor - a changing electric field, that should induce changing magnetic field and so on. Therefore, I think that the solution in my textbook does not consider loss of energy due to the emitted electromagnetic waves. The answer - according to my textbook - is $$Q=S\sqrt{\frac{\varepsilon_r\varepsilon_0\rho gh}{\varepsilon_r-1}}$$
Personally, I found another solution. If we compute the total energy of the system capacitor+water, and then set $\frac{dE}{dy}=0$, then we get $$Q=S\varepsilon_r\sqrt{\frac{2\varepsilon_0\rho gh}{\varepsilon_r-1}}$$
which differs significantly from the solution presented in my textbook. 
Which one is the correct solution then? And, if the  solution presented in my textbook does not exhibit law of conservation of energy properly, then what changes need to be made, to consider the loss of energy due to the emission of electromagnetic waves? 
 A: Neglecting for a moment your point about electromagnetic radiation losses, I trust that you agree that the book's logic was otherwise sound in arriving at
$$ \frac{Q^2}{2C}=\frac{Q^2}{2\varepsilon_rC}+Sd\rho g\frac{h}{2}$$
Algebraically, this does, indeed, give
$$Q=S\sqrt{\frac{\varepsilon_r\varepsilon_0\rho gh}{\varepsilon_r-1}}$$
So the book's answer is correct if energy is not lost by the system.
Assuming that by  $\frac{dE}{dy}=0$, you mean $\frac{dE}{dh}=0$, I would point out that the change in energy with respect to height is not zero.  There is more energy between the plates the higher you go.  So your otherwise inventive and respectable efforts led you to error.  It is $\frac{dE}{dt}$ which would be equal to zero as the water rises between the plates and energy is transferred from the electric field to the gravitational field.
Finally, if you consider the electromagnetic losses, I think that you are correct in that the loss is a finite, nonzero quantity. The electric field is changing, and the rate of change itself changes.  However, the loss would be extremely small.  The electric field is changing quite slowly, and if it oscillated continuously at that rate (which it doesn't), the wave would be a very low frequency one.  Low frequency waves, of course, are low energy waves.  Plus, the overall duration of the radiation is quite short.  It would be more correct to say that an electromagnetic pulse is generated than to say an electromagnetic wave is generated.  I think that the authors were correct in neglecting it, but perhaps should have said so, as some authors do in similar situations, because some readers are very alert and want everything to integrate with what they already understand.
To answer your final question, a time-dependent term would have to be added to the equation. Frankly, I don't know what that term would be without researching it.
A: The correct answer is the one of the book. This level of description is electrostatic, no further than that. 
You can see from Maxwell's laws, magnetic field contributions enter when electric field is not conservative (-> not irrotational). This is not the case, you couldn't even consider potential V otherwise. In fact, a conservative vector field is the gradient of a scalar function and a conservative vector field is always irrotational.
Maybe you are confusing a spacially inhomogeneous electric field with a changing-in-time electric field. 
A: At first I thought your question was complete bogus, but after thinking about it I'm starting to think that both the book and you are right. The book however probably didn't intend to make it this tricky, so actually it is a mistake in the book.
Let's go to the physics. The total energy $E_{tot}$ is the sum of the electrical energy in the capacitor $E_C$ and the gravitational energy of the fluid $E_g$. Both these energies depend on the fluid level $y$. The fluid level will be forced upwards as long as the reduction of electrical energy compensates for the increase in gravitational energy. The fluid level has a stable point when $\frac{dE_C}{dy}=-\frac{dE_g}{dy}$, in other words when $\frac{dE_{tot}}{dy}=0$.
From the question it is not completely clear whether the capacitor is first charged and then brought in contact with the fluid or slowly charged, while in contact with the fluid. I'll consider both cases.
For the slow charging case, the system is constantly in equilibrium at the fluid level given by $\frac{dE_{tot}}{dy}=0$. At the charge you calculated, the fluid will reach the top of the capacitor.
Then the case of first charging and then contacting the fluid. Here the system starts out of equilibrium. If we assume no energy losses, the fluid will be accelerated towards the equilibrium level. However, due to the kinetic energy of the fluid, it will pass this equilibrium level and rise even further. The fluid level will then drop again and oscillate around the equilibrium level. The answer in the book gives the charge for which the heighest level in the oscillation just reaches the top of the capacitor (when the kinetic energy is zero). 
In practice the oscillations will be damped and the system will stabilize at the euilibrium level. The main cause of damping will be the viscosity and friction of the fluid. In theory, if there were no mechanical damping, the system might be damped by emitting very low frequency EM-radiation. However, in practice this effect is completely negligible.
To conclude, the book is mostly wrong, you were mostly right. Note that you probably would have had a sooner answer if you had properly explained what you meant by dE/dy. Furthermore, your responses to the answer of D.Ennis are completely inappropriate and almost made me decide not to type this answer. However, the amazing fact that for once the book is actually wrong, made me type it anyway.
