Can I get multivariable taylor series expansion on wolfram alpha or matlab?

6.9k Views Asked by At

I need something like this : say $a, x, y$ and $t$ are three non-negative real numbers. Now define the complex number, $z = -y + i(a+x-t)$ and consider the function $f(x,y) = z\text{ }tanh (\pi z) log (z^2 + a^2)$.

  • Is there a way I can use wolfram alpha or matlab to get me the Taylor expansion of $f(x,y)$ around $(0,0)$. (I only need the constant term!)

I am happy to know of methods to achieve this on the sage cloud too.

1

There are 1 best solutions below

1
On

Using Matlab R2012a, you can do this:

syms x y z
f = sin(x) + cos(y) + exp(z);
taylor(f, [x, y, z])

In your case:

syms a x y t 'real' 
z = -y+i*(a+x-t);
taylor(z*tanh(pi*z)*log(z^2+a^2),[x y])

Notice that 'real' forces your variables ($a$, $x$, $y$ and $t$) to be defined as real (if you don't need this, just remove it).

If you want to know the expansion around a point (say $x=0$, $y=0$), then use this:

taylor(z*tanh(pi*z)*log(z^2+a^2),[x y], [0 0])

Finally, if you want the taylor series up to a certain order $m$, then use this:

taylor(z*tanh(pi*z)*log(z^2+a^2),[x y], [0 0], 'Order', m)

Having said that, the constant term of the taylor expansion is just the function evaluated in that point. That is:

$$z(0,0) = i(a-t)\\ f(0,0) = z(0,0)\tanh(\pi z(0,0))\log(z^2(0,0)+a^2) = \\ i(a-t)\tanh(\pi i (a-t))\log((i(a-t))^2+a^2) = \\ i(a-t)\tanh(\pi i (a-t))\log(2at-t^2) =\\ (t-a)\tan(\pi (a-t))\log(2at-t^2)$$