0
$\begingroup$

I have tried find the Taylor series expansion for my multivariable function, f[x_, y_, z_] := Exp[I*(x^2 + y^2 + z^2)^(1/2)] of order 3.

This is what I tried, Expandedfunction = Normal[Series[f[(x - x0)*t + x0, (y - y0)*t + y0, (z - z0)*t + z0], {t, 0, 3}]] /. t -> 1

I followed this answer/question: Multivariable Taylor expansion does not work as expected

However, my output does not get rid of the x0, y0, and z0. This is my Mathematica output,

E^(I Sqrt[x0^2 + y0^2 + z0^2]) - (
 I E^(I Sqrt[
   x0^2 + y0^2 + z0^2]) (-x x0 + x0^2 - y y0 + y0^2 - z z0 + 
    z0^2))/Sqrt[x0^2 + y0^2 + z0^2] + 
 1/2 E^(I Sqrt[
   x0^2 + y0^2 + 
    z0^2]) (-((-x x0 + x0^2 - y y0 + y0^2 - z z0 + z0^2)^2/(
     x0^2 + y0^2 + z0^2)) + (
    I (x0^2 y^2 - 2 x x0 y y0 + x^2 y0^2 + x0^2 z^2 + y0^2 z^2 - 
       2 x x0 z z0 - 2 y y0 z z0 + x^2 z0^2 + y^2 z0^2))/(x0^2 + 
      y0^2 + z0^2)^(3/2)) + 
 1/3 E^(I Sqrt[
   x0^2 + y0^2 + z0^2]) ((
    3 I (-x x0 + x0^2 - y y0 + y0^2 - z z0 + z0^2) (x0^2 y^2 - 
       2 x x0 y y0 + x^2 y0^2 + x0^2 z^2 + y0^2 z^2 - 2 x x0 z z0 - 
       2 y y0 z z0 + x^2 z0^2 + y^2 z0^2))/(
    2 (x0^2 + y0^2 + z0^2)^(
     5/2)) + ((-x x0 + x0^2 - y y0 + y0^2 - z z0 + z0^2) (x0^2 y^2 - 
       2 x x0 y y0 + x^2 y0^2 + x0^2 z^2 + y0^2 z^2 - 2 x x0 z z0 - 
       2 y y0 z z0 + x^2 z0^2 + y^2 z0^2))/(x0^2 + y0^2 + z0^2)^2 - (
    I (-x x0 + x0^2 - y y0 + y0^2 - z z0 + 
       z0^2) (-((-x x0 + x0^2 - y y0 + y0^2 - z z0 + z0^2)^2/(
        x0^2 + y0^2 + z0^2)) + (
       I (x0^2 y^2 - 2 x x0 y y0 + x^2 y0^2 + x0^2 z^2 + y0^2 z^2 - 
          2 x x0 z z0 - 2 y y0 z z0 + x^2 z0^2 + y^2 z0^2))/(x0^2 + 
         y0^2 + z0^2)^(3/2)))/(2 Sqrt[x0^2 + y0^2 + z0^2]))

I thought that my expanded function would not have x0, y0, and z0 terms. My end goal is to evaluate my function f[x, y, z] at some point {x, y, z}, but using the Taylor approximated function of order 3 instead. Later, I want to compare my answers such that when I increase the order, the approximated Taylor Polynomial @ {x, y, z} approaches the "exact" function f[x, y, z].

For example for the point {1, 2, 3}, I want to see the following to happen if I increase the order of the Taylor Polynomial.

Expandedfunction/.{x->1, y->2, z->3} ~ f[1, 2, 3]

What am I doing wrong or misunderstanding?

$\endgroup$

1 Answer 1

1
$\begingroup$

The {x0,y0,z0} is the point about which the series is expanded. I think you want it to be {0,0,0}, but you also can choose an other point. Try this

f[x_, y_, z_] = Exp[I*(x^2 + y^2 + z^2)^(1/2)];

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

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

(*   1 + 1/2 (-x^2 - y^2 - z^2) + I Sqrt[x^2 + y^2 + z^2] - 
     1/6 I (x^2 + y^2 + z^2)^(3/2)   *)

ef[1, 1, 1, 0, 0, 0, 3]

(*   -(1/2) + (I Sqrt[3])/2   *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.