Assign Taylor expansion to function

偶尔善良 提交于 2019-12-07 05:18:25

问题


When I use Maxima to calculate the Taylor series:

f(x,y) := taylor((x+y)^3, [x, y], [2, 3], 2);
f(2,3);  /* error: wrong number of arguments */

Basically I want to define a function as a expansion of (x+y)^3, which takes in x,y as parameter. How can I achieve this?


回答1:


Try

(%i1) f(x,y) := ''(ratdisrep(taylor(('x+'y)^3, ['x, 'y], [2, 3], 2))) $

(%i2) f(2, 3);
(%o2)                                 125

or

(%i1) define(f(x, y), ratdisrep(taylor(('x+'y)^3, ['x, 'y], [2, 3], 2)))$

(%i2) f(2, 3);
(%o2)                                 125


来源:https://stackoverflow.com/questions/23294656/assign-taylor-expansion-to-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!