Classroom Tips and Techniques: Partial Derivatives by Subscripting
Robert J. Lopez
Emeritus Professor of Mathematics and Maple Fellow
Maplesoft

Discussion


The prime as the symbol of ordinary differentiation is very compact (and generally convenient), especially when the derivative is to be evaluated at some specific value of the independent variable. Thus, for example, we have to indicate that the derivative of is to be evaluated at the argument . Of course, the notation
is perhaps a bit less ambiguous, but if is declared to be a function of , and prime to mean differentiation with respect to , then the prime notation is pretty clear. Moreover, for typesetting in a manuscript, the prime notation is a definite spacesaver.
The parallel for partial derivatives is the literal subscript. There are texts such as [1] that indicate partial derivatives with numeric subscripts so that for the function , partial differentiation with respect to would be indicated by . If it is clear that is a function of and , then, like the case for primes with ordinary derivatives, the notation is unambiguous.
Given the function , for evaluating its partial with respect to at , the notation is more compact and just as clear as the operator form
Many texts use the literal subscript for partial differentiation; this notation appears, for example, in [2, 3], two of the classics I still have on my shelf.


The declare Command in the PDEtools Package


The first mechanism in Maple that allowed partial derivatives to be displayed with subscripts is the declare command in the PDEtools package. This command predates the introduction of the Typesetting package that allows commands to be entered in math mode, or in what Maplesoft calls "2D math". Thus, declare would function in math mode, but it is best understood as an artifact of the "1D math" environment.
Within the confines of PDEtools package, executing the declare command changes the display of the partial derivative of with respect to to . So, the derivative is expressed with a literal subscript, and the display of the independent variables is suppressed. Table 1 illustrates the basic functionality of this command.
• 
Partial derivative by the explicit diff command.


=

• 
Load the PDEtools package.



• 
The package itself does not change the behavior of the display of a derivative.


=

• 
One form of the display command.



• 
Partial derivative now displayed with literal subscript.


=

Table 1 Basic functionality of the declare command in the PDEtools package

The "Nothing declared" echo in the fourth line of the table indicates that no specific function has been "declared;" hence, all unspecified functions will display with independent variables suppressed, and all partial derivatives will display as literal subscripts. There is a "quiet" option for the declare command that suppresses any output it would otherwise provide. There are undeclare, ON, and OFF commands to remove declarations, and to turn on and off the functionality of the display without having to invoke undeclare. These details are available in the help page for declare. where one can find the important excerpt we provide below.
• 
Different from macro and alias, this scheme handles only 'print/foo' subroutines. That is, it does not change input or output, only the typesetting on the screen.

This paragraph clarifies that the changes induced by declare affect only the display (i.e., printing) of derivatives and functions. Neither input nor output is changed in any essential way. Just the display changes.


The Typesetting Package


The Typesetting package contains the code by which Maple translates "2D math" notation to the original linear text form of its commands. Within the package, the Settings , Suppress , and Unsuppress commands are used to effect changes in the display of partial derivatives. In addition, the typesetting "level" must be changed from the default standard to extended. The use of these commands and options is summarized in Table 2.
• 
Remove the PDEtools package and its declare command.



• 
Install the Typesetting package.



• 
Set the typesetting level to extended (from standard).



• 
The userep option in the Settings command tells Maple that partial derivatives are to be indicated by repeated subscripts.



• 
The userep option only works if the independent variables have been suppressed by the Suppress command.



• 
The partial differential operator from the Expression palette is applied to . The Context Menu option

Evaluate and Display Inline
is used to evaluate the partial derivative. Note that the Suppress command, unlike the declare command, allows suppression of independent variables upon input.

=

• 
The Unsuppress command removes the effects of the Suppress command.



• 
That independent variables must now be explicitly included is evident from the vanishing of the derivative.


=

Table 2 Partial derivatives displayed with literal subscripts through the Typesetting package



Subscript as a Partial Differentiation Operator  1


Maple does not make directly available the subscript as a partial differentiation operator. The experiment that led to this article consists of the display in Table 3.
Remove the Typesetting package and its commands.


Restore the standard typesetting level. Note that a restart does not restore the typesetting level to its default value.


Type the equation
Context Menu: Assign Function


Attempt to compute at by subscripting . The returned value is not , it's .

=

Table 3 The failure of subscripts as partial differentiation operators

The desire to use subscripts as partial differentiation operators is at the heart of this article. That Maple fails as per Table 3 was a surprise, even after 23 years of using Maple as the mathematical tool of daily usage. Fortunately, the Maple programmers explained that this is a feature of the software, namely, that both and evaluate to the same function. In fact, this is the feature that allows to point to the natural log function, and to point to the base logarithm. The secret is in the coding, an example of which is given in Table 4.
Proof that the code in Table 4 defines the function in such a way as to permit literal subscripts to act as partial differentiation operators is in the calculations in Table 5.
Of course, the coding of the function in Table 4 is beyond tedious. Although the code illustrates what is possible, it is not a practical solution to the problem of using subscripts operationally for partial differentiation.


Subscript as a Partial Differentiation Operator  2


Table 6 summarizes a practical and workable method for defining subscripts as partial differentiation operators. The method hinges on the Atomic Identifier construct available in math mode. Loosely speaking, an Atomic Identifier is a collection of symbols that have been "locked" together to form a single name. In Maple, an unassigned letter or string of letters is the name of a variable. Some strings of symbols  for example,  do not form a Maple name because of the space between the two letters. Assignments cannot be made to such collections of characters. However, when frozen into the construction called an Atomic Identifier, they form a valid name.
There are several ways to form an Atomic Identifier. For complex collections of symbols, it is best to assemble the object, select it, and use Context Menu: 2D Math_Convert To_Atomic Identifier. The alternative to the Context Menu is the Format Menu's "Convert To" option, ending at "Atomic Identifier." The keyboard equivalent in the Windows®, and UNIX® operating systems is Control+Shift+A. For the Macintosh® operating system, it's Command+Shift+A.
For a literal subscript, it's easier. Instead of setting the subscript with the underscore key, add the Control key to the combination. Thus, it's Control+Shift+minus in the first two systems, and Command+Shift+minus on the last. Since this adds only one key to the normal combination for setting a subscript, setting the literal subscript and thereby forming an Atomic Identifier is relatively painless. Finally, there is the template in the Expression palette. This also creates a subscripted name as an Atomic Identifier.
Table 6 summarizes how to use subscripts, formed as Atomic Identifiers, as partial differentiation operators.
• 
Execute the restart command to clear all previous assignments.



• 
Type the equation

Context Menu: Assign Function


• 
Type the equation shown to the right. After typing the first , set the subscript as an Atomic Identifier.

• 
Context Menu: Assign Function



• 
Type the left side of the equation shown to the right. The symbol must be set as an Atomic Identifier.

• 
Context Menu: Evaluate and Display Inline


=

Table 6 Use of the Atomic Identifier construct to set a subscript as a partial differentiation operator

The astute reader will realize that the partial derivative has been defined as a function, just as has been. The Atomic Identifier device has allowed the symbols and to be seen as unrelated by Maple, thus bypassing the builtin rule that Maple functions do not distinguish between a function's name and that name subscripted. This may not be completely satisfactory, since each partial derivative has to be defined as a separate function. But the notational clarity that this device can bring to a manuscript makes it worth considering.


References


[1]

David V. Widder, Advanced Calculus, Second Edition, Dover Publications, 1989.

[2]

Watson Fulks, Advanced Calculus: An Introduction to Analysis, John Wiley & Sons, Publishers, 1961.

[3]

John M. H. Olmsted, Advanced Calculus, PrenticeHall, 1961.


