       Re: Pattern Matching for Exponentials

• To: mathgroup at smc.vnet.net
• Subject: [mg67503] Re: Pattern Matching for Exponentials
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Thu, 29 Jun 2006 00:08:59 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <e7tejf\$444\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Rick Eller wrote:
> I am looking for a pattern-matching replacement rule which will
> transform exponential functions of the form exp(n i t) into
> (1/(n^2-1))exp(n i t) where i = sqrt[-1]. For example, exp(2 i t)
> should convert to (1/3)exp(2 i t). I've tried the following code without
> success :
>
> In:     Exp[2 i t]   /.  Exp[n_ i t] -> Exp[n i t]/(n^2-1)
>
> Out:  e^2 i t
>
> I would appreciate any suggestions as to how this code should be
> modified.
>
> Thanks,
>
> Rick Eller
>
Hi Rick,

Well, I do not know what to say since that works fine on my system:

In:=
Exp[2*i*t]

Out=
2 i t
E

In:=
FullForm[%]

Out//FullForm=
Power[E, Times[2, i, t]]

In:=
MatchQ[Exp[2*i*t], Exp[(n_)*i*t]]

Out=
True

In:=
Exp[2*i*t] /. Exp[(n_)*i*t] -> 0

Out=
0

In:=
Exp[2*i*t] /. Exp[(n_)*i*t] -> Exp[n*i*t]/(n^(2) - 1)

Out=
1  2 i t
- E
3

In:=
\$Version

Out=
5.2 for Microsoft Windows (June 20, 2005)

HTH,
Jean-Marc

```

• Prev by Date: RE: Pattern Matching for Exponentials
• Next by Date: Bugs--Bugs Report in List Operation
• Previous by thread: RE: Pattern Matching for Exponentials
• Next by thread: how to fit data with this specified functional form?