# Trouble understanding KVL for discharging RC circuit

I am trying to derive the equation for the charge in an RC circuit with respect to time.

I have drawn the circuit as follows:

simulate this circuit – Schematic created using CircuitLab

Using a KVL, I determine the following:

$$\iR - \frac{q}{C} = 0\$$

$$\\frac{dq}{dt} * R = \frac{q}{C}\$$

Solve for q and t:

$$\q = q(0)\exp(\frac{t}{RC})\$$

This indicates exponential growth and not decay, which doesn't make sense. However, it is evident to me that the first line must potentially be this instead:

$$\iR + \frac{q}{C} = 0\$$

...which will solve my problems. But I do not understand why. Could someone help explain to me please?

• Suppose a counter-clockwise current (one opposite anticipated): KVL would suggest $0\:\text{V} - I\,R -\frac1{C}\int I\,\text{d}t=0\:\text{V}$. Taking the derivative, $-R\frac{\text{d}\,I}{\text{d}t}-\frac{I}{C}=0$, re-arrangement yields $-\frac{\text{d}\,I}{I}=\frac{\text{d}\,t}{R\,C}$. Or, $I=I_0\,e^{^\left[\frac{-t}{R\,C}\right]}$, which is a declining current (negative, since $I_0$ will be negative to show it moves in the direction opposite the assumption above.) To arrive at a charge equation, solve $q=\int \text{d}\,q=I_0\,\int e^{^\left[\frac{-t}{R\,C}\right]}\:\text{d}t$. – jonk Oct 12 '20 at 15:37