Tangent Line
> restart;
>
TangentLine := proc(f,a)
local slope,fa;
fa := simplify(f(a));
slope := simplify(D(f)(a));
unapply(slope*(x-a)+fa,x);
end:# Define the TangentLine function
> Bombay := x -> 7.780117521*sin(.4714658670*x+1.688424783)+10.18610980;
>
f := TangentLine(Bombay,11);
pt := [[11,Bombay(11)]];
P1 := plot(pt,style=point):
P2 := plot([Bombay,f],8..14,color=red):
plots[display](P1,P2);
>
Hour := [ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
Depth := [2.5, 2.7, 4.5, 7.5, 11.1, 14.5, 17.0, 18.0, 17.2, 15.0, 11.7, 8.0, 4.9, 2.9, 2.5];
>
pts := [seq([Hour[k],Depth[k]],k=1..nops(Hour))]:
P1 := plot(pts,style=point):
P2 := plot([Bombay,f],6..20,2..22,color=red):
plots[display](P1,P2);