Re: A Problem with Simplify
- To: mathgroup at smc.vnet.net
- Subject: [mg87456] Re: A Problem with Simplify
- From: Alexey Popkov <popkov at gmail.com>
- Date: Fri, 11 Apr 2008 01:42:26 -0400 (EDT)
- References: <ftkb7f$a9m$1@smc.vnet.net>
This seems to be very strange:
Mathematica 6.0 for Microsoft Windows (32-bit)
Copyright 1988-2008 Wolfram Research, Inc.
In[1]:= Imn = Integrate[Sin[(m*Pi*x)/L]*Sin[(n*Pi*x)/L], {x, 0, L}];
In[2]:= Imn // InputForm
Out[2]//InputForm= (L*n*Cos[n*Pi]*Sin[m*Pi] - L*m*Cos[m*Pi]*Sin[n*Pi])/
(m^2*Pi - n^2*Pi)
In[3]:= Simplify[Imn, Assumptions -> n == m]
L n Cos[n Pi] Sin[m Pi] - L m Cos[m Pi]
Sin[n Pi]
Simplify::infd: Expression
------------------------------------------------- simplified to
2 2
m Pi - n Pi
Indeterminate.
Out[3]= Indeterminate
But:
In[4]:= Integrate[Sin[(n*Pi*x)/L]*Sin[(n*Pi*x)/L], {x, 0, L}] //
InputForm
Out[4]//InputForm= (L*(2 - Sin[2*n*Pi]/(n*Pi)))/4
This is a bug! :(
Recently I also have found another strange bug in Simplfy (not so
dangerous):
FullSimplify[Sin[x]*Cos[x]]
gives Sin[x]*Cos[x] instead Sin[2*x]/2. The workaround is
FullSimplify[2*Sin[x]*Cos[x]]/2.
Kevin J. McCann wrote:
> I have the following rather simple integral of two sines, which should
> evaluate to zero if m is not equal to n and to L/2 if they are the same.
>
> The following is just fine
>
> Imn = Simplify[Integrate[
> Sin[(m*Pi*x)/L]*
> Sin[(n*Pi*x)/L],
> {x, 0, L}]]
>
>
> However, if I specify that m and n are integers, I only get the
> "general" solution of zero, i.e. when m and n are not equal.
>
> Imn = Simplify[Integrate[
> Sin[(m*Pi*x)/L]*
> Sin[(n*Pi*x)/L],
> {x, 0, L}],
> Element[m, Integers] &&
> Element[n, Integers]]
>
> The workaround is obvious in this case, but shouldn't Mathematica give multiple
> answers? Perhaps something similar to what it already does with Integrate?
>
> Kevin
> --
>
> Kevin J. McCann
> Research Associate Professor
> JCET/Physics
> Physics Building
> University of Maryland, Baltimore County
> 1000 Hilltop Circle
> Baltimore, MD 21250
- Follow-Ups:
- Re: A Problem with Simplify
- From: Alexey Popkov <popkov@gmail.com>
- Re: Re: A Problem with Simplify
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: A Problem with Simplify