Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8463 > unrolled thread
| Started by | "peter livingston" <peter.livingston@cox.net> |
|---|---|
| First post | 2012-02-11 20:46 +0000 |
| Last post | 2012-02-13 08:40 +0000 |
| Articles | 6 — 6 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | "peter livingston" <peter.livingston@cox.net> |
|---|---|
| Date | 2012-02-11 20:46 +0000 |
| Subject | Some assistance from seasoned users. |
| Message-ID | <jh6k2n$jr9$1@smc.vnet.net> |
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
[toc] | [next] | [standalone]
| From | David Reiss <dbreiss@gmail.com> |
|---|---|
| Date | 2012-02-12 10:00 +0000 |
| Message-ID | <jh82je$ofm$1@smc.vnet.net> |
| In reply to | #8463 |
Th Mathematica can do these integrals just fine. But you need to use the correct syntax for the expressions. Here they are Sin[x]^3/x and Sin[x]^3/x^3 Using a construct like sin^3[x] hast two problems. The "s" must be capitalized and the Sin[x] must be raised to the 3rd power not the Sin. Hope this helps. --David On Feb 11, 3:46 pm, "peter livingston" <peter.livings...@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 type s: > 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
[toc] | [prev] | [next] | [standalone]
| From | "Oleksandr Rasputinov" <oleksandr_rasputinov@ymail.com> |
|---|---|
| Date | 2012-02-12 10:01 +0000 |
| Message-ID | <jh82lb$ogp$1@smc.vnet.net> |
| In reply to | #8463 |
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.)
[toc] | [prev] | [next] | [standalone]
| From | Richard Fateman <fateman@cs.berkeley.edu> |
|---|---|
| Date | 2012-02-12 10:04 +0000 |
| Subject | Typing errors? was ... Some assistance from seasoned users. |
| Message-ID | <jh82r4$oj3$1@smc.vnet.net> |
| In reply to | #8463 |
On 2/11/2012 12:46 PM, peter livingston 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).
If in fact you are typing Sin^3[x]/x, you might try typing Sin[x]^3/x.
You might also be more specific about (a) the subject line of your
message, and (b) exactly what Mathematica did. "Refuses" is not very
specific.
With Mathematica 7 I got pi/4 for the Integrate[Sin[x]^3/x{x,0,Infinity}]
>
>
>
> 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.
Regardless of this particular result, I agree.
[toc] | [prev] | [next] | [standalone]
| From | David Bailey <dave@removedbailey.co.uk> |
|---|---|
| Date | 2012-02-13 08:38 +0000 |
| Message-ID | <jhai68$4ve$1@smc.vnet.net> |
| In reply to | #8463 |
On 11/02/2012 20:46, peter livingston 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 All of those integrals evaluate, but you have to use Sin - not sin. All the built-in keywords start with a capital letter, and conversely if you use a variable that starts in lower case, you can be sure it is 'yours'. BTW, no error is generated, because Mathematica treats your input (with sin) exactly as it would the integral of f[x]/x^3 - as something that might evaluate later if f is subsequently defined. David Bailey http://www.dbaileyconsultancy.co.uk
[toc] | [prev] | [next] | [standalone]
| From | Barrie Stokes <Barrie.Stokes@newcastle.edu.au> |
|---|---|
| Date | 2012-02-13 08:40 +0000 |
| Message-ID | <jhai94$511$1@smc.vnet.net> |
| In reply to | #8463 |
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.)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web