MathGroup Archive 2001

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

Search the Archive

Naming pieces of patterns


How can I as simply as possible use "substitutions"
1.
-(I/(2 a)) /. I/(2 a) -> A
does not work, while
(I/(2 a)) /. I/(2 a) -> A
works well

2.
{(a + b), -(a + b)}/. a + b -> e
gives
{e, -a - b}
instead of {e,-e}

3.
{-Sqrt[a + b], 1/Sqrt[a + b]} /. Sqrt[a + b] -> e
gives
{-e,1/Sqrt[a + b]}

4.
{I, 2 I, -I} /. I -> J
gives
{J, 2 \[ImaginaryI], -\[ImaginaryI]}

I know _why_ these cases do not work, but I would like to know, if there
is a possibilty to use a common pattern rule to substitute all
occurences of an expression.

Thank you,
Cyril Fischer



  • Prev by Date: kernel problem for trigonometry
  • Next by Date: Clearing cache
  • Previous by thread: Re: kernel problem for trigonometry
  • Next by thread: Re: Naming pieces of patterns