What you need to use is a software specifically to do mathematics. Use a CAS to learn math.
Try software like maxima.
I'm not sure whether that allows scripting. I found one that does it, try: http://eumat.sourceforge.net/
Thanks for the help I will use CAS to learn what is required for options excel and also check out maxima. I hope it works out for me.