       Re: Simplifying

• To: mathgroup at yoda.physics.unc.edu
• Subject: Re: Simplifying
• From: leon at physics.su.oz.au
• Date: Wed, 3 Jun 1992 08:53:03 +1000

```Tom Grandy writes

>Has anyone encountered, or have any ideas about resolving
>the following problem? In trying to evaluate symbolically
>a number of complicated expressions, I have various functions
>of the following type,
>
>In:= f[x_,y_,z_] := Sqrt[m^2 + x^2 + y^2 + z^2]
>
>that must be differentiated:
>
>In:= D[f[x,y,z], y]
>
>                   y
>Out= -----------------------
>              2    2    2    2
>        Sqrt[m  + x  + y  + z ]
>
>While Mathematica (v 1.2 or v 2.0) recognizes the obvious,
>
>In:= D[f[x,y,z], y] == y/f[x,y,z]
>
>Out= True
>
>it doesn't seem to want to regroup:
>
>In:= D[f[x,y,z], y] /. Sqrt[m^2+x^2+y^2+z^2] -> f[x,y,z]
>
>                   y
>Out= -----------------------
>              2    2    2    2
>        Sqrt[m  + x  + y  + z ]
>
>despite considerable effort at variations on this theme.
>Without being able to contract things like this, and other
>types of expression, calculations become imposssibly long
>and cumbersome, and the output is useless. Any hints,
>ideas, or sympathetic comments out there?
>
>Tom Grandy
>wtg at corral.uwyo.edu
>

Mathematica recognizes the Sqrt in the denominator differently from Sqrt in
the numerator
the substitution

D[f[x,y,z], y] /. 1/Sqrt[m^2+x^2+y^2+z^2] -> 1/f[x,y,z]

should solve this problem.  It's not very elegant but it works.