Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8520

Re: Some assistance from seasoned users.

From Barrie Stokes <Barrie.Stokes@newcastle.edu.au>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Some assistance from seasoned users.
Date 2012-02-13 08:40 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jhai94$511$1@smc.vnet.net> (permalink)
References <jh6k2n$jr9$1@smc.vnet.net> <201202120959.EAA25064@smc.vnet.net>

Show all headers | View raw


Hi Oleksandr 

May I say, without apology, that using your code to change Sin to sin, and thus allow a new Mathematican to break the golden rule about capitals for built-in Mathematica symbols, and lower case for your own, would be, well, a sin.  :-)

(I note your excellent advice against this: "this would be at odds with other Mathematica syntax".)

Cheers

Barrie (a Hitchensian who doesn't believe in sin, original or plagiarised!. I do believe in Sin, Cos, Tan, and the rest, of course , as a Platonic Realist.)

>>> On 12/02/2012 at 8:59 pm, in message <201202120959.EAA25064@smc.vnet.net>,
Oleksandr Rasputinov <oleksandr_rasputinov@ymail.com> wrote:
> On Sat, 11 Feb 2012 20:46:15 -0000, peter livingston  
> <peter.livingston@cox.net> wrote:
> 
>> Folks!
>>
>> I have recently come to the pleasures of Mathematica from other popular  
>> but
>> very expensive programming methods that I, as a retiree, cannot afford.
>>
>> My specific question is this: why am I able to get Mathematica to do the
>> complete integral of sin(x)/x, but it refuses to do any of the other  
>> types:
>> specifically sin^3[x]/x or sin^3[x]/x^3 over the half interval from zero  
>> to
>> infinity. (see page 449 of G & R  Table of Integrals).
>>
>> It seems to suggest that throwing away my Gradshtein and Ryzhik is  
>> premature
>> in spite of the claims in the Mathematica "Mathematics and Algorithms"
>> manual.
>>
>> Peter Livingston
> 
> Did you enter sin^n(x) as Sin^n[x], or as Sin[x]^n? The former will not be  
> understood, being interpreted as Sin^(n[x]), but the latter works as  
> expected:
> 
> In[1]:= Integrate[Sin[x]/x, {x, 0, Infinity}]
> 
> Out[1]= Pi/2
> 
> In[2]:= Integrate[Sin[x]^3/x, {x, 0, Infinity}]
> 
> Out[2]= Pi/4
> 
> In[3]:= Integrate[Sin[x]^3/x^3, {x, 0, Infinity}]
> 
> Out[3]= (3 Pi)/8
> 
> In my opinion it is better for Mathematica not to accept Sin^n[x] is  
> because (a) this would be at odds with other Mathematica syntax and (b) in  
> many contexts it will be ambiguous as to whether Sin[x]*Sin[x] or  
> Sin[Sin[x]] is meant. However, it does mean that you'll either have to get  
> used to this discrepancy from common usage, or (as you get more  
> experienced with Mathematica) define your own operators that work in the  
> way that you want. For instance, we can write:
> 
> sin /: sin^n_. := Sin[#]^n &;
> sin[x_] := Sin[x];
> 
> Now:
> 
> In := Integrate[(sin^3)[x]/x^3, {x, 0, Infinity}]
> 
> Out = (3 Pi)/8
> 
> (Although note that we must still use parentheses around sin^3 to make the  
> syntax unambiguous.)

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Some assistance from seasoned users. "peter livingston" <peter.livingston@cox.net> - 2012-02-11 20:46 +0000
  Re: Some assistance from seasoned users. David Reiss <dbreiss@gmail.com> - 2012-02-12 10:00 +0000
  Re: Some assistance from seasoned users. "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> - 2012-02-12 10:01 +0000
  Typing errors?  was ... Some assistance from seasoned users. Richard Fateman <fateman@cs.berkeley.edu> - 2012-02-12 10:04 +0000
  Re: Some assistance from seasoned users. David Bailey <dave@removedbailey.co.uk> - 2012-02-13 08:38 +0000
  Re: Some assistance from seasoned users. Barrie Stokes <Barrie.Stokes@newcastle.edu.au> - 2012-02-13 08:40 +0000

csiph-web