The theory of guitar strings.
The true physics of guitar strings is very complex, but the basic theory is quite straightforward. The starting point is that the fundamental frequency of vibration of a string is inversely proportional to its length and directly proportional to the square root of the tension. This frequency is also inversely proportional to the square root of its mass per unit length. So the frequency that sounds when you pluck a guitar string is a combination of these three properties - length, tension and mass.
It is easy to see that when you fret any guitar string at the twelfth fret you are halving the length of the string. As frequency is inversely proportional to length, the frequency is doubled and we are playing the octave.
When you fret a string, the new (shortened) string length is reduced to L [1 - 1/(2^1/12)] for each fret you move up the fretboard, where L is the length of the string at the last fret. This equation simplifies to L/17.817. It is derived by determining that the semitone intervial, or relationship between two of the twelve notes that create a chromatic scale, is 2^12. By applying this to itself, after 12 times the length of the string is halved at the twelfth fret and we get our octave at double the frequency of the un-fretted string.
Frequencies for equal-tempered scale at Concert Pitch with A4 = 440 Hz
1st String = E = 329.63Hz
2nd String = B = 246.94Hz
3rd String = G = 196.00Hz
4th String = D = 146.83Hz
5th String = A = 110.00Hz
6th String = E = 82.41Hz

