Eliminating (-1)^2
- To: mathgroup at smc.vnet.net
- Subject: [mg16402] Eliminating (-1)^2
- From: "Nicolas B.E. Sawyer" <nbes at eee.nott.ac.uk>
- Date: Thu, 11 Mar 1999 02:17:02 -0500
- Organization: University of Nottingham
- Sender: owner-wri-mathgroup at wolfram.com
1) How do I get Mathematica to eliminate factors of (-1)^2. Specifically I want to replace occurrences of (-(1-a)x -a y)^2 by ((1-a)x +a y)^2 within an expression? 2) Using InputForm In[132]:= (-(1 - a)x - a y)^2 Out[132]= 2 (-((1 - a) x) - a y) but with StandardForm In[130]:= \!\(\((\(-\((1 - a)\)\) x - a\ y)\)\^2\) Out[130]= 2 ((-1 + a) x - a y) Why the difference in the results and why doesn't either give the following? 2 ((1 - a) x + a y) Finally, since Simplify[(-x - y)^2] gives 2 (x + y) why does Simplify[(-(1 - a)*x - a*y)^2] yield 2 ((-1 + a) x - a y) ? -- Nicolas B.E. Sawyer Department of Electrical and Electronic Engineering, University of Nottingham, University Park, Nottingham, NG7 2RD. Tel: +44 115 9515151 ext 12028 Fax: +44 115 9515616 E-mail: nbes at eee.nottingham.ac.uk