If i type the following in Cadabra2, ex:=\frac{19}{2 x};

it gives 191/2x. In fact for any integer numerator it appends a 1 to it. What's going on?

+1 vote

Also, if I type ex:=\frac{19}{2 x} a; it gives 19 (1/2x) a. But, then it does not do the cancellations for example in S:=-\frac{2}{2 s} a, it doesn't cancel the 2 whatever I do. How can I do cancellations? Provisionally I think I will not use \frac{}{}. But, it would help if it gets corrected, or at least pops up an error message.

Please help. I was able to do really difficult computation with Cadabra2 and it was giving correct results many times and I was really grateful for it, when in a subsequent computation way way simpler, I used this \frac thing and got wrong results. Thanks.

+1 vote

I'll get back to this in more detail a bit later, but as a general workaround: only write purely numerical fractions using `\frac`

, and for inverse powers of variables use e.g. `x**{-1}`

. You can then collect those powers using `collect_factors`

(and the numerical factors will collect automatically).