# Solving an equation with a constraint involving not-equal

I am trying to solve an equation with a constraint involving not-equal.

For example:

$$2 x + 3 y = 5$$ with the constraint $$2 x + 4 ≠ 2$$.

How should I approach this?

### Edit 1

I tried the suggestions in the comments. I am actually trying to get Mathematica to return a numerical set of values for each variable (which doesnt seem to work via the suggested methods). Any suggestions on this?

### Edit 2:

I should have clarified. What I would like Mathematica to do is to give a range of values for both variables $$x$$ and $$y$$.

Reduce[{2 x + 3 y == 5, 2 x + 4 != 2}, {y}, Reals]


gives

(x < -1 || x > -1) && y == 1/3 (5 - 2 x)

So there is x-range, but how to get y-range?

• != means not equal. – wuyudi Oct 29 '20 at 12:15
• You would write: Solve[{2 x + 3 y == 5, 2 x + 4 != 2}, x] – Daniel Huber Oct 29 '20 at 12:45
• Reduce[{2 x + 3 y == 5, 2 x + 4 != 2}, x] would be better. – Sjoerd Smit Oct 29 '20 at 12:47
• What numerical expression would you find acceptable? – Michael E2 Oct 29 '20 at 18:26
• I was wondering if Mathematica could give something like x =/= -1 and y =/= 7/3 or something along the lines of that. – Adrian Lee Oct 30 '20 at 14:02

## 1 Answer

How about

Reduce[{2 x + 3 y == 5, 2 x + 4 != 2}, {x, y}, Reals]
(*(x < -1 || x > -1) && y == 1/3 (5 - 2 x)*)


?

• Thanks. I tried that. It looks good - do you think Mathematica could give an explicit set of values that y can take? Or can it only find y in terms of x? Thanks! – Adrian Lee Oct 30 '20 at 14:03