Appendix D. Independence

Recall that the partials \( \overset{x}{\diff} \) and \( \overset{y}{\diff} \) assume that the input variables \( x \) and \( y \) are independent.
\[ \begin{align} \overset{x}{\diff} y &= 0 & &\andSpaced & \overset{y}{\diff} x &= 0 \end{align} \]
The independence laws allow us to take shortcuts when computing partials: we can treat certain expressions as constant. I hope to convince you that taking shortcuts is not always a good thing!
Example.
Consider the function described by
\[ \begin{align} z &\depends (x, y) \\ z &= x^2 y. \end{align} \]
The partials for this function are
\[ \begin{align} \overset{x}{\diff} z &= 2 x y \\ \overset{y}{\diff} z &= x^2. \end{align} \]
If we now assert dependence,
\[ \begin{align} y &\depends x \\ y &= x^2 \end{align} \]
then a substitution let's us rewrite the \( x \)-partial as
\[ \begin{align} \overset{x}{\diff} z &= 2 x y = 2 x^3. \end{align} \]
But this is not correct! A direct calculation gives the actual \( x \)-partial.
\[ \begin{align} z &= x^2 y = x^4 \\ \overset{x}{\diff} z &= \overset{x}{\diff} \bigl(x^4\bigr) = 4 x^3 \end{align} \]
Where did our example go wrong? Just by using partials, we implicitly assumed that \( x \) and \( y \) were independent. We then broke our assumption when we defined \( y = x^2 \). The differential does not assume independence, so it won't run into this same problem.
Example.
Let's redo the above example
\[ \begin{align} z &\depends (x, y) \\ z &= x^2 y \end{align} \]
but this time using the differential.
\[ \begin{align} \diff z &= \diff \bigl(x^2 y\bigr) \\ &= y \mult \diff \bigl(x^2\bigr) + x^2 \mult \diff y \\ &= 2 x y \mult \diff x + x^2 \mult \diff y \end{align} \]
Again, let's assert dependence.
\[ \begin{align} y &\depends x \\ y &= x^2 \end{align} \]
We continue our computation by substituting \( x^2 \) for \( y \).
\[ \begin{align} \diff z &= 2 x y \mult \diff x + x^2 \mult \diff y \\ &= 2 x \mult x^2 \mult \diff x + x^2 \mult \diff \bigl(x^2\bigr) \\ &= 2 x^3 \mult \diff x + x^2 \mult 2 x \mult \diff x \\ &= 2 x^3 \mult \diff x + 2 x^3 \mult \diff x \\ &= 4 x^3 \mult \diff x \end{align} \]
Sure enough, this agrees with the direct calculation.
\[ \begin{align} z &= x^4 \\ \diff z &= \diff \bigl(x^4\bigr) = 4 x^3 \mult \diff x \end{align} \]