Let $a,b$ be constants with $a>0.$ Consider the IVP $$u_t=a \Delta u+b |\nabla u|^2=0~~\textrm{in}~~R^n \times (0,\infty), u=g~~\textrm{on}~~R^n \times \{ t=0 \}.$$ Solve this by using the solution formula for $w,$ where $$w_t-a \Delta w =0~~\textrm{in}~~R^n \times (0,\infty), w=h~~\textrm{on}~~R^n \times \{ t=0 \}.$$
I've got no idea on how to go by and solving this problem. Any help is much appreciated.
To start off let's point out that you have a typo in your statement. The equation for $w$ should be $w_t - a \Delta w =0$. I know this is true because I know the trick to solve the problem using such a $w$, but we can also see this directly because $w_t$ is scalar and $a \nabla w$ is a vector.
Here's a nice hint for the problem that doesn't give away everything. Suppose initially that we have a solution $u$ to the problem. Define a new function $v(x,t) = \varphi(u(x,t))$ for some $C^2$ function $\varphi$.
$$ v_t = \varphi'(u) u_t, \nabla v = \varphi'(u) \nabla u, \Delta v = \varphi'(u) \Delta u + \varphi''(u) \vert\nabla u\vert^2 $$ and so $$ v_t - a \Delta v = \varphi'(u) [ u_t - a \Delta u ] + a\varphi''(u) \vert\nabla u\vert^2 \\ = [b\varphi'(u) + a\varphi''(u)] \vert\nabla u\vert^2. $$ This analysis is valid for ANY $\varphi$, so now you can try to choose $\varphi$ such that $v=w$.
From here you should be able to finish the problem yourself.