[Date Index]
[Thread Index]
[Author Index]
Re: Simplify with assumptions
*To*: mathgroup at smc.vnet.net
*Subject*: [mg32445] Re: [mg32409] Simplify with assumptions
*From*: BobHanlon at aol.com
*Date*: Mon, 21 Jan 2002 02:54:57 -0500 (EST)
*Sender*: owner-wri-mathgroup at wolfram.com
In a message dated 1/19/02 2:18:10 AM, dsnead6 at charter.net writes:
>Using Mathematic 4.1, Why won't the 2nd expression simplify?
>
>Simplify[1 - c^2, s^2 + c^2 == 1]
>gives
>s^2
>
>But
>Simplify[1 - s^2, s^2 + c^2 == 1]
>gives
>1 - s^2
>
>Why doesn't this 2nd expression yield c^2?
>
>The leaf count of both s^2 and c^2 are 3.
>While the leaf count for both 1 - s^2 and 1 - c^2 are 7.
I don't know why but, as in your example, Mathematica's behavior
is sometimes dependent on the canonical order of the variable names.
For this simplification, it appears to stop its search when it has a form
which has eliminated the first (in canonical order) variable. One
work-around is to replace some or all of the variable names with
dummy names to alter the variables' order, solve the problem, and
restore the original names. For example,
Simplify[{1-c^2,1-s^2}, s^2+c^2==1]
{s^2, 1 - s^2}
Simplify[{1-c^2,1-s^2} /. c -> t,
s^2+c^2==1 /. c -> t] /. t -> c
{1 - c^2, c^2}
the desired simplifications being
First[Sort[#,
LeafCount[#1]<LeafCount[#2]&
]]& /@ Transpose[{%, %%}]
{s^2, c^2}
Bob Hanlon
Chantilly, VA USA
Prev by Date:
**Why doesn't this rule work?**
Next by Date:
**Re: parameter restrictions**
Previous by thread:
**Simplify with assumptions**
Next by thread:
**Re: Simplify with assumptions**
| |