# Math and Music – The Piano and the Wave Equation, Notes and the Fibonacci Sequence

A note: The math formulas were ruined by wordpress – I’ll see about fixing it so it reads better.

First, I would like to consider the piano keyboard – each octave has 13 keys (C, C#, D, D#, E, F, F#, G, G#, A, A#, B, C), 8 notes (white keys), 5 black keys, and are composed of steps. There are 88 keys on the piano in total.

Take a moment and think about the Fibonacci sequence: A series in which the next term is the sum of the preceding two. The Fibonacci sequence starts with 0, and proceeds from there: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89. . . The sequence continues on forever. The ratio of the numbers in the Fibonacci sequence create a spiral that is called the Fibonacci spiral, which is drawn by tiling squares with sides informed by the Fibonacci sequence and then spiraling from the corners of the squares. The limit of the Fibonacci numbers lim_(n->inf)((F_(n+alpha)/F_n)=Phi, where Phi is the golden ratio. The golden ratio is the value Phi at which Phi=(1+sqrt(5))/2=1.6180339… Mathematically, two values are considered to be within the golden ratio if their ratio is (a+b)/a = a/b (def)= Phi. This means that a+b is to a as a is to b.[1] This ratio tends to show up all over the natural and man-made world, including in music.

Let us return to the piano keys. There are eight white keys and five black keys. There are thirteen keys in an octave, but these are split into groups of 3 and 2. Additionally, chords are created using 5th and 3rd notes in addition to the first note, creating the idea of “whole tone,” which is based on the note 2 steps different from the first note in the octave.[2] The root tone itself starts the octave. Thus, there is a first note (1), a note which is a two steps away (2), a 3rd (1+2=3), a 5th (2+3=5), for 8 white keys in a 13 note octave. Plus, there are groups of 2 and 3, for 5 black keys, 8 white keys, and 13 notes in total. We see, once again, the Fibonacci terms. However, you may note that there are only 88 keys on the keyboard (and the corresponding Fibonacci term is 89), this is interesting, and something to possibly research in the future.

Let us change gears a little bit – pianos produce notes through a vibration of a string  (we can approximate this as a string vibrating while clamped at both ends). In this ideal string, we can assume that it is a uniform string of length L and a linear density  at a tension T. The wave equation is then (d^2y/dt^2)=c^2(d^2y/dx^2) where c=sqrt(T/rho).[3] [4] To solve this equation, we will take the boundary conditions such that the ends are fixed, y(0,t) = 0 and y(L,t) = 0 where L is the length of the string and t is time. Our initial conditions are such that y(x,0)=f(x) and (dy/dx)|_(t=0) = g(x). If the equation is solved, we see that there is a relationship between the tension, length, and material of the string, and that the wave produced is dependent on the initial displacement AND the initial velocity of the string. [5]

Pretty much, what this all tells us is that the way we play the piano is informed by a really neat bit of math that gets very ugly in the middle but comes out looking (relatively) elegant.

For another moment, I would like to return to the Fibonacci sequence and the golden ratio. If we were to examine the frequencies of notes and the relationship of those frequencies to the root note in the octave, we would see some interesting correlations.[6] For instance, the ratio 1/1 can be taken as the note A, the first note in a scale, which has a calculated frequency of 440Hz (in reality, these can differ, I will use the calculated frequencies from here on out). If we compare this to the octave note, A1, which has a frequency of 880Hz, we see that the ratio of A1 to A is 2/1, which is a Fibonacci ratio. Additionally, if we jump to the fifth in an octave, in this case the note E, the frequency is 660Hz, and the relationship of E to A is 660/440, or 3/2. Now, let us look at an adjusted frequency. If a piano is tuned so that the frequency of A is 432Hz, which is a more realistic frequency, then let F_432 be the frequency in this notation. Then for the root A, F_432 = 432 and for the octave A1, F_432 = 864. Then the ratio between the two is A_1/A = 864/432 = 2. This is the same as previously, a Fibonacci ratio of 2/1. If we jump again to use a C# third, then for C#, F_432 = 1080, and the ratio becomes C#/A = 1080/432 = 5/2. C# is the fifth note away from A, and the second black key. Once again, this is the Fibonacci ratio for the musical relationship.[7]