I’ve written a basic maths program and am thinking about adding some algebra functions to it like if user enters
(A +2B)(4A + 6C)
It would output
4A^2 + 6AC + 8AB + 12BC
I can’t quite decide how to write it. Would you work with it like a string or turn each term into some sort of token and work with them. Does anyone know what category this falls into mathematically or in computer science. The rules, which help to do things by hand, aren’t always much use when you attempt to implement it in a program.
Been hunting for things like this but I’m not sure of its proper title so its hard to find.