I have always had the best luck running Nvidia proprietary drivers on my machines.
Nvidia driver installation:
The latest driver can be downloaded from here (http://www.nvidia.com/Download/index.aspx), but generally unless you have a specific reason to have the latest driver, it is always easier to use the one included in your distribution (sudo apt-get install nvidia-driver in debian for instance).
(At the time of this writing however, the latest driver release (375) has a couple major fixes for the "Prime Sync" functionality--eliminating screen tearing and proper handling of external screens--which makes the latest driver quite a bit more valuable in your circumstance.)
Note that if you choose to do the binary installation from Nvidia's website, you will have features like up-to-date CUDA support at the cost of re-installing the driver every time you update your kernel. Therefore, if you go that route, keep the installer script for the Nvidia driver in an easy-to-find location.
Making sure that nouveau isn't running
If Nouveau runs, it will take ownership of your graphics card and the nvidia driver will be unable to operate. Since the nouveau module comes with Linux by default, you can't uninstall it, but you can blacklist it. Step one is to add the line blacklist nouveau to the file /etc/modprobe.d/blacklist.conf. Step two is to run sudo update-initramfs -u (in debian/ubuntu). This step propagates the blacklist config change into the grub boot sequence or something.
Note that bumblebee, bbswitch, and primus work only with the nouveau and should be uninstalled. See edit at end of post for more detailed information.
Configuring Nvidia driver to work in Prime Sync mode
Nvidia Optimus laptops have two graphics cards: the Intel integrated graphics card which is attached to the screen, and the Nvidia discrete graphics card which is not attached to the screen (though is often attached to external outputs). Therefore you need to configure the Nvidia card to generate graphics, but to pass them to the Intel card to be displayed on the screen.
Try changing your /etc/X11/xorg.conf to the following (substituting in the PCI BusID of your graphics card, usually "PCI:1:0.0", with quotes):
Section "ServerLayout" Identifier "layout" Screen 0 "nvidia" Inactive "intel" EndSection Section "Device" Identifier "nvidia" Driver "nvidia" BusID "<BusID for NVIDIA device here>" EndSection Section "Screen" Identifier "nvidia" Device "nvidia" Option "AllowEmptyInitialConfiguration" EndSection Section "Device" Identifier "intel" Driver "modesetting" EndSection Section "Screen" Identifier "intel" Device "intel" EndSection
Then you will need to run two commands after your X server has started before you can actually use the X server (so put them in a file where they run automatically):
xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto
I start my x server manually from the command line using startx, so I place those commands in my ~/.xinitrc config file. If you boot into a graphical environment, you could probably put them in /etc/X11/xinit/xinitrc. I have never tried that myself.
Information is from Nvidia online documentation (http://us.download.nvidia.com/XFree86/Linux-x86/375.20/README/randr14.html)
Extra Info
The steps I describe here use Nvidia's proprietary driver, using what is called the "Prime Sync" functionality. It renders all graphics on the GPU but pushes them through a buffer to the Intel integrated gpu for actual display. This Prime Sync system is not complementary to bumblebee at all. Note that the Debian instructions may still be correct, because they do not set up the Nvidia Prime Sync functionality. I am much less familiar with the way they suggest. I generally come from the "latest proprietary driver is best" because I generally want to run the latest CUDA on fairly new GPU hardware. I suggest this strategy to you because you are having trouble with the open-source driver setup.
Also worth mentioning is the bbswitch program, which doesn't care about displays or drivers, it just turns the Nvidia GPU on and off. It should not be used at all with Nvidia's Prime Sync functionality because with Prime Sync, turning off your GPU means you have no more graphics :(