Skip to main content
1-Visitor
February 20, 2013
Solved

Partial and ordinary derivatives: not working properly

  • February 20, 2013
  • 8 replies
  • 3732 views

I'm working on partial differentiation and I need to differentiate partially and ordinarily to then carry out a chain rule and check my manual workings as I go along. But for some strange reason Mathcad keeps returning a null (0) for a 1st-order derivative and not differentiating partially for d/dy displaying a warning (i.e. f(x,y) displays in red).

Any ideas?

Best answer by AndyWesterman

Please don't worry abouot it.

The question is very relevant to the section that you posted in & the only thing that will occasion a strongly worded response is posting the same question in multiple forums

.

Regards

Andy

8 replies

Werner_E
25-Diamond I
February 20, 2013

Main problems are the use of the vector index instead of using the literal index and that you tried to take the derivative of a function x(t) with respect to x rather than wrt t.

Hope the attached sheet will help.

12-Amethyst
February 20, 2013

Hi Rosanella,

I'm not sure how you typed the equations that you have:

Capture.PNG

I guess that it was "f[x:=" which would try to address element xof the array f to store the result.

If you change this to f.x to make it a simple subscript showing the diferential relation ,

You then need to add "(x,y)" to allow the numeric processor to understand that the variable x & y are still parameters.

Giving :

Capture.PNG

Regards

Andy

1-Visitor
February 20, 2013

Thank you Werner for pointing out my error in dx/dt.

Thank you both for f dot x (I was not aware of that, but I don't see why the Superscript icon shouldn't be the same as f dot x. Are Superscripts used only for writing text within a text region?)

>Hi Rosanella,

>I'm not sure how you typed the equations that you have:

I've simply used the Superscript at the top.

Basically, what I'm trying to achieve is

given a function f(x,y) , 1) partially differentiate it ,to obtain df/dx and df/dy

2) set z = f(x,y) and dz/dx = df/dx , dz/dy = df/dy

3) use the chain rule given x(t) and y(t)

dz/dt = dz/dx * dx/dt + dz/dy * dy/dt

By the way, the option of displaying dz/dx and dz/dy as partial derivative does not show on the menu by right-clicking on each of them.

PS I've already done the calculations manually. But I'd like to check my workings are correct.

Werner_E
25-Diamond I
February 20, 2013
Thank you both for f dot x (I was not aware of that, but I don't see why the Superscript icon shouldn't be the same as f dot x. Are Superscripts used only for writing text within a text region?)

I guess those super- subscripts at the menu line were supposed to be used for text regions primarily, but they work for math regions as well. The superscript is exponentialisation as supposed, but the subscript is, when used in a math region, the vector/matrix element selector. See this example. a is 3 element vector and as by default the numbering of elements begins with 0 (controlled by system variable ORIGIN) you acces the second element with vector index 1. You obtain this by using the subscript from the formatting toolbar, but you may also use the matrix toobar or simply type a[1. The second example is using an as so far undeclared variable b assigning the element with index 3 (the fourth element) the value 25. As b does not exists Mathcad creates a vector with 4 elements, filling the unreferenced elements with 0. This is what Mathcad would have done in your case, but as x and y where undefined, it failed and f was undefined, too.

vectorindex.png

Basically, what I'm trying to achieve is

given a function f(x,y) , 1) partially differentiate it ,to obtain df/dx and df/dy

We have done that, so far.

2) set z = f(x,y) and dz/dx = df/dx , dz/dy = df/dy

z would be still dependent of x and y. What you want is to first define x and y as fumction of parameter t and then define z(t):=f(x(t),y(t)), right?

3) use the chain rule given x(t) and y(t)

dz/dt = dz/dx * dx/dt + dz/dy * dy/dt

I did it my sheet, but named the function f2 instead of z.

You cannot tell Mathcad how it should calculate the derivation, but you can do it yourself (in MC) both ways and compare the results. Mathcad may not show the two results simplified and written the same way and sometimes its hard to verify the identity. Especially when it comes to sin, cos or logarithms.

See the attached worksheet for one way to do it. Hope it helps.

By the way, the option of displaying dz/dx and dz/dy as partial derivative does not show on the menu by right-clicking on each of them.

You should see it if you click directly on the derivative, not just anywhere in the region.

You know you should write dz(x,y)/dx, etc. !?