## WeBWorK Problems

### ln(e) and MathObject differentiation ### ln(e) and MathObject differentiation

by D. Brian Walton -
Number of replies: 2
When I use the D() operator on a MathObject formula involving exponentials of the form "e^x" instead of "exp(x)", the differentiation rule uses the general base rule: d/dx[b^x] = b^x ln(b). Consequently, when I "Show correct answers" on a problem, it always shows a factor ln(e).

Is there an easy way to make this go away?

- Brian

D. Brian Walton In reply to D. Brian Walton

### Re: ln(e) and MathObject differentiation

by Arnold Pizer -
Hi Brian,

I'm not sure if there is an easy way to make this go away, but if you do not like the way MathObjects format an answer (things like the derivative of e^x or x^x come to mind), you can always specify things the way you want. E.g.

$a = random(2,7,1);$f = Compute("e^{${a}x}");$ans = Compute("${a}e^{${a}x}");
###################################
# Main text

Context()->texStrings;
BEGIN_TEXT

Let $$f(x) = \displaystyle f$$.  Find $$f'(x)$$.
$PAR $$f'(x) =$$ \{ans_rule(50) \} END_TEXT Context()->normalStrings; ################################### # Answers$showPartialCorrectAnswers = 1;
#$ans=$f->D('x');
ANS(\$ans->cmp);

Arnie 