How to use your iPad as an input pen tablet paired with an iMac?
This is possible with some commercial 3rd party apps:


Duet Display is an iOS / OS X app combo (about $20) that makes it possible to use an iPad as an external monitor connected to your mac. The "Pro" version (about $20 per year) provides the requested feature to use the iPad as a graphics tablet. By "mirroring" to the external monitor (iPad) in display settings, one gets the same view on the graphics tablet as on the Mac's screen. 
Astropad is another combo (about $30) that focuses more on the graphics tablet idea. You cannot use it as an external monitor, but define an area of your Mac's screen that is mirrored to the tablet.  Apparently, the basic version can already be used as a graphics tablet, but the "Studio" version (about $80 per year) provides dedicated Apple pencil support for the iPad Pro, support for custom tool palettes and some additional gizmos.


Duet also offers a Windows version. However, according to the testimonials on the internet is has a much higher lag and is barely usable.