To get with your sub x miles in front of a target is just a special case of the "Intercept of moving target"-problem, where you are x miles behind a target, on a same course as the target and you try to intercept the target.
For calculation use then the usual formula for interception
http://img.xrmb2.net/?imgID=207664
from the "formularies for u-boat commanders"-handbook =>