Answer
$85$
Work Step by Step
Step 1. Let $x$ represents the number of unsold seats, the total number of passengers would be $100-x$
Step 2. The price for each passenger would be $40+2x=2(x+20)$
Step 3. The revenue would be $R=2(x+20)(100-x)=2(2000+80x-x^2)$
Step 4. Let $R=5950$, we have $2(2000+80x-x^2)=5950$ or $2000+80x-x^2=2975$ resulting $x^2-80x+975=0$
Step 5. Factor to get $(x-15)(x-65)=0$, thus $x=15$ (discard $65$ as the bus would be more than half empty), thus the total number of passengers is $100-x=85$