# 9.19 EquationΒΆ

The Equation domain provides equations as mathematical objects. These are used, for example, as the input to various solvesolveTransSolvePackage operations.

Equations are created using the equals symbol, =.

```
eq1 := 3*x + 4*y = 5
```

4y+3x=5 |

_{Type: Equation Polynomial Integer}

```
eq2 := 2*x + 2*y = 3
```

2y+2x=3 |

_{Type: Equation Polynomial Integer}

The left- and right-hand sides of an equation are accessible using the operations lhslhsEquation and rhsrhsEquation.

```
lhs eq1
```

4y+3x |

_{Type: Polynomial Integer}

```
rhs eq1
```

5 |

_{Type: Polynomial Integer}

Arithmetic operations are supported and operate on both sides of the equation.

```
eq1 + eq2
```

6y+5x=8 |

_{Type: Equation Polynomial Integer}

```
eq1 * eq2
```

8y2+14xy+6x2=15 |

_{Type: Equation Polynomial Integer}

```
2*eq2 - eq1
```

x=1 |

_{Type: Equation Polynomial Integer}

Equations may be created for any type so the arithmetic operations will be defined only when they make sense. For example, exponentiation is not defined for equations involving non-square matrices.

```
eq1^2
```

16y2+24xy+9x2=25 |

_{Type: Equation Polynomial Integer}

Note that an equals symbol is also used to test for equality of values in certain contexts. For example, x+1 and y are unequal as polynomials.

```
if x+1 = y then "equal" else "unequal"
```

“unequal” |

_{Type: String}

```
eqpol := x+1 = y
```

x+1=y |

_{Type: Equation Polynomial Integer}

If an equation is used where a Boolean value is required, then it is evaluated using the equality test from the operand type.

```
if eqpol then "equal" else "unequal"
```

“unequal” |

_{Type: String}

If one wants a Boolean value rather than an equation, all one has to do is ask!

```
eqpol::Boolean
```

false |

_{Type: Boolean}