I think there are some tricks as bc comand (although not sure if bc is a shell build-in or base Linux command or it comes as an external dependency) or eval. However, my experience is that doing mathematics in shell is not easy... ;)