It shouldn't matter which way they're differentiated, [ie

with respect to

, or

with respect to

], since the answers would be equal, would they not?
Either way, I have tried differentiating

with respect to

, and - as you mentioned - got an answer with a

term in it. So you think the way to go would be to just sub in the original answer for

? It sounds like a sensible idea, and one I had considered, but for some reason didn't think it'd work [although I had become quite frustrated with the problem by the time I got around to trying it, so maybe didn't give it a proper go].
Cheers for the response - I'll try it and let you know how I go.