Charging or discharging a capacitor through a resistor.

Basically, we have some voltage sitting on a capacitor and we close the switch at time . We have:

Since these currents are the same, we put them together:

The equation above is called a first order system, which means there are no oscillations and we will see exponential decay.

Solving for , we have:

So:

We define a time constant , such that the voltage discharge is:

For charging we would have: