The foci of an ellipse are at S(4,0) and T(-4,0) and for any point P on the ellipse SP+TP=10. Find the cartesian equation of the ellipse.

I tried to tackle the question by giving point P the general coordinates (acosx,asinx) and then working out the lengths SP and TP, equating them to 10, but this gave a really complicated equation which was nothing like the answer: [(x^2)/25]+[(y^2)/9]=1.

Can someone please help me with this problem? Thanks in advance.