To make it "persistent", set an rc.local line(s) to arrange it every startup. (It's not actually persistent, but it will seem like it is to the user).
This site gives some hints:
https://help.ubuntu.com/community/HybridGraphics
To have permanent write permissions to the switch file, add the following line, replacing USERNAME with your username, to /etc/init.d/rc.local:
chown USERNAME /sys/kernel/debug/vgaswitcheroo/switch
Now, whichever card you want to be in use and on/off, just add another line that follows the convention for vgaswitcheroo, as seen on that page.
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
Turns on the GPU that is disconnected (not currently driving outputs), but does not switch outputs.
echo IGD > /sys/kernel/debug/vgaswitcheroo/switch
Connects integrated graphics with outputs.
echo DIS > /sys/kernel/debug/vgaswitcheroo/switch
Connects discrete graphics with outputs.
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
Turns off the graphics card that is currently disconnected.
There are also a couple of options that are useful from inside an X-Windows session:
echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
Queues a switch to integrated graphics to occur when the X server is next restarted.
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
Queues a switch to discrete graphics to occur when the X server is next restarted.
cat /sys/kernel/debug/vgaswitcheroo/switch
Allows you to verify the current state of the hybrid graphics. Typically, there will be two lines of output - one should indicate "Pwr" and the other should indicate "Off".
NB: The script with a gui on that page, by Roberto Martinez, may work or it may not, for many reasons. YMMV, so be prepared to try and see, if you want it.