Statement:
Capacitors can be used to store energy or to filter signals. Some examples include filtering out AC [used to reduce the "ripple" of a DC power supply] or filtering out a DC. In filtering out a DC, only time-varying signal will pass through a capacitor. The circuit on either side of the capacitor can be at different DC voltages.

Questions
Can someone explain to me the background on Filtering out AC, and how it is

And similarly the concept of filtering out DC where

As there is no homework problem, I suppose it is OK that you didn't offer a solution. Probably this should be posted in a different forum, but not sure.

Anyway, the easiest way to understand these uses of capacitors is to understand the complex impedance of a capcitor. Are you familiar with complex impedance?

I'll try to explain with an example: the low-pass filter. I will assume you know what an RC circuit is. These circuits have a characteristic time constant, the RC time constant, which indicates how quickly a capacitor will charge/discharge. If an input signal is oscillating much more quickly than the RC constant, the capacitor's voltage over time will not change quickly enough in response, and so you would see only the time-averaged voltage across the capacitor. If the input AC signal has a DC component, you would see only this DC component, the average value of the AC signal. It's called a low-pass filter because only slow, low-frequency signals will be preserved.

Since DC power supplies are plugged into an AC source, and because no filter is perfect, there will always be a remnant of the original AC signal. Using an additional filter can help smooth this out. Go to the following website http://www.falstad.com/circuit/ and then play with the low-pass and high-pass filter settings under Circuits-->Basics. Especially look at the graphs, and you'll see what I mean.

I looked up the definition of impedance, and according to wikipedia, impedance is "a measure of opposition to a sinusoidal alternating current (AC). Electrical impedance extends the concept of resistance to AC circuits, describing not only the relative amplitudes of the voltage and current, but also the relative phases. When the circuit is driven with direct current (DC) there is no distinction between impedance and resistance; the latter can be thought of as impedance with zero phase angle."

I'm not too familiar with RC circuits, so I also looked up the definition, and it seemed fairly straight-foward; that is, RC circuits are circuits composed of resistors and capacitors driven by a voltage difference [current source].

Are you comfortable with ordinary differential equations? The impedance of a passive circuit can be determined by Laplace-transforming the circuit equations. The circuit could be a single element, such as a capacitor or inductor, connected to a voltage or current source.

It turns out that, for a capacitor, the frequency parameter of the Laplace transform appears in the denominator of the impedance expression. What this means is that higher frequencies see lower impedances across/through the capacitor. Loosely speaking, lower impedance implies either less voltage across the element (compared to another element in series) or more current through the element (compared to another element in parallel).

I will cut short the math behind determining the capacitor impedence. Its value is

Zc = -j/(wC)

j = square root of -1
w = 2*pi*f where f is frequency of signal (AC/ripples/etc)
C = Capacitance

Now for fluctuations and high frequency signal, w tends to infinity causing the impedence to become zero. That is, its a short circuit for high frequency signals. The AC part of the signal will hence prefer the parallel path of the capacitance to flow thereby protecting the main circuit from the ripple.

_____________________________________________________________
God is a comedian, playing to an audience, too afraid to laugh. -Voltaire