It is not just killing the sub, but interfering with the subs raiding. The key is to make raiding more costly than it is worth. Not killing everything in 1940.
Remember, after the first couple of years Germany will have a lot of areas to keep up with, naval won't be one of them they can afford, unless you lose a lot of stuff. Their economy is shockingly weak early on and they have to get ready for Barbarossa. If you try them you will see what I mean. Also you need to learn how to screen. Ships stop on a dime with a surprise encounter. Screen the German fleet so they cannot break out. They will probably try in bad weather because the planes can't fly. However, if the weather clear the UK has 4 carriers I think? Not counting a couple of maritime and a medium bomber. You can use a carrier or those planes to spot. Wipe out the German surface fleet and then you are free to play whack a mole. Also ASW on ships gives them a defense value that counters what you are talking about.
From the manual in various areas.
Costs rise with unit upgrades, generally by 10% per level of upgrade, though some like Anti-Submarine Warfare only cost 5% and others like Mobility cost 20% (30% for Germany). This means over time it is cheaper for all your ASW stuff by 50%!
When attacked, Subs have a % chance of diving. They have a 20% starting chance, increasing by 10% with every upgraded level of Advanced Subs. However, each new level of Anti-Submarine Warfare upgrade reduces an attacked Sub’s dive percentage by 10%. If they do dive then they will generally move 1-2 hexes away, and if they were in Hunt mode then they will automatically switch to Silent mode. This means that the attacker will probably have to relocate the Sub before it can be attacked again.
Tip! At zero supply units cannot raid convoy lines, and Submarines cannot dive, so returning to port periodically to refuel is strongly advised. The time in port can also be used to reinforce and upgrade.
Anti-Submarine Warfare – ASW research improves the Sub Attack and Sub Defense values of Maritime Bombers, and all types of surface naval combat units apart from Battleships, who only benefit from improvements in their defense values against Sub attack. Each new level of ASW reduces an attacked Sub’s current dive percentage by 10%. This is a must for the UK.
Anti-Submarine Warfare (ASW) developments were essential in defending ships from Submarine attack, as well as for Submarine detection and destruction. ASW research improves the Sub Attack and Sub Defense values of Maritime Bombers, and for all types of surface naval combat units apart from Battleships, who only benefit from improvements in their Sub Defense values. Each new level of ASW reduces an attacked Sub’s current dive percentage by 10%, while an extra benefit is that it also reduces the MPP loss that convoys suffer from raiders. Just as Germany will benefit from investing in Advanced Submarines, so the UK and USA will benefit greatly from researching Anti-Submarine Warfare. Otherwise a U-Boat campaign in the Atlantic could cripple the UK’s economy. Japan is also recommended to invest in this in the event that the Allies start raiding her convoys.
Maritime Bombers These are useful for spotting naval targets and attacking Submarines, especially when upgraded with Long Range Aircraft and Anti-Submarine Warfare research.
Much cheaper and quicker to build than Carriers, Escort Carriers are ideally suited for hunting enemy Submarines and can be useful against other naval targets, but they are somewhat fragile and cannot keep pace with most other naval units.
Back to me. I hope this helps, or at least gives you, err, hope.