Re: avoid combining like terms in algebraic expression
- To: mathgroup at smc.vnet.net
- Subject: [mg121149] Re: avoid combining like terms in algebraic expression
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Wed, 31 Aug 2011 06:05:56 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <j3ieh3$sda$1@smc.vnet.net>
On 30/08/2011 11:37, Phil Hammond wrote:
> I'm generating problems for basic algebra students, and I would like
> to present expressions with like terms (e.g. 3x + 4x) and have the
> students combine them in their answers. Could somebody help me
> persuade Mathematica to refrain from combining them automatically?
>
> Thanks-
>
It is not completely clear what you mean by 'generating' - because of
course, you can type anything you want into a notebook. However, perhaps
the following is what you want:
HoldForm[3 x]+HoldForm[4 x]
3x + 4x
If the constants come from some other calculation then they would need
injecting inside the HoldForm expressions:
c3=3;
c4=4;
With[{c3=c3,c4=c4},HoldForm[c3 x]+HoldForm[c4 x]]
Note that these expression contains HoldForm invisibly within them, so
it would not be suitable to naively copy/paste into another Mathematica
expression.
David Bailey
http://www.dbaileyconsultancy.co.uk