To illustrate the behaviour of a capacitor in an AC circuit, let us first consider the following scenario: As shown in the left-hand part of the diagram below, a capacitor is connected alternately via a switch S and a resistor R to two voltage sources (e.g. batteries) of opposite polarities. If the switch's setting is now changed periodically, a square-wave (rectangular) alternating voltage is applied to the RC network, and an alternating current flows "through" the capacitor (right-hand chart). The capacitor is therefore charged, i.e. the capacitor voltage rises while the charge current drops. On a reversal of the voltage's polarity, the charging current also reverses direction. As a result, the capacitor begins to lose its previous charge, i.e. the capacitor voltage drops to zero and starts to rise in the other direction. The dashed curve shows the course the capacitor voltage would take if the switch remained in place. On the next switchover, the capacitor is charged again in the original direction, and so on. In this manner, the capacitor can be constantly recharged by alternating current, i.e. it has a "finite" resistance to AC, as compared with an "infinite" resistance to DC.