Kubuntu 15.04 nvidia optimus

First undo everything that you did from the guide you linked to in your question, including uninstalling all the packages that you installed by following the guide and undoing the edits to files that you edited. Uninstall the Nvidia proprietary graphics driver and reboot the computer.

Open the terminal and type:

sudo apt install nvidia-346 nvidia-settings nvidia-prime
sudo reboot  

Nvidia Prime is a more up to date replacement for Bumblebee. Using Nvidia graphics drivers with initial Optimus support in Ubuntu is easier with Nvidia Prime. Nvidia Prime is not supported on some older models of laptops, however it is supported on the Lenovo IdeaPad Y510p laptop.

After the computer reboots, you will be able to switch between NVIDIA (Performance Mode) and Intel (Power Saving Mode) graphics from the NVIDIA Settings utility.