Help with Derivatives in Mathcad

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 10K views
czechman45
Messages
12
Reaction score
0
I know that Mathcad only takes partial derivatives. I set up my equations using this general format:

L:= x(t)

Then, I take the derivative of L with respect to t and get the following:

dL/dt -> d/dt*x(t)

However, when I take the derivative of L with respect to x, I should get 1, but am getting 0.

dL/dx -> 0

I've also tried typing dL/d(x(t)), but the program gets mad at me saying that I'm not using a name. Please help. I need Mathcad to take the derivatives of some big expressions with respect to both time and specific variables.

Thank you.
 
Physics news on Phys.org
Hi czechman45, welcome to PF :smile:

czechman45 said:
I know that Mathcad only takes partial derivatives. I set up my equations using this general format:

L:= x(t)

Then, I take the derivative of L with respect to t and get the following:

dL/dt -> d/dt*x(t)

However, when I take the derivative of L with respect to x, I should get 1, but am getting 0.

dL/dx -> 0

I've also tried typing dL/d(x(t)), but the program gets mad at me saying that I'm not using a name. Please help. I need Mathcad to take the derivatives of some big expressions with respect to both time and specific variables.

Thank you.

Since you have defined L without a parameter, as far as Mathcad knows, L is not dependent on any parameter, meaning it is treated as a constant.

To fix it you need to define:
L(t) := x(t)

This explains to Mathcad that L is a function with a parameter, and that x(t) is supposed to be used with this parameter.
 
@I like Serena
I tried your suggestion. It works for dL/dt, but it still gives me 0 for dL/dx, where I'm supposed to be getting 1. Any other suggestions?
 
czechman45 said:
@I like Serena
I tried your suggestion. It works for dL/dt, but it still gives me 0 for dL/dx, where I'm supposed to be getting 1. Any other suggestions?

I'm guessing a bit, since I don't know what your large expressions look like.

I suspect you need L to be of the form:

L(t,x) := x

Now you can take d/dt from L(t,x(t)) and you can take d/dx from L(t,x).
The first derivative would be a total derivative, while the second is a partial derivative.

In particular each derivative you want to take requires L to have a parameter with the same name.