# Mathematica question - Beginner.

1. May 27, 2005

### plinius

Hi,
when I run those commands in mathematica:
y[x_,A_]:=Sin[x]+A+5
Plot[{y[x,5],y[x,6]},{x,0,5}]
z[x_]:=D[y,x]

Everything seems to go well.
But when I trie to plot the derivative:

Plot[{y[x,5],z[x]},{x,0,5}]

I allways have these errors:
Plot::plnrz[x] is not a machine-size real number at x= 2.0833333333333333`*^-7
....

What am I doing wrong ?
I allready tried to change the arguments of z[] to z[x,4], z[x,A] etc...
There's nothing about plotting derivatives on the quick tutorial.
Any help is really appreciated.
I uploaded my mathematica file here http://s47.yousendit.com/d.aspx?id=0LG6F35A7OTY2SVEC7L1T6GXA

2. May 27, 2005

### mewmew

You take the derivative of y but y has no meaning as y is just an empty variable, y[x,a] does have meaning however, also why is z[x_] a function? if you do D[y[x,a],x] you are taking the derivative of y[x,a] with respect to x, correct, I believe its the 3'rd parameter to have it take the n'th derivative? I will be at work in an hour or so and can check it out, as I'm pretty new to Mathematica myself and dont have a copy here to check myself.

3. May 27, 2005

### plinius

I'm afraid it's not correct. I've just tried what you said and it didn't worked either

4. May 27, 2005

### mewmew

z[n_] = D[y[x, 10], {x, n}]; is saying you want a function of the nth derivative of y[x,10] with respect to x. Plot[{z[2]}, {x, 0, 5}] is a plot of the 2nd derivative of x from 0 to 5.

5. May 27, 2005

### plinius

Thanks a lot.

Now it works indeed!