I'm trying to pass a function of a variable (t) into a module where I will do lots of manipulation (such as taking the derivitave). But I'm not sure what the right way is. I have a workaround (f2), but it doesn't seem like the right way. What's the best practice in this case? thanks!
f[t_] = t^2;
function[f_] := Module[{},
f1[t_] = f;
f2[t2_] = f /. t -> t2;
Print["f[2] = ", f[2]];
Print["f/.t->2 = ", f /. t -> 2];
Print["f1[2] = ", f1[2]];
Print["f2[2] = ", f2[2]];
Print["f'[2] = ", f'[2]];
Print["f1'[2] = ", f1'[2]];
Print["f2'[2] = ", f2'[2]];
];
function[f[t]]
f[2] = (t^2)[2]f/.t->2 = 4
f1[2] = t^2
f2[2] = 4
f'[2] = ((t^2)')[2]
f1'[2] = 0
f2'[2] = 4