# Speed up Mathematica's Simplify and ComplexExpand functions

I am trying to simplify an expression and taking the real part only. However Mathematica use ages to run the command (if it is able to do so in the end). The problem is that the expression I am working with is extremely huge (centerElectron, about 400 000 characters).

simplifiedCenterElectron = Simplify[ComplexExpand[Re[centerElectron]]]


Do anyone have any hints as to how I could make Mathematica run this faster? And will it be able to do so in the end for a 400 000 character expression?

• Once the expression has gotten that large you have already lost the battle. If not done already, try simplifying upstream. Can you identify negligible terms that can be ignored? – Bob Hanlon Dec 9 '18 at 16:40
• I can't ignore more terms without loosing out on some physical phenomena. I have been trying to simplify earlier expressions, and also have problems with expressions about 80 000 characters. Any idea about if it will be possible to simplify expressions of such a length? – user61819 Dec 9 '18 at 16:45
• Try looking for common terms. Try looking for simplifications you might apply by hand. Would a series approximation help? Is there any reason to expect the result to simplify to something small? – mikado Dec 9 '18 at 17:50
• Collect with Simplify as the third argument sometimes finds simplifications that Simplify alone cannot. – bbgodfrey Dec 10 '18 at 2:16