Function Programming Problems
- To: mathgroup at smc.vnet.net
- Subject: [mg90782] Function Programming Problems
- From: davey79 at gmail.com
- Date: Thu, 24 Jul 2008 04:51:59 -0400 (EDT)
Hello, A colleague and myself are working on some Mathematica labs for Calculus using Mathematica 6.0 and I can't seem to find any information or examples that explain defining functions and using functions as arguments. I want to define a LinearApproximation command that preferably would take two arguments and return the linear approximation. Ideally, LinearApproximation[function_,a_] would have LinearApproximation[Sin[x],0] give "x" as the output. So far I have: LinearApproximation[function_, a_, x_] := function[a] + function'[a]*(x - a) which works mostly nicely, except it only works with LinearApproximation[Sin,0,x]. Does anyone know how I would fix this to allow Sin[x] as input (or even x^2, etc)? Getting rid of the third argument "x" would be nice, but not necessary. Thanks! David Taylor Roanoke College
- Follow-Ups:
- Re: Function Programming Problems
- From: Murray Eisenberg <murray@math.umass.edu>
- Re: Function Programming Problems
- From: "Adriano Pascoletti" <adriano.pascoletti@gmail.com>
- Re: Function Programming Problems
- From: Sseziwa Mukasa <mukasa@jeol.com>
- Re: Function Programming Problems