Re: help on Rewrite rules
- To: mathgroup at smc.vnet.net
- Subject: [mg50896] Re: [mg50875] help on Rewrite rules
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 26 Sep 2004 05:32:16 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
Use an assumption in Simplify. assumption = x^2+y^2==1; soln = Simplify[#,assumption]&/@ {3x^2+2y^2, (x^2+y^2)^(1/2), A[x^2]+B[y^2]+C[x^2+y^2]} {3 - y^2, 1, A[x^2] + B[y^2] + C[1]} In the first case Mathematica eliminated x rather than y. You can use a replacement rule to convert the expression. rr = Solve[assumption,y]//Last; soln[[1]] /. rr x^2 + 2 Bob Hanlon > > From: "Jon Palmer" <Jonathan.palmer at new.ox.ac.uk> To: mathgroup at smc.vnet.net > Date: 2004/09/25 Sat AM 01:55:17 EDT > To: mathgroup at smc.vnet.net > Subject: [mg50896] [mg50875] help on Rewrite rules > > I am having trouble simplifying expressions in mathematica. My epxerissions > involve two parameters x & y that parameterise a unit circle so that > > x^2 + y^2 =1 > > Without chosing a particular parameterization for x and y I want to simplify > epxpertions of the form: > > > > 3x^2 + 2y^2 -----> 2 + x^2 > or > (x^2 + y^2)^(1/2) -----> 1 > > and more importantly for should perform the simplification > > A[x^2] + B [y^2] + C[x^2+y^2] -----> A[ x^2] + B[ y^2] + C[1] > > where A,B&C are functions. > > I assume that this can me achieved with a relatively simple rewrite rule but > I have had very limited success making this work. Can anyone suggest a > solution, > > Many thanks > Jon Palmer > > P.S. I also want to expand the problem to that of three variables x,y&z > parameterizing a unit sphere but I suspect that this will be obvious form > the solution of the unit circle problem. > > > > ~