       D[myFunc[g[x]

• To: mathgroup at yoda.physics.unc.edu (Mathematica User's Group)
• Subject: D[myFunc[g[x]
• From: Keith Clay <clay at galileo.phys.washington.edu>
• Date: Tue, 25 Aug 92 11:01:32 MDT

```In Re: the following...

> I want to give the function 'myFunc'
> the property of being 'transparent' to differentiation.
> i.e., I want to have
>
>   d myFunc[g[x]]                       d g[x]
>   --------------    give me    myFunc[ ------ ]                (1)
> 	dx                               dx
>
> where g is an arbitrary function.  "Easy" I hear you say...

Actually, I didn't say that.  But here is one simple solution.

--------------------------------------------------------------------

In:= Unprotect[D]

Out= {D}

In:= D[MyFunc[a_],b_]:=MyFunc[D[a,b]]

In:= Protect[D]

Out= {D}

(*  That's it!
Other functions are unchanged...  *)

In:= D[Sin[x^n],x]

-1 + n      n
Out= n x       Cos[x ]

(* MyFunc now behaves as advertised.  *)

In:= D[MyFunc[x^n],x]

-1 + n
Out= MyFunc[n x      ]

In:= D[MyFunc[x^n],n]

n
Out= MyFunc[x  Log[x]]

In:= Quit

There may be many other solutions.

Keith  (clay at galileo.phys.washington.edu)

```

• Prev by Date: Mathematica 2.0 and solving ODE's
• Next by Date: Re: D[myFunc[g[x]]] -> myFunc[D[g[x],x]: How to do in ch
• Previous by thread: Mathematica 2.0 and solving ODE's
• Next by thread: Re: D[myFunc[g[x]]] -> myFunc[D[g[x],x]: How to do in ch