MathGroup Archive 2001

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

Search the Archive

Re: Factorising operators??

  • To: mathgroup at
  • Subject: [mg30977] Re: [mg30959] Factorising operators??
  • From: BobHanlon at
  • Date: Sat, 29 Sep 2001 04:18:56 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 2001/9/28 5:22:20 AM, m.k.bowen at writes:

>I have two operators, a and b, that function as approximations to first
>second order derivatives. I can write (a+b)[x] and then use Through[%,Plus]
>to generate a[x]+b[x] but I want to do the reverse, ie. Get mathematica
>output (a+b)[x] if I give it a[x]+b[x]. Is there any way (preferably simple)
>to do this which will also work with more general cases ie. a[x]+5b[x]+const
>c[x] should produce (a+5b+const)[x]


c[x_] := c;

undoThrough[expr_, var_:x] := (expr /. f_[var] :> f)[var];

expr1 = (a+5b+c)[x]

(a + 5*b + c)[x]

expr2 = Through[expr1] /. (c_?NumericQ*f_)[x_] :> c*f[x]

c + a[x] + 5*b[x]


(a + 5*b + c)[x]

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Equation solving and Regress
  • Next by Date: Mathematica for Statistics?
  • Previous by thread: Re: Factorising operators??
  • Next by thread: Re: Factorising operators??