Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Naming pieces of patterns

  • To: mathgroup at
  • Subject: [mg29816] Naming pieces of patterns
  • From: Cyril Fischer <fischerc at>
  • Date: Thu, 12 Jul 2001 02:52:30 -0400 (EDT)
  • Organization: Inst. of Theoretical and Applied Mechanics
  • Sender: owner-wri-mathgroup at

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

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

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

{I, 2 I, -I} /. I -> J
{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