nVidia Optimus is not yet supported under Linux. I think Nvidia announced somewhere that they work on it.
AMD/ATI supports under certain circumstances with their proprietary driver GPU switching, on ATI/AMD cards with PowerXPress feature. I think this feature exists only in mobile computers, but maybe I'm wrong.
Ubuntu forum: AMD/Intel Hybrid Graphics works !
hybrid-graphics-linux team mailing list archive
I think on a desktop computer you have to reboot to change between graphic IGP and dedicated graphic card. Before you reboot, you would have to change the configuration then.