Seismic waves travel fast, on the order of kilometers per second (km/s). The precise speed that a seismic wave travels depends on several factors, most important is the composition of the rock. We are fortunate that the speed depends on the rock type because it allows us to use observations recorded on seismograms to infer the composition or range of compositions of the planet. But the process isn't always simple, because sometimes different rock types have the same seismic-wave velocity, and other factors also affect the speed, particularly temperature and pressure. Temperature tends to lower the speed of seismic waves and pressure tends to increase the speed. Pressure increases with depth in Earth because the weight of the rocks above gets larger with increasing depth. Usually, the effect of pressure is the larger and in regions of uniform composition, the velocity generally increases with depth, despite the fact that the increase of temperature with depth works to lower the wave velocity.
When I describe the different seismic wave types below I'll quote ranges of speed to indicate the range of values we observe in common terrestrial rocks. But you should keep in mind that the specific speed throughout Earth will depend on composition, temperature, and pressure.Compressional or P-Waves
P-waves are the first waves to arrive on a complete record of ground shaking because they travel the fastest (their name derives from this fact - P is an abbreviation for primary, first wave to arrive). They typically travel at speeds between ~1 and ~14 km/sec. The slower values corresponds to a P-wave traveling in water, the higher number represents the P-wave speed near the base of Earth's mantle.
The velocity of a wave depends on the elastic properties and density of a material. If we let k represent the bulk modulus of a material,m the shear-modulus, and r the density, then the P-wave velocity, which we represent by a, is defined by:
A modulus is a measure of how easy or difficulty it is to deforms a material. For example, the bulk modulus is a measure of how a material changes volume when pressure is applied and is a characteristic of a material. For example, foam rubber has a lower bulk modulus than steel.
P-waves are sound waves, it's just that in seismology we are interested in frequencies that are lower than humans' range of hearing (the speed of sound in air is about 0.3 km/sec). The vibration caused by P waves is a volume change, alternating from compression to expansion in the direction that the wave is traveling. P-waves travel through all types of media - solid, liquid, or gas.
As a P-wave passes the ground is vibrated in the direction that the wave is propagating. S-Waves
Secondary , or S waves, travel slower than P waves and are also called "shear" waves because they don't change the volume of the material through which they propagate, they shear it. S-waves are transverse waves because they vibrate the ground in a the direction "transverse", or perpendicular, to the direction that the wave is traveling.
As a transverse wave passes the ground perpendicular to the direction that the wave is propagating. S-waves are transverse waves.
The S-wave speed, call it b, depends on the shear modulus and the density
Even though they are slower than P-waves, the S-waves move quickly. Typical S-wave propagation speeds are on the order of 1 to 8 km/sec. The lower value corresponds to the wave speed in loose, unconsolidated sediment, the higher value is near the base of Earth's mantle.
An important distinguishing characteristic of an S-wave is its inability to propagate through a fluid or a gas because a fluids and gasses cannot transmit a shear stress and S-waves are waves that shear the material.
In general, earthquakes generate larger shear waves than compressional waves and much of the damage close to an earthquake is the result of strong shaking caused by shear waves. Using P and S-waves To Locate Earthquakes
We can use the fact that P and S waves travel at different speeds to locate earthquakes. Assume a seismometer are is far enough from the earthquake that the waves travel roughly horizontally, which is about 50 to 500 km for shallow earthquakes. When an earthquake occurs the P and S waves travel outward from the region of the fault that ruptured and the P waves arrive at the seismometer first, followed by the S-wave. Once the S-wave arrives we can measure the time interval between the onset of P-wave and the onset of S-wave shaking.