Prove that a function is differentiable if... I'm trying to prove that given a differentiable function $f: \mathbb{R}^2 \to \mathbb{R}^m$ in $p =(p_1, p_2) \in \mathbb{R}^2$, the function
$$ 
g(x, y) = f(x, y) - \frac{\partial f}{\partial x}(p)(x - p_1) - \frac{\partial f}{\partial y}(p)(y - p_2) 
$$
is also differentiable in $(x, y) = p$?
Suppose that the partial derivatives in $p$ are $\neq 0$ and $f$ is once-differentiable.
What is the easiest and fastest way to prove it (using composition or linearity maybe)?
If works even if the domain of that function is $\mathbb{R}^n$ and
$$ g(\vec{x}) = f(\vec{x}) - \sum^n_{i = 1} \frac{\partial f}{\partial x_i}(p)(x_i - p_i)$$?
 A: This follows, because you know the following


*

*If $f,g:U\rightarrow\mathbb{R}$ with $U\subset\mathbb{R}^{m}$
open are differentiable in $p\in U$, then also $f+g$ is differentiable
in $p$ (and the total derivative is given by $\left(D\left(f+g\right)\right)\left(p\right)=\left(Df\right)\left(p\right)+\left(Dg\right)\left(p\right)$).
If you do not know that, you can use the definition of the total differential.
For brevity, let us write $A:=\left(Df\right)\left(p\right)$ and
$B:=\left(Dg\right)\left(p\right)$. Then
$$
\frac{\left|\left(f+g\right)\left(p+h\right)-\left(f+g\right)\left(p\right)-\left(A+B\right)\cdot h\right|}{\left\Vert h\right\Vert }\leq\frac{\left|f\left(p+h\right)-f\left(p\right)-A\cdot h\right|}{\left\Vert h\right\Vert }+\frac{\left|g\left(p+h\right)-g\left(p\right)-B\cdot h\right|}{\left\Vert h\right\Vert }\xrightarrow[h\rightarrow0]{}0.
$$

*A linear function $g:\mathbb{R}^{m}\rightarrow\mathbb{R}$ is differentiable
at every $p\in\mathbb{R}^{m}$ with $\left(Dg\right)\left(p\right)=g$
(here, we identify a linear functional with it's associated matrix).
To see this, there are two ways. The first is to use again the definition
of the total differential:
$$
\frac{\left|g\left(p+h\right)-g\left(p\right)-g\left(h\right)\right|}{\left\Vert h\right\Vert }=\frac{0}{\left\Vert h\right\Vert }\xrightarrow[h\rightarrow0]{}0.
$$
The second (if you are not that comfortable with the definition) is
to use that there are $a_{1},\dots,a_{m}\in\mathbb{R}$ such that
$g\left(x\right)=\sum_{i=1}^{m}a_{i}x_{i}$ holds. You can then calculate
the partial derivatives (verify this!)
$$
\left(\frac{\partial g}{\partial x_{i}}\right)\left(x\right)=a_{i}
$$
for all $x\in\mathbb{R}^{m}$, so that the partial derivatives are
constant, hence continuous. You can then use that a function which
is continuously partially differentiable is also totally differentiable.
Finally, plug all this together: For the linear(!) map
$$
h:\mathbb{R}^{n}\rightarrow\mathbb{R},x\mapsto-\sum_{i=1}^{m}\left[\frac{\partial f}{\partial x_{i}}\left(p\right)\cdot x_{i}\right],
$$
your function $g$ is of the form
$$
g=f+h+\sum_{i=1}^{n}\left[\frac{\partial f}{\partial x_{i}}\left(p\right)\cdot p_{i}\right],
$$
where the last term is constant(!), hence differentiable.
You can then even conclude that the total derivative of $g$ in $p$
vanishes.
