Now we know the necessity and importance of modal analysis, but how can we setup the mathematics to compute the natural frequencies and mode shapes of an object?

Dynamic vibration behavior is the response of a structure under external excitation. It's actually a combination of all the mode shapes of the structure. Check out the video below of the vibration of a cymbal after an impact load.

Similarly, each of these strings is vibrating at a different natural frequency. In fact each string will have many natural frequencies. Depending on where we strike the string, and where it is being touched we will excite some of the higher frequencies or harmonics.

To solve dynamic behavior in time, we use the equation of motion that includes external loads. This way, we are looking for deformation of the structure at every single time point. However, natural frequencies and mode shapes, are the natural characteristics of a structure. They exist independent of external load and they are not a function of time. What is the right equation of motion to solve for modal analysis? And how can we solve the equation of motion with respect not to time but to frequency?

As the external load term is removed from the equation of motion, we call modal analysis "free" vibration analysis. The key concept to find the natural frequencies and mode shapes of a structure is to view the dynamic vibration as a frequency domain problem instead of a time domain one. Once you are familiar with this concept, you are ready for a series of structural analyses including, harmonic analysis, random vibration analysis, response spectrum analysis, etc. We call these frequency-domain based analyses linear dynamics.