I'm not sure if I can explain this but I'll have a go...
You need to assess whether the wind is a head or tail wind. After your diversion it's now a tailwind. The angle you need to know is therefore not 185-040 = 145 deg, rather 040-(185-180) = 035 deg. In other words you have a wind 035 degrees left of a full tailwind. (You can do this on the DI: turn on to 185, then check the angle between the reciprocal (the number at the bottom of the DI) and the wind. You'll find 005 is at the bottom of the DI so the angle is 035 deg. In fact, always start a diversion by turning onto the track so you can build a mental picture of your situation better.)
Therefore your drift angle will be 3.5 sixths of your 18deg max drift, i.e. 10.5deg. The wind is from your left butt-cheek, so it's pushing you right 10.5deg; so your heading will be 174.5deg (call it 175!).
On the other hand, you will have (9-3.5)=5.5 sixths of the tailwind adding to your groundspeed, or about 27 knots, so your groundspeed should be 122 knots.
I haven't checked these on a whizz-wheel (I'm at work) so I'd be interested to know how accurately those measure up - that's the method I use in the air!
Tim