Equivalences. Re: Checking equivilence of equalities



On 02/08/2012 04:37 PM, Gerd Kortemeyer wrote:
> Hi,
>
> On Feb 8, 2012, at 11:31 AM, Jaime Villate wrote:
>
>> In some sense in this second case you are also solving the equations and comparing them:
>>
>> (%i1) solve(f+4=g+6, f);
>> (%o1) [f = g + 2]
>> (%i2) solve(f-2=g, f);
>> (%o2) [f = g + 2]
>>
>> And again, this second example worked because we were able to find the solution.
> I agree. That's what I ended up doing for the LON-CAPA integration:
>
> http://www.math.utexas.edu/pipermail/maxima/2012/027556.html
>
> Works well,
>
In e-learning systems, you can check that the equations you are 
expecting as an answer to
your questions can be solved with solve() and then you can confidently 
use an implementation
like the following (unless you have genius students who can come up with 
equivalent algebraic
equations that solve cannot handle).

(%i2) equivp(e,f):= 
is(equal(solve(e,first(listofvars(e))),solve(f,first(listofvars(f)))))$

(%i3) e1: x^2-3*x+2=0$
(%i4) e2: 6*x-2*x^2-4=0$
(%i5) equivp(e1,e2);
(%o5) true

(%i6) e3: x+y=1$
(%i7) e4: x=1-y$
(%i8) equivp(e3,e4);
(%o8) true

(%i9) e5: x^2=1+y^2-2*y$
(%i10) e6: 4*y+2*x^2=2*y^2+2$
(%i11) equivp(e5,e6);
(%o11) true

But keep in mind that x=2 is not equivalent to x^2=4.

Regards,
Jaime