Find $f$ for $x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=x^2+y^2$ 
$$x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=x^2+y^2$$

Moving to polar we have $$r\cos \theta\frac{\partial f}{\partial x}+r\sin\theta \frac{\partial f}{\partial y}=r^2$$
We know that:
$$\frac{\partial f}{\partial x}=\frac{\partial f}{\partial r}\frac{\partial r}{\partial x}+\frac{\partial f}{\partial \theta}\frac{\partial \theta}{\partial x}$$
$$\frac{\partial f}{\partial y}=\frac{\partial f}{\partial r}\frac{\partial r}{\partial y}+\frac{\partial f}{\partial \theta}\frac{\partial \theta}{\partial y}$$
In our case we have $$\frac{\partial f}{\partial x}=\frac{\partial f}{\partial r}\frac{2x}{2\sqrt{x^2+y^2}}+\frac{\partial f}{\partial \theta}\frac{\frac{-y}{x^2}}{1+(\frac{x}{y})^2}=\frac{\partial f}{\partial r}\cos \theta-\frac{\partial f}{\partial \theta}\frac{\sin \theta}{r}$$
and for $$\frac{\partial f}{\partial y}=\frac{\partial f}{\partial r}\frac{\partial r}{\partial y}+\frac{\partial f}{\partial \theta}\frac{\partial \theta}{\partial y}=\frac{\partial f}{\partial r}\sin \theta\frac{\partial f}{\partial \theta}\frac{\cos \theta}{r}$$
Do I need to assign to $$x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=x^2+y^2$$ both $\frac{\partial f}{\partial y}$ and $\frac{\partial f}{\partial x}$ for both $r$ and $\theta$?
 A: A solution is $f(x,y)= (x^2+y^2)/2$. If you want obtain one solution, you can separated the variables and solve the system $x\frac{\partial f}{\partial x}=x^2$ and $y\frac{\partial f}{\partial y}=y^2$.
A: $$x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=x^2+y^2$$
With change of variables $\begin{cases} X=x^2 \\ Y=y^2 \end{cases}$ $\quad\to\quad 2X\frac{\partial f}{\partial X}+2Y\frac{\partial f}{\partial Y}=X+Y$
If the goal is to find not only particular solutions, but a general solution, the method of characteristics is recommended.
The related characteristic equations are :
$$\frac{dX}{2X}=\frac{dY}{2Y}=\frac{df}{X+Y}$$
A first characteristic is derived from $\frac{dX}{2X}=\frac{dY}{2Y}\quad\to\quad \frac{Y}{X}=c_1$ 
A second characteristic is derived from $\frac{dX}{2X}=\frac{dY}{2Y}=\frac{dX+dY}{2(X+Y)}=\frac{df}{X+Y}\quad\to\quad f-\frac{X+Y}{2}=c_2$
The solution expressed on implicit form is :
$$\Phi\left(\left(f-\frac{X+Y}{2}\right)\:,\:\left(\frac{Y}{X}\right)\right)=0$$
where $\Phi$ is any differentiable function of two variables.
This can be expressed on explicit form :
$f-\frac{X+Y}{2}=$ any derivable function of $\left(\frac{Y}{X}\right)=\left(\frac{y}{x}\right)^2$ or equivalent to any derivable function of $\frac{y}{x}$
The general solution is :
$$f(x,y)=\frac{x^2+y^2}{2}+F\left(\frac{y}{x}\right) $$ 
where $F$ is any derivable function.
Note that $F\left(\frac{y}{x}\right)$ can be replaced by $G\left(\frac{x}{y}\right)$ or many equivalent forms.
In polar coordinates $\begin{cases} x=\rho\cos(\theta) \\ y=\rho\sin(\theta)\end{cases} \quad\to\quad \frac{y}{x}=\tan(\theta)\quad$ 
and $F\left(\tan(\theta)\right)$ can be replaced by $G(\theta)$
$$f(\rho,\theta)=\frac{\rho^2}{2}+G(\theta)$$
where $G$ is any derivable function.
Alternatively, one can transform the Cartesian PDE to a Polar PDE :
$$x\frac{\partial f}{\partial x}+y\frac{\partial f}{\partial y}=x^2+y^2=\rho \frac{\partial f}{\partial \rho}=\rho^2$$
$$\frac{\partial f}{\partial (\frac{1}{2}\rho^2)}=1\quad\to\quad f=\frac{1}{2}\rho^2+G(\theta)$$
A: in $\mathbb R^2$ in the vector form you can write:
$$\vec r \cdot \vec {\nabla f}=\vec r \cdot \vec r$$
where $ \vec r = (x,y)$
then you can get $$\vec {\nabla f}=\vec r+k\vec r_p$$
where $\vec r_p$ is vector perpendicular to $\vec r$ which is just one possible vector cause we are in $\mathbb R^2$ of dimension 2 and k is an arbitrary coefficient; $\vec r_p=(y,-x)$
or in other words: $$\frac{\partial f}{\partial x}= x+ky$$
$$\frac{\partial f}{\partial y}= y-kx$$
for finding simplest solution we set $k=0$. so by a simple integration you find $f(x,y)=\frac{(x^2+y^2)}{2}+C$
A: $$
(x,y)\cdot\nabla f=(x,y)\cdot(x,y)
$$
gives one solution to be $f(x,y)=\frac12r^2$. The other solutions would differ by a solution to
$$
(x,y)\cdot\nabla g=0
$$
that is, $g$ does not change in the radial direction. Thus, $g$ is simply a function of $\theta$, the angle of $(x,y)$.
Thus, the general solution is
$$
f=\tfrac12r^2+u(\theta)
$$
A: Solve PDE
$$x\frac{\partial u}{\partial x}+y\frac{\partial u}{\partial y}=x^2+y^2\qquad\quad (1)$$


*

*After change $\;x=e^\xi,\; y=e^\eta\;$ we get
$$\frac{\partial u}{\partial \xi}+\frac{\partial u}{\partial \eta}=e^{2\xi}+e^{2\eta}.\qquad (2)$$

*Particular solution of $(2)$ is $$u_p=\frac{e^{2\xi}}{2}+\frac{e^{2\eta}}{2}.$$

*Solution of $\;\frac{\partial u}{\partial \xi}+\frac{\partial u}{\partial \eta}=0\;$ is $u_c=f(\xi-\eta)$.

*Then general solution of $(1)$ is
$$u=u_c+u_p=f(\xi-\eta)+\frac{e^{2\xi}}{2}+\frac{e^{2\eta}}{2}\\=
f(\log x-\log y)+\frac{x^2}{2}+\frac{y^2}{2}\\=f\left(\log\frac xy\right)
+\frac{x^2}{2}+\frac{y^2}{2}\\=
F\left(\frac xy\right) +\frac{x^2}{2}+\frac{y^2}{2}
$$

