Finding a cubic equation based on roots of another