Re: Partial Derivatives
- To: mathgroup at smc.vnet.net
- Subject: [mg7832] Re: [mg7774] Partial Derivatives
- From: Richard Finley <trfin at fiona.umsmed.edu>
- Date: Mon, 14 Jul 1997 03:01:14 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Kesh, What you are trying to do is liable to cause some problems because the results Mma gives are the correct results for a partial derivative...eg. if eq = g(x) + x^2 you would certainly want the partial derivative to be pD[ g(x), x ] + 2 x .... in your case it just so happens that g(x) = y''[x]+y'[x]. If you know that the explicit part of the formula for x is a polynomial in x, you could use pattern matching to exclude other parts of the equation from being differentiated. But then what happens if you have an equation such as y''[x] + y'[x] + Sin[x] , or y''[x] + y'[x] + Exp[x] ....do you really want to exclude the Sin and Exp? And if you do want to include them, you may want to include any f[x] but then you are right back where you started from because that includes y''[x] etc.. You could use pattern matching to exclude any y[x],y'[x], etc... but it would always have to appear in that form...you would also have to be careful because it is not clear that it would make sense mathematically. On the other hand if y really is an independent variable, then your equation eq = y'' + y' + x^2 WILL work...if you take the partial derivative with respect to y of course it correctly gives y''' + y'' , but if you take the partial derivative with respect to x ( D[ eq, x ] , it will give 2 x as you wish. The key is whether y is really an explicit function of x, i.e. (y[x]) or if it is an independent variable y on the same footing as x. Hope that helps... RF At 10:40 PM 7/8/97 -0400, you wrote: >Hi > >Does anyone else think that the partial derivative implementation in >Mma is a little weird? I am trying to find partial derivatives of >an equation, eg y''[x] + y'[x] + x^2 ==0. >What I would like is to say something like pD[eqn,y[x]] and get back 0 >while pD[eqn,y''[x]] will give me 1. Certainly D does this. However, >I also want pD[eqn,x] to give me 2x and not y'''[x] + y''[x] + 2 x. >Can anyone please suggest a way to get around this? > >Note that entering the equation as y'' + y' + x^2 does not work. Here >D[eqn,y] gives me the strange result y''' + y'' which I really cannot >understand. > >I would really appreciate any help. > >Thanks in advance >Kesh > >-- >*************************************************************************** >Kesh Govinder >Dept of Maths and App Maths, University of Natal -- Durban, South Africa >Tel: (+27) 31 260 3021 >Fax: (+27) 31 260 1017 >Email: govinder at lourie.und.ac.za | > govinder at ph.und.ac.za | >**************************************************************************** > >