Re: An open letter
- To: mathgroup at smc.vnet.net
- Subject: [mg16588] Re: An open letter
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Wed, 17 Mar 1999 23:55:01 -0500
- References: <7cleqb$9oh@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jack, I have struggled with the same problems for many years. In my package IntegralManipulation for demonstrating the usual manipulations, I use my own integral sign, int, format it to look like traditional math (see Help>Add-ons > Extra Utilites > Notation) and programme it to do what I want. I turn on the inbuilt function when needed with /.int->Integrate. It would be useful to me to standard versions of functions that format but do not automatically evaluate; that I can programme as I want and turn on to inbuilt evaluation as needed. Perhaps also that hold their parts Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 Jack Goldberg wrote in message <7cleqb$9oh at smc.vnet.net>... >Hi Group, > >I am a Mathematica enthusiast who has dabbled in programming >Mathematica for enough years that I feel free to complain. Here's >my gripe: > >My main purpose in using Mathematica is help students learn mathematics. >So for my purposes the fact that Mathematica evaluates everything in sight >is a major drawback. Let me be explicit. I want to illustrate >"Integration by Parts". So I try to define > >ByParts[Integrate[f_*g_,x_],g_] := ???? > >What I would like as an output of ByParts is this > >Integrate[f*g,x] == f*Integrate[g,x] - > Integrate[D[f,x]*Integrate[g,x],x] > >where the integration on the left IS NOT performed, the integration of >g in the two integrals on the right is performed but the last integral >on the right is unevaluated. Put in other words, I would like Mathematica to >display the kind of formula the student would get using integration by >parts. I have found this surprisingly difficult to do. I have used >various combinations of Evaluate, Hold, HoldFirst and HoldForm with >only partial success. I have gotten to the point where I don't even >understand why my last effort failed! Perhaps someone could explain why >the following does not work. > >ByParts[ f_*g_,x_,g_] := Module[ {int, dif, li1}, > int = Integrate[g,x]; > dif = D[f,x]; > li1 = int*dif; > HoldForm[Integrate[f*g,x]] == f*int- > HoldForm[Integrate[li1,x]] > ] > >(I hope I have the right number of left and right brackets!) >The problem is that the very last HoldForm seems to prevent >li1 from providing int*dif as the integrand. What's going on? > >Now back to my open letter. This example is only one of three or >four that I have fell prey to. All of them are based on Mathematica's propensity >to evaluate. I offer only one more example and I will be brief >in my description. > >I want to explain why e^x*e^x = e^(2x) by using >the power series expansion of e^x. I >define the Cauchy product of series for the students and would like >Mathematica to exhibit the nth coefficient of the product as a finite sum. > >Sum[ x^n/n!, {n,0,Infinity} ]*Sum[ x^n/n!, {n,0,Infinity} ] == > Sum[ Sum[ 1/(k!(n-k)!, {k,0,n}] x^n, {n,0,Infinity} ] > >There is not a single term in this expression that Mathematica will leave >unevaluated! I could trick Mathematica by inserting spurious factors that >would stop the evaluation process, but I don't want to have to figure >out some clever way to do this or to introduce holds etc. > >I am fairly confident that this type of problem can be solved by >a judicious combination of "holds" and "releaseholds" and "evaluates". >The fact remains that it is something of a challange. It shouldn't >be. I say this because at least one other CAS has an easy means for >accomplishing this goal. > >What say yo'all? > >Jack > > >