Fractional Derivatives

And How to Calculate Them

Ozaner Hansha
6 min readApr 4, 2018

Basic Differentiation

In general terms, derivatives are a measure of how a function changes with respect to another variable. Not all functions have derivatives, but those that do are called differentiable.

The derivative of a function is itself a function and thus can be further differentiated. This means we can define things like the second derivative which is obtained by successively taking the derivative of a function twice.

Take the function x³. It’s first derivative is usually denoted:

It’s second derivative is denoted:

We can extend this idea (and its notation) to any integer n forming the nth derivative of a function f(x):

Differential operator

Before we go any further, let’s introduce a less cumbersome notation for differentiation:

The first derivative of f(x)

Or more generally:

The nth derivative of f(x)

This is called the differential operator and it’s used in other fields of calculus. Since all our functions are of one variable (x) there is no ambiguity in using it. Also note that the operators are not being raised to a power, it’s just the notation.

Also note that the differential operator also includes anti-differentiation, or integration. The indefinite integral of a function f is just:

And further integrals can be defined as you’d expect:

Fractional Differentiation

Naturally, one might ask the question “What about derivatives of a non-integer order?” What might such a nonstandard derivative look like? Well, to help us out, let’s take a look at a property of derivatives.

That is, the nth derivative of the mth derivative of a function is equivalent to the (n+m)th derivative of the function. This should come as no surprise as the definition of the second, third, etc. derivatives are just repeated use of the differential operator:

This should remind you of exponents and their properties. As well as the fact that it is not immediately clear what x means.

It should follow that there exists half derivatives, or semiderivatives, of functions that satisfy the following:

Power Rule

But how do we calculate the half derivative of f? Let’s assume f(x) is some polynomial function. If that’s the case we can apply the power rule to find its first and second derivatives:

As we find higher and higher derivatives a pattern emerges:

The nth derivative of a polynomial term

If that wasn’t clear, realize that as we successively apply the power rule we multiply the expression by its power then subtract its power by 1 and so on forming a partial factorial. To deal with the fact that these terms don’t form a full factorial, we divide by the missing terms which are encapsulated by (n−k)!

The Gamma Function

This formula works for any integer order derivative but if we attempt to plug, say ½, into the expression we’re left with:

When n is an integer, n½, will always be a rational number. This means we cannot evaluate the denominator because the factorial function x! is only defined for integer x.

But luckily there is a way to amend the factorial function such that it accepts any real (and even complex) numbers. This done by a process known as analytical continuation, resulting in a unique generalized function.

The generalized factorial function is called the gamma function and is denoted: Γ(x)

Gamma of n+1 equals n! for all integers

In the graph above you’ll see that the gamma function returns the same result as factorial for integer values, but is shifted over by 1:

Why is the gamma function shifted over by 1? Well no particular reason, it’s just an unfortunate turn of mathematical history.

There is so much interesting math that makes use of the Gamma Function that I couldn’t even hope to touch on it here. For the rest of this article I’ll assume you know how to google a gamma function calculator in order to evaluate it.

Fractional Power Rule

We now have all the necessary machinery to derive an expression for fractional (and indeed complex) order derivatives of polynomial functions. It’s as simple as replacing the factorial function in our original definition of the power rule with its continuous cousin, the gamma function:

A more general power rule

Remember, we added 1 to each of the function’s arguments because the gamma function is shifted from factorial.

And so now we have a general formula for the fractional derivative (or integral if k is negative) of any polynomial.

An Example

Now we can finally take the semiderivative of a function. Let’s start off with a simple one: f(x)=x

Below, we can see the derivative of y=x changing between it’s first derivative which is just the constant function y=1 and it’s first integral (i.e D⁻¹x) which is y=x²/2

(gif) Fractional derivative from -1 to 1 of y=x

If we pause this animation at the semiderivative, which we calculated above, we get:

In blue is the function y=x, in red it’s first derivative y=1, and in purple it’s semiderivative.

A More Complex Example

Let’s take a (literally) more complex example, the (1+i)th derivative of 3x:

Unfortunately, the gamma function of complex numbers aren’t usually nice looking. As such, we have to use an approximate value for Γ(3−i).

If you’re wondering how to raise a number to a complex power, I’ve written about it and other consequences of Euler’s formula here.

Fractional Derivatives of other Common Functions

You may have noticed that the above fractional power rule for finding the fractional derivatives of polynomials isn’t very general. What about terms with negative exponents (i.e x⁻⁵)? The power rule above doesn’t work for them because the gamma function isn’t defined for negative integers (it is defined for all other negative real and complex numbers):

And we haven’t even mentioned the fractional derivatives of , sin x, and cos x

Deriving the fractional derivatives of these expressions is a lot to cram into one post, so I’ll shelve them for now.

--

--

Ozaner Hansha
Ozaner Hansha

Written by Ozaner Hansha

Interested in Machine Learning, Math, Quantum Computing, Philosophy, etc. My projects/notes are on https://ozaner.github.io

No responses yet