kill(all)$

f(x):= (m+1)*x^2-2*(m-1)*x+3*(m-1)=0;

solve(f(x),x);

solve(sqrt(-m^2-m+2),m);