MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: DSolve bug

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97820] Re: [mg97768] DSolve bug
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Sun, 22 Mar 2009 05:50:41 -0500 (EST)
  • References: <612696379.19321237704569790.JavaMail.root@mmm.inp.demokritos.gr>
  • Reply-to: drmajorbob at bigfoot.com

More to the point, using Bob's example:

Clear[f]
f[a_][x_] := Sin[a*x]
D[f[x][y], x, y] - D[f[x][y], y, x]

0

As you can see, both derivatives ARE the same. Here's a better test, I  
think (since a and x were used symmetrically, above):

Clear[f]
f[a_][x_] := Sin[a]^x
diff = D[f[x][y], x, y] - D[f[x][y], y, x]

0

But let's try it Sotirios' way, keeping f symbolic for a bit:

Clear[f]
raw=D[f[x][y],x,y]-D[f[x][y],y,x];
Block[{g},g[a_][x_]:=Sin[a]^x;raw/.f->g]//ExpandAll//Simplify

-(Log[Sin[x]]^2 Sin[x]^#1& (g^\[Prime])[x])[y]+(g^\[Prime]\[Prime])[x][y]

Now Mathematica can't equate the two derivatives.

But that's a problem with D, not with DSolve.

Note that Dt does better, too:

Clear[f]
raw = Dt[f[x][y], x, y] - Dt[f[x][y], y, x]

0

DSolve's solution IS correct. It's D that may not be all it should be.

Bobby

On Sun, 22 Mar 2009 01:49:29 -0500, Sotirios Bonanos  
<sbonano at inp.demokritos.gr> wrote:

>
>
> Your example gives two different ways of referring to the same function  
> (Sin[a*x]). But I want to be able to use the arbitrary function in the  
> solution given by DSolve (and its derivatives) in other expressions.  
> This I cannot do because the derivatives D[f1[x][y], x, y], D[f1[x][y],  
> y, x] are not equal:
>
> Clear[f1, f2]
>
> {D[f1[x][y], x, y], D[f1[x][y], y, x]}
>
> That's why I claim, if it is not a bug, it is an unfortunate choice of  
> representation!
>
> Sotirios Bonanos
>
> ----- "Bob Hanlon" wrote:
>> It is just an alternate representation
>>
>> Clear[f1, f2]
>>
>> f1[a_][x_] := Sin[a*x]
>>
>> f2[a_, x_] := Sin[a*x]
>>
>> f1[c][t] == f2[c, t]
>>
>> True
>>
>> {Plot3D[f1[a][x], {x, 0, 2 Pi}, {a, 1, 3}],
>> Plot3D[f2[a, x], {x, 0, 2 Pi}, {a, 1, 3}]}
>>
>> Some people prefer the f[a][x] representation to explicitly separate out
>> parameter(s) from argument(s)
>>
>> If you prefer
>>
>> DSolve[D[F[x, y, z], x, y] == 0, F[x, y, z], {x, y, z}]
>>
>> {{F(x,y,z)->Subscript[c, 1][z][x]+Subscript[c, 2][z][y]}}
>>
>> % /. f_[arg1_][arg2_] :> f[arg2, arg1]
>>
>> {{F(x,y,z)->Subscript[c, 1][x,z]+Subscript[c, 2][y,z]}}
>>
>>
>>
>> Bob Hanlon
>>
>>
>> On Sat, Mar 21, 2009 at 10:25 AM , Sotirios Bonanos wrote:
>>
>> > Hello,
>> > I have encountered the following bug in DSolve:
>> > DSolve[D[F[x, y, z], x, y] == 0, F[x, y, z], {x, y, z}]
>> > gives {{F[x, y, z] -> C[1][z][x] + C[2][z][y]}}
>> > instead of {{F[x, y, z] -> C[1][x, z] + C[2][y, z]}}
>> > I don't know if this has been fixed in Mathematica 7, but it is
>> > present in versions 5 and 6.
>> > S. Bonanos http://www.inp.demokritos.gr/~sbonano/



-- 
DrMajorBob at bigfoot.com


  • Prev by Date: Re: ParametricPlot problem
  • Next by Date: Re: Re: Re: Using Mathematica notebooks in presentations?
  • Previous by thread: Re: DSolve bug
  • Next by thread: How to deal with this integral