MathGroup Archive 2008

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

Search the Archive

Re: A Use for Interpretation

  • To: mathgroup at
  • Subject: [mg85734] Re: [mg85688] A Use for Interpretation
  • From: Murray Eisenberg <murray at>
  • Date: Wed, 20 Feb 2008 07:01:28 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <>
  • Reply-to: murray at

Very nice!  Some other places where this might be employed are in laws 
of exponents or laws of logs.  Or applying trig identities.  Or Laplace 

Ideally, this could be used not just by the teacher, but by the student 
who would demonstrate that she knows the rules by "teaching them to the 
computer".  Yet there's a "catch" to that: the Mathematica 
sophistication needed, what with ReplaceRepeated, RuleDelayed, HoldForm, 
ReleaseHold, and FreeQ.  Not to mention the "strange" definition of the 
function, like "integrate" here, which must be defined in terms of itself.

David Park wrote:
> 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]

Murray Eisenberg                     murray at
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

  • Prev by Date: Re: .NET/Link: Explicitly define data type to be sent to .NET object?
  • Next by Date: Re: Garbage collection and mutable data structures
  • Previous by thread: A Use for Interpretation
  • Next by thread: Re: A Use for Interpretation