your soultion is correct and good for training math research skill, but it is hard to do it in a contest with the time limit. Too many places can commit errors.
also, d is zero comes from 3rd order term in your expansion. No need to prove it by contradiction.