Welcome @thornoar!
You were on the right track, lr
is the function you need, but to auto-scale vertical line |
it needs to be used like this:
$
lr((x - 1/3 x^3 )|)_(x = -1)^(x = 1)
$
For your second question, with lr
the sub/superscripts should by default be on the ends, but there is currently a bug when using explicit scaling that will be fixed in v0.13.