Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: unevaluated expression

  • To: mathgroup at
  • Subject: [mg77157] Re: [mg77114] unevaluated expression
  • From: Carl Woll <carlw at>
  • Date: Tue, 5 Jun 2007 06:33:15 -0400 (EDT)
  • References: <>

juliok at wrote:

>How do you write a function such as
>   example[f_]:= ......
>so that when entering example[#^2] Mathematica will respond with
>integral_symbol x^2 dx = x^3 /3
>where integral_symbol is the standard math symbol, exponents are
>superscripts, etc. I tried Hold[], Unevaluated[], nothing seems to
You should use example[#^2&] instead of example[#^2]. Here is one 

example[f_] :=  With[{integrand = f[x]}, HoldForm[Integrate[integrand, 
x]] == Integrate[f[x], x]]


In[29]:= example[#^2 &]
Out[29]= \[Integral]x^2\[DifferentialD]x\[LongEqual]x^3/3

In[30]:= example[Sqrt]
Out[30]= \[Integral]Sqrt[x]\[DifferentialD]x\[LongEqual](2 x^(3/2))/3

In[31]:= example[Sin]
Out[31]= \[Integral]sin(x)\[DifferentialD]x\[LongEqual]-cos(x)

Carl Woll
Wolfram Research

  • Prev by Date: Rotate and Normal
  • Next by Date: Inverse, numerical precision, simulation dynamical system
  • Previous by thread: unevaluated expression
  • Next by thread: Re: unevaluated expression