Partial Derivatives
Introduction
Suppose we are given a function , written in terms of components by for each . Now let the second coordinate remain some arbitrary fixed value . This determines a function of one variable, , for each possible chosen .
We can take the derivative of in just as any other function of :
The resulting function of may be considered for various possible values of , i.e. the variation may be restored. This function of both and is called the partial derivative of with respect to . As with ordinary derivatives, a variety of notations is used:
The new symbol ‘ ’ is called “partial” and should be written differently from ‘ ’. This symbol indicates the function’s dependence on additional variables.
Functions of several variables may have partial derivatives in each of their variables. Thus, for above we also have or .
By interpreting the function as the “trace” of the function at a fixed value , one sees that the partial derivative gives the slope of the curve formed as the cross-section of the plane with the graph of , namely the surface :
Similarly for the partial and the trace :
One can iterate partial derivatives and consider higher partials in the obvious manner. The notation indicates the “mixed partial” taken in first:
In principle, the double partials and could be different, but for nice functions they do agree by Clairaut’s Theorem:
Clairaut’s Theorem
Provided and exist and are continuous on a region , then on that region.
(Caveat: in the theorem, should be ‘open’ topologically: it should have the same dimension as the background and not include its boundary.)
Link to original
Example
Partial derivatives of a monomial
Link to originalPartial derivatives of a monomial
Problem: Compute the partial derivatives of first and second order of the function .
Solution: We have , , , , .
Exercise
01
Link to originalPartial derivatives of a composite
Let . Compute and .
Exercise
02
Link to originalEvaluate partial with four variables
Let
Calculate .
Exercise
03
Link to originalHigher order partials
Let .
- (a) Calculate the second-order partial derivatives of .
- (b) Calculate .
Exercise
04
Link to originalClairaut: choose the order wisely!
Let . Compute in your head. (Explain it on paper!)
Introduction (part 2)
Link to originalContinuity and differentiability: more complex in 3d!
The concepts of continuity and differentiability are more complicated in 3d due to potential incompatibilities of directionality that are a function of the and relationship.
Linear approximation
Introduction
There is a relation between the concepts of linear approximation, partial derivative, tangent plane, and differentiability. This relation is contained in a function defined in terms of :
Linear approximation function
The linear approximation function includes both partial derivatives and . The set of points satisfying defined by the above equation, namely the graph of , is the tangent plane. Lastly, the function is said to be differentiable when:
with two functions and satisfying as .
If is not differentiable, then the linear approximation may be a bad approximation.
Linear approximation in 2d
Remember that for a function of a single variable, we have the linear approximation:
The tangent line to at is given by , and is considered differentiable when such that as :
Tangent plane via tangent lines
How do we know that the graph of gives the tangent plane?
The tangent vector to the trace at is given by . So the tangent line is given by:
These points satisfy . The graph must be the tangent plane because it is the unique plane such that the tangent lines of the trace curves and lie in this plane.
Link to originalTaylor series and linear approximation
Linear approximation gives the first two terms of the Taylor series of a function, and the remainder term, captured in , must limit to zero when the function is differentiable:
If agrees with its Taylor series, then:
Differentials
Differentials
Some authors use the mnemonic notation of finite differentials for applications of linear approximation. These are written as , , , , etc., even though they are not infinitesimals. Their usage is according to the following kind of rules:
Link to original
Example
Tangent plane to paraboloid
Link to originalTangent plane to paraboloid
Problem: Find the equation of the plane tangent to the paraboloid at .
Solution: Set . Compute , . So , , and the linear approximation is given by:The tangent plane is found by setting .
Exercise
01
Link to originalTangent plane to a graph
Let . Find the tangent plane to the graph of at the point .
Exercise
02
Link to originalLinear approximation
Use a linear approximation to estimate the value of .
- (a) Write this using a function .
- (b) Write this using the notation of differentials.
What is the percentage error of your estimate from the true value?
Differentiability
Differentiability
In 2d, a function is differentiable precisely where its derivative exists. The situation is not so simple in 3d: a function like has both partial derivatives at , but it is not differentiable there! On the other hand, one theorem does help:
Link to originalTheorem
If a function is given and both partials and exist and are continuous at a point , then is differentiable at .
Exercise
03
Link to originalWhen partials aren’t continuous
Compute the partial derivatives of and explain carefully why this non-differentiable function does not violate the theorem.
Exercise
04
Link to originalDifferentiability of the radius function
Let . Is differentiable? Where?
Differentiability (part 2)
Link to originalDifferentiable, but partials aren’t continuous:
The function is differentiable at since it is approximated by its tangent plane at . The partials are not continuous there! You may check this by computing and . You can also compute , which is not continuous at .
Chain Rule
Chain rule over a curve
Chain rule over a curve
Suppose is a real-valued function on the plane, and is a parametric curve. There is a recipe to compute the derivative of the composite function :
Link to original
Example
Particle moving through temperature gradient
Link to originalParticle moving through temperature gradient
Problem: A particle traverses a parametric curve in the plane given by . The ambient temperature is a function of distance from the -axis: . How fast is the temperature changing at ?
Solution: We compute and , while . Then:
Chain rule over a curve (part 2)
Derivation of chain rule over a curve
Let’s suppose that some small change produces a change and via the parametrization . By differentiability of , we have:
Divide both sides by , and take the limit as . Notice that and because implies . It follows that we have:
So the sum of products in this chain rule comes from the linear approximation formula, which in turn comes from the tangency of the trace curves.
Link to original
Chain rule over several parameters
Chain rule over several parameters
The chain rule over a curve can be used to derive a more general chain rule for the case when the input variables are functions of several parameters. The formulas can be remembered as “sum of all products” (considering all products that make sense).
Suppose is a function, and suppose and are both functions of and . We can “consider” itself to be a function of and via the composition. Then:
These formulas may be derived immediately from the formula for the chain rule over a curve by considering the trace curves: let remain fixed for the first equation, and let remain fixed for the second equation.
Link to original
Exercise
01
Link to originalChain rule, several parameters
Let and , , and .
- (a) Generalize the chain rule above to the case of 3 variables and compute the partials and .
- (b) Write out in terms of and and compute the same partials directly.
Example
Polar partials and chain rule
Link to originalPolar partials and chain rule
Problem: Suppose is a real-valued function of points in the plane. Let and be the standard polar coordinates on the plane.
- (a) Write in terms of and and and .
- (b) Suppose . Find at .
Solution: (a) First compute and . Then:
(b) Compute , . So and .
Exercise
02
Link to originalPolar partials
Write in terms of and and and .
Chain rule over several parameters (part 2)
It is easy to generalize the chain rule to an arbitrary number of variables and parameters. Formally, the rule is:
where is a function of many variables, and each is a function of many parameters.
To remember the formula, it sometimes helps to draw a tree. The summation has one term for each path from the output variable down to the relevant input variable:
Link to original
Exercise
03
Link to originalChain rule: 3 variables, 3 parameters
Find at the point given that:
Directional derivative
Introduction
The partial derivative gives the rate of change of with respect to the variable .
Think of as a coordinate that moves the input to the function along a line . The partial gives the rate of change of with respect to this coordinate.
We can move along other lines, at other speeds. Let be any vector in the -plane. Consider the line that starts at and moves along using the parameter . We can take the derivative of with respect to , and the result is called the derivative of with respect to the vector . Here is the defining formula:
where we write for the components of .
Observe that the directional derivatives and with respect to the unit vectors are identical with the partial derivatives and . (Plug in into the limit formula above, for example.)
Link to original
Exercise
01
Link to originalLinearities of directional derivative
- (a) Show that .
- (b) Show that .
Introduction (part 2)
Lengthening the direction vector
Notice that the derivative of with respect to a vector is twice the derivative of with respect to . This is because the line is the same line as but traversed twice as quickly.
Calculating directional derivatives
Link to original
We can use the two partial derivatives and to calculate for vectors other than coordinate basis vectors and . Recall . Use the chain rule instead of the limit definition to compute:
Example
Derivative with respect to a vector
Link to originalDerivative with respect to a vector
Problem: Find the derivative of at the point with respect to the vector .
Solution: The partials at are given by and . So we calculate .
Introduction (part 3)
Link to originalUnit vectors?
Many authors treat directional derivatives as if they only make sense with respect to unit vectors: . If you are interested in the analogue of partial derivative for other directions, you will want to take unit vectors. It may be reasonable to reserve the word ‘directional’ for this case, but it is certainly beneficial to allow the notation to extend to vectors that do not have unit length.
Example
Directional derivative
Link to originalDirectional derivative
Problem: Find the ‘directional’ derivative of at the point in the direction of the vector .
Solution: The key phrase “in the direction of” suggests that we need the unit vector in the direction of . The norm of is , so we want . By the linearity rule with , we can just multiply the previous result by , obtaining .
Exercise
02
Link to originalDirectional derivative
Suppose . Find the rate of change of at the point in the direction of the vector .
Optimization
Review of 1D theory
Review of 1D theory
A regular point of a function is a point where . A critical point is a point where is either zero or undefined. In calculus, the theory of optimization (finding extremal values) is largely a theory of critical points.
Given a function of a single variable, its extrema occur either on boundary points of the region, or at critical points of in the interior of the region. For a closed interval , the boundary points are and , while the interior is the open interval . Every interior point is either regular or critical. To find extrema, therefore, it suffices to check boundary points, interior points of non-differentiability, and interior points where the derivative is zero.
All of this reasoning may be derived from the linear approximation:
Linear approximation:
If exists at , we can write near as:
Here , , and . Now rewrite this as . If , then for small enough, because as . This means there are points close to for which (with ), and points for which (with ). Conversely, if , there are points near for which and for which .
It follows that if is a regular point, meaning , then is certainly neither a local maximum nor minimum.
The critical points can be evaluated using the first and second derivative tests. For example, if the sign of crosses zero at from above, or if , the point is a local maximum.
Link to original
2D theory
2D theory
The 1D theory may be applied directly to the trace curves of a function , i.e. the curves given by or . The result is that if , or if , then is neither a local maximum nor minimum, but rather it would be possible to increase or decrease by moving along the respective trace curve.
A critical point of is a point such that either , or at least one of doesn’t exist. All extreme values of in the interior of a region must occur, therefore, at critical points.
(Note: the situation where, say, fails to exist while , counts as a critical point in these notes, but some other authors would not count it. Such points cannot be local extrema by the trace-curve reasoning applied to .)
The definition of critical points can be encapsulated in a single statement about the gradient:
Info
The point is a critical point of if and only if: or is undefined.
Global extrema are either local extrema (critical points in the interior), or they lie on the boundary. To check the boundary, one must find a parametrization of the boundary as a curve , and then optimize the scalar function of the single variable using the 1D theory. The extrema on the boundary should then be compared with the local extrema in the interior.
As in the 1D theory, critical points of can be either maxima or minima or neither, and there is a tool involving second-order partials that allows us to classify critical points in many cases. It is called the discriminant. Suppose that exist and are continuous near , a critical point of . Define the discriminant by the formula:
This formula is easy to remember as the determinant of the matrix of second-order partials:
Discriminant test
Let be a critical point near which the second-order partials are continuous.
- If the test is inconclusive
- If then is a saddle point
- If then is a max/min:
- If or then is a min
- If or then is a max
Link to original
Exercise
01
Link to originalClassify critical points on topographical contour map
Example
Minimum vs. saddle
Link to originalMinimum vs. saddle
Problem: Consider the function :
Determine the local extrema of by finding and analyzing its critical points.
Solution: We set and solve this system of equations for points . By computing the partials, we obtain:
The second equation implies because is never zero. Plugging this fact into the first equation gives which implies . So the critical points as given by components are and .
Now let us analyze these critical points using the discriminant. Compute:
Therefore , and in particular , . We also need and . The discriminant test concludes that is a local minimum, while is a saddle point.
3D plot: https://www.math3d.org/cDHxQockR
Also try Desmos3d: https://www.desmos.com/3d/17d5d68086
Exercise
02
Link to originalAnalyze two critical points
Exercise
03
Link to originalMaximum on closed domain
Find the global maximum value of on the square , . Where does this occur? Remember to check critical points on the interior and optimize the function on the boundary.
Example
Minimal distance
Link to originalMinimal distance
Problem: Consider the surface given by points with coordinates satisfying . Find the point(s) closest to the origin.
Solution: Our goal is to extremize the distance to the origin of an arbitrary point on the surface. The distance formula gives . This function will be extremized at the same place(s) that the function is extremized because is monotone increasing for positive inputs. So we minimize instead. Next we write the distance as a function of just two variables. Using the surface equation to determine , we write . Then:
Setting these simultaneously to zero and solving gives , and is or . The distance at these points is 3.
Exercise
04
Link to originalBiggest box
Find the largest volume of a box with nonnegative coordinates, all but one vertex on the coordinate planes, and the remaining vertex lying in the paraboloid given by . (So one corner is at the origin, and the opposite corner is on the paraboloid.) What are the dimensions of this box?
nD theory
nD theory
(The technique for D requires knowledge of linear algebra, so the next discussion will not be tested in this course.)
In 3D, the same argument about trace curves shows that where is a non-zero vector, there is not a local extremum. At such a point, motion in the direction of will increase the value of , and motion in the (opposite) direction of will decrease the value of .
Similarly, in D one defines critical points as those points where is either or undefined. Local extrema of can only occur at critical points.
The matrix of second-order partials has a general form called the Hessian matrix:
In 3D the Hessian matrix looks like this:
In order to use to classify critical points, you have to compute its eigenvalues and count the number of positive and number of negative eigenvalues. (All positive minimum, all negative maximum, various signs saddle.) The determinant is the product of the eigenvalues, so in the 2D theory the discriminant reveals whether the eigenvalues have the same or opposite signs. This explains the discriminant rule that is used in 2D.
Link to original
Constrained optimization: Lagrange multipliers
Introduction
The setup is a function and a curve . The problem is to find the extremal values of on the curve. If the curve is given with a parametrization , then we could just extremize using the 1D theory. If the curve is instead given by a constraint such as , then there is another technique that can be much easier to implement than finding a parametrization for . It is called Lagrange multipliers. Since the constraint is written as , you can think of this as a relative of implicit differentiation.
The method of Lagrange multipliers makes use of the fact that when is extremized at on , then the gradients must align: for some scalar .
Gradients align at extremal values
The constraint curve is given as the level curve with . To show the gradients align, we show that they are both perpendicular to this level curve.
Let be a parametrization of . We have already seen that:for any , so is always perpendicular to the level curves. In addition, at the specific time where is extremized, we also have from the 1D optimization theory and the chain rule:
and this shows that is also perpendicular to the level curve at . Since both are perpendicular to the level curve, they must point along the same line.
Link to originalLagrange multipliers: parallel level curves
It is convenient to visualize the Lagrange condition on a contour map. The curve will be parallel to the level curves of at the points where the value of is extremized on .
If the level curves of are not parallel to at a point , then it is possible to increase or decrease by moving along because this motion will cross over level curves of .Because is a level curve of , it is perpendicular to . So the level curves of and must be parallel at an extremal point. This happens if and only if the gradients are parallel.
Example
Lagrange multipliers
Link to originalLagrange multipliers
Problem: Find the extreme values of on the ellipsoid .
Solution: We define . Write out the Lagrange Equations:Solve the system of equations by first solving for in each coordinate and then equating these values:
Obtain and . Insert these expressions into the equation and find a single equation, the solutions of which are and . Using these expressions again, we find the other coordinates of two critical points:
Plug these points into and obtain and .
Since the ellipsoid has no boundary, these are the global max and min of on the ellipsoid.
Exercise
01
Link to originalLagrange multipliers
Find the extreme values taken by the function on the curve that is given by the equation:
- (a) ,
- (b) ,

















