Multivariable Derivatives and Equations
Multivariable Derivatives and Differential Equations
1. Functions of Several Variables
A function can depend on more than one input. For example, the amount of juice produced might depend on the number of oranges and apples used. If R is the number of oranges and A is the number of apples, a simple model consistent with the example is
where J is the amount of juice.
With two inputs, the function can be pictured as a surface in three-dimensional space: one axis for R, one for A, and one for J. Fixing one input at a chosen value produces a one-variable function. For instance, fixing A=0 shows how juice changes as oranges are added; fixing R=0 shows how it changes as apples are added.
Partial derivatives
A partial derivative measures how a multivariable function changes with respect to one input while the other inputs are held constant. The symbol ∂ distinguishes partial differentiation from ordinary differentiation, which applies to functions of a single variable.
For the juice model:
In ∂R∂J, the value of A is treated as constant. The result says that adding one orange increases the modeled juice amount by 0.5 units.
In ∂A∂J, the value of R is treated as constant. The result says that adding one apple increases the modeled juice amount by 0.25 units.
For a linear function, each partial derivative is the coefficient—or slope—of the corresponding variable. A notation such as (∂R∂J)A can emphasize that A was held constant.
2. The Total Differential
For a function of several variables, changes in each input can contribute to a change in the output. The total differential combines those contributions by multiplying each partial derivative by the corresponding small input change:
For the juice model, this becomes
Thus, the total change depends both on the function’s slopes and on how much each input changes. The partial derivatives alone do not give the change in the output; they must be combined with the input changes.
In general, for a function f that depends on inputs x1,…,xn,
The total differential is a local, linear approximation to the change in a function when the input changes are small.
3. The Ideal Gas Law and Partial Derivatives
The ideal gas law relates a gas’s pressure P, volume V, amount of gas n, and temperature T:
or, when pressure is expressed as a function of the other quantities,
Here, n is the amount of gas in moles, and R is the gas constant. A mole contains approximately 6.022×1023 particles. This large particle count makes it convenient to describe amounts of extremely small atoms and molecules using measurable quantities of matter. For example, one mole of carbon-12 has a mass of about 12 grams.
Since R is a constant, pressure changes when n, V, or T changes. The partial derivatives describe the pressure’s local sensitivity to each one:
Combining them gives the total differential:
This equation describes the approximate pressure change arising from small changes in the amount of gas, volume, and temperature.
Interpreting the signs
The signs of the partial derivatives show how each input affects pressure when the other inputs are held fixed:
Amount of gas: ∂n∂P is positive. Adding gas increases pressure.
Volume: ∂V∂P is negative. Increasing volume decreases pressure; decreasing volume increases pressure.
Temperature: ∂T∂P is positive. Heating the gas increases pressure.
These relationships explain several ways the pressure in an inflated balloon can rise: adding air increases n, compressing the balloon decreases V, and heating the gas increases T. Each change can make the balloon’s material stretch more, and a sufficiently large pressure increase can cause it to burst.
Thermodynamic constraints
Thermodynamic terms specify which variables are being held fixed:
A closed system does not exchange matter with its surroundings. For a fixed amount of gas, dn=0.
An isochoric process occurs at constant volume, so dV=0.
An isothermal process occurs at constant temperature, so dT=0.
If a variable is fixed, its change contributes nothing to the total differential. The gas constant R is also treated as fixed, so dR=0.
4. Local Slopes and Approximation Accuracy
The partial derivatives of a nonlinear function can vary from one point to another. For the ideal gas law, the slopes depend on the current values of n, V, and T. A graph of pressure over changing volume and temperature can therefore have regions that are steeper or flatter than others.
Consider a closed system containing n=0.100 moles of gas. At V=1.00 liter and T=298 kelvin, its pressure is approximately 2.4776 bar, using R≈0.08314 liter-bar per mole-kelvin. At this point:
For small changes of dV=0.001 liter and dT=0.1 kelvin, the pressure changes are approximately:
A volume increase of 0.001 liter gives dP≈−0.00248 bar, or about −2.48 millibar.
A temperature increase of 0.1 kelvin gives dP≈0.000831 bar, or about 0.831 millibar.
At a different point, with V=0.50 liter and T=310 kelvin, the pressure is about 5.15 bar. The local slopes are then approximately
At this point, the same small changes—dV=0.001 liter and dT=0.1 kelvin—give pressure changes of about −10.3 millibar and +1.66 millibar, respectively. The changes are larger because the surface is locally steeper there.
Why large changes require care
The total differential is based on local slopes, so it is most accurate for small input changes. For large changes, the slopes can vary substantially along the way. The calculation should then be repeated across a sequence of smaller steps, updating the slopes at each step.
For example, moving from V=1.00 liter and T=298 kelvin to V=0.50 liter and T=310 kelvin is a large change. The exact pressure change is approximately
Using the total differential evaluated at the initial point gives
This local estimate differs substantially from the exact change because the input changes are not small and the slopes change as the system moves. A sequence of smaller differential steps gives a more accurate estimate.
5. Gradient and Direction
For a function of multiple spatial variables, the gradient collects its partial derivatives into a vector. For a function f(x,y,z),
The symbol ∇ is called nabla or del. The gradient points in the direction of the function’s steepest increase; its components describe how rapidly the function changes along each coordinate direction.
A displacement in space can be represented by the vector dr. The corresponding local change in the function is
Thus, the gradient retains directional information, while the differential gives the change associated with a particular displacement. This distinction matters when studying vector operations such as the curl, which require vector-calculus ideas.
6. Differential Equations
A differential equation relates an unknown function to one or more of its derivatives. Unlike an algebraic equation whose answer may be a single number, the solution to a differential equation is a function, or a family of functions.
Ordinary differential equations
An ordinary differential equation (ODE) involves an unknown function of one independent variable and its ordinary derivatives. For example, a position function x(t) depends on time t.
Partial differential equations
A partial differential equation (PDE) involves an unknown function of two or more independent variables and its partial derivatives. A function might depend on spatial coordinates and time, such as u(x,y,z,t).
ODEs and PDEs are important across the physical sciences. Single-variable derivatives and integrals, along with partial derivatives, are often sufficient for introductory physics, chemistry, and thermodynamics. ODEs and PDEs occur frequently in subjects such as quantum mechanics, electrodynamics, and diffusion.
7. A Spring as an ODE: The Harmonic Oscillator
A mass attached to a spring provides a simple model of motion described by an ODE.
Hooke’s law and restoring force
For an ideal spring, Hooke’s law states that the spring force is proportional to displacement from the equilibrium position and points toward equilibrium:
where k is the spring constant and x is the displacement.
At equilibrium, x=0, so the spring force is zero.
When the spring is stretched, x is positive and the force is negative, pulling the mass back toward equilibrium.
When the spring is compressed, x is negative and the force is positive, again pushing the mass toward equilibrium.
Newton’s second law and acceleration
Newton’s second law relates force to mass and acceleration:
Velocity is the time derivative of position, and acceleration is the time derivative of velocity. Therefore, for position x(t),
Equating the spring force with the force in Newton’s second law gives
or
This is an ODE because the unknown position depends on only one independent variable, time.
Solving the equation
The equation asks for a function whose second derivative is the negative of the function multiplied by a positive constant. Sine and cosine have this property. The general solution is
Here, ω is the angular frequency, and C1 and C2 are set by the initial conditions.
If the mass begins at maximum displacement and is released from rest, a cosine form is convenient: x(t)=Lcos(ωt).
If the mass begins at equilibrium and is given an initial push, a sine form is convenient.
The equation permits many solutions, but the physical starting conditions select the one that describes a particular motion. In more advanced treatments, a function that returns proportional to itself when an operator acts on it is called an eigenfunction; the proportionality factor is an eigenvalue.
8. Partial Differential Equations in Physics and Chemistry
PDEs extend the same basic idea to functions of multiple variables. Different classes of PDEs are used to describe different physical processes.
The Laplacian, Laplace’s equation, and Poisson’s equation
For a function of three Cartesian coordinates, the Laplacian is the operator
It applies second derivatives along the spatial directions and combines them. Two important PDEs involving the Laplacian are:
Laplace’s equation: ∇2ϕ=0.
Poisson’s equation: ∇2ϕ=s, where s represents a source term.
These equations appear in many areas of physics and chemistry. The appropriate form of the differential operators can depend on the coordinate system used. Cartesian coordinates are convenient for box-like geometries; spherical polar coordinates are often more suitable for spherical systems.
For example, in one dimension a harmonic-oscillator potential is
and its derivative with respect to position is
The force is the negative derivative of the potential, giving F=−kx.
Quantum mechanics and spherical harmonics
In quantum mechanics, the Laplacian appears in the operator used to describe a particle’s kinetic energy. For a particle of mass m, the kinetic-energy operator is
where ℏ is the reduced Planck constant. Atomic problems are often expressed in spherical polar coordinates because atoms are approximately spherical systems.
Solutions to the angular part of many such problems are spherical harmonics. They are associated with angular-momentum quantum numbers l and m, where m takes integer values from −l to +l. For a given l, there are 2l+1 possible values of m.
An electron also has two possible spin states. Counting both spin states gives 2(2l+1) electron states for each value of l:
For l=0, there is one value of m, giving 2 spin-inclusive states.
For l=1, there are three values of m, giving 6 states.
For l=2, there are five values of m, giving 10 states.
For l=3, there are seven values of m, giving 14 states.
These groups correspond to the familiar s, p, d, and f subshells. Their differing numbers of states help explain the structure of the periodic table. The f-block elements are often displayed below the main body of the table to make it easier to read, although they belong within the overall sequence of elements.
Diffusion and mass transport
Diffusion describes the spreading of material from regions of higher concentration toward regions of lower concentration. For example, a drop of blue ink spreads through water over time.
A common mathematical model for concentration c changing over time is the diffusion equation:
where D is the diffusion coefficient. In one spatial dimension, the Laplacian reduces to a second derivative with respect to position; in multiple dimensions, it includes the second derivatives along the spatial coordinates. Solutions to many basic diffusion problems have Gaussian profiles.
Diffusion equations are used in mass transport and fluid-related problems, including models of how quickly substances dissolve and spread through a solvent.
9. Key Distinctions
Partial derivative: Measures change along one input direction while holding other inputs fixed.
Total differential: Combines the effects of small changes in all inputs to estimate a function’s change.
Gradient: A vector of partial derivatives that describes the direction and rate of steepest increase.
ODE: Relates an unknown function of one independent variable to its ordinary derivatives.
PDE: Relates an unknown function of multiple independent variables to its partial derivatives.
Initial conditions: Select the particular solution of a differential equation that describes a given physical situation.

Ask anything
We've read this whole study set, so questions about it get the best answers.