Let $G\subseteq\mathbb{C}$ be a domain and assume $u:G\to\mathbb{R}$ is a harmonic function such that $|u(z)|\leq M$ for all $z\in G$. Show that $|\nabla u(z)|\leq\frac{2M}{r}$ for $0<r<dist(z,\partial G$) and for all $z\in G$. ($\nabla u$ is the gradient of $u$).
Attempt: As we know, there is some harmonic function $v:G\to\mathbb{R}$ such that $f=u+iv$ is holomorphic. I thought it might help to use Cauchy integral formula. For a given $z_0\in G$ and $0<r<dist(z_0,\partial G$) we have:
$f'(z_0)=\frac{1}{2\pi i}\int_{B_r(z_0)}\frac{f(\xi)}{(\xi-z_0)^2} d\xi=\frac{1}{2\pi}\int_0^{2\pi}\frac{f(z_0+re^{it})}{re^{it}}dt=\frac{1}{2\pi r}\int_0^{2\pi}f(z_0+re^{it})(cost-isint)dt$
Alright, now using the fact that $f'(z_0)=u_x(z_0)+iv_x(z_0)$ I tried to compare real parts. What I got is the following:
$u_x(z_0)=\frac{1}{2\pi r}\int_ 0^{2\pi} u(z_0+re^{it})cost+v(z_0+re^{it})sint dt$
I hoped I can get a bound on both $u_x$ and $u_y$ and from there get the required bound on the gradient. However as you can see I got that $u_x$ is dependent on the values of $v$ and this is a function I cannot bound since I don't know anything about it. So I'm stuck. Any ideas?
Suppose $z_0\in G$. let $ |z-z_0| = r < R$ for some $R$ such that $B_R(z_0)\subseteq G.$ Applying Harnack's inequality yields
${R-r \over R+r}u(z_0)\leq u(z_0+re^{it})\leq {R+r \over R-r}u(z_0).$ Then,
$\frac{1}{r}\left({R-r \over R+r}-1\right)u(z_0)\leq \frac{u(z_0+re^{it})-u(z_0)}{r} \leq \frac{1}{r}\left({R+r \over R-r}-1\right)u(z_0).$
Letting $r\to 0$ gives
$\frac{-2}{R}u(z_0)\leq Du_{v=e^{it}}(z_0)\leq \frac{2}{R}u(z_0)\Rightarrow |\nabla u(z_0)|\le \frac{2}{R}|u(z_0)|\le \frac{2}{R}M $.