ClearAll; 
hour = Table[i - 1,{i,76}];
period = 621/25; halfperiod = 621/50;
factor = 200/207;
tide = {3.9, 3.4, 3.0, 2.8, 3.0, 
         3.6, 4.4, 5.1, 5.7, 6.0, 
         5.6, 4.8, 3.9, 3.4, 2.6, 
         1.9, 1.2, 1.0, 1.3, 2.3, 
         3.2, 4.0, 4.3, 4.5, 4.2, 3.8, 3.3, 3.0, 2.8, 
         3.1, 3.6, 4.5, 5.3, 6.0, 
         6.2, 5.8, 5.1, 4.3, 3.4, 
         2.6, 2.0, 1.6, 1.6, 2.2, 
         3.1, 3.9, 4.5, 4.7, 4.6, 4.2, 3.5, 3.0, 2.6, 
         2.5, 2.8, 3.5, 4.3, 4.9, 
         5.4, 5.5, 5.1, 4.4, 3.5, 
         2.8, 2.2, 1.7, 1.5, 1.8, 
         2.6, 3.4, 4.1, 4.5, 4.5, 4.2, 3.7, 3.1};
data = Map[Thread,Transpose[{hour,tide}]];
lp:= ListPlot[data];
interp = Interpolation[data];
f[t_] = Fit[data,{1,Cos[2 Pi t/period], Sin[2 Pi t/period],
					 Cos[2 Pi t/halfperiod],  Sin[2 Pi t/halfperiod]},t];
a1 = Coefficient[f[t],Cos[50 Pi t/621]];
a2 = Coefficient[f[t],Cos[100 Pi t/621]];
b1 = Coefficient[f[t],Sin[50 Pi t/621]];
b2 = Coefficient[f[t],Sin[100 Pi t/621]];
a0 = f[0] - a1 - a2;
g[t_] = a0 + a1 Cos[50 Pi t/621] + b1 Sin[50 Pi t/621];
h[t_] = a2 Cos[100 Pi t/621] + b2 Sin[100 Pi t/621];
up:= Plot[g[t],{t,0,period},AxesOrigin->{-1,2.55},
		  AxesLabel->{"t","y"},
		  PlotLabel->"(a) y = g(t)"];
down:= Plot[h[t],{t,0,period},AxesOrigin->{-1,-1.75},
		  AxesLabel->{"t","y"},
		  PlotLabel->"(b) y = h(t)"];
bestfit:= Plot[f[t],{t,0,75}];
right:= Show[lp,bestfit,AxesOrigin->{-5,0.55},
   			 AxesLabel->{"t","y"},
			 PlotRange->{Automatic,{0.8,6.25}},
			 PlotLabel->"(c) y = f(t)"];
Show[GraphicsArray[{GraphicsArray[{{up},{down}}],right}],
		PlotLabel->"Figure 23.9"]
f[t]