Writing maths in LaTeX is the preferred choice. I used Texmaker https://www.xm1math.net/texmaker/ on GNU/Linux the license it GPL-2.0-or-later.
Overleaf https://www.overleaf.com/learn/latex/ can be used online, but this is not for me.
A nice python package is handcalcs. https://github.com/connorferster/handcalcs This can be used with jupyter notebooks see this as examples https://medium.com/@zumaia/python-calculations-in-jupyter-li...