On 10/03/2014 08:38, firstname.lastname@example.org wrote: > Hi all, > > I'm building a little Mathematica system that checks answers entered by students. Suppose the question is "what is Sin'[x]?" ad the student responds: Sin'[x] which is "correct", but not the intended answer (Cos[x]). I'm wondering if there is a general way to approach this sort of problem. In particular, is there a way to find out whether a given expression includes certain elements (like Derivative)? > > Thank you in advance, > > Sam > Of course, you can search an expression for particular symbols, e.g. FreeQ[Hold[Sin'[x]], Derivative]
(Note that you need the Hold, otherwise Mathematica will do the evaluation itself!)
This leads me to the obvious question as to how you will prevent students using Mathematica to obtain the answers anyway!
I can't help thinking there are much more inspiring ways to use Mathematica to teach!