I have been practicing my residue calculus recently (a fairly new topic for me), I started with calculating integrals of simple functions in the form of
$$\int_{-\infty}^{\infty} \frac{1}{(x^2 + 1)^n} \, dx$$
where $n$ is an integer $>0$. I used a semicircular contour over the top half of the complex plane with the diameter of this contour covering the real axis. It is not that difficult to prove that the circumference part of such contour will be $0$ as $R$ tends to infinity. So I will not spend time on this here and focus on the real part of the contour.
I used these formulas from Cauchy Residue Theorem
$$\int_{-\infty}^{\infty} \frac{1}{(x^2 + 1)^n} \, dx = 2\pi i \cdot \operatorname{Res}(f,i)$$
and
$$\operatorname{Res}(f, i) = \frac{1}{(n-1)!} \lim_{x \to i} \frac{d^{n-1}}{dx^{n-1}} \left[ (x - i)^n f(x) \right]$$
I did not use the sum in the first formula since there is only one special point in those kinds of integrals and therefore only one residue.
Out of curiosity, I decided to try using this formula for cases that $n$ is a non-integer. I tried $1.5$, then a bunch of half integers ($2.5$ through $5.5$), then $1.6$ and then a general formula for any $n>0.5$, as if $n$ is less than or equal to $0.5$ then the integral obviously diverges.
The $\frac{1}{(n-1)!}$ part of the formula is easy to extend into non-integers using the gamma function. The problem arises when defining a non-integer order derivative. I tried generalising it from differentiating a function in the form $(x + a)^n$.
If you only use positive integers it is easy to see that $k$-th derivative of such function will be as follows
$$\frac{d^k}{dx^k} (x + a)^n = \begin{cases} \dfrac{n!}{(n - k)!} (x + a)^{n - k}, & \text{if } k \leq n, \\ 0, & \text{if } k > n. \end{cases}$$
This of course can be written using the gamma function, which allows positive non-integer values for $n$ and $k$. It is also my undertsanding that this is consistent with the Riemann-Liouville fractional derivative for basic power functions.
$$\frac{d^k}{dx^k} (x + a)^n = \begin{cases} \dfrac{\Gamma(n+1)}{\Gamma(n - k+1)} (x + a)^{n - k}, & \text{if } k \leq n, \\ 0, & \text{if } k > n. \end{cases}$$
This clearly does not work when $n$ is a negative integer, or if $n$ and $k$ are both half integers with $n$ being negative, as then $n-k$ is a negative integer and the gamma function is not defined for those. Here comes my biggest leap of faith in this entire solution. I needed to have a formula which will be consistent with an idea of the fractional derivative, but also will be defined for all negative values of $n$ and $n-k$. I used the recurrent relationship of the gamma function to obtain a different formula. A similar idea has been used in answering this question here and I just expanded the application of this formula with non-integers. Eventually I reached this formula:
$$\frac{\Gamma(q-l)}{\Gamma(-l)} = (-1)^{q} \frac{\Gamma(l+1)}{\Gamma(l-q+1)}$$
Now, this formula is clearly only valid if $q$ is an integer. If $q$ is, let's say. $0.8$, and $l$ is $0.5$, you will have on the LHS the ratio of two real values of the gamma functions, and on the RHS you will have some other ratio of two real values of the gamma function multiplied by ${-1}^{0.8}$ which is complex. However, I decided to use RHS as the basis of defining my fractional derivative, including non-integer values, since even though there is no equality between the two sides when $q$ is non-integer, RHS is always defined for all negative values I need. In fact when I was originally developing the solution of this problem I introduced a different function I called $\Gamma^*$, but right now I see that there is no reason for this. Using two formulas above I said,
let $-l = n-k+1$ and $q-l = n+1$
Therefore $q = k$ and $l = k-n-1$
So for my positive powers my fractional derivative looks like this:
$$D^{k} (x + a)^{n} = \frac{\Gamma(n+1)}{\Gamma(n-k+1)} (x + a)^{n - k}$$
For negative $n$ it switches to this, which is also consistent with Riemann-Liouville definition for negative integer powers. But my intention is to use it for all negative powers (and as you will see, for some positive non integer powers as well).
$$D^{k} (x + a)^{n} = {(-1)}^k\frac{\Gamma(k-n)}{\Gamma(-n)} (x + a)^{n - k}$$
(Note that for the ${(-1)}^k$ term, the principal value is used for non-integer $k$)
As you can see, as long as the order of the derivative is positive and $n$ is negative, resulting inputs for the gamma function will be positive and therefore defined everywhere. Yes, resulting fractional derivatives generally are complex, but I have tested it and if you take, lets say half derivative and then half derivative again you will get first derivative. I will supply a more rigorous proof on request if needed.
Consider this integral
$$\int_{-\infty}^{\infty} \frac{1}{(x^2 + 1)^{1.5}} \, dx$$
At this point I am going to use the term pseudoresidue to acknowledge the shaky mathematical justification of what I am doing. If we are using the semicircular contour, then there will only be one special point at $x=i$ at which we will evaluate our pseudoresidue.
So I followed the general pattern and said that
$$\int_{-\infty}^{\infty} \frac{1}{(x^2 + 1)^{1.5}} \, dx = 2\pi i \cdot \operatorname{PsRes}(f,i)$$
$$\operatorname{PsRes}(f, i) = \frac{1}{\Gamma(n)} \lim_{x \to i} \frac{d^{n-1}}{dx^{n-1}} \left[ (x - i)^n f(x) \right]$$
For this case $n=1.5$ hence
$$\operatorname{PsRes}(f, i) = \frac{1}{\Gamma(1.5)}\lim_{x \to i} \frac{d^{0.5}}{dx^{0.5}} (x - i)^{1.5} \frac{1}{(x^2 + 1)^{1.5}}$$
This simplifies into
$$\frac{1}{\Gamma(1.5)}\lim_{x \to i}\left( (x+i)^{-1.5} \right)^{(0.5)}$$
So $0.5$-th derivative of a power function of an order $-1.5$. Use the formula from before
$$D^{k} (x + a)^{n} = {(-1)}^k\frac{\Gamma(k-n)}{\Gamma(-n)} (x + a)^{n - k}$$
$k=0.5$, $n=-1.5$ and $a=i$
$$D^{0.5} (x + i)^{-1.5} = {(-1)}^{0.5}\frac{\Gamma(2)}{\Gamma(1.5)} (x + i)^{-2}$$
Hence we get that the total value of pseudoresidue is
$$\operatorname{PsRes}(f, i)= \frac{1}{\Gamma(1.5)} {(-1)}^{0.5}\frac{\Gamma(2)}{\Gamma(1.5)} (x + i)^{-2}$$
with $x=i$ that yields
$$\operatorname{PsRes}(f,i)= \frac{1}{\Gamma\left(1.5\right)} \cdot \frac{i \cdot \Gamma(2)}{\Gamma(1.5)} \cdot (2i)^{-2} = -\frac{i}{\pi}$$
So total integral will be
$$2\pi i \cdot \operatorname{PsRes}(f,i) = 2$$
Which is correct for this integral.
I tried this with several other values using the same method and it all yielded the correct results. So after that I tried using the general case to obtain a general formula and compare it to what exists in literature and internet. To my surprise this was also successful and I managed to obtain a known general formula.
(At this point I realised I have been using $x$ instead of $z$ for complex variable, which is against the convention, so in this example I will be using $z$.)
$$\int_{-\infty}^{\infty} \frac{1}{(z^2 + a^2)^{m}} \, dz = 2\pi i \cdot \operatorname{PsRes}(f,ai)$$
Here $a$ can be any nonzero real number and $m$ is any real number greater that $1/2$.
Using the same semicircular contour around one special point at $z=ai$ we get:
$$\operatorname{PsRes}(f,ai) = \frac{1} {\Gamma{(m)}} \lim_{z \to ai} \frac{d^{(m-1)}}{dz^{(m-1)}} \left[ (z - ai)^{m} f(z) \right] = \frac{1}{\Gamma(m)}\lim_{z \to ai}\left( (z+ai)^{-m} \right)^{(m-1)}$$
Using the formula for the fractional derivative of negative power functions we get that
$$D^{k} (z + a)^{n} = {(-1)}^k\frac{\Gamma(k-n)}{\Gamma(-n)} (z + a)^{n - k}$$
For $n=-m$, $k=m-1$ and $a=ai$
$$D^{m-1} (z + ai)^{-m} = {(-1)}^{m-1}\frac{\Gamma(2m-1)}{\Gamma(m)} (z + ai)^{1-2m}$$
Then we return to the pseudoresidue itself with $z=ai$
$$\operatorname{Res}(f,ai) = \frac{1}{\Gamma(m)}(-1)^{m-1} \frac{\Gamma(2m-1)}{\Gamma(m)}(2ai)^{1-2m}$$
Replace $-1 $with $i^2$ Here, as before, we are using principle values for all expressions, so the index laws hold.
$$\operatorname{PsRes}(f,ai) = \frac{1}{\Gamma(m)}(i)^{2m-2} \frac{\Gamma(2m-1)}{\Gamma(m)}(i)^{1-2m}(2a)^{1-2m}$$
Let us cancel the powers of $i$
$$\operatorname{PsRes}(f, ai) = \frac{1}{\Gamma(m)}(i)^{-1} \cdot \frac{\Gamma(2m - 1)}{\Gamma(m)}(2a)^{1 - 2m}$$
Hence we get
$$\int_{-\infty}^{\infty} \frac{1}{(z^2 + a^2)^{m}} \, dz = 2\pi i \cdot \operatorname{PsRes}(f,ai) = {2 \pi}\frac{\Gamma(2m-1)}{\Gamma^2(m)}(2a)^{1-2m}$$
Now, this formula is already correct as far as I tested it for all real $a$ and all real $m>1/2$ but I wanted it to be a bit more rigorous and obtain a formula from another source. So I wanted to get something similar to this. I decided to apply Legendre Duplication formula.
$$\Gamma(z) \cdot \Gamma\left(z + \frac{1}{2}\right) = 2^{1 - 2z} \cdot \sqrt{\pi} \cdot \Gamma(2z)$$
Assume $z=m-1/2$, then
$$\Gamma(2m - 1) = \Gamma(2z) = \frac{\Gamma(z) \cdot \Gamma\left(z + \frac{1}{2}\right)}{2^{1 - 2z} \cdot \sqrt{\pi}} = \frac{\Gamma\left(m - \frac{1}{2}\right) \cdot \Gamma(m)}{2^{2 - 2m} \cdot \sqrt{\pi}}$$
We input the obtained expression for $\Gamma(2m-1)$ into the integral.
$$\int_{-\infty}^{\infty} \frac{1}{(z^2 + a^2)^{m}} \, dz = 2\pi \cdot \frac{\Gamma\left(m - \frac{1}{2}\right) \cdot \Gamma(m)}{2^{2 - 2m} \cdot \sqrt{\pi} \cdot \Gamma^2(m)} \cdot (2a)^{1 - 2m} = 2\pi\frac{\Gamma\left(m - \frac{1}{2}\right)}{2^{2 - 2m} \cdot \sqrt{\pi} \cdot \Gamma(m)}(2a)^{1 - 2m}$$
Since $(2a)^{1 - 2m} = (2)^{1 - 2m}(a)^{1 - 2m}$
$$\int_{-\infty}^{\infty} \frac{1}{(z^2 + a^2)^{m}} \, dz = 2\pi \cdot \frac{\Gamma\left(m - \frac{1}{2}\right)}{2^{2 - 2m} \cdot \sqrt{\pi} \cdot \Gamma(m)} \cdot 2^{1 - 2m} \cdot a^{1 - 2m}$$
All the powers of $2$, including the one before $\pi$ will cancel, we will get
$$\int_{-\infty}^{\infty} \frac{1}{(z^2 + a^2)^{m}} \, dz = \pi \cdot \frac{\Gamma\left(m - \frac{1}{2}\right)}{\sqrt{\pi} \cdot \Gamma(m)} \cdot a^{1 - 2m} = \sqrt{\pi} \cdot \frac{\Gamma\left(m - \frac{1}{2}\right)}{\Gamma(m)} \cdot a^{1 - 2m}$$
Which is almost exactly the formula from the link with the exception of the fact they did not square the term added to $x^2$ and the coefficient for $x^2$ in my case is $1$.
I tried using this method for some more complicated cases and more interesting contours with branch cuts etc. (for example $\int_{0}^{\infty} \frac{\sqrt{z}}{(z + 1)^{1.6}} \, dz$) and it also yielded the correct result. As long as there was a nice way do define a fractional derivative of a function using method above (which only works for a small class of functions), my calculations worked.
After some more exploration, I believe I found another class of functions for which this approach works. Consider this generic integral:
$$\int_0^\infty \frac{\ln(z)}{(z+q)^{p}} \, dz$$
Where $p>1$ and $q>0$
Here, we would have to consider the contour of a different function, by replacing $\ln(z)$ with $\ln(z)^2$ in the function we are looking at. This is a reasonably well known trick, so I am not going to spend too much time explaining it. I will have a keyhole contour made up of four parts: infinitely small circle, infinitely large circle, and two straight paths connecting them, parallel to the positive real axis. The paths are in the opposite direction, so their signs are opposite, and, of course, we assume arguments of $z$ lying on those lines are 0 for the positive direction and $2\pi$ for the negative.
On the upper path, $arg(z)=0 \Rightarrow \ln{z}^2$
On the lower path, $ arg(z)=2\pi \Rightarrow \ln{z}^2 = \ln{(z\cdot e^{2\pi i})}^2 = (\ln{z}+2i\pi)^2 $
Trivially, the values of both circular contours is $0$, so we are left with just two straight contours equalling to the sum of residues. So we get the following arrangement:
$$\int_0^\infty \frac{\ln(z)^2}{(z+q)^{p}} \, dz + \int_\infty^0\frac{(\ln(z)+2i\pi)^2}{(z+q)^{p}} \, dz= 2\pi i \cdot \operatorname{PsRes}(f,-q)$$
Let us change the sign and bounds of integration, as well as open the brackets.
$$\int_0^\infty \frac{\ln^2 z}{(z+q)^p} \, dz - \left( \int_0^\infty \frac{\ln^2 z}{(z+q)^p} + \frac{4i\pi \ln z}{(z+q)^p} - \frac{4\pi^2}{(z+q)^p} \right) dz = 2\pi i \cdot \operatorname{PsRes}(f, -q)$$
Opening the brackets will result in $ln{(z)}^2 terms cancel, leaving us with.
$$ \int_0^\infty - \frac{4i\pi \ln z}{(z+q)^p} + \frac{4\pi^2}{(z+q)^p} dz = 2\pi i \cdot \operatorname{PsRes}(f, -q)$$
Quite handily, The integral we need is multiplied by $i$, hence we can just consider the imaginary part of the pseudoresidue. Hence we get
$$ -\int_0^\infty \frac{4\pi \ln z}{(z+q)^p} dz = \Im(2\pi i \cdot \operatorname{PsRes}(f, -q))$$
Now let us evaluate the pseudoresidue. The order is $p$, so we will need $p-1$-th derivative of $\ln(z)^2$
$$\operatorname{PsRes}(f, -q) = \frac{1}{\Gamma(p)} \lim_{z \to -q} \frac{d^{p-1}}{dz^{p-1}} \left[ \ln(z)^2 \right]$$
Defining fractional derivative for $\ln(z)^2$ is the problem here. This function is more complicated than the power functions I was dealing with before. There many different fractional derivatives I can use here, but they are generally quite messy, and I am not proficient enough with fractional calculus to use them properly (which makes it even more surprising that my amateur hand-wavy method worked). I decided to try to extend the formulas I get from integer order derivatives for $\ln(z)^2$ into non integers. You can see that:
$(\ln(z)^2)' = \frac{2 \ln(z)}{z} = \frac{0+2 \ln(z)}{z}$ I will add the $0$ for the reasons that will become apparent below. link
$(\ln(z)^2)'' = \frac{2 - 2 \ln(z)}{z^2}$ Link
$(\ln(z)^2)''' = \frac{-6 + 4 \ln(z)}{z^3}$ Link
$(\ln(z)^2)'''' = \frac{22 - 12 \ln(z)}{z^4}$ Link
$(\ln(z)^2)''''' = \frac{-100 + 48 \ln(z)}{z^5}$ Link
$(\ln(z)^2)'''''' = \frac{548 - 240 \ln(z)}{z^6}$ Link
$(\ln(z)^2)''''''' = \frac{-3528 + 1440 \ln(z)}{z^7}$ Link
So we can see that generally, $n$-th derivative of this function can be expressed in the form $\frac{a + b \ln(z)}{z^n}$, where $a$ and $b$ are members of two different sequences.
Aside from sign alternations, which can be expressed as various powers of $-1$, we get two sequences of numbers. If I want to define fractional derivatives of $\ln(z)^2$ I need to generalise those sequences.
$A_n \Rightarrow 0, 2, 6, 22, 100, 548, 3528...$
$B_n \Rightarrow 2, 2, 4, 12, 48, 240, 1440...$
It is very obvious that the second sequence is just the factorial multiplied by 2. Hence can be expanded into non-integers using Gamma function. It should be noted that we start from $0!$ in the first derivative, hence the value of this part is $(n-1)!$ for the $n$-th derivative. I had to do some exploration of the first sequence to figure out it's nth term. I had to look in the OEIS. This is what I found.
So the first sequence is the double product of the factorial of $n$ by the sum of the harmonic series up to and including $n$. Sum of the harmonic series has been extended into non integers by Euler using this formula $H_n = \int_0^1 \frac{1 - x^n}{1 - x} \, dx$, as before, the first derivative contains the $0$-th term of the sequence, so the $n$-th derivative it will contain $(n-1)$-th term.
Therefore, using Gamma function and Euler's extension we can try to generalise the $n$-th derivative of $\ln(z)^2$ into non-integers. We also need to remember the sign alternations.
$(\ln(z)^2)^{(n)}= \frac{{(-1)}^{n}2\Gamma{(n)}\int_0^1 \frac{1 - k^{(n-1)}}{1 - k} \, dk + {(-1)}^{n+1}2\Gamma{(n)} \ln(z)}{z^n} $
Now we can use this formula in the pseudoresidue calculation. Remember, we are taking $p-1$-th derivative, so $n=p-1$.
$$\operatorname{PsRes}(f, -q) = \frac{1}{\Gamma(p)} \lim_{z \to -q} \frac{d^{p-1}}{dz^{p-1}} \left[ \ln(z)^2 \right]$$
Which yields
$$\operatorname{PsRes}(f, -q)= \frac{1}{\Gamma(p)} \lim_{z \to -q} \frac{(-1)^{p-1} \cdot 2\Gamma(p-1) \int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk + (-1)^p \cdot 2\Gamma(p-1) \ln(z)}{z^{p-1}}$$
Let us cancel the gamma functions.
$$\operatorname{PsRes}(f, -q)= \frac{1}{p-1} \lim_{z \to -q} \frac{(-1)^{p-1} \cdot 2\int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk + (-1)^p \cdot 2 \ln(z)}{z^{p-1}}$$
Let $z=-q$
$$\operatorname{PsRes}(f, -q)= \frac{1}{p-1} \frac{(-1)^{p-1} \cdot 2\int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk + (-1)^p \cdot 2 \ln(-q)}{(-q)^{p-1}}$$
As we agreed that $q$ is positive, $\ln(-q) = \ln(q)+i\pi$
Hence
$$\operatorname{PsRes}(f, -q)= \frac{1}{p-1} \frac{(-1)^{p-1} \cdot 2\int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk + (-1)^p \cdot (2 \ln(q)+2i\pi)}{(q)^{p-1}(-1)^{p-1}}$$
We can cancel the powers of $-1$ and open brackets.
$$\operatorname{PsRes}(f, -q)= \frac{1}{p-1} \frac{2\int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk - 2 \ln(q)-2i\pi}{(q)^{p-1}}$$
Now let us recall what our integral was equal to.
$$ -\int_0^\infty \frac{4\pi \ln z}{(z+q)^p} dz = \Im(2\pi i \cdot \operatorname{PsRes}(f, -q))$$
Hence
$$-4\pi\int_0^\infty \frac{\ln z}{(z+q)^p} dz = \Im(2\pi i \cdot \frac{1}{p-1} \frac{2\int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk - 2 \ln(q)-2i\pi}{(q)^{p-1}})$$
Let us simplify
$$-4\pi\int_0^\infty \frac{\ln z}{(z+q)^p} dz = \Im( \cdot \frac{1}{p-1} \frac{4\pi i\int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk - 4\pi i \ln(q)+4\pi}{(q)^{p-1}})$$
We can cancel both sides by $4\pi$
$$-\int_0^\infty \frac{\ln z}{(z+q)^p} dz = \Im( \cdot \frac{1}{p-1} \frac{ i\int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk - i \ln(q)+1}{(q)^{p-1}})$$
Let us now consider only the imaginary part of the RHS (and also move the minus\ to the other side).
$$\int_0^\infty \frac{\ln z}{(z+q)^p} dz = -\frac{1}{p-1} \frac{ \int_0^1 \frac{1 - k^{p-2}}{1 - k} \, dk - \ln(q)}{(q)^{p-1}})$$
So this is the formula I have achieved using this method. I have put it to the test in Desmos. Here is a link to it. Generally, if $p>2$ I have a very good alignment between the value of the integral calculated by Desmos, and value given by the formula. The alignment is ten or more decimal places. However, if $p$ is close to $1$, the two values no longer align. That, said, I believe that this is due to imprecisions of Desmos, rather than my mistake. The reason I think that is because I tried several other calculators, and they given the results which align. For example I used Wolfram for special case of $p=1.1$ and $q=0.5$. Desmos gives out value $87.869767018$ for the integral and $95.8556231156$ for the formula. But Wolfram gives the value of $98.1036$ for both integral and formula calculations.
My question is, why does this work, especially for two different classes of functions (at least 2) despite the whole idea of non-integer order pole being nonsensical and me choosing rather arbitrary methods to define a fractional derivative for negative power functions? Is this method valid? If so, has it been used before? Can I show it to my students (I am a schoolteacher)?
My apologies for such a long question but I am unable to make it shorter without throwing away key information. I actually had to remove some derivations of some integrals to keep this shorter. I can provide those calculations at request separately if they are needed to clarify anything.