A new study group devoted to Differential Equations begins next Monday! A list of daily topics can be found on our Daily Study Groups page. This group will be led by one of our outstanding Wolfram certified instructors, Luke Titus, and will meet daily, Monday to Friday, over the next three weeks. Luke will share the excellent lesson videos created by him for the upcoming Wolfram U course “Introduction to Differential Equations”. Study group sessions include time for exercises, discussion and Q&A. This study group will help you achieve the “Course Completion” certificate for the “Introduction to Differential Equations” course after you complete the course quizzes.
I am trying to resolve this trivial problem trying to verify a solution . In the first run I get the incorrect answer but in the second run if I substitute the solution directly into the 4th line I get the correct answer . Any suggestions ?
Function does not evaluate its second argument automatically, so you could use Evaluate as shown below to achieve the desired result in the first case:
A link to the download folder containing all the lecture notebooks (as well as any additional materials used during the sessions) is included in the reminder email you receive from BigMarker. It will also be shared in the live session everyday of the study group series.
Thank you, Devendra. When you said “Function does not evaluate its second argument automatically” was it a general statement, or one related to a particular example? What would the “second argument” mean in general?
M
Thanks, Vincent. Could you please explain what’s the meaning of “1” in the list. Is it the module (length) of the vector which is, in fact, variable (but this is apparently handled by color coding) or something else? The lecture said that the “1” is D[x,x] , but why are we taking this derivative?
Yes, I also find it strange that the “Function does not evaluate its second argument automatically”. When I first ran into the problem I tried a number of alternatives and the error will occur without using “Function” . I cannot fathom the reason for Wolfram doing this …
In Function[x, body], the variable ‘x’ is the first ‘argument’ and the expression ‘body’ is the second ‘argument’.
The variable ‘x’ is effectively a ‘local’ (Module) variable inside Function and hence, as shown below, the function evaluation does not depend upon its name.
In practice, this means that the second argument ‘body’ is not evaluated by Function, so Evaluate is required below (since ‘body’ is defined outside Function).
Great! Thank you, Devendra, for opening the hood.
Also, I did not realize that “body” is the second argument. Apparently, I had in mind a function of several variables.
All the best.
M
OK, the first one fails, perhaps, because of the HoldAll attribute for Function. But why does the second one fail when there is no HoldAll attribute there?