Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11987 > unrolled thread
| Started by | Murray Eisenberg <murray@math.umass.edu> |
|---|---|
| First post | 2012-10-07 05:37 +0000 |
| Last post | 2012-10-11 06:13 +0000 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Assuming and Integrate Murray Eisenberg <murray@math.umass.edu> - 2012-10-07 05:37 +0000
Re: Assuming and Integrate Roland Franzius <roland.franzius@uos.de> - 2012-10-08 06:51 +0000
Re: Assuming and Integrate "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-10-09 04:44 +0000
Re: Assuming and Integrate Murray Eisenberg <murray@math.umass.edu> - 2012-10-09 04:47 +0000
Re: Assuming and Integrate Roland Franzius <roland.franzius@uos.de> - 2012-10-11 06:13 +0000
| From | Murray Eisenberg <murray@math.umass.edu> |
|---|---|
| Date | 2012-10-07 05:37 +0000 |
| Subject | Re: Assuming and Integrate |
| Message-ID | <k4r4en$noo$1@smc.vnet.net> |
How to treat exceptional cases, here m = n an integer, is always an issue with Integrate (and other operations). Here one would hope to see at least a ConditionalExpression for the general situation Element[{n,m}, Integers]. After all, such integrals are so common in Fourier analysis.
Perhaps this should even be reported as a bug to Wolfram Research.
On Oct 6, 2012, at 1:53 AM, hamiltoncycle@gmail.com wrote:
> When I try the line below in Mathematica 8 I get the answer 0 which is what I expect when m and n are different but not when m=n. Can anyone explain how to do this correctly?
>
> Assuming[Element[{n, m}, Integers], Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}]]
>
> When m=n we should get Pi/2, as in this case:
>
> Assuming[Element[n, Integers], Integrate[Sin[n*x]*Sin[n*x], {x, 0, Pi}]]
>
---
Murray Eisenberg
murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
[toc] | [next] | [standalone]
| From | Roland Franzius <roland.franzius@uos.de> |
|---|---|
| Date | 2012-10-08 06:51 +0000 |
| Message-ID | <k4tt4p$sdo$1@smc.vnet.net> |
| In reply to | #11987 |
Am 07.10.2012 07:37, schrieb Murray Eisenberg:
> How to treat exceptional cases, here m = n an integer, is always an issue with Integrate (and other operations). Here one would hope to see at least a ConditionalExpression for the general situation Element[{n,m}, Integers]. After all, such integrals are so common in Fourier analysis.
>
> Perhaps this should even be reported as a bug to Wolfram Research.
>
> On Oct 6, 2012, at 1:53 AM, hamiltoncycle@gmail.com wrote:
>
>> When I try the line below in Mathematica 8 I get the answer 0 which is what I expect when m and n are different but not when m=n. Can anyone explain how to do this correctly?
>>
>> Assuming[Element[{n, m}, Integers], Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}]]
>>
>> When m=n we should get Pi/2, as in this case:
>>
>> Assuming[Element[n, Integers], Integrate[Sin[n*x]*Sin[n*x], {x, 0, Pi}]]
>>
For integration you have to use the specialized Assumptions option of
Integrate.
Integrate[Sin[n x] Sin[m x],{x,0,Pi},Assumptions->{n,m} \in Integers]
is giving the correct Kronecker symbol 0 or +-pi/2 for for n=+-m.
The reason will be that - with the exception of linear real
substitutions - external assumptions cannot be translated to domain
conditions in substitutions in the complex domains or through
transcendental replacements of variables.
Instead the integration machine has to plan ist table lookup or
simplification and transformation process with the special domain
assumptions to be designed by hand for an successful attempt.
The half period sines are a complete basis of the Hilbert space on
(0,Pi) but in Fourier analysis they are used only for zero boundary
conditions. So the orthogonality relations are not so evident contrary
to the every day formulas for standard periodic boundary conditions.
--
Roland Franzius
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2012-10-09 04:44 +0000 |
| Message-ID | <k50a3c$3oo$1@smc.vnet.net> |
| In reply to | #11987 |
On 8 Okt., 08:52, Roland Franzius <roland.franz...@uos.de> wrote:
> Am 07.10.2012 07:37, schrieb Murray Eisenberg:
>
> > How to treat exceptional cases, here m = n an integer, is always an issue with Integrate (and other operations). Here one would hope to see at least a ConditionalExpression for the general situation Element[{n,m}, Integers]. After all, such integrals are so common in Fourier analysis.
>
> > Perhaps this should even be reported as a bug to Wolfram Research.
>
> > On Oct 6, 2012, at 1:53 AM, hamiltoncy...@gmail.com wrote:
>
> >> When I try the line below in Mathematica 8 I get the answer 0 which is what I expect when m and n are different but not when m=n. Can anyone explain how to do this correctly?
>
> >> Assuming[Element[{n, m}, Integers], Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}]]
>
> >> When m=n we should get Pi/2, as in this case:
>
> >> Assuming[Element[n, Integers], Integrate[Sin[n*x]*Sin[n*x], {x, 0, Pi}]]
>
> For integration you have to use the specialized Assumptions option of
> Integrate.
>
> Integrate[Sin[n x] Sin[m x],{x,0,Pi},Assumptions->{n,m} \in Integers]
> is giving the correct Kronecker symbol 0 or +-pi/2 for for n=+-m.
>
> The reason will be that - with the exception of linear real
> substitutions - external assumptions cannot be translated to domain
> conditions in substitutions in the complex domains or through
> transcendental replacements of variables.
>
> Instead the integration machine has to plan ist table lookup or
> simplification and transformation process with the special domain
> assumptions to be designed by hand for an successful attempt.
>
> The half period sines are a complete basis of the Hilbert space on
> (0,Pi) but in Fourier analysis they are used only for zero boundary
> conditions. So the orthogonality relations are not so evident contrary
> to the every day formulas for standard periodic boundary conditions.
>
> --
>
> Roland Franzius
I get in version 8:
In[3]:= Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}, Assumptions ->
Element[{n, m}, Integers]]
Out[3]= (n*Cos[n*Pi]*Sin[m*Pi] - m*Cos[m*Pi]*Sin[n*Pi])/(m^2 - n^2)
In the limit n->m we get
In[7]:= Limit[%, n -> m]
Out[7]= Pi/2 - Sin[2*m*Pi]/(4*m)
Nice result but no Kronecker contrary to your statement.
By the way, the same result appears without Assumptions.
Regards,
Wolfgang
In[2]:= Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}]
Out[2]= (n*Cos[n*Pi]*Sin[m*Pi] - m*Cos[m*Pi]*Sin[n*Pi])/(m^2 - n^2)
the same result appears using
Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}, Assumptions -> Element[{n,
m}, Integers]]
[toc] | [prev] | [next] | [standalone]
| From | Murray Eisenberg <murray@math.umass.edu> |
|---|---|
| Date | 2012-10-09 04:47 +0000 |
| Message-ID | <k50a8d$3sn$1@smc.vnet.net> |
| In reply to | #11987 |
On Oct 8, 2012, at 2:29 AM, Roland Franzius <roland.franzius@uos.de> wrote:
> Am 07.10.2012 07:37, schrieb Murray Eisenberg:
>> How to treat exceptional cases, here m = n an integer, is always an issue with Integrate (and other operations). Here one would hope to see at least a ConditionalExpression for the general situation Element[{n,m}, Integers]. After all, such integrals are so common in Fourier analysis.
>>
>> Perhaps this should even be reported as a bug to Wolfram Research.
>>
>> On Oct 6, 2012, at 1:53 AM, hamiltoncycle@gmail.com wrote:
>>
>>> When I try the line below in Mathematica 8 I get the answer 0 which is what I expect when m and n are different but not when m=n. Can anyone explain how to do this correctly?
>>>
>>> Assuming[Element[{n, m}, Integers], Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}]]
>>>
>>> When m=n we should get Pi/2, as in this case:
>>>
>>> Assuming[Element[n, Integers], Integrate[Sin[n*x]*Sin[n*x], {x, 0, Pi}]]
>>>
>
>
>
> For integration you have to use the specialized Assumptions option of
> Integrate.
>
> Integrate[Sin[n x] Sin[m x],{x,0,Pi},Assumptions->{n,m} \in Integers]
> is giving the correct Kronecker symbol 0 or +-pi/2 for for n=+-m.
>
> The reason will be that - with the exception of linear real
> substitutions - external assumptions cannot be translated to domain
> conditions in substitutions in the complex domains or through
> transcendental replacements of variables.
>
> Instead the integration machine has to plan ist table lookup or
> simplification and transformation process with the special domain
> assumptions to be designed by hand for an successful attempt.
>
>
> The half period sines are a complete basis of the Hilbert space on
> (0,Pi) but in Fourier analysis they are used only for zero boundary
> conditions. So the orthogonality relations are not so evident contrary
> to the every day formulas for standard periodic boundary conditions.
>
I don't know which version of Mathematica you're using, but in 8.0.4, one does NOT get any kind of conditional (hence correct) result from:
Integrate[Sin[n x] Sin[m x],{x,0,Pi},Assumptions->{n,m}\[Element] Integers]
(Note the syntax correction from "\in" to "\[Element]" there.)
Rather, one gets the same "general" result as from the OP's Assuming expression, namely:
(n Cos[n \[Pi]] Sin[m \[Pi]]-m Cos[m \[Pi]] Sin[n \[Pi]])/(m^2-n^2)
And as originally said, this is wrong when m = n.
---
Murray Eisenberg
murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
[toc] | [prev] | [next] | [standalone]
| From | Roland Franzius <roland.franzius@uos.de> |
|---|---|
| Date | 2012-10-11 06:13 +0000 |
| Message-ID | <k55o23$e7d$1@smc.vnet.net> |
| In reply to | #12018 |
Am 09.10.2012 06:47, schrieb Murray Eisenberg:
> On Oct 8, 2012, at 2:29 AM, Roland Franzius <roland.franzius@uos.de> wrote:
>
>> Am 07.10.2012 07:37, schrieb Murray Eisenberg:
>>> How to treat exceptional cases, here m = n an integer, is always an issue with Integrate (and other operations). Here one would hope to see at least a ConditionalExpression for the general situation Element[{n,m}, Integers]. After all, such integrals are so common in Fourier analysis.
>>>
>>> Perhaps this should even be reported as a bug to Wolfram Research.
>>>
>>> On Oct 6, 2012, at 1:53 AM, hamiltoncycle@gmail.com wrote:
>>>
>>>> When I try the line below in Mathematica 8 I get the answer 0 which is what I expect when m and n are different but not when m=n. Can anyone explain how to do this correctly?
>>>>
>>>> Assuming[Element[{n, m}, Integers], Integrate[Sin[n*x]*Sin[m*x], {x, 0, Pi}]]
>>>>
>>>> When m=n we should get Pi/2, as in this case:
>>>>
>>>> Assuming[Element[n, Integers], Integrate[Sin[n*x]*Sin[n*x], {x, 0, Pi}]]
>>>>
>>
>>
>>
>> For integration you have to use the specialized Assumptions option of
>> Integrate.
>>
>> Integrate[Sin[n x] Sin[m x],{x,0,Pi},Assumptions->{n,m} \in Integers]
>> is giving the correct Kronecker symbol 0 or +-pi/2 for for n=+-m.
>>
>> The reason will be that - with the exception of linear real
>> substitutions - external assumptions cannot be translated to domain
>> conditions in substitutions in the complex domains or through
>> transcendental replacements of variables.
>>
>> Instead the integration machine has to plan ist table lookup or
>> simplification and transformation process with the special domain
>> assumptions to be designed by hand for an successful attempt.
>>
>>
>> The half period sines are a complete basis of the Hilbert space on
>> (0,Pi) but in Fourier analysis they are used only for zero boundary
>> conditions. So the orthogonality relations are not so evident contrary
>> to the every day formulas for standard periodic boundary conditions.
>>
>
> I don't know which version of Mathematica you're using, but in 8.0.4, one does NOT get any kind of conditional (hence correct) result from:
>
> Integrate[Sin[n x] Sin[m x],{x,0,Pi},Assumptions->{n,m}\[Element] Integers]
>
> (Note the syntax correction from "\in" to "\[Element]" there.)
>
> Rather, one gets the same "general" result as from the OP's Assuming expression, namely:
>
> (n Cos[n \[Pi]] Sin[m \[Pi]]-m Cos[m \[Pi]] Sin[n \[Pi]])/(m^2-n^2)
>
> And as originally said, this is wrong when m = n.
Thats one form of the correct general integral and gives both
In[31]:= Limit[
Integrate[Sin[n x] Sin[m x], {x, 0, \[Pi]},
Assumptions -> {n, m} \[Element] Integers && m^2 == n^2], n -> m]
Out[31]= \[Pi]/2 - Sin[2 m \[Pi]]/(4 m)
In[49]:= Limit[
Integrate[Sin[n x] Sin[m x], {x, 0, \[Pi]},
Assumptions -> {n, m} \[Element] Integers], n -> -m]
Out[49]= (-2 m \[Pi] + Sin[2 m \[Pi]])/(4 m)
In[50]:=
Assuming[{n, m} \[Element] Integers && n == m,
Integrate[Sin[n x] Sin[m x], {x, 0, \[Pi]}]]
Out[50]= \[Pi]/2
In[51]:=
Assuming[{n, m} \[Element] Integers && n == -m,
Integrate[Sin[n x] Sin[m x], {x, 0, \[Pi]}]]
Out[51]= -(\[Pi]/2)
Using the trigonometric product formula, the trival expression for this
obscuring formula
(n Cos[n \[Pi]] Sin[m \[Pi]] - m Cos[m \[Pi]] Sin[n \[Pi]])/(m^2 - n^2)
is of course the integral of the sum of Sincs with center at m=+-n
In[44]:=
b = Integrate[Sin[n x] Sin[m x], {x, 0, \[Pi]}] // TrigReduce // Apart
Out[44]= Sin[m \[Pi] - n \[Pi]]/(2 (m - n)) - Sin[m \[Pi] + n \[Pi]]/(
2 (m + n))
which is equal to
+-Pi/2 Sinc[Pi (n+-m) ]
but Mathematica behaves stubbornly with functions like Sinc (and Csc).
Generally speaking, "Mathematica" seems to have no clue about
orthogonality in Hilbert space bases as you can see trying any family
like BesselJ, LaguerreL HermiteH, LegendreP and JacobiP with the
corresponding domains and measures.
eg
In[57]:= Integrate[
HermiteH[5, x] HermiteH[6,
x] Exp[-x^2], {x, -\[Infinity], \[Infinity]},
Assumptions -> {n, m} \[Element] Integers && {n, m} > 0]
Out[57]= 0
In[56]:= Integrate[
HermiteH[n, x] HermiteH[m,x] Exp[-x^2], {x, -\[Infinity], \[Infinity]},
Assumptions -> {n, m} \[Element] Integers && {n, m} > 0]
During evaluation of In[56]:= Integrate::idiv: Integral of E^-x^2
HermiteH[m,x] HermiteH[n,x] does not converge on
{-\[Infinity],\[Infinity]}. >>
which is an obvously misleading message.
Out[56]= Integrate[
E^-x^2 HermiteH[m, x] HermiteH[n, x], {x, -\[Infinity], \[Infinity]},
Assumptions -> (n | m) \[Element] Integers && {n, m} > 0]
The missing chapters about definite integrals of orthogonal polynomials
eg from the Tables in Gradshtey/Rhyzik or Abramowitz we have always add
by hand, Help gives a look at the stub
Help: tutorial/OrthogonalPolynomials.
Since the direct verification of general orthogonality relations is a
difficult task, writing a general algorithm for the algebraic derivation
of orthogonality relations one has to implement Hilbert space methods
for eigenfunctions of symmetric differential operators.
Could be a Mathematica task for some in mathematical physicists, I assume.
--
Roland Franzius
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web