# Symbolic equivalence

Hi all,

I define ;

```
sage: x,y,z=var("x y z")
sage: x=y+z
sage: x
y + z
sage: y
y
```

I want to achieve the following:

```
sage: y
x-z
```

any idea how this scenario would be possible ?

Symbolic equivalence

asked
**
2015-04-19 11:06:05 -0500
**

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi all,

I define ;

```
sage: x,y,z=var("x y z")
sage: x=y+z
sage: x
y + z
sage: y
y
```

I want to achieve the following:

```
sage: y
x-z
```

any idea how this scenario would be possible ?

1

Use an equation to encode the relations between the variables.

You can then solve the equation with respect to the variable of your choice.

An example:

```
sage: x,y,z = var('x y z')
sage: eq = x==y+z
sage: solve(eq, x)
[x == y + z]
sage: solve(eq, y)
[y == x - z]
```

Asked: **
2015-04-19 11:06:05 -0500
**

Seen: **317 times**

Last updated: **Jul 15 '15**

Dropping higher powers of a variable in an expression

Calculation of symbolic eigenvalues

Multiplying an inequality by -1.

Using symbolic expressions with numpy arrays

I don't know why Sage return 0 for integrate(sin(2*x).abs(),(x,0,pi)) when its value is 2

why is symbolic comparison so slow?

Extracting numerical value from a symbolic expression

symbolic_expression produces invalid traceback (TypeError)

How to make solve to use certain variables on the right side

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

I do not think I understand your question, but note you have

`sage: bool(y == x-z)`

that evaluates to`True`

I do not understand what you exactly mean by "I want to achieve ...".What I tried to mean is that when I query for "y" I want to get the corresponding equivalence. I want to construct the equations in such a way that Sage will be aware of this. Bool works but not exactly what I want.