# [GiNaC-list] comparing ex

John Pye john.pye at student.unsw.edu.au
Thu Aug 18 16:28:40 CEST 2005

```I typed the attached into ginsh, maybe it helps,

> lsolve({a0+x*a1 == y, y - (b0+b1*x) ==0}, {x,y});
{x==(a1-b1)^(-1)*(-a0+b0),y==(a1-b1)^(-1)*(b0*a1-a0*b1)}

You can also the 'collect' expression on a-b to help simplify.

Can you give some more information on what you need to do?

JP

Vera Louise Hauge wrote:

> Hi,
>
> I want to compare (or test the equality of) two ex objects which contain
> symbols.
> a = a0 + x*a1;
> b = a0 + a1*x;
>
> If the ex objects are evaluated (symbolically), such that
> a-b becomes 0, then the test would be finished.
>
> However, how do I evaluate such a expression as a-b symbolically?
>
> Or are there other ways of comparing two such ex objects?
>
> Any suggestions on how to do this?
>
>
> Thanks,
>
> Vera Louise Hauge
>
> _______________________________________________
> GiNaC-list mailing list
> GiNaC-list at ginac.de
> http://thep.physik.uni-mainz.de/mailman/listinfo/ginac-list
>

```