HACKER Q&A
📣 ironSkillet

Higher order derivatives in everyday life?


Hi all, I read a Bloomberg article today (https://www.bloomberg.com/news/articles/2022-07-27/fed-raise...) stating the following:

"Powell also said the Fed will slow the pace of increases [to interest rates] at some point"

This is referencing a 3rd derivative (loan obligation = base, interest rate = 1st derivative, change in interest rate = 2nd derivative, pace of changes in interest rate = 3rd derivative).

I was wondering if hackernews had any other interesting examples of higher order derivatives that one might encounter in everyday life.


  👤 jules Accepted Answer ✓
"In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection."

-- http://www.ams.org/notices/199610/page2.pdf


👤 valbaca
In terms of an real-time strategy (RTS) game, like Starcraft:

1. base: how many Marines you have

2. dx: how many Marine-producers you have = X Marines / sec

3. d2x: how many Marine-producer-producers you have, your harvesting units = (X Marines / sec) / sec

4. d3x: how many harvester-producers you have, your bases

5. d4x: how many base-producers you have

Idle games also fall in this category: first you chop wood with a crap axe, then you use wood to upgrade to a better axe, eventually you assemble an axe factory.

Inverted pendulums use such advanced math as well: https://en.wikipedia.org/wiki/Inverted_pendulum


👤 seanhunter
Not exactly an answer to your question but also from finance. A fun moment after the 2008 financial crisis came when a lot of pundits were trying to call the bounce. Everyone kept going on MSNBC and the like saying that “the second derivative was positive” and saying that was a sign the economy was about to turn around. I was watching one day and yet another person said that for some indicator (maybe nonfarm payrolls?) the second derivative was positive and therefore things were about to get better when Mohammed El-Erian (who was also on the program) said dryly “There are lots of analytic functions where the second derivative is consistently positive and the first derivative is consistently negative”. There was a stunned silence.

👤 armchairhacker
Bezier curves.

Cubic bezier curves (generally the most common type) are represented by cubic polynomials x(t) and y(t) (or just one polynomial P(t) where the coefficients are vectors). The first derivative gives you the tangent and normal. The second derivative gives you the direction the normal will gradually become as t increases. The third derivative gives you the change in this change (the fourth derivative is zero). Curvature is also computed from the first and second derivatives: K = det(P', P'')/||P'||^3

Other kinds of bezier curves are similar. In quadratic ones the first and second derivatives are normal and normal change but the third derivative is zero. In higher-polynomial bezier curves the third derivative changes over time as the fourth is non-zero, and so on.

Source is a really interesting video on bezier curves which I highly recommend: https://www.youtube.com/watch?v=aVwxzDHniEw.


👤 QuadrupleA
Steering an airplane is a fun one - you the pilot want to set the compass direction of the plane. The derivative of that is the rate of turn, corresponding to bank angle. But what the yoke / stick actually controls is the derivative of that, the bank angle rate / roll speed.

So pilots have to sort of double-integrate to set their heading.


👤 an1sotropy
Many other comments have noted "jerk", the derivative of acceleration that you can feel in a car; but here's maybe a way to make that a little more concrete.

Suppose you're driving, and you keep your speed constant (no change in the accelerator or "gas" pedal). Keeping the steering wheel at a fixed orientation then moves you uniformly along a fixed circle == constant acceleration == constant force (you feel from car) to the left or right.

But when you move the steering wheel, you're changing the circle radius, and changing acceleration, which changes the force you feel. To a first order approximation (I think), the rate of change of steering wheel position is the rate of change of acceleration, or 3rd derivative of position.

It's not a surprise that a car ride feels smoother when move the steering wheel slower, but the speed of steering wheel motion is the simplest tangible example I can think of for controlling and experiencing a third derivative.


👤 alted
A fun one with easy visualization is mechanical engineering statics, in which one calculates how much something deforms from a force (e.g., a bookshelf or bridge sags, a spring stretches, or an elastic tire or sponge or pillow squishes). The standard example is simple beam bending [1].

If you hold a thin beam (say, a ruler or a stiff piece of paper) horizontally in the air by one end, and press down on the free end, it bends from a straight line into a third-order (cubic) polynomial.

To calculate this, one considers the beam as a number of little segments connected to one another. The vertical force on each segment due to the force pressing down is constant over the beam. The first integral of this is the torque ("moment") on each segment. The second integral is the slope of the beam, and the third integral is the actual shape of the bent beam. If you consider it the other way around, the force is the third derivative of the resulting beam shape. This is often visualized in a "shear force and bending moment diagram".

The best part is there's a stupidly simple approximation to calculate how much bending you get from a single force (Hooke's law [2]): the distance the beam moves is proportional to the force (by some constant you can get either with these derivative calculations or by experiment).

[1] https://en.wikipedia.org/wiki/Bending [2] https://en.wikipedia.org/wiki/Hooke%27s_law


👤 c_o_n_v_e_x
CNC machining relies on motion controls with higher order derivatives.

https://tenmilesquare.com/resources/iot-connected-hardware/a...

"Note: In the past TinyG used 3rd-order “constant jerk” motion planning, similar to a form of controlled-jerk motion planning that is found in some commercial products. TinyG has since moved on to even smoother motion control that uses further derivatives “snap” (4th derivative), “crackle” (5th derivative), and “pop” (6th derivative). As far as we know, no commercial CNC products advertise that they use 6th-order motion planning."


👤 rawgabbit
Agile Development 1. Story points 2. Velocity = user story points completed per iteration 3. Burn out = number of sick days per iteration due to unreasonable estimates 4. New hires = number of new developers you have to hire because the old ones quit

👤 mac3n
"sudden" acceleration 0: position 1: velocity 2: acceleration 3: jerk

👤 andy81
Card games. e.g. MtG or LoR.

You've got to deal X damage to win.

You could directly cast spells at an opponent each turn.

Or instead you can play units or destroy enemy units to affect the amount of damage being done each turn.

Certain cards even increase the amount you can increase your damage each turn, e.g. by reducing costs, drawing cards on future turns, or improving deck contents.


👤 randycupertino
Drug derivatives are pretty common in chemistry and pharma. First-order derivatives are drugs that are created from the parent drug via just one chemical reaction. there are derivatives of derivatives which create (fun, lol) headaches for pharma licensing and marketing regulatory authorities.

Ecgonine is a tropane derivative from coca leaves and is convertible 2-carbomethoxytropinone and then cocaine. Another example is making buprenorphine from thebaine which is used for making oxycodone, oxymorphone, buprenorphine, naloxone and other opiate agonists. US Controlled substances act in 1986 spelled out the number of steps was irrelevant.

https://pubs.acs.org/doi/10.1021/acsomega.0c00282

Another area we're seeing twice and third derivatives to get around regulatory & consumer purview is perfluoroalkyl chemicals ie PFOAs, PFAS, PFOS. Consumers and regulators start avoiding or banning some of them, let's just spin up some derivatives of the perfluorooctane sulfonic acids that they haven't cracked down on yet and put that in everything until the people become savvy and then we'll move on to newer harmful unbanned things!


👤 jjgreen
They're rather important in roller-coaster rides, see for example https://iopscience.iop.org/article/10.1088/0143-0807/37/6/06...

👤 venachescu
While it's mostly a phenomenological observation (and not a natural law), many types of movements in humans and animals are well described by a "minimum jerk trajectory" [1]. There's a ton of debate about whether or not the brain is actually computing or optimizing the 'jerk' of your arm at all - or if it just happens to be the consequence of minimizing the effects of noisy neurons and muscles.

[1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6565116


👤 antegamisou
Everyday life may be a stretch, however some higher-end quadrotors are able to navigate safely in complex indoor environments by generating trajectories that minimize the snap, the second derivative of acceleration.

👤 yobbo
When you "scroll" on smart phones, the scroll speed is calculated a bit like a physical simulation with an instantaneous acceleration (second order) by a "flick" on the screen and then set to slowly decrease the scroll speed (first order).

👤 brian-armstrong
The universal speed limit applies to the 1st derivative of position, and we have nerve endings that can "feel" the second derivative, which seems to be a pretty important one!

👤 mdcds
options trading

when you calculate risk/exposure of your position, you want to consider Delta and its derivative, Gamma. But you also need to consider the rate of change of Gamma.


👤 gnicholas
PG, who built up YC, which builds up startups, which build up products/services.

OTOH, I have never encountered PG in everyday life, so perhaps this doesn't count!


👤 vagab0nd
Haha, I actually think about this a lot.

There are mechanical g-force meters you use when driving. The position of the needle is the acceleration (2nd derivative of position). The velocity of the needle would be the 3rd derivative. The acceleration of the needle would be the 4th.


👤 gigatexal
This is such a cool thread and why I keep coming to HN. I think that if I had friends like this that nerded out on such things and made such escoteric things like second and third derivatives of things I’d not have bombed calculus.

👤 rakoo
Music ?

A sound wave at a specific frequency is a cyclical difference in air pressure, so there's an infinite number of derivatives here. But let's take the Fourier Transform to keep it simple: a specific frequency is a constant. Music is made by having different frequencies together, ie multiple constants, and changing them over time ie first derivatives. You also want that change of rate to be smooth, which means there is an impact on the second derivative. I'm not sure what the third derivative would be, but I guess it would be the change in rhythm, tone, or even changing music.


👤 dmurray
This confused me more than it should have, thinking through "is the interest rate really the time derivative of the amount of money outstanding on my loan?"

It might be easier to think of it in terms of a bank deposit. If I put $100 in a bank account and the rate of interest is 5%/year, after a year my balance has grown by $5.

Of course, a loan works the exact same way in reverse. But as consumers normally we think of a loan as being paid off over a fixed length of time, so the rate of change is the rate at which you pay it off, and only second-order influenced by the interest rate.


👤 ur-whale
Jerk (derivative of acceleration, so 3rd derivative of position) matters when planning drone trajectories:

https://www.coursera.org/lecture/robotics-flight/supplementa...

https://www.youtube.com/watch?v=8RILnqPxo1s


👤 nl
Changes in health insurance premiums.

Age (base) -> Health (a large amount of the premium is based on age) (1st derivative) -> Premium (2nd derivative) -> Change in Premium (3rd derivative)


👤 ACow_Adonis
Pandemics, disease control, and epidemiology :)

i.e. infected = base. New infection rate, spread, R0 etc = 1st derivative. R0 increasing or decreasing = 2nd derivative.

Environment, Metereology and Climate.

Climate/phenomenon (i.e. global warming) = base. Is it increasing/decreasing = 1st derivative. Is the rate of change increasing or decreasing (i.e. as carbon emissions start to enter the atmosphere after the industrial revolution) = 2nd derivative.

You could get really fancy and say that climate is a statistical function on localised individual weather observations which follow the above pattern. And that you can take a derivative on the numbers generated by these individual observations themselves measuring localised 1st/2nd derivatives. Does that make it a third derivative? Exercise left for the reader :)

Economics, Finance, Risk and Regulation.

Closely related to interest rates and equilibrium funnily enough. Lets take mortgage stock/book cause it's easy.

A percentage of mortages go into default. 1st derivative. Are the rate of defaults (or adverse events) increasing or decreasing: 2nd derivative. (am i right on that, i haven't thought too hard, just whipped it out).

Indeed, I imagine it would come up in a lot of places where things can transition between states of equilibrium. To observe equilbrium and transition to another state, you may need to first measure 1st derivative. 2nd derivative may then inform on whether the system is transitioning to a new equilibrium/state or not. Sorry if that's too abstract.

Engineering

I presume higher derivatives would come up anywhere there's possibly of feedback loops. 2nd derivative can tell you if the system is heading towards catastrophic failure.

Which brings us to...

Anything (or at least a lot) of fields that invovle practical or empirical measurements or estimations of exponential effects. Since in the real world most exponential effects have a natural limit or regulator, we're often interested in knowing when the phenomenon hits its natural limit. And this means observing the rate of change (2nd derivative) on the rate of change (1st derivative) to pinpoint where and when the exponential behaviour is breaking down.


👤 jbay808
Carbon emissions is a big one.

Since the climate is far from equilibrium, temperature goes as something like the time-integral of excess carbon concentration.

CO2 concentration goes with the integral of total emissions. So emissions is roughly the second derivative of temperature.

But public policy discussions are often taking place on the level of slowing the rate of emissions growth. Which is about four derivatives up from temperature.


👤 marshallward
We use biharmonic diffusion operators in oceanography as a basic turbulence model, which is effectively a fourth order derivative in space. It is like an accelerated diffusion which aggressively dissipates small scales but preserves the large physical scales more robustly than normal diffusion.

👤 raverbashing
Elevators. You want to keep the 3rd derivative of position (jerk) limited, to have a smooth ride

👤 AlDante2
Interest is not a derivative of a debt instrument such as an obligation.

The most common example quoted is slowing the rise of the rate of increase in inflation. Inflation is change in price, i.e. first derivative.


👤 omarhaneef
Agree with whomever said options but it should be noted that the higher derivatives “lurk” in the lower ones in real life.

Example: a simple change in position means that the object had to move or experience two changes in velocity (starting and stopping). And to change its velocity it had to accelerate, and in order to do that it had to change its acceleration (from 0 to whatever) and so on.

So it is with all deltas that require basically many derivatives to happen at the edges.


👤 abxytg
driving is higher order derivative thinking (speed, rates of change in speed, relative rates of change in speed) and this is why most people suck at it.

👤 di456
Disk space = base, change in disk space = 1st derivative, rate of change = 2nd derivative.

Useful as a monitor for the rate of change in data intensive applications that sometimes spill to disk. Spikiness is okay if it reverts towards the base within a certain timeframe, but not okay if the rate of change persists or increases over same timeframe.


👤 njkleiner
I suppose it depends on how you define "everyday life", but in digital image processing, derivatives can be used as a relatively simple method for edge detection.

For example, the Sobel and Prewitt operators (1st derivative) and the Laplacian operator (2nd derivative) can be used as filter kernels to detect edges in images.


👤 quickthrower2
There was a HN submission about the G forces in roller coasters.

G force is acceleration, so a second derivative.

Early looping roller coasters had big spikes in G force rather than a steady G force. This made them horrible to ride on, so no one did, and was a problem to be solved (later solved by a different loop shape).

Measure how spikey G forces are is the 3rd derivative.


👤 eternityforest
Jerk is the 3rd derivative of position after velocity and acceleration, and has real effects on people.

👤 mathattack
Recently when I wasn’t merging into traffic fast enough I was told “More acceleration.”

👤 freahsteaksauce
Jerk is the feeling you get when you change acceleration, for example in a car when you go from a little gas pedal to flooring it. That abrupt change is jerk. The third derivative of position with respect to time.

👤 kalid
y(t) = bank balance

y'(t) = income

y''(t) = raises


👤 bradwood
Hardly everyday life, but "The Greeks" are used often in (financial) options pricing and market risk analysis.

Delta, Gamma, Theta, Rho. And then some more obscure ones like Vega and even a thing called Vanna.


👤 lynndotpy
Roller coaster curves are so you experienced a gentle change in acceleration, i.e. the fourh derivative of position.

We also see this for car brakes (and is responsible for the "elevator feeling".)


👤 AnimalMuppet
Health. We care about our actual level of health, of course, and we care about the first derivative. But as I get older, I'm starting to keep an eye on the second derivative...

👤 anonym29
base = location 1st = velocity (location/time AKA speed) 2nd = acceleration (location/time/time AKA rate of change of speed) 3rd = jerk (location/time/time/time AKA rate of change of acceleration)

If you've ever rode in (or drove) a Model S P85D, P90D, P100D, Performance AWD, or Plaid, you'll understand "jerk".


👤 GeorgeChiesa
see "Derivative Thinking with George Chiesa [Just for Jerks]" https://vimeo.com/GeorgeChiesa/Just4Jerks

👤 onos
Reads to me like op’s example is a fourth derivative as they are slowing the pace!

👤 GeorgeChiesa
You can read the book The JERK by my dear friend Chris Surdak...

👤 bilsbie
Change in acceleration is one. I always wondered if we could feel that.

👤 gitgud
Fuel prices (1st order)

Affect people's decisions to go on longer trips to the country (2nd order)

Which affects growth and tourism of outlying towns in the country (3rd order)


👤 tough
It's funny because NFT 10k collections is all derivs of punks for example lol

👤 garrybelka
"Acceleration of a rate of labor productivity growth" - 6th derivative.

Not found in English, but in original Russian - "ускорение темпов роста производительности труда" - about 4,090 results in Google.

"The acceleration of labor productivity growth" in English - about 11,700 results. But that's only a 5th derivative.