Input formula for 2 switching sine-waves (Heaviside eq'n)?
Basically, what you are describing is a frequency modulated waveform. Every 0.5 seconds the frequency changes instantaneously from 2\$\omega\$ to 5\$\omega\$ and back again. As RF engineers know, a carrier signal that is modulated by a sinewave produces an infinite bandwidth but you can make decent approximations even if the modulating signal is complex audio - after all FM radios work just fine last time I checked. 

The problem with your signal is that you are modulating with a square wave and a square wave has infinite spectral content so, not only are you wanting to create a signal that will have infinite bandwidth (due to modulation but can be approximated to a finite banwidth), you are using a modulation signal that has infinite bandwidth.

So if you want a perfect answer it's going to be an infinite fourier series (the square wave) with each term enclosed within the standard formula for FM.

Basically this means there are no simple math tricks to express the signal mathematically, heavyside or not.