The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: [mg5137] simplify problem
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Francisco Edmundo de Andrade

Posts: 9
Registered: 12/7/04
Re: [mg5137] simplify problem
Posted: Nov 9, 1996 2:06 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Wed, 6 Nov 1996, Tomasz Bieruta wrote:

> 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:

Consider a function called fullFactor that factors individuals
terms of any expression of sum defined as follow:

(* Edmundo's contribution 1996 *)
nextFactor[Plus[a__,b__],tabu_List] :=
x /; Not[MemberQ[tabu,x]]
] /; Length[{a}]<=Length[{b}]

Then, here is an example of his working:


which returns:

2 2 2 2
a + 2 a b + b + c + 2 c d + d

2 2
(a + b) + (c + d)

This solution can be expanded easily for general simplifying of
expressions of sum by replacing the word "Factor" by "Simplify"
along the definitions of functions above. The new function called
fullSimplify is slightly slowest than fullFactor.

I hope this solve your problem.

With kindest regards,

Edmundo [8-)
Universidade Federal do Ceara
Department of Computing

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.