WOLFRAM

"CalculusResult" (Comparison Method)

Updated in 14.1[Experimental]
Compare mathematical expressions in a way suitable for exercises about calculus, allowing computation that does not include operations of calculus.

Details

  • The calculus comparison method considers two mathematical expressions to be equivalent if they do not differ by any calculus operations, e.g. D[x^2,x]2x.
  • Answers are considered correct even when containing differences that are not calculus operations, such as basic arithmetic or representations of trigonometric functions.
  • The values of the key and answer can both be specified as held expressions Hold[expr] to maintain the values exactly as they were given. Even when the values are held, evaluation of non-calculus functions (i.e. excluding D and Integrate) are performed within the held values during assessment. It is recommended to always hold the answer.
  • When values in the answer key contain integration constants represented using C, any appropriate representation of an integration constant in the answer is considered equivalent. For example, AssessmentFunction[x+C[1],"CalculusResult] will mark x+a as correct.
  • For results of the form expr+C[i] (consistent with first-order integration) the constant term can be omitted and the answer is still considered correct.
  • For answer key values containing multiple constants C[i],C[j],, any answer containing unique constants consistent with the answer key are considered equivalent to the answer key.

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Create an AssessmentFunction for a calculus question:

Out[1]=1

Use it to assess an answer:

Out[2]=2

Scope  (3)Survey of the scope of standard use cases

Create an assessment function for the solution to D[Tan[x],x]:

Out[1]=1

The original question is not accepted as an answer:

Out[2]=2

Equivalent mathematical expressions that are invariant in calculus operations are considered correct:

Out[3]=3
Out[4]=4

Include an integration constant in the answer:

Out[1]=1

Answers are considered correct if they use any C, unique symbol or omit the constant:

Out[2]=2
Out[3]=3
Out[4]=4

More complicated expressions are considered incorrect:

Out[5]=5

Compute the solution to a differential equation:

Out[1]=1

Create an assessment function using the solution:

Out[2]=2

Any equivalent representation of constants is considered correct:

Out[3]=3

Applications  (1)Sample problems that can be solved with this function

Create a QuestionGenerator that generates calculus questions including plots:

Out[1]=1

Generate a random question:

Out[2]=2

Properties & Relations  (1)Properties of the function, and connections to other functions

Evaluation for operations not considered to be calculus occurs even when the answer is held:

Out[1]=1

Global definitions of variables are ignored during assessment:

Out[2]=2