Skip to main content
Post Closed as "Duplicate" by Michael E2, creidhne, MarcoB, bbgodfrey, Syed
edited tags
Link
Michael E2
  • 244.7k
  • 18
  • 351
  • 774
Source Link

How can I perform partial computations?

Given that $x = a^2 + b^2$ and $y = a^2 - b^2$, how can I compute $x + y$ in Mathematica such that the result is $a^2 + b^2 + a^2 - b^2$ without simplifying? Essentially, I want to calculate $x + y$ while keeping $x$ and $y$ in their original forms without performing any further calculations.

x = a^2 + b^2;y=a^2 - b^2
Hold[Evaluate[x + y]]

The above code has no effect. How can this be achieved in Mathematica?