Will the 40T work with 11-34? Considering that the different between 34 and 40 is the same as 36 to 42
It will only work with 11-36 as it's been designed that way. 11-34 cassette is different if i can say so from the perspective of dimensions of the last spider. So AB sprocket would not have place to sit against the 34T sprocket on cassette. So it will not work.
Well it's a bit difficult to say.
In "regular use", providing you have optimized your chainline correctly it will last you as long as cassette. This is because 40T won't be used as much as let say 17/20T cassette sprocket.
Chainline optimization is a key for having one drivertian for long time. Please always remember that, as improper chainline will wear you chainring, chain and cassette.
To set up proper chainline to your preferences, make a note what gears on the back you use most and aim to have a chain "straight" on the sprocket you use most of the time. Everyone is different, so each of us should have different chainline according to ones riding style/preferences.
Some of you will use bottom of cassette most of the time, and some only last few bigger sprockets..
Remember also, if you change front ring to bigger/smaller you will start using different sprockets on the back straight away. so with such a change, you need to optimize your chainline again! this is very important and most people forget about it.