Simplicity is the ultimate sophistication, Anonymous

Definition. Let $f: \text{dom}(f) \to \mathbb{R}^m$ be a function, where its domain $\text{dom}(f) \subseteq \mathbb{R}^n$ is an open set. The function $f$ is said to be differentiable if it is differentiable at every point $\mathbf{x} \in \text{dom}(f)$.
Formally, $f$ is differentiable at a point $\mathbf{x}$ if there exists a linear map $L: \mathbb{R}^n \to \mathbb{R}^m$ (represented by an $m \times n$ matrix, the Jacobian matrix $Df(\mathbf{x})$), such that $\lim_{\mathbf{h} \to \mathbf{0}, \mathbf{h} \in \mathbb{R}^n} \frac{\| f(\mathbf{x} + \mathbf{h}) - f(\mathbf{x}) - Df(\mathbf{x})\mathbf{h} \|}{\|\mathbf{h}\|} = 0$
Here, $\| \cdot \|$ denotes a norm (e.g., the Euclidean norm) on $\mathbb{R}^n$ and $\mathbb{R}^m$. This limit must hold for sequences $\mathbf{h} \to 0$ from any direction within $\mathbb{R}^n$.
For (x, y) ≠ (0, 0), one shows $\sqrt{x^2+y^2}=(x^2+y^2)^{1/2}, \dfrac{∂g}{∂x} =\dfrac{1}{2}(x^2+y^2)^{-1/2}·2x = \dfrac{x}{\sqrt{x^2+y^2}}$. Analogously, $\dfrac{∂g}{∂y} =\dfrac{y}{\sqrt{x^2+y^2}}$, Both continuous on ℝ² \ {(0, 0)}, so g is differentiable everywhere except possibly at the origin.
If g were differentiable at (0, 0): (i) the function has a minimum at (0, 0) (since g ≥ 0 and g(0,0) = 0); (ii) at a differentiable minimum, ∇g(0, 0) = (0, 0); (iii) Therefore, $D_u g(0, 0) = ∇g(0, 0) \cdot u = 0$ for all u.
When a differentiable function $g\colon\R^n\to\R$ attains a local minimum at a point p, the gradient $\nabla g(p)$ has to be the zero vector. The gradient $\nabla g(p)$ points in the direction of steepest ascent. At a minimum, there is no “downhill” direction to go—every small move increases (or leaves unchanged) the value of g. Hence there cannot be any nonzero component of the gradient; otherwise you could go “downhill” in the opposite direction.
The graph of $\sqrt{x^2+y^2}$ is the upper half of a circular cone (a sharp corner) with its vertex at the origin.
It has no tangent plane at the origin.
Directional derivatives along (1, 0) and (0, 1) give, $Dg_{(1, 0)} = \lim_{h \to 0^+} \dfrac{g(h, 0)-g(0, 0)}{h} = \lim_{h \to 0^+} \dfrac{h^2}{h}=1, Dg_{(0, 1)} = \lim_{h \to 0^+} \dfrac{g(0, h)-g(0, 0)}{h}=1$.
If g were differentiable at (0, 0), the total derivative would be Dgu(0, 0) = ∇g(0,0)⋅u=(0,0)⋅(a,b) = 0 for all u. Since the previous directional derivatives along (1, 0) and (0, 1) don’t match $D_{(1,0)} g = 1 ≠ 0$ ⊥, g fails to be differentiable at (0, 0).
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Define the coordinates
x = np.linspace(-1, 1, 100)
y = np.linspace(-1, 1, 100)
X, Y = np.meshgrid(x, y)
# Avoid division by zero
Z = np.zeros_like(X)
mask = (X != 0) | (Y != 0)
# Define the function
Z[mask] = (X[mask]**2 * Y[mask]) / (X[mask]**4 + Y[mask]**2)
# Create the figure
fig = plt.figure(figsize=(10, 8))
ax = fig.add_subplot(111, projection='3d')
# Plot the surface
ax.plot_surface(X, Y, Z, cmap='viridis', alpha=0.8)
# Adding labels and title
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('f(x, y)')
plt.title('Surface Plot of f(x, y)')
plt.savefig('surface_plot.png')
A common misconception is that if a function has directional derivatives in every direction at a point, then it must be differentiable there. This is false. Differentiability requires the existence of a single linear map that simultaneously approximates the function's behavior in all directions in a coherent, consistent way.
For a function $f: \mathbb{R}^n \to \mathbb{R}^m$ to be differentiable at a point $a$, we need a linear map $L: \mathbb{R}^n \to \mathbb{R}^m$ (the derivative $Df(a)$) such that for every direction vector $v$ (not necessarily unit), the directional derivative satisfies: $D_v f(a) = L(v) \quad \text{for all vectors } v \in \mathbb{R}^n$
This single requirement actually imposes two hidden algebraic conditions on the collection of directional derivatives:
If either of these properties fails, the function cannot be differentiable at that point —even if every single directional derivative exists.
For $f: \mathbb{R}^n \to \mathbb{R}^m$ to be differentiable at $a$, we require three things, each building on the last:
All three requirements—existence, linearity, and approximation—are elegantly captured in the single limit definition of differentiability: $\lim_{h \to 0} \frac{\|f(a+h) - f(a) - Df(a) \cdot h\|}{\|h\|} = 0$
This definition simultaneously:
Definition. Let $D \subseteq \mathbb{C}$ be an open set and $f: D \to \mathbb{C}$ be a function. We say $f$ is **complex differentiable** at a point $z_0 \in D$ if the limit: $f'(z_0) = \lim_{h \to 0} \frac{f(z_0 + h) - f(z_0)}{h}$ exists. The value of this limit is called the derivative of $f$ at $z_0$.. Otherwise, if this limit does not exist, then we say that f is not differentiable at $z_0$.
Key facts:
Definition. A function $f$ is called analytic (or holomorphic) on an open set $D$ if it is complex differentiable at every point in $D$.
Definition. A function $f$ is called entire if it is analytic on the whole complex plane $\mathbb{C}$.
The rules of calculation mirror real calculus because the limit definition is algebraically identical.
$f′(z)= \lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{c-c}{h} = lim_{h \to 0} \frac{0}{h} = lim_{h \to 0} 0 = 0.$ ∎ This shows that the derivative exists and is zero for all z∈ℂ.
$f′(z)= \lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{z+h-z}{h} = lim_{h \to 0} \frac{h}{h} = lim_{h \to 0} 1 = 1.$ ∎
$f′(z)= \lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{{z+h}^n-z^n}{h} =[\text{Using the binomial theorem}] \lim_{h \to 0} \frac{\sum_{k=0}^n {n \choose k}z^{n-k}h^k-z^n}{h} = \lim_{h \to 0} \sum_{k=1}^n {n \choose k}z^{n-k}h^{k-1}$
As h → 0, all terms with hk-1, k ≥ 2 vanish, leaving $f′(z)= {n \choose 1}z^{n-1} = nz^{n-1}$ ∎
A polynomial function in the complex variable z is of the form: f(z) = aₙzⁿ + aₙ₋₁zⁿ⁻¹ + … + a₁z + a₀ where aᵢ ∈ ℂ for i = 0, 1, …, n, and aₙ ≠ 0. The differentiability of polynomials follows from several key facts:
Since polynomials are finite sums of products of differentiable functions (constants and powers of z), they are differentiable everywhere.
This limit exists and we also know that $f'(z_0) = \frac{-3i}{(z_0-i)^2}$. Since z₀ is an arbitrary point in dom(f), f is differentiable.
$f′(z)= \lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{e^{z+h}-e^z}{h} = e^z·\lim_{h \to 0} \frac{e^{h}-1}{h}$
Expand eh as a Taylor series: $e^h = 1 + h + \frac{h^2}{2!} + \frac{h^3}{3!} + \cdots, \frac{e^h-1}{h} = 1 + \frac{h}{2!} + \frac{h^2}{3!} + \cdots$
As h→0, higher-order terms vanish, leaving: $\lim_{h \to 0}\frac{e^h-1}{h} = 1, f′(z)= e^z·\lim_{h \to 0} \frac{e^{h}-1}{h} = e^z·1 = e^z$ ∎
f(z) = sin(z), $f′(z)= \lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{sin(z+h)-sin(z)}{h} =$
Substitute the exponential form of sine, $sin(z) = \frac{e^{iz}-e^{-iz}}{2i}$:
= $\lim_{h \to 0} \frac{1}{h} (\frac{e^{i(z+h)}-e^{-i(z+h)}}{2i}-\frac{e^{iz}-e^{-iz}}{2i}) = \lim_{h \to 0} \frac{e^{i(z+h)}-e^{-i(z+h)}-e^{iz}+e^{-iz}}{2ih} = \lim_{h \to 0} \frac{e^{iz}e^{ih}-e^{-iz}e^{-ih}-e^{iz}+e^{-iz}}{2ih} = \lim_{h \to 0} \frac{e^{iz}(e^{ih}-1)-e^{-iz}(e^{-ih}-1)}{2ih} $
$= \frac{e^{iz}}{2i}\lim_{h \to 0} \frac{(e^{ih}-1)}{h} + \frac{e^{-iz}}{2i}\lim_{h \to 0} \frac{-(e^{-ih}-1)}{h}$
$\lim_{h \to 0} \frac{(e^{ih}-1)}{h} = \lim_{h \to 0}\frac{cos(h)+isin(h)-1}{h} = \lim_{h \to 0} \frac{cos(h)-1}{h} + i \lim_{h \to 0}\frac{sin(h)}{h} = \text{L'Hôpital's rule, limits are of the indeterminante form 0/0} = \lim_{h \to 0} \frac{-sin(h)}{1} + i\lim_{h \to 0}\frac{cos(h)}{1} = -sin(0) + icos(0) = 0 + i = i$. Using a completely similar reasoning, $\lim_{h \to 0} \frac{-(e^{-ih}-1)}{h} = i$
$= \frac{e^{iz}}{2i}\lim_{h \to 0} \frac{(e^{ih}-1)}{h} + \frac{e^{-iz}}{2i}\lim_{h \to 0} \frac{-(e^{-ih}-1)}{h} =[\text{Substitute Limits:}] = \frac{e^{iz}·i + e^{-iz}·i}{2i} = \frac{e^{iz} + e^{-iz}}{2} = cos(z)$ ∎
f(z) = cos(z), $f′(z)= \lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{cos(z+h)-cos(z)}{h} =$
Substitute the exponential form of cosine, $cos(z) = \frac{e^{iz}+e^{-iz}}{2}$
$\lim_{h \to 0} \frac{\frac{e^{i(z+h)}+e^{-i(z+h)}}{2}-\frac{e^{iz}+e^{-iz}}{2}}{h} = \lim_{h \to 0}\frac{e^{i(z+h)}+e^{-i(z+h)}-e^{iz}-e^{-iz}}{2h}$
Expand numerator: $e^{i(z+h)}+e^{-i(z+h)}-e^{iz}-e^{-iz} = e^{iz}e^{ih}+e^{-iz}e^{-ih}-e^{iz}-e^{-iz} = e^{iz}(e^{ih}-1)+e^{-iz}(e^{-ih}-1)$
$\lim_{h \to 0}\frac{e^{i(z+h)}+e^{-i(z+h)}-e^{iz}-e^{-iz}}{2h} = \lim_{h \to 0}\frac{e^{iz}(e^{ih}-1)+e^{-iz}(e^{-ih}-1)}{2h} = \frac{e^{iz}}{2}\lim_{h \to 0}\frac{e^{ih}-1}{h} + \frac{e^{-iz}}{2}\lim_{h \to 0}\frac{e^{-ih}-1}{h}$
Apply limits (Euler’s formula, then L’Hôpital’s rule): $\lim_{h \to 0}\frac{e^{ih}-1}{h} = i, \lim_{h \to 0}\frac{e^{-ih}-1}{h} = -i$
$\frac{e^{iz}}{2}\lim_{h \to 0}\frac{e^{ih}-1}{h} + \frac{e^{-iz}}{2}\lim_{h \to 0}\frac{e^{-ih}-1}{h} = \frac{i}{2}(e^{iz}-e^{-iz}) = \frac{i}{2}(cos(z)+isin(z)-cos(-z)-isin(-z)) =[\text{Use even/odd properties of sine and cosine}] \frac{i}{2} (cos(z)+isin(z)-cos(z)+isin(z)) = \frac{2i^2sin(z)}{2} = -sin(z)$. Therefore, f(z) = cos(z), f’(z) = -sin(z) ∎
f(z) = tan(z), $f′(z)= \lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{tan(z+h)-tan(z)}{h} = lim_{h \to 0} \frac{\frac{sin(z+h)}{cos(z+h)}-\frac{sin(z)}{cos(z)}}{h} = lim_{h \to 0} \frac{sin(z+h)cos(z)-cos(z+h)sin(z)}{hcos(z+h)cos(z)}$
Since sin (a - b) = sin a cos b - cos a sin b,
$lim_{h \to 0} \frac{sin(z+h)cos(z)-cos(z+h)sin(z)}{hcos(z+h)cos(z)} = lim_{h \to 0} \frac{sin(z+h-z)}{hcos(z+h)cos(z)} = lim_{h \to 0} \frac{sin(h)}{hcos(z+h)cos(z)} = lim_{h \to 0} \frac{sin(h)}{h}·lim_{h \to 0} \frac{1}{cos(z+h)cos(z)} = 1·\frac{1}{cos^2(z)} = sec^2(z)$.
These simple examples serve as building blocks for more complex analytic functions and illustrate the consistency between real and complex differentiation in these cases.
Complex conjugate. f(z) = $\bar{z}$. Fails at all a, $\lim_{h \to 0} \frac{f(a+h)-f(a)}{h} = \lim_{h \to 0} \frac{\overline{a+h}-\overline{a}}{h}=[\text{Conjugation distributes over addition}] \lim_{h \to 0} \frac{\overline{h}}{h}$ does not exist (e.g., h ∈ ℝ gives 1, h imaginary gives −1).
Real Part Function. f(z) = Re(z). Fails at all a, $\lim_{h \to 0} \frac{f(a+h)-f(a)}{h} = \lim_{h \to 0} \frac{Re(a+h)-Re(a)}{h} = \lim_{h \to 0} \frac{Re(h)}{h}$ does not exist (e.g., h ∈ ℝ gives 1, h pure imaginary gives 0).
Let f: ℂ → ℂ be a complex function defined by f(z) = z·Re(z). This function is differentiable only at 0.
Let z ∈ ℂ, $\lim_{h \to 0} \frac{f(z+h)-f(z)}{h} = \lim_{h \to 0} \frac{(z+h)\mathbb{Re}(z+h)-z\mathbb{Re}(z)}{h} = \lim_{h \to 0} \frac{z\mathbb{Re}(z)+z\mathbb{Re}(h)+h\mathbb{Re}(z)+h\mathbb{Re}(h)-z\mathbb{Re}(z)}{h} = \lim_{h \to 0} \frac{+z\mathbb{Re}(h)+h\mathbb{Re}(z)+h\mathbb{Re}(h)}{h} = \lim_{h \to 0} \frac{z\mathbb{Re}(h)}{h} + \mathbb{Re}(z) + \mathbb{Re}(h) = \lim_{h \to 0} (\frac{z\mathbb{Re}(h)}{h}) + \mathbb{Re}(z)$
If z ≠ 0, then $\lim_{h \to 0} (\frac{z\mathbb{Re}(h)}{h})$ does not exist.
Conclusion: f(z) = z·Re(z) is differentiable only at z = 0 and f’(0) = 0.
The derivative of a complex function f(z) at a point z₀ is defined by the limit f’(z₀) = $\lim_{h \to 0}\frac{f(z₀+h)-f(z₀)}{h}$, provided this limit exists and is independent of the path h takes to approach zero (in the two-dimensional complex plane). This path independence is a much stronger condition than for real differentiability.
This definition can also be expressed as follows: Δz = z − z₀, f’(z₀) = $\lim_{Δz \to 0}\frac{f(z₀+Δz)-f(z₀)}{Δz}$. Typically, the subscript in z₀ is dropped for simplicity and the change in the function value w = f(z) corresponding to a change Δz in the input is denoted by Δw = f(z + Δz) − f(z). Hence, the derivative could be written as $\frac{dw}{dz} = \lim_{Δz \to 0}\frac{Δw}{Δz}$. The key aspect to consider is that the limit must exist and be the same regardless of the path h (or Δz) takes as it approaches zero in the complex plane.
If this limit exists, f(z) is said to be complex differentiable at z₀ and the value of the limit is denoted by f’(z₀). If a function is differentiable at every point in an open set U ⊆ ℂ is said to be analytic or holomorphic on U.