Outside temperature over a day can be modelled as a sinusoidal function. Suppose you know the high temperature for the day is 51 degrees and the low temperature of 39 degrees occurs at 3 AM. Assuming t is the number of hours since midnight, find an equation for the temperature, D, in terms of t.

To model the temperature variation as a sinusoidal function, we can use the general form:

D = A + B * sin(C * t + D)

Where:
D is the temperature at time t (in degrees)
A is the average temperature between the high and low temperatures
B is half the difference between the high and low temperatures
C determines the period of the function (in this case, the number of hours for one full cycle)
D gives the horizontal shift of the function (in this case, to account for the low temperature at 3 AM)

We are given:
High temperature = 51 degrees
Low temperature = 39 degrees
Temperature at 3 AM = 39 degrees

Therefore,
A = (51 + 39) / 2 = 90 / 2 = 45 degrees
B = (51 - 39) / 2 = 12 / 2 = 6 degrees
D = -3 (since the low temperature occurs 3 hours before t = 0)

Now, we need to find C, the period of the function. Since one full cycle occurs when the high temperature is reached again, we know this happens every 24 hours (since there's a 24-hour cycle in a day). So, C = 2π / T, where T is the period in hours. In this case, T = 24 hours, so:

C = 2π / 24 = π / 12

Now, substituting the values into the equation, we get:

D = 45 + 6 * sin((π / 12) * t - 3)

So, the equation for the temperature, D, in terms of t is:

D = 45 + 6 * sin((π / 12) * t - 3)