L'Hopital's rule contradiction --- what am I messing up?

*To*: mathgroup at smc.vnet.net*Subject*: [mg8215] L'Hopital's rule contradiction --- what am I messing up?*From*: "Tom Chwastyk" <chwastyk at nrl.navy.mil>*Date*: Tue, 19 Aug 1997 21:11:53 -0400*Organization*: US Naval Research Laboratory*Sender*: owner-wri-mathgroup at wolfram.com

Yesterday I was writing something dealing with the entropy of a probability distribution s(p)=sum_i p_i log p_i. I wondered if I had to exclude p_i=0 from the sum, so I looked at limit_(p->0) p log p = 0 (-infinity) . This is an indeterminate form, so I tried applying L'Hopital's rule (limit of an indeterminate form two-factor product is the limit of the product of the derivatives of the factors) and got .... = limit_(p->0) (1) (1/p) = infinity . This seemed odd (I didn't see the exclusion all over the literature), so I asked Mathematica for Limit[p Log[p], p->0] and got back 0. I am confident that 0 is correct. For one thing, I looked at plots of p and log p; p seems to go to 0 faster than log p goes to -infinity. Second, I found the MMa book even includes (with evident pride) the example Limit[x Log[x],x->0] giving 0 'even though there's not a power series for Log[x] about 0'. Third, I looked at q=log p, p=e^q with the equivalent limit_(q->-infinity) e^q q = 0 (-infinity); this is indeterminate again, but now L'Hopital gives .... = limit(q->-infinity) (e^q) (1) = (0) (1) = 0. Question: what am I messing up or overlooking in the first version? Thanks in advance, Tom -- Tom Chwastyk ["Fosdick". Polish: CH='H, W=F (here), A=AH, Y=I. Soften strict 'HFAH-stik.... :-) ] Naval Research Laboratory Code 6383 Wash. DC 20375-5343 (202) 767 2567

**Re: Sorting Eigenvalues/EigenVectors**

**mathematica comes of age as a scientific simulation tool.**

**Saving Mma plots as .ps and .eps**

**Re: L'Hopital's rule contradiction --- what am I messing up?**