this is a question of hcv isnt it?well ive got the solution
first obtain T as a function of d
T = ax + b at x = 0 T = T1 and at x = d T = T2. this gves T(x) = x*(T2 - T1)/d + T1
and speed of sound is underroot YRT/M
now dx/dt = underroot YRT(x)/M
dx/underroot YRT(x) = dt
integrate both side, put the limits and enjoy!!