I have a function F=c+dz
, which has particular boundary values, say F(z=1)=2
and F(z=-1)=1
, Then I can determine the coefficients: c=1.5
and d=0.5
. However, the following does not work!
ClearAll;
F[c_, d_, z_] = c + d*z;
Print[F[c, d, 1]]; Print[F[c, d, -1]];
Solve[{F[c, d, 1] == 2, F[c, d, -1] == 1}, {c, d}];
Print["c=", c, " d=", d];
Where's the mistake?
PS. There's a question of similar title here, which hasn't received an answer (and looks complicated too).