A friend of mine recently talked to me about the derivative of \(\left| x \right| \), and I decided to work with it to see what I could find. What I did find is probably already a well-known or at least well-explored thing, but the method I used to find it is interesting. To me, at least.

I started with the knowledge that \(\sum _{ n=1 }^{ \infty }{ \frac { 1 }{ { n }^{ 2 } } } =\frac { { \pi }^{ 2 } }{ 6 } \) and I decided that the derivative of \(\left| x \right| \) should be \(sign\left( x \right) \) (where \(sign\left( x \right) =1\) for \(x>0\), \(sign\left( x \right) =-1\) for \(0>x\), and \(sign\left( x \right) \) is \(0\) for \(x=0\)), with chain rule applied for \(x\). I went about mimicking the terms of the sum I mentioned earlier using my \(sign\left( x \right)\) function. I won't go through every detail, but I ended up with

\(1-\sum _{ n=1 }^{ \infty }{ \frac { \left( 2n+1 \right) \left( sign\left( x-n \right) +1 \right) }{ 2{ n }^{ 2 }{ \left( n-1 \right) }^{ 2 } } } \)

This is a function of \(x\) whose integral would hypothetically equal the \(p\)-series sum of \(2\). I took a literal integral here using my knowledge of the antiderivative of my \(sign\left( x \right)\) function, obtaining:

\({ \left( x-\frac { 1 }{ 2 } \sum _{ n=1 }^{ \infty }{ \frac { \left( 2n+1 \right) \left( \left| x-n \right| +x \right) }{ { n }^{ 2 }{ \left( n+1 \right) }^{ 2 } } } ) \right] }_{ 0 }^{ x }=x-\frac { 1 }{ 2 } \sum _{ n=1 }^{ \infty }{ \frac { \left( 2n+1 \right) \left( \left| x-n \right| +x \right) }{ { n }^{ 2 }{ \left( n+1 \right) }^{ 2 } } } -0+\frac { 1 }{ 2 } \sum _{ n=1 }^{ \infty }{ \frac { n\left( 2n+1 \right) }{ { n }^{ 2 }{ \left( n+1 \right) }^{ 2 } } } \)

This is incredible! In our original indefinite integral, if \(n>x\), then the sum can be written as

\(x-\frac { 1 }{ 2 } \sum _{ n=1 }^{ \infty }{ \frac { \left( 2n+1 \right) \left( n-x+x \right) }{ { n }^{ 2 }{ \left( n+1 \right) }^{ 2 } } } =x-\frac { 1 }{ 2 } \sum _{ n=1 }^{ \infty }{ \frac { n\left( 2n+1 \right) }{ { n }^{ 2 }{ \left( n+1 \right) }^{ 2 } } } \)

*which is the same as the right side of our definite integral!* This means that our definite integral can be represented as the indefinite integral bounded where \(n<x\), written as

\(x-\frac { 1 }{ 2 } \sum _{ n=1 }^{ \left\lfloor x \right\rfloor }{ \frac { \left( 2n+1 \right) \left( 2x-n \right) }{ { n }^{ 2 }{ \left( n+1 \right) }^{ 2 } } } \)

(Note that, instead of \(\infty\), we have \(\left\lfloor x \right\rfloor\) on top)

One thing I'm still trying to understand is that I have to multiply my sum by two to actually get my desired result. I'll figure it out eventually.

Since this sum is approaching \(\frac { { \pi }^{ 2 } }{ 6 } \) as \(x\) increases, I calculate \(\pi\) by the following:

\(\sqrt { 6\left( 2x-\sum _{ n=1 }^{ \left\lfloor x \right\rfloor }{ \frac { \left( 2n+1 \right) \left( 2x-n \right) }{ { n }^{ 2 }{ \left( n-1 \right) }^{ 2 } } } \right) } \)

And somehow, it works. I'm looking for any info or comments on this. It converges to \(\pi\) very quickly in comparison to the most standard methods, but I know there are some insanely quick methods out there. Different values of \(x- \left\lfloor x \right\rfloor \) return different results (let's call this difference \(d\) for further use). From graphing, it appears that \(d\approx 0.75\) returns the quickest convergence, but I'm still investigating this. I believe \(d=0\) is safest, but any value \(0\le d<1\) appears to converge to \(\pi\), just at different rates.

At \(2000\) sums with \(d=0\), this method converges about \(1334\) times more quickly than the \(p\)-series of \(2\). At \(2000\) sums with \(d=0.75\), this method converges about \(22445300\) times more swiftly than the \(p\)-series of \(2\). However, as the number of terms increases, \(d\) must decrease or it loses accuracy. There seems to be some relationship between number of terms and optimal \(d\) value, which I'm still looking into, but I suggest (in the meantime, at least) the use of \(d=0\) for any practicality. These values were calculated in Desmos (see my test graph here) as the following:

\(f\left( x \right) =\left| 1-\frac { \sqrt { 6\left( 2\left( \left\lfloor x \right\rfloor +d \right) -\sum _{ n=1 }^{ \left\lfloor x \right\rfloor }{ \frac { \left( 2n+1 \right) \left( 2(\left\lfloor x \right\rfloor +d)-n \right) }{ { n }^{ 2 }{ \left( n+1 \right) }^{ 2 } } } \right) } }{ \pi } \right| \) where \(d<1\)

\(g\left( x \right) =\left| 1-\frac { \sqrt { 6\sum _{ n=1 }^{ \left\lfloor x \right\rfloor }{ \frac { 1 }{ { n }^{ 2 } } } } }{ \pi } \right| \)

Note that I used \(\left\lfloor x \right\rfloor\) as the upper bound of the \(p\) series in order to compare the two sums with equal number of terms. So, the number of times quicker is \(\frac { f\left( x \right) }{ g\left( x \right)} \)

Upon further research, I found that Desmos is not accurate enough for this sum. It continues to converge to \(\pi\), but Desmos puts it above \(\pi\) relatively quickly.

## Comments

Sort by:

TopNewestwow this is insane :o good job :D – Romeo Gomez · 1 year, 8 months ago

Log in to reply