Integration of Cantor function from $0$ to $x$, $\int_0^{x} c(x') dx' $ Define $c(x)$ is the Cantor function. 
What is the value of following integral ?
$$\int_0^{x} c(x') dx' $$ 
with $0\le x \le 1$.
Because $c(x)$ is continuous in $[0,1]$, it must be  Riemannian integrable. 
And we know $$\int_0^1 c(x)dx=1/2$$ from the symmetry of square $[0,1]\times[0,1]$. I'm curious about the area below $c(x)$ from $0$ to $x$.
It's equivalent to ask what $C^1([0,1])$ function $f(x)$ such that $f'(x)=c(x)$.  
 A: The definition of the Cantor function can be given in the following, recursive form:
$$ c(x)=
\begin{cases}
\frac12 c(3x)\quad\text{for}\quad x\in[0,\frac13]\\
\frac12\quad\text{for}\quad x\in[\frac13,\frac23]\\
\frac12+\frac12 c(3x-2)\quad\text{for}\quad x\in[\frac23,1]
\end{cases}\tag1
$$
If we define $$I(x)=\int^x_0c(x')\,dx',$$ it's easy to derive from (1) 
$$ I(x)=
\begin{cases}
\frac16 I(3x)\quad\text{for}\quad x\in[0,\frac13]\\
\frac1{12}+\frac12\left(x-\frac13\right)\quad\text{for}\quad x\in[\frac13,\frac23]\\
\frac1{12}+\frac12\left(x-\frac13\right)+\frac16 I(3x-2)\quad\text{for}\quad x\in[\frac23,1]
\end{cases}\tag2
$$
That's sufficient to calculate $I(x)$ quickly with arbitrary accuracy.
The process described by (2) will be finite for almost all $x$ in the sense of Lebesgue measure: if $x$ is not in the Cantor set, the process will end in the middle equation of (2), as soon as we find a $1$ in the ternary expansion of $x$, and we obtain $I(x)=a+bx$ for some rational $a,b$.
Interestingly, the process gives the exact rational value of $I(x)$ even if $x$ is in the Cantor set and rational, for instance
$$I\left(\frac14\right)=\frac16I\left(\frac34\right)=\frac16\left(\frac1{12}+\frac12\left(\frac34-\frac13\right)+\frac16I\left(\frac14\right)\right)=\frac7{144}+\frac1{36}I\left(\frac14\right),$$
giving $$I\left(\frac14\right)=\frac1{20}.$$
