psolve(c_+b_*x_+a_*x_^2, x_) := If(isfree(a_,x_) and isfree(b_,x_) and isfree(c_,x_), ((-b_+sqrt(b_^2-4*a_*c_))/(2*a_), (-b_-sqrt(b_^2-4*a_*c_))/(2*a_))); psolve(c_+b_*x_+x_^2, x_) := If(isfree(b_,x_) and isfree(c_,x_), ((-b_+sqrt(b_^2-4*c_))/2, (-b_-sqrt(b_^2-4*c_))/2)); psolve(b_+a_*x_, x_) := If(isfree(a_,x_) and isfree(b_,x_), (-b_)/a_ ); psolve(a_*x_-b_, x_) := If(isfree(a_,x_) and isfree(b_,x_), b_/a_ ); psolve(a_/x_-b_, x_) := If(isfree(a_,x_) and isfree(b_,x_), a_/b_ ); psolve(a_/x_+b_, x_) := If(isfree(a_,x_) and isfree(b_,x_), (-a_/b_) );