Professional Documents
Culture Documents
How To Compute Functions
How To Compute Functions
In[19]:= f[x]
Out[19]= x3 + Sin [x]
2
In[20]:= f[0]
Out[20]= 0
In[21]:= f[1]
Out[21]= 1 + Sin [1]
In[22]:= D[f[x], x]
Out[22]= 3 x2 + Cos [x]
In[26]:= g[x]
x2
Out[26]= -ⅇ + Log [x]
In[28]:= f[0] = 1;
f[1] = 1;
f[n_] := f[n] = f[n - 1] + f[n - 2];
Table [f[n], {n, 0, 10 }]
0.5
Out[32]=
1 2 3 4 5 6
-0.5
-1.0
2.0
1.5
Out[36]=
1.0
0.5
2 4 6 8 10
1.0
0.8
0.6
Out[37]=
0.4
0.2
Out[38]=
1 2 3 4 5 6
Out[40]=
5
Out[41]=