If you're pedaling relatively hard on a hilly course and averaging 18-20 mph, most individuals that I've talked to indicate a minimum of 15-20 wh per mile. The Trek battery probably has about 500wh (36V x 15 a-h). You'll have difficulty going 40 miles IMO. Chas58 is a very fit rider; he may chime in with some other numbers for his interesting builds.