0

I want to get the n-order Taylor expansion of a bivariate function at point (x0,y0):

f[x_, y_]: = E^(x + y);

{x0,y0}={0,0};

The result calculated by hand is:

$\begin{aligned} \mathrm{e}^{x+y}=& 1+(x+y)+\frac{1}{2 !}\left(x^{2}+2 x y+y^{2}\right)+\frac{1}{3 !}\left(x^{3}+3 x^{2} y+3 x y^{2}+y^{3}\right) \\ &+\cdots+\frac{1}{n !}(x+y)^{n}+R_{n}=\sum_{k=0}^{n} \frac{(x+y)^{k}}{k !}+R_{n} \end{aligned}$

$R_{n}$ is Langrange Remainder. How to get this result by MMA?

ps:

  1. There are some answers for reference, but they are all about univariate functions:

Taylor series representation as an infinite sum

Series with specific notation

For example,

E^x=

    Clear["Global`*"]
    series[expr_, x_, x0_] := 
     Defer[expr = Sum[#, {n, 0, \[Infinity]}]] &[
      FullSimplify@
        SeriesCoefficient[expr, {x, x0, n}, 
         Assumptions -> {n >= 0}] (x - x0)^n]
    series[E^x, x, 0]

($e^{x}=\sum_{n=0}^{\infty} \frac{x^{n}}{n !}$)

Similarly, how to get the n-order Taylor expansion of "E^(x + y)"?

  1. Taylor series representation as an finite sum for bivariate function:

Taylor Expansion of and Exponential function but multivariable

https://community.wolfram.com/groups/-/m/t/2353053?p_p_auth=8FpuUkxs

For example,

3-order Taylor expansion for E^(x + y):

Clear["Global`*"]
f[x_, y_] = E^(x + y);

ef[x_, y_, x0_, y0_, n_Integer] := Normal[Series[f[(x - x0)t + x0, (y - y0)t + y0], {t, 0, n}]] /. t -> 1

ef[x, y, 0, 0, 3]

(1 + x + y + 1/2 (x + y)^2 + 1/6 (x + y)^3)

Similarly, how to get the "n"-order Taylor expansion of E^(x + y)?

In the comment area, the results can be obtained by the substitution method. Thanks for the comment from @Michael E2. But I want to ask, is there any method suitable for the general situation? Because most bivariate functions cannot be converted into univariate functions by the method of substitution.

For example, f[x_, y_] = E^x*Log[1 + y].

ps. The n-order Taylor expansion formula of bivariate function f(x,y) at (x0,y0).

(x0 + h, y0 + k) is any point in the neighborhood of point (x0, y0).

$\begin{aligned} & f\left(x_{0}+h, y_{0}+k\right) \\=& f\left(x_{0}, y_{0}\right)+\left(h \frac{\partial}{\partial x}+k \frac{\partial}{\partial y}\right) f\left(x_{0}, y_{0}\right)+\\ & \frac{1}{2 !}\left(h \frac{\partial}{\partial x}+k \frac{\partial}{\partial y}\right)^{2} f\left(x_{0}, y_{0}\right)+\cdots+\frac{1}{n !}\left(h \frac{\partial}{\partial x}+k \frac{\partial}{\partial y}\right)^{n} f\left(x_{0}, y_{0}\right) \end{aligned}$

$\left(h \frac{\partial}{\partial x}+k \frac{\partial}{\partial y}\right) f\left(x_{0}, y_{0}\right)$ ---> $h f_{x}\left(x_{0}, y_{0}\right)+k f_{y}\left(x_{0}, y_{0}\right)$

$\left(h \frac{\partial}{\partial x}+k \frac{\partial}{\partial y}\right)^{2} f\left(x_{0}, y_{0}\right)$ ---> $h^{2} f_{x x}\left(x_{0}, y_{0}\right)+2 h k f_{x y}\left(x_{0}, y_{0}\right)+k^{2} f_{y y}\left(x_{0}, y_{0}\right)$

$\left(h \frac{\partial}{\partial x}+k \frac{\partial}{\partial y}\right)^{m} f\left(x_{0}, y_{0}\right)$ ---> $\left.\sum_{p=0}^{m} C_{m}^{p} h^{p} k^{m-p} \frac{\partial^{m} f}{\partial x^{p} \partial y^{m-p}}\right|_{\left(x_{0}, y_{0}\right)}$

lotus2019
  • 2,091
  • 5
  • 10
  • The answer could probably be found in your previous question Taylor expansion of binary function – Ulrich Neumann Feb 25 '22 at 08:08
  • They are two different questions. In this question, I want to get the general expression of Taylor series. The order is n, not a specific value. Similar to this question: https://mathematica.stackexchange.com/questions/83551/taylor-series-representation-as-an-infinite-sum, but this question is about Taylor series of univariate functions. @Ulrich Neumann – lotus2019 Feb 25 '22 at 08:33
  • Did you see this answer: 15035 – LouisB Feb 25 '22 at 11:06
  • I don't think you understand my question. You can take a look at my update. @LouisB – lotus2019 Feb 27 '22 at 12:00
  • You mean you want an indeterminate order? (That is, n is a variable, not a specific number.) Do you want the remainder term, too? I forget, is the Lagrange the derivative or the integral form? I wish they would just call them that. – Michael E2 Feb 28 '22 at 00:43
  • Something like this?: Block[{c = 0}, Inactive[Sum][SeriesCoefficient[Exp[t], {t, c, k}, Assumptions -> k >= 0] (t - c)^k, {k, 0, n}] /. t -> x + y ] -- Sum will find a closed form, Inactive[Sum] won't. – Michael E2 Feb 28 '22 at 00:50
  • Yes, I want an indeterminate order ( n is a variable, not a specific number.) without the remainder term. @Michael E2 – lotus2019 Feb 28 '22 at 01:01
  • (1) Could substitute x+y->t at the beginning, expand in powers of t, and substitute back. (2) I think I've now seen several variants of the same question. Which makes it seem like a moving target. This is not good practice for the MSE forum. – Daniel Lichtblau Feb 28 '22 at 03:46
  • I guess the solution proposed in my comment is not what you want? – Michael E2 Feb 28 '22 at 04:15
  • Thanks! I'm sorry I didn't read it carefully before. The result in your comment is what I want. However, is there any method suitable for the general situation? Because most bivariate functions cannot be converted into univariate functions by the method of substitution. For example, f[x_, y_] = E^x*Log[1 + y]. @Michael E2 – lotus2019 Feb 28 '22 at 06:13
  • 2
    On the face of it, f[x_, y_] := E^x*Log[1 + y] would not seem to admit a series expansion of the form $\sum a_n(x+y)^n$, since f[x, y] != f[y, x]. There's something like Normal@Series[E^(t x)*Log[1 + t y], {t, 0, 4}] /. t -> 1, which I learned on this site from another Q&A. I don't know if that's what you mean. — Here it is: https://mathematica.stackexchange.com/q/15023/4999 – Michael E2 Feb 28 '22 at 06:31
  • Here's a modified example: Normal@Series[f[x0 + t h, y0 + t k], {t, 0, 3}] /. t -> 1 – Michael E2 Feb 28 '22 at 06:42
  • You mean that a bivariate function with asymmetric x and y like f[x_, y_] := E^x*Log[1 + y] can't write a general expression of n-order Taylor expansion term? @Michael E2 – lotus2019 Feb 28 '22 at 06:51
  • 1
    No, nt in the form you originally indicated (and shown in my comment). You changed the question to ask for the general form, and the question I linked does that. See the example in my last comment, too. – Michael E2 Feb 28 '22 at 06:57
  • I've seen the link in your comment before. That code still can only get the Taylor expansion result of specific order. Normal@Series[f[x0 + t h, y0 + t k], {t, 0, n}] /. t -> 1 can't work. @Michael E2 – lotus2019 Feb 28 '22 at 07:09
  • You could write the Sum[] by hand, in term of Binomial[] and so forth. You might want to use Inactive[Sum]; otherwise, Sum[] will try to find a closed form, and you sometimes get something like the result of SeriesCoefficient[Exp[t h] Log[1 + t k], {t, 0, m}] instead. Mathematica doesn't really support indefinite order Taylor expansions. If there's a trick to get one, it hasn't occurred to me yet. – Michael E2 Feb 28 '22 at 07:38
  • OK, thank you for your comment! @Michael E2 – lotus2019 Feb 28 '22 at 07:56
  • To expand on comments by @MichaelE2, if the function is not symmetric, then it will not be possible to write a general Taylor expansion (that is, to arbitrary degree) in terms of symmetric polynomials. – Daniel Lichtblau Feb 28 '22 at 16:02
  • That's what I think, too. A bivariate function with asymmetric x and y like f[x_, y_] := E^x*Log[1 + y] can't write a general expression of n-order Taylor expansion term. @Daniel Lichtblau – lotus2019 Mar 01 '22 at 03:04

0 Answers0