Re: HoldForm
- To: mathgroup at smc.vnet.net
- Subject: [mg76017] Re: HoldForm
- From: Norbert Marxer <marxer at mec.li>
- Date: Tue, 15 May 2007 04:42:20 -0400 (EDT)
- References: <f294ia$mpg$1@smc.vnet.net>
On 14 Mai, 09:53, dimitris <dimmec... at yahoo.com> wrote: > 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??? > > Thanks a lot! > > Dimitris Hello One possible solution: In[20]:= f[x_] = Log[x]*x; lowerLim = 0; upperLim = Pi; Integrate[HoldForm[Evaluate[f[x]]], {x, lowerLim, upperLim}] Out[22]= Integrate[HoldForm[x*Log[x]], {x, 0, Pi}] If you prefer to have the HoldForm wrapped around your expression you could (in addition) apply the replacement rule In[23]:= Integrate[HoldForm[Evaluate[f[x]]], {x, lowerLim, upperLim}] /. Integrate[HoldForm[x_], y_] :> HoldForm[Integrate[x, y]] Out[23]= HoldForm[Integrate[x*Log[x], {x, 0, Pi}]] Best Regards Norbert Marxer