Mathematica derivative

  • Mathematica
  • Thread starter Rasalhague
  • Start date
  • #1
1,384
2

Main Question or Discussion Point

Mathematica:

Code:
In[1]:= x = {(u + 2 v)/3, (u - v)/3, w}; D[x[u], u]

Out[1]= {1/3, 1/3, 0}[u] + {(u + 2 v)/3, (u - v)/3, w}’[u]
Why does it do this? Wolfram Alpha gives the answer I expected:

http://www.wolframalpha.com/input/?i=d%2Fdu+%28{%28u+%2B+2+v%29%2F3%2C+%28u+-+v%29%2F3%2C+w}%29

{1/3, 1/3, w’(u)} = {1/3, 1/3, 0} if w doesn't change with u.
 

Answers and Replies

  • #2
313
1
You defined
x = { ... }
without reference to u. So x was stored as { ... }.
Then you tried taking the derivative of x, which gets converted to
{ ... }
which doesn't make sense. If you ask for D[x,u] you will get what you wanted.

Wolfram Alpha has a more flexible grammar -- ie it's not a programming language.
Thus it guessed what you meant.
 
  • #3
1,384
2
Thanks, Simon. Problem solved. Yes, I've noticed before that WA is more forgiving and able to guess (for better or worse) at the meaning of ambigious syntax.
 

Related Threads on Mathematica derivative

Replies
9
Views
2K
Replies
6
Views
10K
Replies
2
Views
10K
Replies
3
Views
1K
Replies
3
Views
2K
Replies
10
Views
11K
Top