I am trying to define a function of variables "x" and "t" and take partial derivatives with respect to each. The function is as follows:
When defining the function using variable "t" the output becomes:
Then taking the partial derivative w.r.t "t" using D[f,t] returns 0 (zero).
Substituting variable "y" for "t" returns a different (correct in my eyes) result.
So my question is; What is the difference in the eyes of mathematica, to the variables "t" and "y" (or really any other variable that I could define)?
I've posted screenshots to show exactly what my inputs were. Thank you so much in helping me better understand this.
You can read up on some of the differences between = and := here:
I thought I had tried that before moving on to using variable "y". I guess I didn't though as D[f[x,t],t] works just fine. My mistake.
Why is using delayed evaluation advantageous over immediate evaluation?
Look at your two examples carefully. In the first case you computed
By the way, you should define your functions using delayed evaluation (:=) rather than immediate evaluation (=)