From 4c8e1866e5550bb363c777af1ba06b2b347b530e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Axel=20S=C3=B8gaard?= Date: Wed, 4 Jul 2012 23:54:23 +0200 Subject: [PATCH] Added checks of solutions. --- bracket/examples/equation-solving.rkt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bracket/examples/equation-solving.rkt b/bracket/examples/equation-solving.rkt index 58031c6a8..14b7d528c 100644 --- a/bracket/examples/equation-solving.rkt +++ b/bracket/examples/equation-solving.rkt @@ -1,8 +1,17 @@ #lang bracket DeclareVars(x,a,b,c); -Solve(2*x=1,x); % x = 1/2 +Solve(2*x=1,x); % x = 1/2 +Substitute(2*x=1,Solve(2*x=1,x)); % 1=1 Solve(2*x+3=1,x); % x = -1 Solve(a*x+b=c,x); % x = (c-b)/a + +solution:=Solve(a*x+b+x=c,x); +solution; +% Check solution +Expand(Substitute(a*x+b+x,solution)); % This actually simplifies to c +% ... unfortunately not automatically. + +