# How to derive and write Kirchoff loop law for circuits including capacitors?

Consider a circuit like the one in the picture Where $V_0$ is an electromotive force.

How do I write Kirchoff "loop law" for circuits like the one in picture (i.e. with capacitors)?

Here is the derivation of Kirchoff law I know: Ohm's law states that

$$\bf{E}=\rho \bf{j}\tag{1}$$

Where $\rho$ is the electrical resistivity of the material.

From here one can get

$$\mathrm{\oint_{circuit}} \bf{E} \cdot \bf{ds}=\mathrm{emf_{tot}} = \mathrm{\oint_{circuit}} \rho \bf{j} \cdot \bf{ds} = \mathrm{R_{tot}i}$$

Where emf is the electromotive force and $R_{tot}$ is the toal resistance of the circuit: this is Kirchoff loop law.

But how do I include the contribute of the capacitor? And what "convention" on the polarity of the capacitor should I use with respect to the choosen direction of current in the circuit?

I found out, looking at some exercises, that this relation hold for the circuit:

$$\mathrm{emf_{tot}}=\mathrm{R_{tot}i}+\frac{q}{C}\tag{2}$$

Where $q$ is, conventionally, the charge on the first plate met on the capacitor if I walk through the circuit in the direction choosen for i. For example $q$ should be the one in picture:

(Walking clockwise and meeting first the "upper" plate).

Nevertheless I do not understand if and how I can get to $(2)$ starting from Ohm law $(1)$.

My idea is that I could include in the integral of $\bf{E}$ also the electrostatic field in the capacitor, which, by convenction on the sign of $q$ is directed from $A$ to $B$. But I would get the wrong sign, infact this would led to:

$$\mathrm{\oint_{circuit}} \bf{E} \cdot \bf{ds}=\mathrm{emf_{tot}}+ \int_{A}^{B} \bf{E_{\mathrm{electrostatic}}}\cdot ds=\mathrm{emf_{tot}+\frac{q}{C}} = \mathrm{\oint_{circuit}} \rho \bf{j} \cdot \bf{ds} = \mathrm{R_{tot}i}$$

And so $$\mathrm{emf_{tot}}=\mathrm{R_{tot}i}-\frac{q}{C}$$

Therefore the main question is: how to correctly derive and then write Kirchoff loop law for circuits including capacitors?

Nevertheless I do not understand if and how I can get to (2)(2) starting from Ohm law (1)(1).

You should not try to use Ohm's law to tell you anything about a capacitor.

Ohm's law is a description of a (ideal linear) resistor. It doesn't say anything about any component that is not a linear resistor.

The equivalent law for a capacitor is

$$Q=CV$$

which you have correctly adapted to write

$$V=\frac{Q}{C}$$

I think you made a sign error just by forgetting the $-$ sign in the equation defining electrostatic potential difference:

$$\Delta{}V = -\int_a^b \vec{E}\cdot{}\rm{d}\vec{l}$$

So when you "encounter" the positively charged plate of the capacitor first and calculate the potential across the capacitor using this integral, you will have a positive potential difference.