Do the formulas for capacitive and inductive impedance always hold?
The differential equations which use \$\frac{di}{dt}\$ and \$\frac{dV}{dt}\$ are more fundamental. They do not do not care about any abstractions such as &quot;frequency&quot;, &quot;sinusoids&quot;, or &quot;canned&quot; waveforms which, in a sense, need you to know what is going to happen in the future. As a result, you can always use the differential equations.
The impedance equations which use \$\omega\$ are derived from the differential equations using sinusoids as inputs. If you choose to work with the impedance equations instead of the differential equations then you need to break the input down into component sinusoids using Fourier analysis, perform the analysis for each sinusoid than add them up again at the end via super position. Don't forget to account for the phase shifts.