Can you use a wide range 11-42 cassette with a double crankset
An 11-42t cassette as per the title, no. An 11-40t however as you mention, yes! Shimano has the answer here. So if you're not already tied into SRAM then I'd jump ship to Shimano. They have the answer to your question.