Time-domain model of a capacitor when the capacitance is varying with time The current through a capacitor as a function of time is given by;
$$i(t)=C\cdot \frac{d}{dt}U(t)$$
When assuming that the capacitance $C$ does not vary with time.
But what if it does?
I don't know how to derive the equation above from Gauss's law, so here is instead my attempt at a "common-sense" kind of solution, I don't know whether this is valid or nonsense.
Integrating the equation above;
$$Q(t)=\int i(t) dt=C\cdot U(t)$$
..we get the equation for charge $Q=C\cdot U$,
I assume that this is always valid, even if $C$ is a function of time (let's ignore relativity and quantum mechanics for a moment).
If that is true then to get back to the original equation all I need to do is differentiate, this time letting $C$ be a function of time;
$$i(t)=\frac{d}{dt}Q(t)=\frac{d}{dt}[C(t)\cdot U(t)]=\frac{d}{dt}C(t)\cdot U(t)+C(t)\cdot \frac{d}{dt}U(t)$$
..which gives the result;
$$i(t)=\frac{d}{dt}C(t)\cdot U(t)+C(t)\cdot \frac{d}{dt}U(t)$$
Is this equation valid? Or how do you solve for the current through a capacitor with varying capacitance and voltage?
 A: Yes your equation for i(t) is right
A: The first equation correctly expresses the charge as an integral of the current:
$$Q(t)=\int_{-\infty}^{t}i(\tau)d\tau.$$
The problem however is with the definition of capacitance, used in the second equation, as a proportionality coefficient between the charge and the potential difference, $Q(t)=C(t)U(t)$, since there is no reason to think that charge instantaneously responds to a change in the potential! In fact, for this to be true we would need to have infinite current, which would make meaningless the first equation.
The closest working solution to defining linear capacitance is relating the charge and the potential via a convolution integral:
$$Q(t) = \int_{-\infty}^tC(t-\tau)U(\tau).$$
While this may appear as a complication, it is in fact a simplification from the point of view of the circuit theory, since in the frequency domain (i.e., after the Laplace or Fourier transform) we would get
$$\tilde{Q}(\omega)=\tilde{C}(\omega)\tilde{U}(\omega),$$
i.e. convenient linear relation.
Update
While the discussion above focused on the incompatibility between the expressions relating charge&current and charge&potential in the question, it missed the essential point - that the capacitance is changing in time. This means that we need to use $C(t,\tau)$ rather than $C(t -\tau)$, which further complicates the issue.
