Is there a way to simplify an expression so that it's easy to use it in a program?
For example:
Return[3(x+Sqrt[y])^2+9(x+Sqrt[y])]
Would become:
temp1=x+Sqrt[y]; Return[3 temp1^2+9 temp1]
Basically if the same expression appears multiple times in a larger expression, is there a way to automatically extract it so that it only has to be calculated once?
Returnfunction. Just evaluate the input cell and the result will be shown in an output cell. – Edmund Sep 23 '17 at 11:10