Multivariable Derivatives and Equations


Multivariable Derivatives and Equations

Simon
We’ve used ordinary derivatives to describe how things change with one variable, like a car’s position changing over time. But nature often depends on several variables at once. Today we’ll connect partial derivatives and total differentials to differential equations—and see how those ideas appear in springs, gases, quantum mechanics, and diffusion.

Hope
Let’s begin with a familiar kind of function: a juice recipe. Suppose the number of glasses of juice, J, depends on the number of oranges, R, and apples, A. You can picture that relationship as a surface in three-dimensional space, with R and A as the inputs and J as the output.

Simon
To focus on just one input, hold the other one fixed. For example, set A to zero and see how J changes as R changes. Or set R to zero and study how J changes with A. That’s the central idea of a partial derivative: differentiate with respect to one variable while treating the others as constants.

Hope
So if the recipe gives a partial derivative of J with respect to R equal to 0.5, that means adding one orange increases the juice by half a glass, with the number of apples held fixed. The derivative with respect to A might be 0.25, meaning each additional apple adds a quarter glass, with the orange count held fixed.

Simon
The notation signals that we’re doing partial rather than ordinary differentiation. Instead of the usual d, we use the partial symbol, ∂. You may also see a subscript naming the variable held constant—for example, an A subscript indicates that A was held fixed while differentiating with respect to R.

Hope
And for a linear function, those partial derivatives are simply the coefficients—the slopes in front of the variables. Each slope describes the effect of changing its own input while the other input stays fixed.

Simon
What if several inputs change together? The total differential combines their individual contributions. For the juice function, you multiply each partial derivative by the small change in its corresponding variable, then add the results: dJ equals the partial derivative with respect to R times dR, plus the partial derivative with respect to A times dA.

Hope
That gives us a useful bridge from a simple recipe to a physical system. The ideal gas law relates pressure P to the amount of gas n, its volume V, and its temperature T: P equals nRT over V. Here, n is measured in moles, T is temperature, V is volume, and R is the gas constant.

Simon
A mole is a way of counting an enormous number of particles: about 6.022 times 10 to the 23rd atoms or molecules. It makes microscopic particles easier to handle in the laboratory. For example, a mole of carbon-12 has a mass of about 12 grams, and a mole of nitrogen-14 has a mass of about 14 grams.

Hope
The ideal gas law shows how pressure can change for different reasons. Add more gas and pressure rises; increase the temperature and pressure rises; reduce the volume and pressure rises. A balloon makes those changes easy to picture, as long as we’re considering its internal pressure.

Simon
Differentiate pressure with respect to each variable, holding the other two fixed. For P equals nRT over V, the partial derivative with respect to n is RT over V. It’s positive, so a positive change in the amount of gas contributes a positive change in pressure.

Hope
With respect to volume, the partial derivative is negative: minus nRT over V squared. That negative sign captures the inverse relationship between volume and pressure. If you squeeze a balloon, dV is negative; multiplying that negative change by the negative slope gives a positive contribution to dP.

Simon
And the partial derivative with respect to temperature is nR over V, which is positive. So heating the gas, giving it a positive dT, also increases pressure. Put all three pieces together and you get dP equals RT over V times dn, minus nRT over V squared times dV, plus nR over V times dT.

Hope
That total differential tells us how small changes in amount, volume, and temperature contribute to a small pressure change. The changes can happen one at a time or together. If two or all three inputs change, their contributions are added.

Simon
Thermodynamics has names for some situations where a variable is held fixed. A closed system doesn’t exchange gas with its surroundings, so dn is zero. An isochoric process has constant volume, so dV is zero. An isothermal process has constant temperature, so dT is zero.

Hope
And R doesn’t get its own term in this differential because it’s the gas constant. If we treat it as truly constant, its change is zero. In contrast, the slopes for n, V, and T depend on where we are in the pressure-volume-temperature relationship.

Simon
That dependence matters in a sealed piston, where n stays fixed. Take 100 millimoles of gas at a volume of one liter and a temperature of 298 kelvin. The ideal gas law gives a pressure of about 2.4776 bar. At that point, increasing volume by one milliliter lowers pressure by about 2.5 millibar, while increasing temperature by 0.1 kelvin raises it by about 0.83 millibar.

Hope
Now move to a different point: volume 0.5 liters and temperature 310 kelvin. The pressure is about 5.15 bar, and the local slopes have changed. A one-milliliter increase in volume now lowers pressure by about 10.3 millibar, while a 0.1-kelvin increase raises it by about 1.6 millibar.

Simon
So a derivative is local: it describes the slope at a particular point, not one unchanging slope for the entire surface. That’s why the same small change in volume or temperature can have a different effect depending on the gas’s current state.

Hope
There’s a related limitation. The total differential is based on infinitesimally small changes, so it estimates what happens over a small step. If we use it for a large change, the slopes themselves change along the way, and the estimate can become less accurate.

Simon
For example, going from one liter and 298 kelvin to 0.5 liters and 310 kelvin gives a change in pressure of about 2.68 bar when calculated from the endpoint pressures. Using the differential at the starting point for the entire large change gives about 2.34 bar, roughly 12 percent off.

Hope
A practical fix is to break the journey into smaller steps. Estimate the pressure change from one liter and 298 kelvin to 0.9 liters and 300 kelvin, then recalculate the slopes and continue from there. Smaller steps let the estimate adapt as the system moves across the surface.

Simon
There’s also a distinction between the total differential and the gradient. The differential combines the contributions to give a change in the function, but it doesn’t by itself express the direction as a vector. The gradient is the vector of partial derivatives; its component unit vectors indicate the directions along the input dimensions.

Hope
That vector perspective leads toward other ideas, such as the curl and cross products, which require more linear algebra. For now, the key point is that partial derivatives describe slopes along individual directions, while the total differential combines their effects.

Simon
So far, we’ve started with a known function and calculated its derivatives. Physical science often presents the reverse puzzle: we know how an unknown function relates to its derivatives, and we have to find the function itself. That is a differential equation.

Hope
If the unknown function depends on one independent variable and the equation relates it to ordinary derivatives, it’s an ordinary differential equation, or ODE. If it depends on two or more variables and the equation involves partial derivatives, it’s a partial differential equation, or PDE. The solution is a function, not merely a number.

Simon
A spring and a ball give us a clear ODE example. Hooke’s law says the spring’s force points back toward the center and is proportional to the displacement: F equals minus kx. When the ball is displaced to the right, x is positive and the force is negative; when displaced to the left, x is negative and the force is positive.

Hope
Because the displacement changes with time, we write it as x of t. Newton’s second law says force equals mass times acceleration. Velocity is the time derivative of position, and acceleration is the time derivative of velocity—in other words, the second derivative of position.

Simon
Putting Hooke’s law and Newton’s second law together gives minus kx equals m times the second time derivative of x. Rearranged, that’s a differential equation for the ball’s motion. It’s ordinary because time is the one independent variable.

Hope
To solve it, look for functions whose second derivative returns the same function multiplied by a negative constant. A power such as t cubed won’t work: its second derivative is 6t, not another cubic. A real exponential returns itself, but its second derivative has a positive multiplier, which has the wrong sign for this equation.

Simon
Sine and cosine do have the right behavior: their second derivatives are the original functions multiplied by a negative factor. So the motion can be described by a sinusoidal function, with angular frequency equal to the square root of k over m. A cosine fits a spring released from maximum displacement; a sine fits a ball given a push as it passes through equilibrium.

Hope
That choice illustrates why initial conditions matter. The differential equation describes the general physical relationship, while details such as where the ball starts and how it’s moving determine which particular solution describes the motion. The amplitude sets the maximum distance from equilibrium.

Simon
PDEs follow the same broad idea but involve functions of multiple variables, such as position and time. There are many kinds, and each leads to its own mathematical and scientific applications. Let’s sample a few rather than pretending to cover every PDE in one sitting.

Hope
One important spatial operator is called nabla, written as an upside-down delta. It collects derivatives in the spatial directions. Applying it twice gives the second spatial derivatives; in some physics contexts, that operation is written nabla squared or represented by a delta.

Simon
For a one-dimensional spring, the potential energy is V of x equals one-half kx squared, and its derivative with respect to x relates to the force along that axis. In several dimensions, derivatives across the spatial coordinates can be handled together using nabla.

Hope
That second-derivative operator appears in quantum mechanics. It helps describe the kinetic energy of wave-like particles such as electrons. Because atoms are spherical, the relevant equations are commonly expressed in spherical polar coordinates rather than ordinary Cartesian coordinates.

Simon
The angular solutions in this setting are called spherical harmonics. They help explain the shapes of electron orbitals and, in turn, the structure of the periodic table. The quantum numbers described here include an angular momentum number L and a number M that ranges from minus L to plus L in steps of one.

Hope
For L equals zero, M has one possible value, so there’s one angular function; accounting for two electron spin states gives two states. For L equals one, there are three M values and therefore six states with spin. For L equals two, there are five M values and ten states; for L equals three, seven M values and fourteen states.

Simon
Those counts help explain the sizes of the orbital groups in the table. The bottom two rows are often displayed separately for readability, even though they belong with the other elements in the main table. The periodic table’s distinctive shape is connected to the solutions of these quantum equations.

Hope
Another major PDE application is diffusion, along with heat flow, mass transport, and fluid dynamics. In one dimension, a diffusion equation describes how a concentration changes over time and position; in more spatial dimensions, nabla squared can express the spatial part.

Simon
Think of a drop of blue ink spreading through water. The color gradually disperses through the liquid, and diffusion equations describe that changing pattern. For the kind of diffusion problem discussed here, solutions can be Gaussian functions.

Hope
So the overall map is: partial derivatives track how a multivariable function changes along one input at a time; the total differential combines small changes across inputs; and differential equations describe unknown functions through their derivatives. One independent variable gives an ODE, while multiple independent variables give a PDE.

Simon
And the applications range from a spring’s back-and-forth motion to gas pressure, electron behavior, the periodic table, and the spread of ink in water. Multivariable integrals and coordinate transformations are also important next steps, but they’re separate topics still to explore.

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