# Polynomial approximation of a more complicated function

• I

## Main Question or Discussion Point

There is an arbitrarily complicated function F(x,y,z).

I want to find a simpler surface function G(x,y,z) which approximates F(x,y,z) within a region close to the point (x0,y0,z0).

Can I write a second-order accurate equation for G if I know F(x0,y0,z0) and can compute the derivatives at the point using finite-differences. What does that function look like? What derivatives are needed?

I want to do this because the function F(x,y,z) is very complicated, but I want to compute an approximate result many times at positions which only change slowly.

• Delta2

Related Differential Equations News on Phys.org
HallsofIvy
Homework Helper
Start with the "Taylor's series expansion". For a function of three variables, f(x,y,z), about $(x_0, y_0, z_0)$, that $$f(x_0, y_0, z_0)+ f_x(x_0,y_0,z_0) (x- x_0)+ f_y(x_0,y_0,z_0)(y- y_0)+ f_z(x_0,y_0,z_0)(z- z_0)+ f_{xx}(x_0,y_0,z_0)(x- x_0)^2+ f_{xy}(x_0,y_0,z_0)(x- x_0)(y- y_0)+ f_{xz}(x_0,y_0,z_0)(x- x_0)(z- z_0)+ f_{yy}(x_0,y_0,z_0)(y- y_0)^2+ f_{yz}(x_0,y_0,z_0)(y- y_0)(z- z_0)+ f_{zz}(x_0,y_0,z_0)(z- z_0)^2$$.

• Hypatio and DaveE
WWGD
Gold Member
If the function is differentiable near the point of interest then the derivative is the best local linear approximation near the point. You would need the partials to compute the total derivative, i.e., tangent plane.

Chestermiller
Mentor
Start with the "Taylor's series expansion". For a function of three variables, f(x,y,z), about $(x_0, y_0, z_0)$, that $$f(x_0, y_0, z_0)+ f_x(x_0,y_0,z_0) (x- x_0)+ f_y(x_0,y_0,z_0)(y- y_0)+ f_z(x_0,y_0,z_0)(z- z_0)+ f_{xx}(x_0,y_0,z_0)(x- x_0)^2+ f_{xy}(x_0,y_0,z_0)(x- x_0)(y- y_0)+ f_{xz}(x_0,y_0,z_0)(x- x_0)(z- z_0)+ f_{yy}(x_0,y_0,z_0)(y- y_0)^2+ f_{yz}(x_0,y_0,z_0)(y- y_0)(z- z_0)+ f_{zz}(x_0,y_0,z_0)(z- z_0)^2$$.
How about also indicating the points on the finite difference grid that the function would be evaluated at to provide the coefficients in this finite difference approximation?

Start with the "Taylor's series expansion". For a function of three variables, f(x,y,z), about $(x_0, y_0, z_0)$, that $$f(x_0, y_0, z_0)+ f_x(x_0,y_0,z_0) (x- x_0)+ f_y(x_0,y_0,z_0)(y- y_0)+ f_z(x_0,y_0,z_0)(z- z_0)+ f_{xx}(x_0,y_0,z_0)(x- x_0)^2+ f_{xy}(x_0,y_0,z_0)(x- x_0)(y- y_0)+ f_{xz}(x_0,y_0,z_0)(x- x_0)(z- z_0)+ f_{yy}(x_0,y_0,z_0)(y- y_0)^2+ f_{yz}(x_0,y_0,z_0)(y- y_0)(z- z_0)+ f_{zz}(x_0,y_0,z_0)(z- z_0)^2$$.
Thanks this works. However, I'm looking at the first derivatives of f(x,y,z) and its taylor series approx and see that the taylor series is wildly inaccurate unless the cross derivatives are included, even right next to the point. Is it correct to simply remove the cross terms to get a lower order approximation, or does something else need to be done?

Chestermiller
Mentor
Thanks this works. However, I'm looking at the first derivatives of f(x,y,z) and its taylor series approx and see that the taylor series is wildly inaccurate unless the cross derivatives are included, even right next to the point. Is it correct to simply remove the cross terms to get a lower order approximation, or does something else need to be done?
I don't understand what you are describing.

HallsofIvy