# How do I plot the derivative of the Cantor Staircase?

I know that the derivative of the Cantor Staircase should be close to 0 since the Cantor Set has a measure of zero. I wanted to graph the derivative of Cantor's Staircase in Mathematica to see if it was closed to 0 from the interval [0,1]. Here is my input:

f[x_] := f[x] = CantorStaircase[x];

Plot[f'[x], {x, 0, 1}]


However, the plot of the derivative is not close to 0. I appreciate any suggestions of where I went wrong. Thanks!

• N[CantorStaircase'[1/2]] returns -0.119127 when it should return something close to zero, so I suspect this is a bug of some sort. – Michael Seifert Apr 26 at 19:09
• Also, N[CantorStaircase'[1/6]] = -0.837313, apparently. Not all rational values return a numerical answer, though; N[CantorStaircase'[1/4]] doesn't give any output in a reasonable time on my computer. – Michael Seifert Apr 26 at 19:18
• Curiouser and curiouser: N[CantorStaircase'[1/6], n] for various values of n gives wildly fluctuating values as n increases — but only the first time you run the command in a fresh kernel. So running N[CantorStaircase'[1/6], 5] gives you one number, N[CantorStaircase'[1/6], 10] gives you a second, different number, and N[CantorStaircase'[1/6], 5] gives you the second result rounded off to five significant digits. – Michael Seifert Apr 26 at 23:12

Plot[CantorStaircase[x], {x, 0, 1}]