MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Related quastions. Question 2

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57524] Re: [mg57499] Related quastions. Question 2
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 31 May 2005 04:59:27 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

Using a name does not change the form of the expression

expr=a x+b==c
expr1=#-b&/@expr
expr2=#/a&/@expr1

b + a*x == c

a*x == c - b

x == (c - b)/a


Bob Hanlon

> 
> From: kazimir04 at yahoo.co.uk (Kazimir)
To: mathgroup at smc.vnet.net
> Date: 2005/05/29 Sun PM 09:00:18 EDT
> Subject: [mg57524] [mg57499] Related quastions. Question 2
> 
> Dear Bob,
> 
> you gave the example 
> 
> Print["Equation to solve for x"]
> a x + b == c
> Print["Subtract b from each side"]
> # - b & /@ %%
> Print["Divide each side by a"]
> #/a & /@ %%
> 
> It works but i do not like very much expressions with  %%, as I should
> not insert more lines before it or I have to modify this symbol. I
> would like to start with
> 
> expr= (a x + b == c)
> 
> and then make a transform like expr1 =  expr - b. It clearly does not
> work. Could you advise me a mathematical operartion over expression
> which would return a x == c - b .
> 
> The best thing I found was 
> expr = (a x + b == c)
> Distribute[#1 - b &@expr, Equal]
> however, it does not work in all cases that I need.
> 
> Vlad
> 
> 


  • Prev by Date: Re: Two related question. Question 1
  • Next by Date: export of EPS
  • Previous by thread: Related quastions. Question 2
  • Next by thread: Re: Related quastions. Question 2