MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: simplify problem

In article <55dkc8$22v at> Tomasz Bieruta  
<bieruta at> writes:
> I have following problem:
> In[1]   u=(a+b)^2; v=(c+d)^2;
> In[2]   uv=Expand[u+v]
> Out[2]  a^2+2ab+b^2+c^2+2cd+d^2
> How can I revers the above Operation, in this example from
> a^2+2ab+b^2+c^2+2cd+d^2
> I want to have (a+b)^2 + (c+d)^2.
> Can someone help me, please ?
> Tomasz B.
> ----
> e-mail: bieruta at

In version 3.0 one can do this as follows:

In[30]:= u=(a+b)^2; v=(c+d)^2;

In[31]:= uv=Expand[u+v];

In[32]:= FullSimplify[uv] // InputForm
Out[32]= (a + b)^2 + (c + d)^2

Simplify alone is not quite up to the task, though it will factor one  

Be aware that FullSimplify can be quite expensive re speed.

Daniel Lichtblau
Wolfram Research, Inc.
danl at

  • Prev by Date: Programming: Replace Heads
  • Next by Date: Re: 3.0 = Rip Roaring Resource Hog :-(
  • Previous by thread: Re: Programming: Replace Heads
  • Next by thread: simplify problem