Change of Variables in Differential Operators
There is no command or standard package for computing the effect of a change of variables in integrals or differential equations. However, all the necessary tools exist as built-in functions and hence the required functionality can be obtained through a straightforward combination of a few simple commands.
As a concrete example, consider , where and are implicit functions of and . Using the chain rule, differentiation with respect to leads to the following equality.
On the left-hand side we use partial differentiation, but on the right we need to use total differentiation because and are implicit functions of and .
The Jacobian matrix, , is easily computed using Outer.
For example, with the change of variables and , , reads
When this matrix is invertible, the change of variables is (locally) invertible, and its Jacobian matrix, , can be directly equated to the (matrix) inverse of .
Evaluate is required so that the assignments are made--not to JacobianMatrix itself--but on an element-by-element basis to the matrix generated by JacobianMatrix. The identity generated by the chain rule becomes
which is an example of the sort of computation required for an arbitrary change of variables in a partial differential equation.
To compute and we have used pattern-matching: HoldPattern prevents the total differentiation of the pattern on the left-hand side, and delayed replacement () delays the evaluation of the pattern on the right-hand side until after and have been matched. We need to use total differentiation because and are expressed as implicit functions of and .
Computing higher derivatives this way is tedious. Also, there is another more subtle problem: because the first derivatives have been computed and stored
higher-partial derivatives are computed directly from this, and an incorrect result is obtained.
This is because this computation essentially involves
which vanishes because is not explicitly dependent upon and .
Using Clear[Derivative] to clear all saved partial derivatives (which are assignments attached to Derivative), we modify the above steps to make the dependency of the functions on all variables explicit and combine them into a procedure.
Through[new@@old] and Thread[new->explicit] make explicit the dependency of the new variables upon the old variables.
Note that Clear[Derivative] has the unfortunate side-effect of removing any extra definitions for Derivative that have been defined during the current session. However, it is required so that the matrix of (inverse) partial derivatives, JacobianMatrix[explicit, old], can be computed without Set errors. It is rather more difficult to modify ChangeVariables so as to only Clear rules for Derivative generated by ChangeVariables itself.
Recomputing the (inverse) Jacobian matrix for the change of variables and , we now obtain
and all higher derivatives are computed automatically, as in
where the result has been simplified by removing the explicit dependence on and using the replacement rule .
We now compute the Laplacian, , in spherical polar coordinates. The inverse Jacobian matrix reads
so the Laplacian acting on a function , , is
We use f_Function to restrict this rule to pure functions. We extend this specific rule to compute the Laplacian of any (explicit or implicit) function by converting f into a pure function as follows.
As examples, we compute the Laplacian of a spherically symmetric function
and a function with azimuthal symmetry (i.e., independent of ).
We conclude by clearing ChangeVariables, , and Derivative.
Converted by Mathematica September 30, 1999 [Prev Page][Next Page]