Is that a math question or a novel?
Inside. Let d be the depth in km and t be the temperature in C at that depth. We have an initial temperature of 15 C and an increase of 25 degrees C per km. Our model is thus
t = 15 + 25d
or in slope intercept form
t = 25d + 15
At d=10 we expect a temperature of 265 C.
At d=40 we expect a temperature of 1015 C
Our range is 265 C to 1015 C, span of 750 C
Outside. Same story, different slope. d is now the altitude in km, Here we have a decrease of 6.5 C per km, so that's a negative slope. Our model is
t = 15 - 6.5d
t = -6.5d + 15
At d=8 we get t= 15-6.5(8) = -37 C
At d=20 we get t=15-6.5(20) = -115 C
Range -115 C to -37 C, span of 78 C