       "Transparency" with respect to differentiation

• To: mathgroup at smc.vnet.net
• Subject: [mg73846] "Transparency" with respect to differentiation
• From: Martin Schoenecker <ms_usenet at gmx.de>
• Date: Fri, 2 Mar 2007 06:23:26 -0500 (EST)

```I would like to use a dummy object, that has the only task to mark its
argument function.  So I could use a previously undefined symbol for
that pupose:

In:= quat[f[x]+g[x]]
Out= quat[f[x]+g[x]]

Now I would like this flag to distribute over Plus:  each element in the
argument sum has the property of being "quat":

In:=
quat[a_+b_]:=quat[a]+quat[b]
quat[f[x]+g[x]+h[x]]
DownValues[quat]

Out= quat[f[x]]+quat[g[x]]+quat[h[x]]
Out= {HoldPattern[quat[a_+b_]]\[RuleDelayed]quat[a]+quat[b]}

So this property is stored as DownValue of quat.  Then, I would like the
quat to be transparent with respect to differentiation, and I thought it
would be a good idea to store this property as an UpValue for quat
rather than changing the (Protected!) D:

In:= quat/:D[quat[fun_],var__]:=quat[D[fun,var]]
D[quat[f[x]],x]

Out= quat[f'[x]]

which seems to work alright. However, a combination requiring both
properties does not work easily, the derivative of quat w.r.t. its
argument is produced:

In:=
D[quat[f[x] + g[x]], x]
(D[#1, x] &)/@quat[f[x] + g[x]]

Out= f'[x] quat'[f[x]] + g'[x] quat'[g[x]]
Out= quat[f'[x]] + quat[g'[x]]

So how could I define an object, distributing over Plus and transparent
w.r.t. differentiation more conveniently?

And, additionaly, how could I define a standard form of this object,
that returns a 'nicer' version (however maybe a bit less unambiguous),
like the integrate sign appearing when asking for Integrate?  My
attempts to understand TagBox and InterpretationBox (if these constructs
would help) were fruitless until now.

Regards, Martin

```

• Prev by Date: Re: Beginner--Problem with FilledPlot
• Next by Date: Re: deleting a title or subtitle in a notebook
• Previous by thread: Re: Hilbert Transform problems
• Next by thread: Re: "Transparency" with respect to differentiation