How To:
Deal With Integrals

Mobius Logo

In particular indefinite integrals where the constant of integration is an issue. The more general problem of well-formatted answers also comes into this area.

KISS

The easiest way to setup a definite integral question is to use the Mathematical Formula type and insist on a particular Constant of Integration (or none at all if you so wish!). For example you could add this line after the question statement:

NOTE: Use capital "C" as your constant of integration!

In this case then just use the Formula type and enter an answer that includes that constant of integration.

While this method is quick and easy, it does not allow for part marks and presents an ugly answer. For example the answer to:


will be shown as: 

-1/(1+ln(x))-(1/5)ln(cos(5x))+C

whereas Maple graded questions can show the answer as:

You can make this a bit better by putting a properly formatted answer at the very top of the feedback so it appears beneath the badly formatted answer.

Use Maple-Grading

There are two advantages: (1) You can assign part marks and (2) you can control the answer format.  Here is the basic things you need:

  • In the Algorithm section define:
    $AnsPML="full answer with +C";
    #If returning from Maple: Let Ans be the actual answer passed back to $Ans. convert(Ans, string) and pass the result back as say $PAns. Then set $AnsPML="$PAns + C".
    $Ans=maple("answer");  # w/o +C
    This was added 2021/07/15 because for complicated answers the result from the previous assignment (w/o a maple call) did not work.
    # The Ci and C[i] are quoted, otherwise Mobius does not use them properly.
    # The C[i] allow Ci as constants. 
    $C=[C,c,K,k,"C1","C2","C[1]","C[2]"];
    $CML=maple("MathML:-ExportPresentation($C)");

  • $PartMark=0.8;
    $PMPct=100*$PartMark;
    $PMExp="(Any one of $CML could be used as the constant of integration. If you omitted the constant and were otherwise correct, you received $PMPct% of the mark.)";

  • In the feedback include at the bottom:
    [insert a horizontal line, change font size to xsmall, italic]
    $PMExp

  • In the Answer box for the Maple grading:
    printf(MathML[ExportPresentation]($AnsPML));

  • In the Maple Grading box:
    if evalb(simplify(simplify($RESPONSE)-simplify($Ans)) in $C) then
      1
    elif  evalb(simplify(simplify($RESPONSE)-simplify($Ans))=0) then
      $PartMark
    else
      0
    end if;

 
 

How-To Index

Main Index

Updated: 2023/06/29 SMS/DAG