Question on multivariable chain rule (voltage-current equation of a capacitor with time-, voltage- and current-dependent capacitance)

chain rulederivativesmultivariable-calculuspartial derivative

This is not homework. I want to obtain the equation that relates the voltage across a capacitor with the current through that capacitor, where the capacitance is a function of the voltage, current and time; and where the voltage and current are a function of time. To explicitly indicate that, I'm going to denote those quantities as $C(i,v,t)$, $v(t)$ and $i(t)$. We don't know the specific expressions for $v(t)$, $i(t)$ or $C(i,v,t)$, because I want to obtain a general formula, we just know the dependencies I said. Also, I want to write the equation such that $i(t)$ is in terms of $C(i,v,t)$ and $v(t)$ (and possibly of the charge $q(t)$).

First, we begin with the definition of capacitance of a two-terminal ideal capacitor, which as we know it's:

$C(i,v,t) = \dfrac{q(t)}{v(t)} \tag 1$

Multiplying both sides by $v(t)$, we get:

$C(i,v,t) \, v(t) = q(t) \tag 2$

Differentiating both sides with respect to time, we get:

$\dfrac{\mathrm dq(t)}{\mathrm dt} = \dfrac{\mathrm d}{\mathrm dt} [C(i,v,t) \, v(t)] \tag 3$

Applying the definition of current ($i(t) = \mathrm dq(t)/\mathrm dt$) in left-hand side of the previous equation, we get:

$i(t) = \dfrac{\mathrm d}{\mathrm dt} [C(i,v,t) \, v(t)] \tag 4$

Notice if the capacitance was constant, then we could take it out of the derivative and we'd end up with the typical current-voltage equation of a capacitor:

$i(t) = C \, \dfrac{\mathrm dv(t)}{\mathrm dt} \tag 5$

But we're assuming the capacitance is a function of voltage, current and time, so we can't apply that property, so equation (5) is not valid in our case.

So far I don't have questions. If I made an error, please tell me. Going back to equation (4), I'm not exactly sure how to decompose the derivative of the right-hand side. In my Calculus 3 class, I was taught that if $w = w(x,y)$, where at the same time $x = x(t)$ and $y = y(t)$, then:

$\dfrac{\mathrm dw}{\mathrm dt} = \dfrac{\partial w}{\partial x} \dfrac{\mathrm dx}{\mathrm dt} + \dfrac{\partial w}{\partial y} \dfrac{\mathrm dy}{\mathrm dt} \tag 6$

However, in equation (4), we identify $x$ as $C$ and $y$ as $v$, so we have $w = w(C,v) = C \, v$, where at the same time $C = C(i,v,t)$ and $v = v(t)$ and $i = i(t)$. Notice the difference between this and the previous example is that in the previous example, $x$ was a function of one variable, while in my case it's of three variables. I think the following is true:

$\begin{align} \dfrac{\mathrm dw}{\mathrm dt} &= \dfrac{\partial w}{\partial C} \dfrac{\mathrm dC}{\mathrm dt} + \dfrac{\partial w}{\partial v} \dfrac{\mathrm dv}{\mathrm dt} \\ &= \dfrac{\partial w}{\partial C} \dfrac{\partial C}{\partial t} + \dfrac{\partial w}{\partial v} \dfrac{\mathrm dv}{\mathrm dt} && \text{$C$ is a function of three variables so we use $\partial$} \\ &= \dfrac{\partial [C \, v]}{\partial C} \dfrac{\partial C}{\partial t} + \dfrac{\partial [C \, v]}{\partial v} \dfrac{\mathrm dv}{\mathrm dt} && \text{Substituting the expression for $w$} \\ &= v \dfrac{\partial C}{\partial t} + C \dfrac{\mathrm dv}{\mathrm dt} && \text{Evaluating} \\ \implies \dfrac{\mathrm d}{\mathrm dt} [C \, v] &= v \dfrac{\partial C}{\partial t} + C \dfrac{\mathrm dv}{\mathrm dt} \tag 7 \end{align}$

Is equation (7) true/correct? Because if so, finally we substitute its right-hand side into the right-hand side of equation (4) to get:

$\boxed{i(t) = v(t) \dfrac{\partial C(i,v,t)}{\partial t} + C(i,v,t) \dfrac{\mathrm dv(t)}{\mathrm dt}} \tag 8$


Based on the textbook Network analysis by Mac E. Van Valkenburg, it looks like equation (8) is correct at least when the capacitance is a function of time but not of voltage nor current (notice in the following image he used a complete differential instead of a partial one when differentiating $C(t)$), and still assuming the voltage and current are a function of time, since in such case equation (8) reduces to:

$i(t) = v(t) \dfrac{\mathrm dC(t)}{\mathrm dt} + C(t) \dfrac{\mathrm dv(t)}{\mathrm dt} \tag 9$

Here's what the author says:

Current-voltage equation of a capacitor whose capacitance varies as a function of time but not of voltage nor current

The following example from that textbook illustrates the equation (1-21) when the voltage is constant (notice he writes with an uppercase $V$, which is common when voltage is a constant):

Example of the current-voltage equation of a capacitor whose capacitance varies as a function of time but not of voltage nor current, and where its voltage is constant

Best Answer

$$i(t) = \frac{d}{dt} [C(i(t),v(t),t) \, v(t)]$$

By the product rule,

$$i(t) = v(t) \, \frac{d}{dt} [C(i(t),v(t),t)] + C(i(t),v(t),t) \, \frac{dv}{dt}$$

By the chain rule for total derivatives,

$$\frac{d}{dt} [C(i(t),v(t),t)] = \frac{\partial C}{\partial t} + \frac{\partial C}{\partial i} \frac{d i}{d t} + \frac{\partial C}{\partial v} \frac{d v}{d t}$$

Related Question