I'm not sure what you mean by know the x value
but you get an expression with one variable - x
.
x1 = 2
y_part = 3
y1 = 4
var x_res = math.simplify('(x - '+x1 + ')^2 + (' + y_part + ' - ' + y1 + ')^2 - 197.5^2');
x_res.toString()
// "-156021 / 4 + (x - 2) ^ 2"
If you want then to evaluate the expression against a defined x, you can:
x_res.eval({ x: 1 })
// -39004.25
x_res.eval({ x: 2 })
// -39005.25
x_res.eval({ x: 1000 })
// 956998.75
Not regarding mathjs but, If you want to find what x will be equals to when the all equation equals some value you can use AlgebraJs
var expr = new Expression("x");
expr = expr.subtract(3);
expr = expr.add("x");
console.log(expr.toString());
2x - 3
var eq = new Equation(expr, 4);
console.log(eq.toString());
2x - 3 = 4
var x = eq.solveFor("x");
console.log("x = " + x.toString());
x = 7/2