MathGroup Archive 2008

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

Search the Archive

A Use for Interpretation

Since Version 6 appeared and I first encountered Interpretation I found it 
rather difficult to understand what use it might have. The examples in Help 
seem almost bizarre.

Here is one use where it works rather well. Teachers might often be 
frustrated in demonstrating the behavior of basic function such as D, 
Integrate or Limit because Mathematica automatically evaluates using its 
built-in rules. With Interpretation we can define a pseudo routine that 
displays as the real routine and then apply our own basic transformation 
rules. Here is an example with a linear breakout of Integrate.

integrate[integrand_, var_] :=
 Interpretation[HoldForm[Integrate[integrand, var]],
  integrate[integrand, var]]

We then define rules that breakout sums and constant factors. The rules even 
display in a nice form.

rule1 = integrate[a_ + b_, x_] -> integrate[a, x] + integrate[b, x]
rule2 = integrate[a_?(FreeQ[#, x] &) b_, x_] -> a integrate[b, x]

Then we can demonstrate how these rules work, performing the actual 
integration in the last step.

integrate[5 a Sin[x] + y Cos[x] + x^2, x]
% //. rule1
% //. rule2
% /. Interpretation[a_, b_] :> ReleaseHold[a]

David Park
djmpark at

  • Prev by Date: C++ const and mathlink
  • Next by Date: Re: [functional approach should give] an even faster way
  • Previous by thread: Re: C++ const and mathlink
  • Next by thread: Re: A Use for Interpretation