Capacitors are used in DC circuits to provide "bursts of energy." Typical examples would be a capacitor used to jump start a motor or a capacitor used to charge a camera's flash or a capacitor used to provide a large voltage across the chest in an emergency defibrillator when a person suffers from cardiac arrest. Charging Capacitors
When the switch is closed, charges immediately start flowing onto the plates of the capacitor. As the charge on the capacitor's plates increases, this transient current decreases; until finally, the current ceases to flow and the capacitor is fully charged. In the diagram shown above, the right plate of the capacitor would be positively charged and its left plate negatively charged since the plates are arbitrarily assigned as + and  according to their proximity to the nearest battery terminal.
Graphs of current vs time and charge vs time are shown below. Mathematically, both of these graphs are exponential functions  current is an example of exponential decay, while charge is an example of exponential growth.
Charging Capacitor Graphs



current vs time

charge vs time

At t = 0 seconds, when the switch is initially closed, the capacitor does not have carry any charge and Kirchoff's loop rule would result in the equation:
where I_{max} represents the initial, maximum current flowing off the battery onto the plates of the capacitor. However, this current is not steady. As time passes, more and more charges accumulate on the capacitor. This in turn increases the voltage across the capacitor, Q = CV. When the voltage of the capacitor equals the voltage of the battery, charges will cease to flow. The current decreases with time.
We will now derive the equations for the transient charge on the capacitor and the transient current in the circuit. In this derivation,

i
or i (t)
represents the transient current in the circuit as the capacitor charges at any time, t,

q
or q (t)
represents the amount of charge on the capacitor at any given time, t,

R is the resistance of the resistor, and

C is the capacitance of the capacitor.
Applying Kirchoff's Loop Rule we have Separating variables and integrating both sides yields
In order to solve for q(t) we must first extricate it from within its natural log expression: . To do this, we will raise both sides of our equation to a power of e since .
In the equation above the final total charge present on the plates is . This allows us to rewrite our final equation for the build up of charge on the capacitor's plates as
In these equations, the product of RC must have the units of time, since the exponent in the function f(x) = e^{x} must be dimensionless. Let's investigate this relationship.
t 
RC 
sec 
ohms (farads) (volts/amps) (coulombs/volts) coulombs/amps coulombs/(coulombs/sec) sec

This product is called the RC time constant and it allows us the ability to determine when certain percentages of change have occurred. To calculate the equation for the transient current, we will use the fact that and differentiate the equation we just derived for q(t).
Let's use this information to work an example of a charging capacitor. 