Integrating SquareWave - don't understand result

May be it will help if you look at the plots:

Plot[SquareWave[t], {t, 0, 10}]

enter image description here

Plot[Evaluate[Integrate[SquareWave[t], t]], {t, 0, 10}]

enter image description here


Wolfram support have confirmed that

TriangleWave[t+3/4]/4 

would be a more appropriate result for

Integrate[SquareWave[t], t]

EDIT

This problem remains in V12.2


One problem with picking a constant at each discontinuity is that there are infinitely many discontinuities. In general, this couldn't be done, so returning a mathematically correct answer would be the next best thing. In the SquareWave[] case, some cleverness leads some to realize that there is a way to choose the constants or even an antiderivative expression (in terms ofTriangleWave[]). One might hope this could be handled (eventually) by a special rule for SquareWave[].

You can get a continuous result by restricting the domain, thereby restricting the number of discontinuities. The answer is valid only over the domain, however.

Assuming[{0 < t < 10},
 Integrate[SquareWave[t], t]
 ]
Plot[%, {t, 0, 10}]

Out[]= large piecewise function

Mathematica graphics