Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assign Taylor expansion to function

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?

like image 702
gongzhitaao Avatar asked Oct 01 '22 22:10

gongzhitaao


1 Answers

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
like image 177
slitvinov Avatar answered Oct 05 '22 01:10

slitvinov