back substitution (2.7.96)

Carl David

I wonder if someone has a good strategy for backsubstituting?

For instance, define f(x,y,z) = sqrt(x**2+y**2+z**2) and then take a derivative of a function such as diff(f(x,y,z),x). At this point I would like to back substitute for f, i.e., remove sqrt(x**2+y**2+z**2) where ever it occurs and replace it with f.

I find that I need contortions involving subs(%1=f,...); and that this trial and error procedure is not pedagogically reasonable.

Is there a scheme for doing this kind of back substitition so that physically meaningful variables can be employed consistently in the manner which pencil and paper work is done in physics and chemistry?

Jan-Moritz Franosch (8.7.96)

I think this is a very general problem in Maple. You may try using the alias function, but that is certainly not a final solution:

Maple automatically substitutes the subexpression 1/sqrt(...) by a. Note that unfortunately alias( a=sqrt(...) ) does not work because of the internal structure of Maple expressions. But subs does not work also:

subs( sqrt(...)=b ); 

I and certainly many Maple users have the problem of really ”intelligent” backsubstitution in a way like ”Find the most simple expressions using these substitutions or functions ...”. E.g. if should be possible to find out that x^4+y^2 should be expressed by f(x^2,y) if f(x,y)=x^2+y^2 has been previously defined or given as a possible substitution.


comment and a caveat. ASSUMING the range/characteristics of a variable does not make it so in the ’eyes’ of ”whattype”. This is, I believe, an error on Maple’s part. It screws up the performance of such programs as BesselI(n,x) when n is only ASSUMEd integer, not TYPEd integer.