simplify terms containing a exponential function

Skip to first unread message

Feb 24, 2021, 3:24:46 AMFeb 24
to Numbas Users


I treid this in a promt of a part (for clarity without variables e.g. for the minus sign):

$ f(x) = 3 \cdot e ^ \simplify[std]{-2*x+1} + \simplify[std]{-x^2}  $

It yields to a display with "... +-x^2". With a plus followed by a minus sign.

So I tried
$ f(x) = \simplify[std]{3 * e ^ {-2*x+1}  +{-x^2}}  $
But this gives  an mathematical error from the part with e^ .

Is there a way to display this formula naturally?


Christian Lawson-Perfect

Feb 24, 2021, 4:37:23 AMFeb 24
Within \simplify, curly braces are used to substitute in variable values. Assuming you want to show the variable x, and it's not a question variable that you want to substitute, I think you should use parentheses, e.g.

$ f(x) = \simplify[std]{ 3*e^(-2x+1) + (-x^2) } $

You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web, visit

Feb 24, 2021, 6:42:00 AMFeb 24
to Numbas Users
Thank you! Now it works. My line is now with variables to substitute:

$ f(x) = \simplify[std,!otherNumbers,!noLeadingMinus]{{c}e^({b[1]}*x+{b[0]})  + {a[1]}x^{n[1]} + {a[0]}x^{n[0]}}$

It doesn't matter, but I wonder why the first example "e ^ \simplify[std]{-2*x+1}" is working.

Sincerely, Helge
Reply all
Reply to author
0 new messages