`y = A cos(B(x - C)) + D`

Where:
- A is the amplitude of the cosine function (half the difference between the maximum and minimum values)
- B is the frequency of the function (determines how quickly the function oscillates)
- C is the phase shift of the function (horizontal shift)
- D is the vertical shift of the function

Given that the water level varies from 12 inches at low tide to 64 inches at high tide, the amplitude is `A = (64 - 12) / 2 = 26 inches`.

Since low tide occurs at 8 am and high tide occurs at 1:30 pm, the period is `T = 5.5 hours`. Therefore, the frequency is `B = 2π / T = 2π / 5.5`.

The phase shift `C` is the time at which the cosine function reaches its maximum value. Since high tide occurs at 1:30 pm, the phase shift is `C = 1.5 hours`.

The vertical shift `D` is the average of the maximum and minimum values of the cosine function, which is `(64 + 12) / 2 = 38 inches`.

Putting it all together, the cosine function that models the variation in inches above and below the water level as a function of time in hours since 8 am is:

`y = 26cos((2π / 5.5)(x - 1.5)) + 38`

Thus, the equation to model the tide variation is:

`y = 26 cos((2π / 5.5)(x - 1.5)) + 38`