Derivation of power and energy in a capacitor
One of your equations is incorrect: the energy in a capacitor is \$ \frac{1}{2}QV\$. Then, the power is

\$P = \frac{dw}{dt} = \frac{d}{dt}(\frac{1}{2}QV) = \frac{1}{2}[Q\frac{dV}{dt} + V\frac{dQ}{dt}]\$

Then, since V = \$\frac{Q}{C}\$, \$\frac{dV}{dt} = \frac{1}{C}\frac{dQ}{dt}\$, so

\$ P = \frac{1}{2}[\frac{Q}{C}\frac{dQ}{dt} + V\frac{dQ}{dt}] = \frac{1}{2}[V\frac{dQ}{dt} + V\frac{dQ}{dt}] = IV \$

with no assumptions about constant voltage.

I haven't thought about your second question, but I think the same idea will help out there too.