Using basic circuit analysis techniques we can find the voltage gain of this basic integrator as follows:
\$i_1=\frac{v_I}{R_I}\quad\text{and}\quad i_2=-C(\frac{dv_O}{dt})\\\text{since:}\quad i_1=i_2 \ \rightarrow \ \frac{v_I}{R_I}=-C(\frac{dv_O}{dt})\$
From this we can derive the output voltage to be:\$-\frac{1}{RC}\int_{0}^{t}v_Idt+v_O(0)\$
If we look at it in the s domain, we can easily find the voltage gain of the circuit to be:
\$G_v=\frac{v_O}{v_I}=-\frac{1}{sRC}\$
This was easy enough. The only problem is, this is only valid if the input signal is a sine wave. Granted, the gain will approximate this value if the input signal is a square wave and it will be even closer if the input is a triangle wave, but it will not be 100% correct.
So my question: how can we modify this relationship to solve for the output voltage or gain of the circuit if the input signal is a square wave? I would think that since a square wave is composed of a sine wave at the primary frequency and a number of odd order harmonic frequencies, there must be a way to add to this and solve it more accurately.