BEGIN_TEXT To find the area under the curve \( y=x^2 \) for \(2 \le x \le 3 \), we can calculate \( \int_\{ans_rule(20)\}^\{ans_rule(20)\} \{ans_rule(20)\} dx \) END_TEXT ANS(num_cmp(2)); ANS(num_cmp(3)); ANS(fun_cmp("x^2"));

To do this sort of thing properly you need to use a table. I have attached a problem file that does this. The key section is the following:

if ($displayMode eq 'TeX') { $integral = '\[\int_{'.ans_rule(4).'}^{'.ans_rule(4).'}'. ans_rule(35).'\,dx\]'; } else { $integral = $PAR. $BCENTER. BeginTable(). Row(['\(\displaystyle \int\)', ans_rule(4).$BR.$BR.ans_rule(4), ans_rule(35), '\(dx\).'],separation=>2). EndTable(). $ECENTER; }which uses the Union library's table macros to set up an integral with answer rules like you suggest. When hardcopy is requested ('TeX' mode), the layout is done without the table so that it formats a bit better.

Later, when you do the output of the problem, you simply use the variable `$integral` where you want this integral to appear.

Hope that helps.

Davide