10 speed rear derailleur to shift 11-40 cassette on 3x10
For this setup you would need a derailleur with a capacity of (52-30)+(40-11) = 51 teeth.  This page states that the SGS has a total capacity of 45 teeth. That's seems quite a bit below what you are trying to do, even if you don't plan on running big/big.