Message Boards Message Boards

0
|
6148 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

[?] Use differentiation operator "D" for trigonometric functions?

Posted 7 years ago

Hello, I am using Mathematica to calculate metric tensors. I am finding that Mathematica is returning unexpected results when I try to take derivative of Rhosin(Theta)cos(Phi) with respect to Rho. In Mathematica I enter:

D[\[Rho]*sin (\[Theta])*cos (\[Phi]), \[Rho]]

Results is: cos sin [Theta] [Phi]

but it should be: cos(Theta)*sin(Phi)

Any ideas?

POSTED BY: Motaz Al-Hasan
2 Replies

Thanks! I am used to Matlab notation!

POSTED BY: Motaz Al-Hasan
Posted 7 years ago

Functions in the Wolfram Language, like Sin and Cos, all start with capital letters, and arguments are held within square braces. Knowing this, you would want to use the following to get the answer you'd expect:

D[\[Rho]*Sin[\[Theta]]*Cos[\[Phi]], \[Rho]]

There's a decent list of resources available for learning the language here, if you are interested.

POSTED BY: Kyle Martin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract