MathGroup Archive 1999

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

Search the Archive

Re: An open letter

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16602] Re: [mg16540] An open letter
  • From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
  • Date: Wed, 17 Mar 1999 23:55:07 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

The answer to your first question is simple: you just put the second
HoldForm in the wrong place. The correct code is:

In[11]:=
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]
	]

Now,

In[12]:=
ByParts[x*Log[x],x,x]
Out[12]=
                           2
                          x  Log[x]             x
Integrate[Log[x] x, x] == --------- - Integrate[-, x]
                              2                 2
as you wanted.

I am not quite sure what you would like to happen in your second example.
You can certainly use definitions like:


In[30]:=
p1[i_,j_]:=(Sum[ x^n/n!, {n,0,Infinity} ]+O[x]^i)*(
    Sum[ x^n/n!, {n,0,Infinity} ] +O[x]^j)
In[31]:=
p2[j_]:=Sum[ Sum[ 1/(k!(n-k)!), {k,0,n}] x^n, {n,0,Infinity} ]+O[x]^j

Now you can compare expressions like p1[9,9] with p2[9] etc. What is
difficult to do is to get Mathematica to carry out for you all the
transformations you would do by hand. But I would not be very keen on
having this ability in Mathematica.  To start with, they could not be the
transformations that Mathematica carries out internally, because what is
the right way to proceed for a computer program (i.e. a general
algorithm) may not at all be the right way to proceed for a human being,
who should try to make use of intuition and ingenuity. Besides, this
would not be of any use to most people and having taught university
calculus courses for 15 years I very much doubt that this sort of
computer based demonstrations have any advantage at all over the usual
chalk and blackboard ones.

On Tue, Mar 16, 1999, Jack Goldberg <jackgold at math.lsa.umich.edu> wrote:

>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
> 
>


Andrzej Kozlowski
Toyama International University
JAPAN
http://sigma.tuins.ac.jp/
http://eri2.tuins.ac.jp/



  • Prev by Date: Re: Gettting Rid of units
  • Next by Date: Re: Re: Vector-valued DE's
  • Previous by thread: Re: An open letter
  • Next by thread: Re: An open letter