Re: HoldForm
- To: mathgroup at smc.vnet.net
- Subject: [mg76093] Re: HoldForm
- From: Albert <awnl at arcor.net>
- Date: Wed, 16 May 2007 05:27:52 -0400 (EDT)
- Organization: Arcor
- References: <f294ia$mpg$1@smc.vnet.net>
Hi,
> May be I will annoy a little Roman (I am just kiddin'!)
> but I have one question about HoldForm (and yes I am
> obsessed with it! No kiddin'! It's amazing!)
>
> I have
>
> In[19]:=
> f[x_] = Log[x]*x;
> lowerLim = 0; upperLim = Pi;
>
> Then
>
> In[20]:=
> o = HoldForm[Integrate[f[x], {x, lowerLim, upperLim}]]
>
> Out[20]=
> HoldForm[Integrate[f[x], {x, lowerLim, upperLim}]]
>
> However I want the output of Input[20] to be as Out[28]...
>
> In[28]:=
> HoldForm[Integrate[Log[x]*x, {x, 0, Pi}]]
>
> Out[28]=
> HoldForm[Integrate[Log[x]*x, {x, 0, Pi}]]
>
> Any ideas???
>
as usual, there are plenty of possibilities, and some have been
mentioned by others. As also has been mentioned, you want to partially
evaluate only certain symbols/subexpressions. In my opinion the least
obscure way to do this is:
With[{lowerLim=lowerLim,upperLim=upperLim},
HoldForm[Integrate[Log[x]*x,{x,lowerLim,upperLim}]]
]
of course you might want to use different names but it is noteworthy
that it works like this, too (and I think that is by design...).
hth,
albert