Let's say I have the function x + y = z and I know that x = y. How can I define this in Mathematica?

I tried using

x + y == z x == z

Kind regards


I have a formula (x1+x2)/2=kand i'm given the information that x1=x2=2 for example. Is there anyway to define this in Mathematica?

  • 1
    $\begingroup$ Can you explain in full what you are trying to achieve? Your question based on the assumption that it is possible to 'define' such a thing in general. It is not. Some context is necessary to answer the question. $\endgroup$ – Szabolcs May 23 at 11:25
  • 2
    $\begingroup$ this looks like XY question. in which the real issue, X, of the person asking for help is obscured, because instead of asking directly about issue X, they ask how to solve a secondary issue, Y, which they believe will allow them to resolve issue X. $\endgroup$ – Nasser May 23 at 12:33
  • 1
    $\begingroup$ If you know that x == y, then use the replacement rule y -> x, e.g., x + y == z /. y -> x. If you want the substitution to always be made, use Set, i.e., y = x. $\endgroup$ – Bob Hanlon May 23 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.