Why is $\int_0^1 \operatorname{sgn}(\sin(2^n\ \pi t))^2 dt$ equal to 1? The integral given is
$$\int_0^1 \operatorname{sgn}(\sin(2^n\ \pi t))^2 dt$$
for $n=0,1,2,...$
The indefinite integral is given as
$$\frac14 t\left(\;\operatorname{sgn}(\sin(2^n\pi t))^2 + 3\;\right)$$ by WolframAlpha. If I plug in in $0$ and $1$, that gives me $3/4$, but it should be $1$. If I enter the definite integral from $0$ to $1$, it gives me $1$ as desired.
Why is this integral equal to $1$?
 A: With the usual definition of $\def\sgn{\operatorname{sgn}}$ $\sgn$, which is
$$\sgn(x) = \begin{cases}
1,&x > 0\\
0,&x = 0\\
-1,&x < 0\\
\end{cases}$$
we get that the value of $\sgn^2$ is 1 except at the zeros of $\sin$:
$$\sgn(\sin(2^n \pi t))^2 = \begin{cases}
0,&\text{ if } 2^nt \in\Bbb Z\\
1,&\text{ else }\\
\end{cases}$$
For $t\in[0,1]$ the zeros are at $\{k/2^n \ | \ k\in\Bbb Z\cap[0,2^n]\}$ which is a set of measure zero.  Therefore
$$\int_0^1 \sgn(\sin(2^n \pi t))^2 dt = \int_0^1 dt =1$$
A: $\def\sgn{\operatorname{sgn}}$

Can you figure out where $\frac34$ comes from? [From a comment]

Well, maybe the problem is that the integrand can be parsed in two different ways.  In my 1st answer I parsed it as $\sgn^2\sin$, but one can also parse it as $\sgn\sin^2$.  However that makes no difference because $\sgn^2 (f(x)) = \sgn (f^2(x))$ for any real-valued $f$.
So no, I have no idea where the 3/4 comes from.  Maybe it's a glitch in WA, which is unlikely.
So let's drop that square and go
$$\begin{align}
\int_0^1 \sgn(\sin(2^n \pi t)) dt
&= \underbrace{\int_0^{1/2} \sgn(\sin(2^n \pi t)) dt}_{\textstyle=A_n}
+ \underbrace{\int_{1/2}^1 \sgn(\sin(2^n \pi t)) dt}_{\textstyle=B_n}
\end{align}$$
Then substitute $x=1-t$, $dx=-dt$ in the second integral:
$$\begin{align}
B_n &= \int_{1/2}^1 \sgn(\sin(2^n \pi t)) dt \\
&= -\int_{1/2}^0 \sgn(\sin(2^n \pi (1-x))) dx \\
&= \begin{cases}
-\displaystyle\int_0^{1/2} \sgn(\sin(2^n \pi x)) dx, & n \geqslant 0\\
+\displaystyle\int_0^{1/2} \sgn(\sin(\pi x)) dx, & n=0 \\
\end{cases}\\
&= \begin{cases}
-A_n, & n \geqslant 0\\
A_n = B_n = 1/2, & n=0 \\
\end{cases}\\
\end{align}$$
So the integral will be either 1 if $n=0$ or it will be 0 if $n>0$.

So still no idea what to make of that $3/4$.... One could use it to forge a new question, like:

Find values $C$ such that
$$\int_0^1 \sgn(C+\sin(2^n \pi t)) dt\ =\ \frac34$$


