Proof of $|f'(z)|\le C\frac{\lVert f \rVert _\infty}{d(z, \partial G)}$ for holomorphic $f$ on bounded $G$ and what is the optimal constant? I had my complex analysis exam today and am torturing myself over the following question, which I totally failed to solve.
Let $G$ be a bounded domain and $f$ holomorphic on $G$. Show that:
$$|f'(z)|\le C\frac{\lVert f \rVert _\infty}{d(z, \partial G)}$$ where $\partial G$ denotes the edge of the domain $G$ and $d$ the distance. Find the optimal constant $C$. 
Except for the trivial case of a constant function, I had no idea how to solve this problem. The maximum principle doesn't apply in the form I know, as $f$ is not necessarily holomorphic on the closure of $G$. I am not aware of any other tools from complex analysis for this kind of inequality.
As we don't get these exams back, I would appreciate it if someone could give an insight into how this problem can be solved.
 A: Since $f$ is holomorphic on $G$ we may utilize the Cauchy Integral Formula on some path contained in $G$ to compute an estimate for the modulus of the derivative at a point contained in this domain.  Now the fact that $G$ is bounded says that given any $z\in G$ we have $d(z,\partial G):=\inf\{|w-z|:w\in G^c\}$ will be finite. 
Now given $z\in G$ consider $B_{\delta}(z)=\{w:|z-w|<\delta\}$ where we take $\delta=d(z,\partial G)$.  We observe that $B_{\delta}(z) \subset G$ by the way we chose delta. 
The Cauchy integral formula gives:
$$f'(z)=\frac{2}{2\pi i}\int_{\partial B_{\delta}(z)} \frac{f(\zeta)}{(\zeta -z)^2}d\zeta$$ 
Using the triangle inequality we get:
$$|f'(z)|\leq\frac{2}{2\pi}\int_{\partial B_{\delta}(z)} \frac{|f(\zeta)|}{|\zeta -z|^2}|d\zeta|$$
We can say that $|f(\zeta)|\leq\|f\|_{\infty}$ on the path of integration and additionally  we know $|\zeta -z|^2=d(z,\partial G)^2$.  So we get the following: $$|f'(z)|\leq \frac{\|f\|_{\infty}}{\pi d(z,\partial G)^2}\int_{\partial B_{\delta}(z)}|d\zeta|=\frac{\|f\|_{\infty}}{\pi d(z,\partial G)^2}(2\pi d(z,\partial G))=\frac{2\|f\|_{\infty}}{d(z,\partial G)}$$
