Help with Derivatives in Mathcad

Click For Summary

Discussion Overview

The discussion revolves around the use of Mathcad for taking derivatives, specifically addressing issues with partial derivatives and function definitions. Participants are exploring how to correctly define functions and variables to achieve the desired derivative results.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant notes that Mathcad only takes partial derivatives and describes their attempt to differentiate a function defined as L := x(t).
  • Another participant suggests redefining L as L(t) := x(t) to clarify its dependency on the parameter t, which is said to resolve the issue for dL/dt but not for dL/dx.
  • A subsequent reply indicates that despite following the suggestion, the participant still receives 0 for dL/dx when they expect to receive 1, prompting a request for further assistance.
  • Another participant proposes that L should be defined as L(t,x) := x to allow for both total and partial derivatives, emphasizing the need for L to have parameters matching the variables involved.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correct function definition to achieve the desired derivative results, as some suggestions work for one derivative but not the other, leading to ongoing uncertainty and requests for additional solutions.

Contextual Notes

There are unresolved issues regarding the correct form of function definitions in Mathcad and how they affect the calculation of derivatives. The discussion reflects varying interpretations of how to define dependencies in the context of derivatives.

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.
 

Similar threads

Replies
1
Views
4K
Replies
8
Views
4K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
12K
  • · Replies 1 ·
Replies
1
Views
9K
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
7K