What happens to a compass below an AC line? I was solving a homework problem (don't worry it's already solved, I'm just curious as to how you can view magnetic fields), and I'm trying to figure out why the conclusion is what it is.
The problem goes as follows:

There is current running through the wire above, while you hold a compass below the wire, facing north. The direction of North is given. The current is AC current, and switches directions 100 times a second. What happens to the compass when this is occuring?
The answer was that the compass faces north. My answer was that they "cancel out", so the compass is instead affected by earth's B field, but the book said that the change in current was "too fast" as its reasoning.
But what is actually going on in this situation? Are there magnetic fields constantly opposing each other?
How do the fields "cancel each other" if the current swaps direction? Wouldn't that field instantly disappear, resulting in just one field existing until the current swaps again?
If my questions are too broad, don't hesitate to ask me to clarify and I'll do my best. Thanks!
Edit: The book said the compass, couldn't keep up with the change, to avoid confusion. Which makes sense but still doesn't answer what goes on with the fields atleast for me.
 A: The current in the wire changes direction 100 times per second. There is no way the compass needle could follow those changes; they happen way too fast to move the needle. In other words, the currents in the two directions cancel each other out.
If the AC frequency were slowed own, say to 1 Hz, then the current's direction would change twice per second, and you would see the needle swing with the current. Even at that frequency, it would not be able to follow all the way, the current would reverse before the needle reached its maximum deflection.
If we slow the frequency down even further, say 0.1 Hz or 5 sec in each direction, the needle would have little trouble following the current, and would swing to full deflection both ways.
A: This is an example of forced oscillation of a system (the pivoted magnet) by an external driving force (the interaction between the oscillating magnetic field and the field produced by the magnet).
In such an arrangement the frequency of the mains supply $(50/60\,\rm Hz)$ is much higher than the natural frequency of oscillation of the pivoted magnet $(<1\,\rm Hz)$ and the compass system might also be slight under-damped as the magnet is immersed in a liquid.
These two factors, coupled with the fact that the magnitude of the driving force is small, mean that the magnet is forced to oscillate at the frequency of the mains by the amplitude of oscillation is very, very small and probably not visible.
I cannot find a video to show this but applying an alternation voltage at mains frequency to a dc moving coil voltmeter will often result in the needle of the voltmeter vibrating enough to be seen by the naked eye.
A: Your use of the phrase "cancel out" and the answer "too fast" are two ways of saying the same thing, but both are a bit vague and unclear.
The force from the oscillating $B$ field at time $t$ is in the opposite direction to that at time $t+T/2$ where $T$ is the period of oscillation of the a.c. current. Your phrase "cancel out" is saying these two forces cancel each other, but strictly they don't since they act at different times. Rather, the force $f$ at time $t$ pushes the end of the compass needle one way, and it therefore has an acceleration in the direction of $f$ at time $t$. But an acceleration is not the same as a velocity! It just starts to pick up velocity. So a tiny bit later (after some milliseconds) it is moving in the direction of $f$ with some tiny velocity. But now the viscous and friction forces also act, so the velocity is low and does not build up much further before the magnetic force switches direction (after half a period of the oscillation of the a.c. current, the time $T/2$). And then the force makes it accelerate back again.
Overall the net movement of the end of compass needle is too small for the human eye to detect. It keeps on making these tiny oscillations but you cannot see them without a microscope. There is also the effect of the constant magnetic field from planet Earth. This makes the time-averaged direction of the compass needle point north.
(P.S. actually the Earth's magnetic field is also dynamic, but on much longer timescales)
