A curve is traced by a point P(x,y) which moves such that its distance from the point A(-1,1) is three times the distance from the point B(2,-1). Find the equation of the curve and identity.