Let $f:\mathbb R^2\to \mathbb R$ be differentiable everywhere with $f(-\sqrt 2,-\sqrt 2)=0$ and let $$|\frac{\partial f}{\partial x}(x,y)| \le |\sin (x^2+y^2)|, |\frac{\partial f}{\partial y}(x,y)| \le |\cos(x^2+y^2)|$$ for all $(x,y)\ne (0,0)$. Prove that $$|f(\sqrt 2,\sqrt 2)|\le 4.$$
with $p=(-\sqrt 2,-\sqrt 2), x=(\sqrt 2,\sqrt 2)$. I got $$|f(x)|\le 2\sqrt 2(|\sin 4| + |\cos 4|)\le 4\sqrt 2.$$ But I need a better estimate. How should I proceed?

Use the fact that $|\sin \theta| +|\cos \theta | \leq \sqrt 2$ where $\theta = x^{2}+y^{2}$.