## Q: Is there such a thing as half a derivative?

The original question was: Another one of those questions of the type “does this make sense”.  You have first derivatives and second derivatives.  f'(x), f”(x) or sometimes dy/dx and d^2y/dx^2. Is there any sensible definition of a something like a “half” derivative, or more generally an nth derivative for a non-integer n?

Physicist: There is!  For readers not already familiar with first year calculus, this post will be a lot of non-sense.

Strictly speaking, the derivative only makes sense in integer increments.  But that’s never stopped mathematicians from generalizing.  Heck, non-integer exponentiation doesn’t make much sense (I mean, 23.5 is “2 times itself three and a half times”.  What is that?), but with a little effort we can move past that.

The derivative of a function is the slope at every point along that function, and it tells you how fast that function is changing.  The “2nd derivative” is the derivative of the derivative, and it tells you how fast the slope is changing.

f(x) is a parabola. f'(x) describes the fact that as you move to the right the parabola’s slope increases. Notice that a negative slope means “down hill”. f”(x) describes the slope of f'(x), which is constant.

When you want to generalize something like this to you basically need to “connect the dots” between those cases where the math actually makes sense.  For something like exponentiation by not-integers there’s a “correct” answer.  For not-integer derivatives there really isn’t.  One way is to use Fourier Transforms.  Another is to use Laplace Transforms.  Neither of these is ideal.  Just to be clear: non-integral derivatives are nothing more than a matter of choosing “what works” from a fairly short list of options that aren’t terrible.

It turns out (as used in both of those examples) that integrals are a great way of “connecting dots”.  When you integrate a function the result is more continuous and more smooth.  In order to get something out that’s discontinuous at a given point, the function you put in needs to be infinitely nasty at that point (technically, it has to be so nasty it’s not even a function).  So, integrals are a quick way of “connecting the dots”.

To get the idea, take a look at N!.  That excited looking N is “N factorial” and it’s defined as $N!=1\cdot2\cdot3\cdots(N-1)\cdot N$.  For example, $3!=1\cdot2\cdot3=6$.  Clearly, it doesn’t make a lot of sense to write “3.5!” or, even worse, “π!”.  And yet there’s a cute way to smoothly connect the dots between 3! and 4!.

Γ(N+1) is a fairly natural way of generalizing N! to non-natural numbers.  The dotted lines correspond to 1!=1, 2!=2, and 3!=6.

The Gamma function, Γ(N),  (not to be confused with the gamma factor) is defined as: $\Gamma(N+1) = \int_0^\infty t^{N} e^{-t}\,dt$.  Before you ask, I don’t know why Euler decided to use “N+1″ instead of “N”.  Sometimes decent-enough folk have good reasons for doing confusing things.  If you do a quick integration by parts, a pattern emerges:

$\begin{array}{ll}\Gamma(N+1)\\[2mm]= \int_0^\infty t^{N} e^{-t}\,dt \\[2mm]=\left[-t^Ne^{-t}\right]_0^\infty + N\int_0^\infty t^{N-1} e^{-t}\,dt \\[2mm]=N\int_0^\infty t^{N-1} e^{-t}\,dt \\[2mm]=N\Gamma(N)\end{array}$

So, Γ(N+1) has the same defining property that N! has: $\Gamma(N+1) = N\cdot \Gamma(N)$ and $N! = N\cdot (N-1)!$.  Even better, $\Gamma(1) = \int_0^\infty e^{-t}\,dt=-e^{-t}\big|_0^\infty = 0-(-1)=1$, which is the other defining property of N!, 0!=1.  We now have a bizarre new way of writing N!.  For all natural numbers N, N! = Γ(N+1).  Unlike N!, which only makes sense for natural numbers, Γ(N+1) works for any positive real number since you can plug in whatever positive N you like into $\int_0^\infty t^{N} e^{-t}\,dt$.

Even better, this formulation is “analytic” which means it not only works for any positive real number, but (using analytic continuation) works for any complex number as well (with the exception of those poles at each negative integer where it jumps to infinity).

|Γ(N)|, where N can now take values in the complex plane.

Long story short, with that integral formulation you can connect the dots between the integer values of N (where N! makes sense) to figure out the values between (where N! doesn’t make sense).

So, here comes a pretty decent way to talk about fractional derivatives: fractional integrals.

If “f ‘(x)=f(1)(x)” is the derivative of f, “f(N)(x)” is the Nth derivative of f, and “f(-1)(x)” is the anti-derivative, then by the fundamental theorem of calculus $f^{(-1)}(x) = \int_0^x f(t)\,dt$.  It turns out that $f^{(-N)}(x)=\frac{1}{(N-1)!}\int_0^x (x-t)^{N-1}f(t)\,dt$.  x-t runs over strictly positive values, so there’s no issue with non-integer powers, and it just so happens that we already have a cute way of dealing with non-integer factorials, so we may as well deal with that factorial cutely: $f^{(-N)}(x)=\frac{1}{\Gamma(N)}\int_0^x (x-t)^{N-1}f(t)\,dt$.

Holy crap!  We now have a way to describe fractional integrals that works pretty generally.  Finally, and this is very round-about, but it turns out that a really good way to do half a derivative is to do half an integral and then do a full derivative of the result:

$f^{\left(\frac{1}{2}\right)}(x)=\frac{d}{dx}f^{\left(-\frac{1}{2}\right)}(x)=\frac{d}{dx}\left[\frac{1}{\Gamma\left(\frac{1}{2}\right)}\int_0^x (x-t)^{-\frac{1}{2}}f(t)\,dt\right]=\frac{d}{dx}\left[\frac{1}{\sqrt{\pi}}\int_0^x \frac{1}{\sqrt{x-t}}f(t)\,dt\right]$

That “root pi” is just another math thing.  If you want to do, say, a third of a derivative, then you can first find f(-2/3)(x) and then differentiate that.  This isn’t the “correct” way to do fractional derivatives, just something that works while satisfying a short wishlist of properties and re-creating regular derivatives without making a big deal about it.

Answer Gravy: You can show that $f^{(-N)}(x)=\frac{1}{(N-1)!}\int_0^x (x-t)^{N-1}f(t)\,dt$ (or even better, $f^{(-N)}(x)=\frac{1}{\Gamma(N)}\int_0^x (x-t)^{N-1}f(t)\,dt$) through induction.  The base case is $f^{(-1)}(x)=\frac{1}{(1-1)!}\int_0^x (x-t)^{1-1}f(t)\,dt=\int_0^x f(t)\,dt$.  This is true by the fundamental theorem of calculus, which says that the anti-derivative (the “-1″ derivative) is just the integral.  So… check.

To show the equation in general, you demonstrate the (N+1)th case using the Nth case.

$\begin{array}{ll} f^{(-N-1)}(x)\\[2mm] =\int_0^x f^{(-N)}(t)\,dt \\[2mm] = \int_0^x \frac{1}{\Gamma(N)}\int_0^t (t-u)^{N-1}f(u) \,du\,dt \\[2mm] = \frac{1}{\Gamma(N)}\int_0^x \int_0^t (t-u)^{N-1}f(u) \,du\,dt \\[2mm] = \frac{1}{\Gamma(N)}\int_0^x \int_u^x (t-u)^{N-1}f(u) \,dt\,du \\[2mm] = \frac{1}{\Gamma(N)}\int_0^x f(u)\int_u^x (t-u)^{N-1} \,dt\,du \\[2mm] = \frac{1}{\Gamma(N)}\int_0^x f(u)\left[\frac{1}{N}(t-u)^{N}\right]_u^x\,du \\[2mm] = \frac{1}{\Gamma(N)}\int_0^x f(u)\frac{1}{N}(x-u)^{N}\,du \\[2mm] = \frac{1}{\Gamma(N+1)}\int_0^x f(u) (x-u)^{N}\,du \\[2mm] \end{array}$

Huzzah!  Using the formula for f(-N)(x) we get the formula for f(-N-1)(x).

There’s a subtlety that goes by really quick between the fourth and fifth lines.  When you switch the order of integration (dudt to dtdu) it messes up the limits.  Far and away the best way to deal with this is to draw a picture.  At first, for a given value of t, we integrate u from zero to t, and then integrating t from zero to x.  When switching the order we need to make sure we’re looking at the same region.  So for a given value of u, we integrate t from u to x and then integrate u from zero to x.

Integrating over the same region in two different orders.

So that’s what happened there.

Posted in -- By the Physicist, Conventions, Equations, Math | 13 Comments

## Q: Why is our Moon drifting away while Mars’ moons are falling?

The original question was: I know the Moon is getting further away because tides/friction/conservation of angular momentum.  This video claims Phobos is getting closer to Mars because of tidal forces, what gives?  Obviously no oceans to drag around but what else?

Physicist: A moon causes the material of the planet under it to distend toward it (and away, which is why there are two tides).  This is especially obvious on Earth where the water is free to move a lot more than the ground.  However that bump takes a little while to relax and, because planets turn and moons orbit, that bump is never exactly under the moon.

The tidal bulge created by a moon doesn’t stay directly under that moon, either because the planet is turning, because the moon is orbiting, or both.  This is really, really not to scale.

Because the Earth spins in the same direction that the Moon orbits, our bump leads the Moon a little.  If the Moon orbited in the opposite direction, or even orbited so fast that its orbit were faster than the Earth’s spin, then the bump would trail the Moon.

The bump itself has mass and therefore a little extra gravity.  If it leads the moon, then the moon speeds up because it’s getting a tiny, tiny extra pull in the direction its orbiting.  Speeding up causes things in orbit to assume higher orbits, which we often and not-quite-accurately describe as “drifting away”.  Our Moon gets a couple cm farther away every year.

On the other hand, if the tidal bump trails behind a moon, then that moon is slowed down and drops lower as a result.  Phobos’ orbital period is about 8 hours (it’s already very low), and Mars’ day (a “sol“) is about as long as ours, so the bump Phobos creates necessarily trails behind it.  As a result Phobos is slowly dropping and will eventually impact Mars.  Mars is going to have a really bad sol in about 50 million years.

But raising moons consumes a lot of energy and that energy has to come from somewhere.  The same tiny pull that the Earth applies to the Moon to speed up its orbit is applied to the Earth to slow down our day.  When the Moon formed around 4.5 billion years ago, it about 15 times closer to the Earth (give or take) and a day was only about 6 hours long.  Back then a full moon would have provided about 200 times as much light and solar eclipses would have blacked out swaths of the Earth’s surface nearly the size of Australia.

Our Moon has more than 7 million times the mass of Phobos, so Phobos doesn’t have nearly as pronounced an impact on the spin of Mars.

The Earth and Moon as they are now and the Earth and Moon as they were when the Moon formed.

We live in a remarkably unlikely time, when the size of the Moon in the sky perfectly matches the size of the Sun.  In fact, since the Moon’s orbit around Earth is a little elliptical, the Moon is sometimes a little smaller and sometimes a little bigger.  We live on the only planet that gets to see both annular and total solar eclipses.  But see a total eclipse while you can; in a few million years we’ll be stuck with only annular eclipses.  Sucks to be you, unforeseeable future generations!

Posted in -- By the Physicist, Astronomy, Physics | 9 Comments

## Q: Why do we (people) wave our arms when we fall? Is it for attention?

The original question was: When I am about to fall backwards I spin my arms up over my head then down . This seems to help in preventing my fall somewhat.

Is this some form of conservation of angular momentum?

Physicist: Actually, it’s some form of conservation of angular momentum.

Assuming you still have at least one foot on the ground, falling over is just a rotation that stops either comically or sadly or both.  You start upright and 90° later you’re prone.  Everything that moves is subject to the conservation of momentum: if you push something one way, then you’ll be pushed the other way.  Similarly, everything that rotates is subject to the conservation of angular momentum: if you rotate something one way, then you’ll be rotated the other way.

Mr. Anderson wants his body to rotate clockwise (to stand back up), so he rotates his arms counter-clockwise.  This sort of insight is why it’s so unpleasant to watch movies with physicists.

If you start to fall in some direction, then you want your body to rotate in the opposite direction.  Rotating your arms in the direction of the fall causes the rest of you to rotate back to upright.

Someone with gigantic hands and stick-thin-but-long arms would practically never fall over.  The more mass you have far from the pivot point (shoulders) the greater the “moment of inertia“.  Something with a lot of mass is hard to move or stop (it has a lot of “inertia“).  Something with a high moment of inertia is hard to turn and to stop turning.  In fact, that’s why flywheels are designed the way they are.  Most of their mass is far from their pivot so that they have a high moment of inertia without being ridiculously heavy.

She couldn’t fall if she wanted to: her moment of inertia is way to high.

Until we can find the coveted giant-hands-long-arms gene, tightrope walkers will be forced to continue using poles to keep their balance.  They use their pole to keep balanced in exactly the same way the rest of us ground-dwellers use our arms.  If you can believe it, the search for this gene isn’t a priority for most geneticists.

Such tiny arms.

The same trick we (humans with arms) use to keep our balance is the same trick that space craft use to rotate in space.  Here on the ground we can push off of things.  If you want to face a new direction, use your feet to push on the ground and voilà: a new vista lays before you (or another wall if you’re inside).

However, space is notable for its remarkable dearth of stuff.  There’s nothing in space to push on, so spacecraft engineers (notable for their remarkable plenitude of cleverness) literally provide stuff for their spacecraft to push: flywheels.  By turning a tiny flywheel clockwise a lot, the rest of the spacecraft turns counter-clockwise a little.

Turn a wheel in space, and turn yourself.  These are from the Hubble space telescope.  Hubble would be a whole lot of pointless if it couldn’t point in more than one direction, but it also can’t pollute the space around it with rocket exhaust (avoiding gases is why it’s up there in the first place).  So: flywheels.

Posted in -- By the Physicist, Physics | 2 Comments

## Q: What is the state of matter in deep space?

The original question was: What might be the state of matter in [interstellar space]. Average temperature is 2.7K , so all the gases like hydrogen, helium should be in liquid or solid state?

Physicist: Matter in deep space tends to take the form of gas.  Liquids basically don’t happen, and solids are pretty rare.  The cosmic microwave background ensures that everything is at least as hot as about 2.7K, but in general the gases we see out there are quite a bit hotter.  Fortunately, there’s so little of it that you’d barely notice.

Sure it’s hot, but there’s so little of it that there isn’t enough heat to light things on fire.  The same thing is true for gases in space: it’s hot, but there’s so little of it you’d never notice.

For example, in the core of the Orion Nebula the temperature of the gas is around 10,000K, but even if you were there your biggest problem wouldn’t be getting burned, it would be freezing to death.  Also suffocation.  Really, if you’re going to travel in space at all, bring a spacesuit.

Temperature is a measure of the average random speed of a material (technically, it’s the “variance” of the velocities).  That “random” bit is important.  For example, the air you’re (hopefully) breathing isn’t sitting still, it’s moving every-which-way at around half a km per second.  Air bounces around so much that it doesn’t get very far (about 1 ten millionth of a meter before it gets bounced), but it’s all still moving pretty fast.

By comparison, Halley’s comet is moving at a few dozen km/s (it varies between about 1 km/s and 50 km/s).  However, it’s frozen because that movement isn’t random.  Its atoms are all moving really fast, but they’re all moving together.

(left) a hot air balloon and (right) an artist’s interpretation of a comet.  Temperature is the random movement of molecules.  A comet moves faster than air molecules (on average), but it’s still frozen solid because all of its molecules are moving in more-or-less the same direction.  The air molecules  in a hot air balloon move fast (relative to each other) and the bits of ice in the comet moves slowly (relative to each other).

Here comes the point.  In deep space you mostly find individual atoms cruising along at high speeds.  In order to define a temperature you look at lots of atoms passing through a region and see how random those trajectories are.  Typically: they’re very random and very fast, so the temperature of those gases is thousands of degrees Celsius (or Kelvin or Fahrenheit for that matter).

It’s not unusual for things to be randomly traveling through space really fast: space is full of stuff taking forever to go from nowhere to nowhere through nothing at break-neck speeds.  Generally, unless there’s a good reason to do otherwise, the individual atoms in space are traveling in every-which-way.  A “good reason” is often running into something, or being caught up in an accretion disk.  The majority of molecules in deep space are traveling in a straight line, very fast, without (strongly) interacting with anything else for years at a time.

A natural question to ask is: Isn’t space cold?  If this interstellar gas is so damnably hot, then why doesn’t it cool off?  The answers are: “yes it is” and “you have to think about why things cool off”.  Light is created by accelerating charges.  Traveling in a straight line involves no acceleration.  If things bounce off of each other a lot, then they change direction a lot and that involves (for lack of a better word) a lot of accelerating.

This has nothing to do with either the spirit or letter of the question, but one of the most terribly cool things ever is that entire stars obey the same rules; they travel along at high speeds without interacting with anything else for huge periods of time.  While atoms scatter by bouncing off of each other, stars interact with each other through their gravity (it’s very, very rare for stars to actually run into each other).  If you stand back far enough, you find that the stars in a galaxy act a lot like a gas.  You can even describe the “temperature” of a galaxy and talk about the movement of its stars in terms of thermodynamics.  For example, “hot galaxies” are those with lots of randomly moving stars, and these galaxies literally evaporate (eject stars into inter-galactic space) and “cool” as a result.  As they “cool” the randomness of their remaining stars’ movements decrease and the galaxy itself tends to contract.

Posted in -- By the Physicist, Astronomy, Physics | 9 Comments

## Q: Is there a scientific conspiracy?

Physicist: Obviously.

Science started in the 1750’s when a cadre of ultra-wealthy nobles decided to use their extreme means to build complex and bewildering devices for the express purpose of, as Mikhail V. Lomonosov put it (in Russian), “… the obfuscation of the truth from all, the befuddlement of the masses, the erosion of spiritual pursuits, and to [waste a lot of] time.”.

Built to befuddle and obfuscate.

In his letters to fellow conspirator Cantor, Newton boasted about their contributions to science and mathematics saying “What we do today, let it not be mistaken, is the most elaborate and vexing gaff ever perpetrated.  This truly is a godly joke against which all other humour can scarcely be compared.”.

Within the conspiracy there are supporters and detractors.  Einstein, crushed by guilt, finally recanted in 1960 saying (in German) “I made it all up.  I thought it would be funny, but then things got out of hand.”  At the other extreme are examples like Gallileo, who left his middle finger on display with a plaque that read (in Italian) “May all the Earth sit and spin like a plate upon my bird”.  This plaque was later removed, ostensibly for being offensive, but in reality for accidentally revealing a truth about the Earth.

Galileo’s only entirely honest statement.

The scientific community didn’t become truly organized until the early 20th century in order to squelch public knowledge of ghosts and telepathy.  Today psychic scientists like James Randi use their secret powers to “prove” that other psychics don’t exist by messing up their vibes.  During a meeting of the NSF inside their secret volcano lair, NSF director Dr. Córdova was accidentally recorded speaking without her human face mask on: “Tricking people into injecting their children with autism and hiding all the health benefits of coal is easy.  That’s Tuesday morning.  The hardest part of my job is keeping all the free energy devices off the market.”

The scientific conspiracy was perhaps best summed up by Carl Sagan from the after-life “Why did I do Cosmos?  Are you serious?  Why did man pretend to go to the Moon?  Why do we hide global cooling or make up germs?  Why do we systematically spread bizarre and fantastic lies about the nature of all of existence, generation after generation?  Because it’s hilarious.”

Posted in -- By the Physicist, April Fools | 8 Comments

## Q: After the heat death of the universe will anything ever happen again?

Physicist: If you wait forever, then you might see something happen.  But the more practical answer is: no.

The universe does a lot of stuff (for example, whatever you did today), but literally everything that ever happens increases entropy.  In some sense, the increase of entropy is equivalent to the statement “whatever the most overwhelmingly likely thing is, that’s the thing that will happen”.  For example, if you pop a balloon there’s a chance that all of the air inside of it will stay where it is, but it is overwhelmingly more likely that it will spread out and mix with the other air in the room.  Similarly (but a little harder to picture), energy also spreads out.  In particular, heat energy always flows from the hotter to the cooler until everything is at the same temperature (hence the name: “thermodynamics”).

If you get in front of that flow you can get some work done.

All machines need to be between a “source” and a “sink”. If the source and sink are at the same temperature, then there’s no reason for energy to flow and the machine won’t work.  For example, if the water were already steam (not previously cold), then it won’t expand and you can’t use it to do work.

“Usable energy” is energy that hasn’t spread out yet.  For example, the Sun has lots of heat energy in one (relativity small) place.  Ironically, if you were in the middle of the Sun, that energy wouldn’t be accessible because there’s nowhere colder for it to flow (nearby).

The spreading out of energy can be described using entropy.  When energy is completely and evenly spread out and the temperatures are the same everywhere, then the system is in a “maximal entropy state” and there is no remaining useable energy.  This situation is a little like building a water wheel in the middle of the ocean: there’s plenty of water (energy), but it’s not “falling” from a higher level to a lower level so we can’t use it.

Useable energy requires an imbalance. If all the water were at the same level there would be no way to use it for power.

The increase of entropy is a “statistical law” rather than a physical law.  You’ll never see an electron suddenly vanish and you’ll never see something moving faster than light because those events would violate a physical law.  On the other hand, you’ll never see a broken glass suddenly reassemble, not because it’s impossible, but because it’s super unlikely.  A spontaneously unbreaking glass isn’t physically impossible, it’s statistically impossible.

However, when you look at really, really small systems you find that entropy will sometimes increase.  This is made more explicit in the “fluctuation theorem“, which says that the probability of a system suddenly having a drop in entropy decreases exponentially with size of the drop.

For example, if you take a fistful of coins that were in a random arrangement of heads and tails and toss them on a table, there’s a chance that they’ll all land on heads.  That’s a decrease in the entropy of their faces, and there is absolutely no reason for that not to happen, other than being unlikely.  But if you do the same thing with two fistfuls of coins it’s not twice as unlikely, it’s “squared as unlikely” (that should be a phrase).  10 coins all landing on heads has a probability of about 1/1,000, and the probability of 20 coins all landing on heads is about 1/1,000,000 = (1/1,000)2.  The fluctuation theorem is a lot more subtle, but that’s the basic sorta-idea.

The “heat death of the universe” is what you get when you starting talking about the repercussions from ever-increasing entropy and never stop asking “and then what?”.  Eventually every form of useable energy gets exhausted; every kind of energy ends up more-or-less evenly distributed and without an imbalance there’s no reason for it to flow anywhere or do work.  “Heat death” doesn’t necessarily mean that there’s no heat, just no concentrations of heat.

But even in this nightmare of homogeneity we can expect occasional, local decreases in entropy.  Just as there’s a chance that a broken glass will unbreak, there’s a chance that a pile of ash will unburn, and there’s a chance that a young (fully-fueled) star will accidentally form from an fantastically unlikely collection of scraps.  There’s even a chance of a fulling functioning brain spontaneously forming.  But just to be clear, these are all really unlikely.  Really, really unlikely.  As in “in an infinite universe over an infinite amount of time… maybe“.  We do see entropy reverse, but only in tiny quantities (like fistfuls of coins or the arrangements of a few individual molecules).  Something like the air on one side of a room (that’s in thermal equilibrium) suddenly getting 1° warmer while the other gets 1° colder would literally be the least likely thing that’s ever happened.  The universe suddenly “rebooting” after the heat death is… less likely than that.  Multivac interventions notwithstanding.

Those events that look like decreases in entropy have always been demonstrated to be either a matter of not taking everything into account or just being wrong.

Fun fact: Patents for perpetual motion machines are the only patents that require a working model.  Yet another example of the scientific conspiracy at work!

Long story short: yes, after the heat death there should still be occasional spontaneous reversals of entropy, but they’ll happen exactly as often as you might expect.  If you break a glass, don’t hold your breath.  Get a new glass.