From a Surface Equation to Second Derivatives
An equation \(F(x,y,z)=0\) describes a surface in three-dimensional space. Near some points, that surface can be viewed as the graph of a function \(z=f(x,y)\). Once it is a graph, its first partial derivatives describe how the height changes as \(x\) or \(y\) changes. Its second partial derivatives describe how those changes vary.
For an implicit surface, calculating those second derivatives requires care. The variable \(z\) depends on \(x\) and \(y\), so differentiating a term involving \(z\) produces additional chain-rule terms. This tutorial derives those terms and applies the resulting formulas.
In the formulas below, \(F_x,F_{xz}\), and similar symbols mean partial derivatives of \(F\) with respect to its displayed independent variables. When such a derivative is evaluated along the graph \((x,y,f(x,y))\), it can vary with \(x\) and \(y\), and must itself be differentiated by the chain rule.
The First Derivative Identities
Substitute the graph \(z=f(x,y)\) into the surface equation. The resulting identity is \(F(x,y,f(x,y))=0\). Differentiating with respect to \(x\), while holding \(y\) fixed, gives \(F_x+F_z z_x=0\). Differentiating with respect to \(y\), while holding \(x\) fixed, gives \(F_y+F_z z_y=0\). Here \(z_x\) and \(z_y\) denote the partial derivatives of the graph function.
When \(F_z\ne 0\), these identities can be solved for the first derivatives:
The second derivatives follow by differentiating the identities again. The important point is that \(F_x\) and \(F_z\) are not generally constant along the graph. For instance, differentiating \(F_x\) with respect to \(x\) gives \(F_{xx}+F_{xz}z_x\), not just \(F_{xx}\).
Deriving the Second Derivative Formulas
Apply the product rule to \(F_z z_x\), and apply the chain rule to both \(F_x\) and \(F_z\).
Differentiate the \(x\)-identity with respect to \(y\), accounting for the dependence of each coefficient on \(z\).
Each resulting equation contains one term \(F_z\) times the desired second derivative. Divide by \(F_z\), which is nonzero in the region under consideration.
For the \(x\)-derivative, start with \(F_x+F_z z_x=0\). Along the graph, the chain rule gives \(\frac{\partial F_x}{\partial x}=F_{xx}+F_{xz}z_x\) and \(\frac{\partial F_z}{\partial x}=F_{zx}+F_{zz}z_x\). The product rule then yields
Since \(F\) is twice continuously differentiable, its mixed partials agree: \(F_{zx}=F_{xz}\). Collecting terms and solving for \(z_{xx}\) gives the first formula below.
To obtain the mixed derivative, differentiate \(F_x+F_z z_x=0\) with respect to \(y\). In particular, \(\frac{\partial F_x}{\partial y}=F_{xy}+F_{xz}z_y\), while \(\frac{\partial F_z}{\partial y}=F_{zy}+F_{zz}z_y\). Thus
Finally, differentiating \(F_y+F_z z_y=0\) with respect to \(y\) gives the \(y\)-second-derivative formula. Taken together, the formulas are:
All derivatives of \(F\) in these expressions are evaluated at \((x,y,z(x,y))\). The formulas rely on the nonzero denominator \(F_z\). If \(F_z=0\), these formulas cannot be used to solve for the second derivatives; a surface might still have a graph representation by another method, but this argument does not establish one.
Worked Example: A Sphere Near Its Top
Worked Example: A Sphere Near Its Top
Consider \(F(x,y,z)=x^2+y^2+z^2-1\) at \((0,0,1)\). Since \(F(0,0,1)=0\) and \(F_z=2z=2\) there, the surface locally defines \(z\) as a function of \(x,y\).
The first partial derivatives are \(F_x=2x\) and \(F_y=2y\). At the point, both are zero, so \(z_x=-F_x/F_z=0\) and \(z_y=-F_y/F_z=0\). The relevant second partial derivatives are \(F_{xx}=2\), \(F_{yy}=2\), \(F_{xy}=0\), \(F_{xz}=F_{yz}=0\), and \(F_{zz}=2\).
Substitute into the formulas:
Check by putting these values into the differentiated equations: the \(xx\) equation gives \(2+2(-1)=0\); the \(xy\) equation gives \(0+2(0)=0\); and the \(yy\) equation gives \(2+2(-1)=0\). Each identity is satisfied.
Worked Example: A Surface with Nonzero First Derivatives
Worked Example: A Surface with Nonzero First Derivatives
Let \(F(x,y,z)=z^2+xz+yz+xy+x^2+2y^2-1\), and evaluate the derivatives at \((0,0,1)\). The point is on the surface because \(F(0,0,1)=1-1=0\), and \(F_z=2z+x+y=2\) there.
The first partial derivatives are \(F_x=z+y+2x\) and \(F_y=z+x+4y\), so both equal \(1\) at the point. Hence \(z_x=-1/2\) and \(z_y=-1/2\). The second partials at the point are \(F_{xx}=2\), \(F_{yy}=4\), \(F_{xy}=1\), \(F_{xz}=1\), \(F_{yz}=1\), and \(F_{zz}=2\).
For the pure second derivatives,
For the mixed derivative, keep both terms containing a first derivative of \(z\):
To check, substitute into the three differentiated identities. The \(xx\) left side is \(2-1+1/2+2(-3/4)=0\). The \(xy\) left side is \(1-1/2-1/2+1/2+2(-1/4)=0\). The \(yy\) left side is \(4-1+1/2+2(-7/4)=0\). The first derivative identities also hold: \(F_x+F_z z_x=1+2(-1/2)=0\), and \(F_y+F_z z_y=1+2(-1/2)=0\).
Worked Example: The Mixed Derivative from a Product Term
Worked Example: The Mixed Derivative from a Product Term
Consider \(F(x,y,z)=z(1+x+y)+xy-1\) at \((0,0,1)\). The equation holds there, and \(F_z=1+x+y=1\), so the implicit graph condition is satisfied.
Here \(F_x=z+y\) and \(F_y=z+x\), each equal to \(1\) at the point. Thus \(z_x=z_y=-1\). The needed second partials are \(F_{xx}=F_{yy}=0\), \(F_{xy}=1\), \(F_{xz}=F_{yz}=1\), and \(F_{zz}=0\).
The formulas give
For the check, the \(xx\) differentiated equation is \(0+2(1)(-1)+1(2)=0\), and the \(yy\) equation is also \(0+2(1)(-1)+1(2)=0\). The mixed equation is \(1-1-1+1(1)=0\). Each computed second derivative satisfies its corresponding identity.
A Common Mistake: Treating \(z\) as Constant
A frequent error is to differentiate \(F_x\) along the surface as if \(z\) were fixed. For example, in the second worked example, \(F_x=z+y+2x\). Its derivative along the graph with respect to \(x\) is \(F_{xx}+F_{xz}z_x=2+1(-1/2)=3/2\), not merely \(F_{xx}=2\). The missing term comes from the fact that \(z\) changes when \(x\) changes.
Omitting that dependence also drops terms when differentiating \(F_z z_x\). In particular, the derivative of \(F_z\) along \(x\) is \(F_{zx}+F_{zz}z_x\), and it must be multiplied by \(z_x\) using the product rule. The resulting contribution is \(F_{zx}z_x+F_{zz}z_x^2\). Keeping these terms is what produces the factor \(2F_{xz}z_x\) in the \(z_{xx}\) formula.
Why the Conditions and Terms Matter
The formulas are useful because they turn the curvature information of an implicitly specified surface into calculations with partial derivatives of its defining function. They are also a systematic check on a proposed graph: each second derivative must satisfy the equation obtained by differentiating \(F(x,y,z(x,y))=0\).
The condition \(F_z\ne 0\) has a specific role. It makes it possible to solve the first derivative identities for \(z_x,z_y\), and then to isolate each second derivative by dividing by \(F_z\). It is not a cosmetic assumption. At a point where \(F_z=0\), the displayed formulas have zero denominators and do not apply in this form.
For the mixed derivative, the formula includes both \(F_{xz}z_y\) and \(F_{yz}z_x\), as well as \(F_{zz}z_xz_y\). These terms record the ways the coefficients and the graph itself change as both inputs vary. Keeping only \(F_{xy}\) would generally give the wrong answer, even when the equation and all partial derivatives of \(F\) have been computed correctly.
Check Your Understanding
Use the formulas and conditions in this tutorial to answer the following questions.
- What condition on \(F_z\) allows the second derivative formulas to be solved for \(z_{xx}\), \(z_{xy}\), and \(z_{yy}\)?
- When differentiating \(F_x\) with respect to \(x\) along the graph, why does the term \(F_{xz}z_x\) appear?
- Write the complete formula for \(z_{xy}\), including every term in its numerator.
- For \(F(x,y,z)=z+x^2+y^2-1\) at \((0,0,1)\), find \(z_{xx}, z_{xy}, z_{yy}\) and check them in the differentiated identities.
- Why can the formulas not be applied directly at a point where \(F_z=0\)?