Edit and compile if you like:
\documentclass{article}\usepackage{tikz}\usepackage{tikz-3dplot}\usetikzlibrary{math}\usepackage{ifthen}\usepackage[active,tightpage]{preview}\PreviewEnvironment{tikzpicture}\setlength\PreviewBorder{1pt}%% File name: linear-approximation-3d.tex% Description:% The linear approximation for a function of two variables $z = f(x,y)$ is shown.%% Date of creation: March, 7th, 2021.% Date of last modification: October, 9th, 2022.% Author: Efraín Soto Apolinar.% https://www.aprendematematicas.org.mx/author/efrain-soto-apolinar/instructing-courses/% Source: page 15 of the% Glosario Ilustrado de Matem\'aticas Escolares.% https://tinyurl.com/5udm2ufy%% Terms of use:% According to TikZ.net% https://creativecommons.org/licenses/by-nc-sa/4.0/% Your commitment to the terms of use is greatly appreciated.%\begin{document}%\tdplotsetmaincoords{70}{130}%\begin{tikzpicture}[tdplot_main_coords]% functions\tikzmath{function funcion(\x,\y) {return (\x*\x+3*\y*\y)*e^(-\x*\x-\y*\y);};} % the function $z = f(x,y)$\tikzmath{function derivadax(\x,\y) {return -2.0*\x*(-1.0 + \x * \x + 3.0 * \y * \y) * exp(-\x*\x - \y*\y);};} % $f_{x}$\tikzmath{function derivaday(\x,\y) {return -2.0*\y*(-3.0 + \x * \x + 3.0 * \y * \y) * exp(-\x*\x - \y*\y);};} % $f_{y}$% equation of the plane\tikzmath{function plano(\x,\y) {return derivadax(\xcero,\ycero)*(\x-\xcero)+derivaday(\xcero,\ycero)*(\y-\ycero)+\zcero;};}%\pgfmathsetmacro{\dominio}{0.75*pi} % domain for plotting\pgfmathsetmacro{\step}{\dominio/50.0} % step size\pgfmathsetmacro{\max}{\dominio}
Click to download: linear-approximation-3d.tex • linear-approximation-3d.pdf
Open in Overleaf: linear-approximation-3d.tex
See more on the author page of Efraín Soto Apolinar.