BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Non-independent variables

When x, y, z are tied by a relation g(x, y, z) = c, one of them is a function of the others, and its partial derivatives come from setting dg = 0 without solving: ∂z/∂x = −g_x/g_z. With related variables, ∂f/∂x is ambiguous until we say what is held fixed: x = u yet ∂f/∂x ≠ ∂f/∂u, so we write (∂f/∂x)_y. For the area of a right triangle, A = ½ab sin θ with a = b cos θ, the rate of change with θ depends on whether a, b or both are held fixed; (∂A/∂θ)_a = ½ab sec θ, found by substitution, by differentials or by the chain rule.

You need this first

Full reading path (13 pages)
  1. Vectors (8.01)
  2. Vectors and the dot product (18.02)
  3. Determinants and the cross product (18.02)
  4. Planes through three points, and matrices (18.02)
  5. Equations of planes and square systems (18.02)
  6. Parametric equations of lines and the cycloid (18.02)
  7. Velocity, acceleration and Kepler's second law (18.02)
  8. Functions of two variables and partial derivatives (18.02)
  9. Tangent planes, critical points and least squares (18.02)
  10. The second derivative test (18.02)
  11. Differentials and the chain rule (18.02)
  12. The gradient and directional derivatives (18.02)
  13. Lagrange multipliers (18.02)
On this page · 5 sections
  1. Rates of change of related variables
  2. The notation can be dangerous
  3. Three rates for one triangle
  4. Computing (∂A/∂θ) with a fixed
  5. Summary

Lagrange multipliers found extremes when the variables are related. This lecture asks how to take partial derivatives at all when the variables are related (transcript, p. 1).

In physics, a function often depends on pressure, volume and temperature, which are related by PV=nRTPV = nRT; one could substitute, but it is often more convenient to keep all three (transcript, p. 1; notes, p. 1). In general, let xx, yy, zz be related by g(x,y,z)=cg(x, y, z) = c. Then, in principle, zz is a function of xx and yy, and we can ask for ∂z/∂x\partial z/\partial x and ∂z/∂y\partial z/\partial y, even when the relation cannot be solved (p. 1; notes, p. 1).

Example. The lecture's relation is x2+yz+z3=8x^2 + yz + z^3 = 8, near (2,3,1)(2, 3, 1) (indeed 4+3+1=84 + 3 + 1 = 8). Solving the cubic for zz would be painful. Instead, take the differential: since g=8g = 8 is constant, dg=0dg = 0 (p. 1; notes, p. 1):

Differential of the constraint
2x dx+z dy+(y+3z2) dz=0⟹4 dx+dy+6 dz=0  at (2,3,1)2x\,dx + z\,dy + (y + 3z^2)\,dz = 0 \quad\Longrightarrow\quad 4\,dx + dy + 6\,dz = 0 \ \text{ at } (2, 3, 1)
In words

2 x d x plus z d y plus the quantity y plus 3 z squared, d z equals 0 which gives 4 d x plus d y plus 6 d z equals 0 at (2, 3, 1)

This relates the changes of all three variables near the point. Solving for dzdz (p. 1; notes, p. 1):

Two partial derivatives
dz=−16(4 dx+dy),∂z∂x=−46=−23,∂z∂y=−16dz = -\tfrac16(4\,dx + dy), \qquad \frac{\partial z}{\partial x} = -\frac46 = -\frac23, \qquad \frac{\partial z}{\partial y} = -\frac16
In words

d z equals minus one sixth the quantity 4 d x plus d y, partial z over partial x equals minus four sixths equals minus two thirds, partial z over partial y equals minus one sixth

The coefficients of dxdx and dydy are the partials. Equivalently, ∂z/∂x\partial z/\partial x keeps yy constant, so set dy=0dy = 0; ∂z/∂y\partial z/\partial y keeps xx constant, so set dx=0dx = 0 (p. 1). In general, from gx dx+gy dy+gz dz=0g_x\,dx + g_y\,dy + g_z\,dz = 0 with dy=0dy = 0 (p. 1; notes, p. 1):

The general formula
∂z∂x=−gxgz\frac{\partial z}{\partial x} = -\frac{g_x}{g_z}
In words

partial z over partial x equals minus g sub x over g sub z

The minus sign is surprising the first time; it comes straight out of the derivation (p. 1).

The notation can be dangerous#

A warning example (transcript, p. 2; notes, p. 1). Let f(x,y)=x+yf(x, y) = x + y, so ∂f/∂x=1\partial f/\partial x = 1. Change variables: x=ux = u, y=u+vy = u + v. Then f=2u+vf = 2u + v and ∂f/∂u=2\partial f/\partial u = 2. So x=ux = u, but ∂f/∂x≠∂f/∂u\partial f/\partial x \ne \partial f/\partial u (p. 2).

The reason: ∂f/∂x\partial f/\partial x changes xx keeping yy fixed, while ∂f/∂u\partial f/\partial u changes uu (the same thing) keeping vv fixed, that is keeping y−xy - x fixed, so that yy changes too (p. 2; notes, p. 1). The usual notation does not say what is held fixed. When there is any risk of confusion, we say it with a subscript, a notation Auroux blames on physicists and chemists (p. 2):

Saying what is held fixed
(∂f∂x)y=1,(∂f∂u)v=(∂f∂x)v=2\left(\frac{\partial f}{\partial x}\right)_y = 1, \qquad \left(\frac{\partial f}{\partial u}\right)_v = \left(\frac{\partial f}{\partial x}\right)_v = 2
In words

( partial f over partial x ) sub y equals 1, ( partial f over partial u ) sub v equals ( partial f over partial x ) sub v equals 2

Source: 18.02 lecture summaries, Week 6 (Prof. Auroux), Lecture 14, pp. 1–2, Lecture 14, p. 1

The subscript now names the variable held constant, not one being differentiated, a clash with the earlier notation fxf_x (p. 2). Without a subscript, ∂/∂x\partial/\partial x still means the other natural variable (yy) is fixed; the example of the last section was (∂z/∂x)y(\partial z/\partial x)_y (notes, p. 1).

Three rates for one triangle#

The lecture's example is geometric (transcript, p. 2; notes, p. 1). A triangle with two sides aa and bb at an angle θ\theta has area A=12absin⁡θA = \frac12 ab\sin\theta. Suppose it is a right triangle with hypotenuse bb, so the constraint is a=bcos⁡θa = b\cos\theta. (The transcript first misstates it as b=sin⁡θb = \sin\theta, p. 2, before using a=bcos⁡θa = b\cos\theta on p. 3.) How does AA change with θ\theta? Three answers make sense (pp. 2–3; notes, p. 1):

  1. (∂A∂θ)a,b\left(\frac{\partial A}{\partial\theta}\right)_{a,b}: ignore the constraint and treat aa, bb, θ\theta as independent. The triangle stops being a right triangle. This is the old partial derivative, 12abcos⁡θ\frac12 ab\cos\theta (p. 2).
  2. (∂A∂θ)a\left(\frac{\partial A}{\partial\theta}\right)_a: keep aa fixed and the right angle; bb changes as it must.
  3. (∂A∂θ)b\left(\frac{\partial A}{\partial\theta}\right)_b: keep bb fixed and the right angle; aa changes as it must.

(Keeping the third side fixed would be yet another choice. Of the three variables, two are independent, and we must say which, p. 3.)

Computing (∂A/∂θ) with a fixed#

Method 0: substitution. Here b=a/cos⁡θ=asec⁡θb = a/\cos\theta = a\sec\theta, so A=12a2tan⁡θA = \frac12 a^2\tan\theta and (transcript, p. 3; notes, p. 1):

By substitution
(∂A∂θ)a=12a2sec⁡2θ\left(\frac{\partial A}{\partial\theta}\right)_a = \tfrac12 a^2\sec^2\theta
In words

( partial capital A over partial theta ) sub a equals one half a squared secant squared theta

That only works when the constraint can be solved, which in general it cannot; there are two systematic methods (p. 3).

Method 1: differentials. aa is fixed, so da=0da = 0. Differentiating the constraint a=bcos⁡θa = b\cos\theta: da=cos⁡θ db−bsin⁡θ dθ=0da = \cos\theta\,db - b\sin\theta\,d\theta = 0, so db=btan⁡θ dθdb = b\tan\theta\,d\theta (p. 3; notes, p. 1). Then, from dA=12bsin⁡θ da+12asin⁡θ db+12abcos⁡θ dθdA = \frac12 b\sin\theta\,da + \frac12 a\sin\theta\,db + \frac12 ab\cos\theta\,d\theta with da=0da = 0 (pp. 3–4; notes, pp. 1–2):

By differentials
dA=(12asin⁡θ⋅btan⁡θ+12abcos⁡θ)dθ,(∂A∂θ)a=12ab(sin⁡2θcos⁡θ+cos⁡θ)=12absec⁡θdA = \left(\tfrac12 a\sin\theta \cdot b\tan\theta + \tfrac12 ab\cos\theta\right)d\theta, \qquad \left(\frac{\partial A}{\partial\theta}\right)_a = \tfrac12 ab\left(\frac{\sin^2\theta}{\cos\theta} + \cos\theta\right) = \tfrac12 ab\sec\theta
In words

d capital A equals the quantity one half a sine theta times b tan theta plus one half a b cos theta, d theta, ( partial capital A over partial theta ) sub a equals one half a b the quantity sine squared theta over the quantity cos theta, plus cos theta, equals one half a b secant theta

In short: write dAdA; set the differential of the fixed variable to 0; eliminate the unwanted one (dbdb) using the differentiated constraint; read off the coefficient of dθd\theta (p. 4). With b=asec⁡θb = a\sec\theta, this agrees with method 0.

Method 2: the chain rule. Differentiating with aa held fixed (p. 4; notes, p. 2):

By the chain rule
(∂A∂θ)a=Aθ(∂θ∂θ)a+Aa(∂a∂θ)a+Ab(∂b∂θ)a=Aθ+Ab(∂b∂θ)a\left(\frac{\partial A}{\partial\theta}\right)_a = A_\theta\left(\frac{\partial\theta}{\partial\theta}\right)_a + A_a\left(\frac{\partial a}{\partial\theta}\right)_a + A_b\left(\frac{\partial b}{\partial\theta}\right)_a = A_\theta + A_b\left(\frac{\partial b}{\partial\theta}\right)_a
In words

( partial capital A over partial theta ) sub a equals capital A sub theta ( partial theta over partial theta ) sub a plus capital A sub a ( partial a over partial theta ) sub a plus capital A sub b ( partial b over partial theta ) sub a equals capital A sub theta plus capital A sub b ( partial b over partial theta ) sub a

Source: 18.02 lecture summaries, Week 6 (Prof. Auroux), Lecture 14, pp. 1–2, Lecture 14, p. 2

since θ\theta changes at rate 1 with itself and aa does not change. The rate (∂b/∂θ)a=btan⁡θ(\partial b/\partial\theta)_a = b\tan\theta comes from the constraint, as before, and the result is the same: the two methods compute the same quantities, written differently (p. 4; notes, p. 2).

Worked example

A constrained partial, and three rates for one triangle

(a) On the sphere x2+y2+z2=9x^2 + y^2 + z^2 = 9, near (1,2,2)(1, 2, 2), find (∂z/∂x)y(\partial z/\partial x)_y and check by solving for zz. Then find (∂f/∂x)y(\partial f/\partial x)_y for f=x+y+zf = x + y + z. (b) For the right triangle with a=3a = 3 and θ=π/4\theta = \pi/4, find all three rates of change of AA with θ\theta.

(a) Differentials

2x dx+2y dy+2z dz=02x\,dx + 2y\,dy + 2z\,dz = 0 gives 2 dx+4 dy+4 dz=02\,dx + 4\,dy + 4\,dz = 0 at the point. With dy=0dy = 0: (∂z/∂x)y=−2/4=−1/2(\partial z/\partial x)_y = -2/4 = -1/2. Check: z=9−x2−y2z = \sqrt{9 - x^2 - y^2} has ∂z/∂x=−x/z=−1/2\partial z/\partial x = -x/z = -1/2. Then (∂f/∂x)y=1+(∂z/∂x)y=1/2(\partial f/\partial x)_y = 1 + (\partial z/\partial x)_y = 1/2, while treating zz as independent would give 1.

(b) The three rates

Here b=asec⁡θ=32≈4.24b = a\sec\theta = 3\sqrt2 \approx 4.24. With aa and bb independent: 12abcos⁡θ=12⋅3⋅32⋅22=4.5\frac12 ab\cos\theta = \frac12 \cdot 3 \cdot 3\sqrt2 \cdot \frac{\sqrt2}{2} = 4.5. With aa fixed: 12a2sec⁡2θ=12⋅9⋅2=9\frac12 a^2\sec^2\theta = \frac12 \cdot 9 \cdot 2 = 9.

(b) Holding the hypotenuse fixed

With bb fixed, a=bcos⁡θa = b\cos\theta, so A=12b2sin⁡θcos⁡θ=14b2sin⁡2θA = \frac12 b^2\sin\theta\cos\theta = \frac14 b^2\sin 2\theta and (∂A/∂θ)b=12b2cos⁡2θ=0(\partial A/\partial\theta)_b = \frac12 b^2\cos 2\theta = 0 at θ=π/4\theta = \pi/4: for a given hypotenuse, the 45° right triangle has the largest area. Three different answers, 4.5, 9 and 0, to "how does the area change with θ\theta".

Summary#

  • If g(x,y,z)=cg(x, y, z) = c, set dg=0dg = 0 and solve for the dependent variable's differential: (∂z/∂x)y=−gx/gz(\partial z/\partial x)_y = -g_x/g_z.
  • With related variables, say what is held fixed: (∂f/∂x)y(\partial f/\partial x)_y. Example: x=ux = u but (∂f/∂x)y≠(∂f/∂u)v(\partial f/\partial x)_y \ne (\partial f/\partial u)_v.
  • For A=12absin⁡θA = \frac12 ab\sin\theta with a=bcos⁡θa = b\cos\theta, the rate of change with θ\theta depends on whether aa, bb or both are fixed; (∂A/∂θ)a=12absec⁡θ=12a2sec⁡2θ(\partial A/\partial\theta)_a = \frac12 ab\sec\theta = \frac12 a^2\sec^2\theta.
  • Methods: substitution (if the constraint can be solved), differentials, or the chain rule with the dependent rate taken from the constraint.

Symbols on this page

Show the 37 symbols used here
θ\theta theta.
An angle. Say it: “theta” (sounds like “thay-ta or thee-ta”).
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
≈\approx approximately equal.
Is approximately equal to. Say it: “is approximately”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
⇒\Rightarrow implies.
Implies: what follows is a consequence of what came before. Say it: “which gives”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
∂\partial partial.
Partial derivative: the rate of change with one variable, holding the others fixed. Say it: “partial”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
tan⁡\tan tangent.
Tangent of an angle, sin/cos. Say it: “tan”.
aa a.
One side of the triangle (in the right triangle, the side next to θ). Say it: “a”.
zz z.
The third variable, viewed as a function of x and y through the constraint. Say it: “z”.
cc c.
The constant in the constraint g = c. Say it: “c”.
TT T.
Temperature, in PV = nRT. Unit: K. Say it: “T”.
xx x.
The first of three related variables. Say it: “x”.
yy y.
The second of three related variables. Say it: “y”.
dd d.
The d of a differential, such as dx or dA. Say it: “d”.
nn n.
Amount of gas, in PV = nRT. Unit: mol. Say it: “n”.
ff f.
A function of the related variables, such as f = x + y. Say it: “f”.
gg g.
The function in the constraint g(x, y, z) = c. Say it: “g”.
vv v.
A second new variable, y = u + v. Say it: “v”.
PP P.
Pressure of a gas, in PV = nRT. Unit: Pa. Say it: “capital P”.
AA A.
The area of the triangle, ½ab sin θ. Say it: “capital A”.
bb b.
The other side of the triangle (in the right triangle, the hypotenuse). Say it: “b”.
pp p.
In the cosmology note, the pressure of the gas. Unit: Pa. Say it: “p”.
RR R.
The gas constant, in PV = nRT. Unit: J/(mol K). Say it: “R”.
uu u.
A new variable, x = u. Say it: “u”.
UU U.
In the cosmology note, the energy of the gas in the box. Unit: J. Say it: “capital U”.
VV V.
Volume, in PV = nRT and dU = −p dV. Unit: m³. Say it: “capital V”.
sec⁡\sec secant.
The secant, 1/cos. Say it: “secant”.
fxf_{x} f sub x.
The partial derivative ∂f/∂x, with the other natural variable held fixed. Say it: “f sub x”.
gxg_{x} g sub x.
The partial derivative ∂g/∂x. Say it: “g sub x”.
gyg_{y} g sub y.
The partial derivative ∂g/∂y. Say it: “g sub y”.
gzg_{z} g sub z.
The partial derivative ∂g/∂z. Say it: “g sub z”.
AθA_{\theta} A sub theta.
The partial derivative of A with respect to θ, with a and b treated as independent. Say it: “capital A sub theta”.
AaA_{a} A sub a.
The partial derivative of A with respect to a, with b and θ treated as independent. Say it: “capital A sub a”.
AbA_{b} A sub b.
The partial derivative of A with respect to b, with a and θ treated as independent. Say it: “capital A sub b”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 21 words used here

Also used

Lagrange multipliers.
A method for finding the largest or smallest value of a function when its variables must satisfy a constraint. Explained in A ring on a string, and Newton's method.
partial derivative.
The rate of change of a function of several variables with respect to one of them, while all the others are held fixed. Explained in Functions of two variables and partial derivatives.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
pressure.
The force pushing on a surface divided by the area of the surface, so the push on each square metre. Explained in Density and pressure.
differential.
A tiny change in a variable, such as dx, or the matching change in a function along its tangent line, dy = f′(x) dx. Explained in Differentials and antiderivatives.
constraint.
A condition that limits what is allowed, such as a rope of fixed length that links the motions of the bodies it joins. Explained in Tension in ropes and the spring force.
differentiation.
Finding a derivative: working out how fast a function changes. Explained in The derivative: slope of the tangent line and rate of change.
chain rule.
The rule for the derivative of a function of a function: multiply the derivative of the outer one by that of the inner one. Explained in Circular motion: polar coordinates, position and velocity.
rate of change.
How fast one quantity changes compared with another, often time: the change in the first divided by the change in the second. Explained in Rates of change and area under a graph.
thermodynamics.
The study of heat, work, temperature and energy in large systems, through general laws that do not depend on what the system is made of. Explained in Thermodynamic variables, temperature and work.
energy.
A quantity, measured in joules, that a body or field has because of its motion, position or state; a closed system keeps its total. Explained in Conservation of energy.
energy density.
The energy stored in each cubic metre of space, for example in an electric or magnetic field, or in radiation. Explained in Conductors, capacitors and stored energy.
entropy.
A measure of how many microscopic arrangements of a system match its large-scale state; it never decreases in an isolated system. Explained in Entropy and the second law.
heat.
Energy that passes between bodies because their temperatures differ, rather than by one doing mechanical work on the other. Explained in Temperature and thermal energy.
matter–radiation equality.
The moment, about 50,000 years after the Big Bang, when matter and radiation had the same energy density; after it matter dominated. Explained in Matter–radiation equality and the pressure of light.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
in principle.
According to the rules or theory, even if it would be hard or impossible to do in reality.
derive.
To obtain a result by reasoning or calculation from other known results.
notation.
A system of symbols used to write ideas down briefly, such as dy/dx for a derivative.
systematic.
Following a fixed method; of an error, one that pushes every result the same way, so averaging does not remove it.
read off.
To take a value directly from a graph, table or formula, without further calculation.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

33 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. If x2+y2+z2=9x^2 + y^2 + z^2 = 9, what is ∂z/∂x\partial z/\partial x (with yy held fixed) at (1,2,2)(1, 2, 2)?
  2. In general, for g(x,y,z)=cg(x, y, z) = c, (∂z/∂x)y=(\partial z/\partial x)_y =
  3. With f=x+yf = x + y and x=ux = u, y=u+vy = u + v: why is ∂f/∂x=1\partial f/\partial x = 1 but ∂f/∂u=2\partial f/\partial u = 2?
0 of 3 answered

Flashcards

1 / 3