<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [
  <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>9.4 The Gradient in Polar Coordinates and other Orthogonal Coordinate Systems</title>
  <link rel="stylesheet" type="text/css" href="../calculus.css" />
  <link rel="stylesheet" type="text/css" href="../mathml.css" />
<!-- Meta tag goes here -->
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="navbar">
      <p>
      <a href="http://ocw.mit.edu/OcwWeb/Mathematics/18-013ASpring-2005/Readings/index.htm">Home</a>
      |
      <a href="../index.xhtml">18.013A</a>
      |
      <a href="contents.xhtml">Chapter 9</a>
      </p>
    </td>
    <td class="navbar">&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td class="navbar">
      <p class="text-right">
      <a href="../tools/contents.xhtml">Tools</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="../glossary_notations/contents.xhtml">Glossary</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="../word_index/contents.xhtml">Index</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="contents.xhtml">Up</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="section03.xhtml">Previous</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="../chapter10/contents.xhtml">Next</a>
      </p>
    </td>
  </tr>
  <tr>
    <td colspan="3">
      <hr />
    </td>
  </tr>
</table>
<h2>9.4 The Gradient in Polar Coordinates and other Orthogonal Coordinate Systems</h2>
<p>
Suppose we have a function given to us as 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>f</mi>
      <mo stretchy="false">(</mo>
      <mi>x</mi>
      <mo>,</mo>
      <mi>y</mi>
      <mo stretchy="false">)</mo>
    </mrow>
  </math>
</span>
 in two dimensions or as 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>g</mi>
      <mo stretchy="false">(</mo>
      <mi>x</mi>
      <mo>,</mo>
      <mi>y</mi>
      <mo>,</mo>
      <mi>z</mi>
      <mo stretchy="false">)</mo>
    </mrow>
  </math>
</span>
 in three dimensions. We can take the partial derivatives with respect to the given variables and arrange them into a vector function of the variables called
<strong>the gradient of</strong>
<span class="math-inline-bold">
  <math display="inline" xmlns="&mathml;">
    <mi>f</mi>
  </math>
</span>
, namely
</p>
<div class="math-block-bold">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mrow>
        <mo>(</mo>
        <mrow>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>f</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>x</mi>
            </mrow>
          </mfrac>
          <mo>,</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>f</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>y</mi>
            </mrow>
          </mfrac>
        </mrow>
        <mo>)</mo>
      </mrow>
      <mtext>or</mtext>
      <mrow>
        <mo>(</mo>
        <mrow>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>g</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>x</mi>
            </mrow>
          </mfrac>
          <mo>,</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>g</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>y</mi>
            </mrow>
          </mfrac>
          <mo>,</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>g</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>z</mi>
            </mrow>
          </mfrac>
        </mrow>
        <mo>)</mo>
      </mrow>
    </mrow>
  </math>
</div>
<p>
which mean
</p>
<div class="math-block-bold">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>f</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>x</mi>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mi>i</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>+</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>f</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>y</mi>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mi>j</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mtext>or</mtext>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>g</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>x</mi>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mi>i</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>+</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>g</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>y</mi>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mi>j</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>+</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>g</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>z</mi>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mi>k</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
    </mrow>
  </math>
</div>
<p>
Suppose however, we are given 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>f</mi>
  </math>
</span>
 as a function of 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>r</mi>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03B8;</mi>
  </math>
</span>
, that is, in polar coordinates, (or 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>g</mi>
  </math>
</span>
 in spherical coordinates, as a function of 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>&#x03C6;</mi>
      <mo>,</mo>
      <mi>&#x03B8;</mi>
    </mrow>
  </math>
</span>
, and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03C1;</mi>
  </math>
</span>
 ).
</p>
<p>
For example, suppose 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>f</mi>
      <mo>=</mo>
      <mfrac>
        <mn>1</mn>
        <mi>r</mi>
      </mfrac>
    </mrow>
  </math>
</span>
, or 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>g</mi>
      <mo>=</mo>
      <mfrac>
        <mn>1</mn>
        <mi>&#x03C1;</mi>
      </mfrac>
    </mrow>
  </math>
</span>
, or 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>g</mi>
      <mo>=</mo>
      <mi>sin</mi>
      <mo>&#x2061;</mo>
      <mi>&#x03B8;</mi>
    </mrow>
  </math>
</span>
.
</p>
<p>
<strong>How do we find the gradient of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>f</mi>
    </math>
  </span> or
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>g</mi>
    </math>
  </span>?</strong>
</p>
<p>
<strong>One way</strong>
to find the gradient of such a function is to
<strong>convert
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>r</mi>
    </math>
  </span> or
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03C1;</mi>
    </math>
  </span> or
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> into rectangular coordinates using the appropriate formulae for them,</strong>
and perform the partial differentiation on the resulting expressions.
</p>
<p>
Thus we can write
</p>
<div class="math-block-normal">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mfrac>
        <mn>1</mn>
        <mi>r</mi>
      </mfrac>
      <mo>=</mo>
      <msup>
        <mrow>
          <mo stretchy="false">(</mo>
          <msup>
            <mi>x</mi>
            <mn>2</mn>
          </msup>
          <mo>+</mo>
          <msup>
            <mi>y</mi>
            <mn>2</mn>
          </msup>
          <mo stretchy="false">)</mo>
        </mrow>
        <mrow>
          <mo>&#x2212;</mo>
          <mn>1</mn>
          <mo>/</mo>
          <mn>2</mn>
        </mrow>
      </msup>
    </mrow>
  </math>
</div>
<p>
and find, by ordinary partial differentiating
</p>
<div class="math-block-normal">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mover accent="true">
        <mo>&#x2207;</mo>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
      <mfrac>
        <mn>1</mn>
        <mi>r</mi>
      </mfrac>
      <mo>=</mo>
      <mo>&#x2212;</mo>
      <mfrac>
        <mi>x</mi>
        <mrow>
          <msup>
            <mi>r</mi>
            <mn>3</mn>
          </msup>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mi>i</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>&#x2212;</mo>
      <mfrac>
        <mi>y</mi>
        <mrow>
          <msup>
            <mi>r</mi>
            <mn>3</mn>
          </msup>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mi>j</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
    </mrow>
  </math>
</div>
<p>
It is a bit more convenient sometimes, to be able to express the gradient directly in polar coordinates or spherical coordinates, like it is expressed in rectangular coordinates as above.
</p>
<p>
We want here an expression involving partial derivatives with respect to 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>r</mi>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03B8;</mi>
  </math>
</span>
<strong>multiplied by vectors pointing respectively in the
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>r</mi>
    </math>
  </span> direction, and
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> direction.</strong>
</p>
<p>
So we want to know:
<strong>what vectors should these partial derivatives be multiplied 
  by in order to form the gradient?</strong>
</p>
<p>
<strong>When we find the answer, the actual partial derivative with respect to each 
  polar variable will be the dot product of a unit vector in a polar direction 
  with the gradient. </strong>
</p>
<p>
<strong>We therefore digress to discuss what thes unit vectors are so that you can 
  recognize them.</strong>
</p>
<p>
The r direction is the direction tilted by an angle 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03B8;</mi>
  </math>
</span>
 counterclockwise from the 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>x</mi>
  </math>
</span>
 axis. A unit vector in that direction, call it 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mover accent="true">
        <mrow>
          <msub>
            <mi>u</mi>
            <mi>r</mi>
          </msub>
        </mrow>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
    </mrow>
  </math>
</span>
, can be written in any of the three following forms
</p>
<div class="math-block-bold">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mover accent="true">
        <mrow>
          <msub>
            <mi>u</mi>
            <mi>r</mi>
          </msub>
        </mrow>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
      <mo>=</mo>
      <mi>cos</mi>
      <mo>&#x2061;</mo>
      <mi>&#x03B8;</mi>
      <mover accent="true">
        <mi>i</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>+</mo>
      <mi>sin</mi>
      <mo>&#x2061;</mo>
      <mi>&#x03B8;</mi>
      <mover accent="true">
        <mi>j</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>=</mo>
      <mfrac>
        <mi>x</mi>
        <mi>r</mi>
      </mfrac>
      <mover accent="true">
        <mi>i</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>+</mo>
      <mfrac>
        <mi>y</mi>
        <mi>r</mi>
      </mfrac>
      <mover accent="true">
        <mi>j</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>=</mo>
      <mfrac>
        <mrow>
          <mover accent="true">
            <mi>r</mi>
            <mo stretchy="true">&LongRightArrow;</mo>
          </mover>
        </mrow>
        <mi>r</mi>
      </mfrac>
    </mrow>
  </math>
</div>
<p>
The unit vector in the 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03B8;</mi>
  </math>
</span>
 direction lies in the direction 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mn>90</mn>
      <mo>&#x00B0;</mo>
    </mrow>
  </math>
</span>
 beyond the 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>r</mi>
  </math>
</span>
 direction, counterclockwisely, and is therefore given by
</p>
<div class="math-block-bold">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mover accent="true">
        <mrow>
          <msub>
            <mi>u</mi>
            <mi>&#x03B8;</mi>
          </msub>
        </mrow>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
      <mo>=</mo>
      <mo>&#x2212;</mo>
      <mi>sin</mi>
      <mo>&#x2061;</mo>
      <mi>&#x03B8;</mi>
      <mover accent="true">
        <mi>i</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>+</mo>
      <mi>cos</mi>
      <mo>&#x2061;</mo>
      <mi>&#x03B8;</mi>
      <mover accent="true">
        <mi>j</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>=</mo>
      <mo>&#x2212;</mo>
      <mfrac>
        <mi>y</mi>
        <mi>r</mi>
      </mfrac>
      <mover accent="true">
        <mi>i</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
      <mo>+</mo>
      <mfrac>
        <mi>x</mi>
        <mi>r</mi>
      </mfrac>
      <mover accent="true">
        <mi>j</mi>
        <mo stretchy="true">&#x005E;</mo>
      </mover>
    </mrow>
  </math>
</div>
<p class="text-center">
<img src="images/gradient_polar_coords.gif" alt="figure" width="300" height="300" />
</p>
<p>
<strong>We now ask: what is
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mrow>
        <mover accent="true">
          <mo>&#x2207;</mo>
          <mo stretchy="true">&LongRightArrow;</mo>
        </mover>
        <mi>f</mi>
      </mrow>
    </math>
  </span> in polar coordinates?</strong>
</p>
<p>
We know that if we make differential changes in 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>r</mi>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03B8;</mi>
  </math>
</span>
 the resulting change in 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>f</mi>
  </math>
</span>
 will be given by
</p>
<div class="math-block-normal">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>f</mi>
      <mo stretchy="false">(</mo>
      <mi>r</mi>
      <mo>,</mo>
      <mi>&#x03B8;</mi>
      <mo stretchy="false">)</mo>
      <mo>=</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>f</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>r</mi>
        </mrow>
      </mfrac>
      <mi>d</mi>
      <mi>r</mi>
      <mo>+</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>f</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>&#x03B8;</mi>
        </mrow>
      </mfrac>
      <mi>d</mi>
      <mi>&#x03B8;</mi>
    </mrow>
  </math>
</div>
<p class="text-center">
<a id="Equation_A" class="doclink"></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(A)
</p>
<p>
since this relation holds for any variables at all.
</p>
<p>
But they must also obey
</p>
<div class="math-block-normal">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>f</mi>
      <mo>=</mo>
      <msub>
        <mrow>
          <mo stretchy="false">(</mo>
          <mover accent="true">
            <mo>&#x2207;</mo>
            <mo stretchy="true">&LongRightArrow;</mo>
          </mover>
          <mi>f</mi>
          <mo stretchy="false">)</mo>
        </mrow>
        <mi>r</mi>
      </msub>
      <mi>d</mi>
      <msub>
        <mi>s</mi>
        <mi>r</mi>
      </msub>
      <mo>+</mo>
      <msub>
        <mrow>
          <mo stretchy="false">(</mo>
          <mover accent="true">
            <mo>&#x2207;</mo>
            <mo stretchy="true">&LongRightArrow;</mo>
          </mover>
          <mi>f</mi>
          <mo stretchy="false">)</mo>
        </mrow>
        <mi>&#x03B8;</mi>
      </msub>
      <mi>d</mi>
      <msub>
        <mi>s</mi>
        <mi>&#x03B8;</mi>
      </msub>
      <mo>=</mo>
      <mover accent="true">
        <mo>&#x2207;</mo>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
      <mi>f</mi>
      <mo>&#x00B7;</mo>
      <mi>d</mi>
      <mi>s</mi>
    </mrow>
  </math>
</div>
<p>
As we noted briefly in
<strong>
  <a href="../chapter03/section08.xhtml" class="doclink">section 
  3.8</a>
</strong>
, distance in polar coordinates upon making small changes in the variables 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>r</mi>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03B8;</mi>
  </math>
</span>
 is described by
</p>
<div class="math-block-normal">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <msup>
        <mi>s</mi>
        <mn>2</mn>
      </msup>
      <mo>=</mo>
      <mi>d</mi>
      <msup>
        <mi>r</mi>
        <mn>2</mn>
      </msup>
      <mo>+</mo>
      <msup>
        <mi>r</mi>
        <mn>2</mn>
      </msup>
      <mi>d</mi>
      <msup>
        <mi>&#x03B8;</mi>
        <mn>2</mn>
      </msup>
    </mrow>
  </math>
</div>
<p>
From this we deduce that 
<span class="math-inline-bold">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <msub>
        <mi>s</mi>
        <mi>r</mi>
      </msub>
    </mrow>
  </math>
</span>
 is 
<span class="math-inline-bold">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>r</mi>
    </mrow>
  </math>
</span>
 while 
<span class="math-inline-bold">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <msub>
        <mi>s</mi>
        <mi>&#x03B8;</mi>
      </msub>
    </mrow>
  </math>
</span>
 is 
<span class="math-inline-bold">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>r</mi>
      <mi>d</mi>
      <mi>&#x03B8;</mi>
    </mrow>
  </math>
</span>
.
</p>
<p>
Putting the two equations for ds together, we deduce:
</p>
<p>
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <msub>
        <mrow>
          <mo stretchy="false">(</mo>
          <mover accent="true">
            <mo>&#x2207;</mo>
            <mo stretchy="true">&LongRightArrow;</mo>
          </mover>
          <mi>f</mi>
          <mo stretchy="false">)</mo>
        </mrow>
        <mi>r</mi>
      </msub>
    </mrow>
  </math>
</span>
 is the partial derivative of 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>f</mi>
  </math>
</span>
 with respect to 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>r</mi>
  </math>
</span>
, just as 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <msub>
        <mrow>
          <mo stretchy="false">(</mo>
          <mover accent="true">
            <mo>&#x2207;</mo>
            <mo stretchy="true">&LongRightArrow;</mo>
          </mover>
          <mi>f</mi>
          <mo stretchy="false">)</mo>
        </mrow>
        <mi>x</mi>
      </msub>
    </mrow>
  </math>
</span>
 is its partial derivative with respect to 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>x</mi>
  </math>
</span>
.
</p>
<p>
But
<strong>because
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mrow>
        <mi>d</mi>
        <msub>
          <mi>s</mi>
          <mi>&#x03B8;</mi>
        </msub>
      </mrow>
    </math>
  </span> has a factor of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>r</mi>
    </math>
  </span> in it, there must be a compensating factor of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>r</mi>
    </math>
  </span> in the denominator of the component of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mrow>
        <mover accent="true">
          <mo>&#x2207;</mo>
          <mo stretchy="true">&LongRightArrow;</mo>
        </mover>
        <mi>f</mi>
      </mrow>
    </math>
  </span> in the
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> direction</strong>
</p>
<div class="math-block-bold">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <msub>
        <mrow>
          <mo stretchy="false">(</mo>
          <mover accent="true">
            <mo>&#x2207;</mo>
            <mo stretchy="true">&LongRightArrow;</mo>
          </mover>
          <mi>f</mi>
          <mo stretchy="false">)</mo>
        </mrow>
        <mi>&#x03B8;</mi>
      </msub>
      <mo>=</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>f</mi>
        </mrow>
        <mrow>
          <mi>r</mi>
          <mo>&#x2202;</mo>
          <mi>&#x03B8;</mi>
        </mrow>
      </mfrac>
    </mrow>
  </math>
</div>
<p>
<strong>and</strong>
</p>
<div class="math-block-bold">
  <math display="block" xmlns="&mathml;">
    <mrow>
      <mover accent="true">
        <mo>&#x2207;</mo>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
      <mi>f</mi>
      <mo>=</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>f</mi>
        </mrow>
        <mrow>
          <mi>r</mi>
          <mo>&#x2202;</mo>
          <mi>&#x03B8;</mi>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mrow>
          <msub>
            <mi>u</mi>
            <mi>&#x03B8;</mi>
          </msub>
        </mrow>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
      <mo>+</mo>
      <mfrac>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>f</mi>
        </mrow>
        <mrow>
          <mo>&#x2202;</mo>
          <mi>r</mi>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mrow>
          <msub>
            <mi>u</mi>
            <mi>r</mi>
          </msub>
        </mrow>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
    </mrow>
  </math>
</div>
<p>
A similar computation can be made for any orthogonal directions in any dimension, and we can anticipate the result.
</p>
<p>
<strong>The component of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mrow>
        <mover accent="true">
          <mo>&#x2207;</mo>
          <mo stretchy="true">&LongRightArrow;</mo>
        </mover>
        <mi>f</mi>
      </mrow>
    </math>
  </span> in the direction of any such variable will be the partial derivative of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>f</mi>
    </math>
  </span> with respect to that variable, divided by the ratio of distance change in that direction 
  to change in the variable itself.</strong>
</p>
<p>
<strong>Using</strong>
the last equation we can immediately deduce that
<strong> the gradient of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> is
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mrow>
        <mfrac>
          <mrow>
            <mover accent="true">
              <mrow>
                <msub>
                  <mi>u</mi>
                  <mi>&#x03B8;</mi>
                </msub>
              </mrow>
              <mo stretchy="true">&LongRightArrow;</mo>
            </mover>
          </mrow>
          <mi>r</mi>
        </mfrac>
      </mrow>
    </math>
  </span>, except of course at
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mrow>
        <mi>r</mi>
        <mo>=</mo>
        <mn>0</mn>
      </mrow>
    </math>
  </span>, where
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> is not differentiable.</strong>
Similarly we find that the gradient of 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mfrac>
        <mn>1</mn>
        <mi>r</mi>
      </mfrac>
    </mrow>
  </math>
</span>
 is 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mo>&#x2212;</mo>
      <mfrac>
        <mn>1</mn>
        <mrow>
          <msup>
            <mi>r</mi>
            <mn>2</mn>
          </msup>
        </mrow>
      </mfrac>
      <mover accent="true">
        <mrow>
          <msub>
            <mi>u</mi>
            <mi>r</mi>
          </msub>
        </mrow>
        <mo stretchy="true">&LongRightArrow;</mo>
      </mover>
    </mrow>
  </math>
</span>
.
</p>
<p>
<strong>Exercises:</strong>
</p>
<p>
<strong>9.5 Use the fact that both angular variables in spherical coordinates are polar variables to express
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mrow>
        <mi>d</mi>
        <msup>
          <mi>s</mi>
          <mn>2</mn>
        </msup>
      </mrow>
    </math>
  </span> in 3 dimensions in terms of differentials of 
  the three variables of spherical coordinates. From this deduce the formula for 
  gradient in spherical coordinates.</strong>
</p>
<p>
<strong> 9.6 Find the gradient of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03D5;</mi>
    </math>
  </span> in spherical coordinates by this method and the gradient of
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> in spherical coordinates also.</strong>
</p>
<p>
There is a
<strong>third way</strong>
to find the gradient in terms of given coordinates, and that is by using the
<strong>chain rule.</strong>
</p>
<p>
We can first consider differential change of 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>f</mi>
  </math>
</span>
 in rectangular coordinates, and then relate the differential changes in 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>x</mi>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>y</mi>
  </math>
</span>
 to differential changes in the other coordinates, say 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>r</mi>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>&#x03B8;</mi>
  </math>
</span>
. Combining these we can relate the change in 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>f</mi>
  </math>
</span>
 to changes in the latter two variables.
</p>
<p>
Since we know how to write the gradient in rectangular coordinates and can recognize unit vectors, we can express the resulting expression in terms of components of the gradient in the other coordinate system.
</p>
<p>
Explicitly we can write
</p>
<div class="math-block-normal">
  <math display="block" xmlns="&mathml;">
    <mtable columnalign="left">
      <mtr>
        <mtd>
          <mi>d</mi>
          <mi>f</mi>
          <mo>=</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>f</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>x</mi>
            </mrow>
          </mfrac>
          <mi>d</mi>
          <mi>x</mi>
          <mo>+</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>f</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>y</mi>
            </mrow>
          </mfrac>
          <mi>d</mi>
          <mi>y</mi>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <mi>d</mi>
          <mi>x</mi>
          <mo>=</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>x</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>r</mi>
            </mrow>
          </mfrac>
          <mi>d</mi>
          <mi>r</mi>
          <mo>+</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>x</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>&#x03B8;</mi>
            </mrow>
          </mfrac>
          <mi>d</mi>
          <mi>&#x03B8;</mi>
        </mtd>
      </mtr>
      <mtr>
        <mtd>
          <mi>d</mi>
          <mi>y</mi>
          <mo>=</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>y</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>r</mi>
            </mrow>
          </mfrac>
          <mi>d</mi>
          <mi>r</mi>
          <mo>+</mo>
          <mfrac>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>y</mi>
            </mrow>
            <mrow>
              <mo>&#x2202;</mo>
              <mi>&#x03B8;</mi>
            </mrow>
          </mfrac>
          <mi>d</mi>
          <mi>&#x03B8;</mi>
        </mtd>
      </mtr>
    </mtable>
  </math>
</div>
<p>
and use the latter two equations to get rid of 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>x</mi>
    </mrow>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>y</mi>
    </mrow>
  </math>
</span>
 in the first equation. The result is an expression for 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>f</mi>
    </mrow>
  </math>
</span>
 in terms of 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>r</mi>
    </mrow>
  </math>
</span>
 and 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <mi>&#x03B8;</mi>
    </mrow>
  </math>
</span>
,
<strong>the coefficients of which can be described in terms of unit vectors in the 
  various directions, and the gradient in rectangular coordinates.</strong>
</p>
<p>
Comparing that equation with
<strong>the basic formula defining partial derivatives, 
  <a href="#Equation_A" class="doclink">Equation (A)</a>
</strong>
above you can read off the components of the gradient.
</p>
<p>
This approach is useful when 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>f</mi>
  </math>
</span>
 is given in rectangular coordinates but you want to write the gradient in your coordinate system, or if you are unsure of the relation between 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <mi>d</mi>
      <msup>
        <mi>s</mi>
        <mn>2</mn>
      </msup>
    </mrow>
  </math>
</span>
 and distance in that coordinate system.
</p>
<p>
<strong>Exercises:</strong>
</p>
<p>
<strong>9.7 Do this computation out explicitly in polar coordinates.</strong>
</p>
<p>
<strong>9.8 Do it as well in spherical coordinates.</strong>
</p>
<p>
<strong>What variables should we keep constant in taking partial derivatives?</strong>
</p>
<p>
It is worth noting that
<strong>when we take the partial derivative with respect to
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>x</mi>
    </math>
  </span> or
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>y</mi>
    </math>
  </span> we always mean that we are keeping the other variable,
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>y</mi>
    </math>
  </span> or
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>x</mi>
    </math>
  </span>, constant; on the other hand the partials with respect to
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>r</mi>
    </math>
  </span> and
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> always mean keeping the other one of these,
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>&#x03B8;</mi>
    </math>
  </span> or 
<span class="math-inline-bold">
    <math display="inline" xmlns="&mathml;">
      <mi>r</mi>
    </math>
  </span>, constant.</strong>
Any other meaning has to be described explicitly.
</p>
<p>
There are times and places where in a partial derivative one can become confused as to which variable or variables are being kept constant, and under such circumstances it is wise to modify the notation to supply this information explicitly. Thus we can write 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mrow>
      <msub>
        <mrow>
          <mrow>
            <mo>(</mo>
            <mrow>
              <mfrac>
                <mrow>
                  <mo>&#x2202;</mo>
                  <mi>f</mi>
                </mrow>
                <mrow>
                  <mo>&#x2202;</mo>
                  <mi>x</mi>
                </mrow>
              </mfrac>
            </mrow>
            <mo>)</mo>
          </mrow>
        </mrow>
        <mi>y</mi>
      </msub>
    </mrow>
  </math>
</span>
 to mean the partial derivative with respect to 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>x</mi>
  </math>
</span>
 keeping 
<span class="math-inline-normal">
  <math display="inline" xmlns="&mathml;">
    <mi>y</mi>
  </math>
</span>
 fixed, and then there can be no confusion as to what is kept constant.
</p>
<p>
<strong>The most important facts to remember about the gradient are:</strong>
</p>
<p>
It is straightforward to compute, in
<strong>any</strong>
orthogonal coordinate system
</p>
<p>
You can use it to determine the directional derivative of the function involved, in any direction.
</p>
<p>
In rectangular coordinates its components are the respective partial derivatives.
</p>
<p>
The gradient of the sum of two fields is the sum of their gradients (the gradient is a linear operator).
</p>
<p>
The gradient of a product can be computed by applying the usual product rule for differentiation.
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <hr />
    </td>
  </tr>
  <tr>
    <td class="navbar">
      <p class="text-right">
      <a href="contents.xhtml">Up</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="section03.xhtml">Previous</a>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="../chapter10/contents.xhtml">Next</a>
      </p>
    </td>
  </tr>
</table>
</body>
</html>
