I have a circuit where resistor is parallel to capacitor, which is charged with voltage U. How to compute line integral around closed loop to get the result of Kirchhof second law – $U_{capacitor}+I\cdot R=0$?
For beginning I splited it in two parts, starting from the capacitor positive plate through resistor:
$$\oint \vec{E} \cdot d \vec{l} = \int_{+R-}\vec{E_{R}} \cdot d \vec{l} +
\int_{-C+} \vec{E_C} \cdot d\vec{l}$$
Since intensity of resistor is with the same direction as current density $\vec{j}$:
$$\int_{+R-}\vec{E_{R}} \cdot d \vec{l} = \int_{+R-} \rho \cdot \vec{j} \cdot d \vec{l} = I \cdot R$$
When I do the same for capacitor I gain negative line integral, because the $E_{c}$ is opposite to $d \vec{l}$ when positive charge is moved from negative plate to the positive.
So in which part I have made a mistake?
Best Answer
Here's a step-by-step analysis:
Assign potential $V=0$ to node "-", and potential $V_+$ to node "+". $V_+$ could be either positive or negative, but I'll be assuming positive for definiteness. Clearly, if you compute the line integral $\boldsymbol{E}$ around the circuit, you get a result of 0. I'll use the direction of integration in your question to analyze the elements of that integral. (You could take the opposite sense and get the same result.)
Adding the two pieces, which must sum to 0, you get:
$$ -U_{capacitor} + IR = 0 \text{ , or}\\ U_{capacitor} = IR $$
Finally, by convention one takes $q$ to be the charge on the "plus" plate of the capacitor (here at node "+"), so that $q=C U_{capacitor}$. Then $dq/dt$ represents the charge flowing into the capacitor's "+" node (through the part, and out the "-" node), which is the opposite of the resistor current:
$$ \frac{dq}{dt} = -I $$
Since $q= C U_{capacitor}$, the above loop equation can be re-written as:
$$ \frac{q}{C} = - \frac{dq}{dt} R \text{ , or} \\ \frac{q}{RC} + \frac{dq}{dt} = 0 $$