Finding a solution for $x\frac{\partial u}{\partial x}+2y\frac{\partial u}{\partial y}=x^2$ To find a solution for $x\frac{\partial u}{\partial x}+2y\frac{\partial u}{\partial y}=x^2$ knowing that $u(x,y)=1$ if $xy=1.$
I thought it may be useful to do the change $v=\log x, w=\frac{1}{2}\log y$ because then
$$x\frac{\partial u}{\partial x}+2y\frac{\partial u}{\partial u}=\frac{\partial u}{\partial v}+\frac{\partial u}{\partial w}$$
And the term $x^2$ will be given now by $e^v$, so now the idea is to solve
$$\frac{\partial u}{\partial v}+\frac{\partial u}{\partial w}=e^{2v}$$
Can I give a tentative solution here?, the right hand side only depends on $v$ so $u_v=e^{2v}$ leads to $u(v,w)=\frac{1}{2}e^{2v}+C$. But this doesn't work, because if I try to find a way to satisfy the initial condition I get that $xy=1$ is equivalent to $v+w=\log\frac{1}{2}$ and $u(\log\frac{1}{2}-w,w)=\frac{1}{2}e^{\log \frac{1}{4}}e^{-2w}+C \implies C=1-\frac{1}{8}e^{-w}.$
It doesn't matter if I use $v$ or $w$ for the substitution, it would give me a "constant" which depends of $v$ or $w$, messing up with the partial derivatives I set before.
Update: Ok, forget the change of variables. Just setting $\frac{\partial u}{\partial x}=x-1/x$ and $\frac{\partial u}{\partial y}=1/(2y)$ seems to get part of the job done. Then $u(x,y)=\frac{1}{2}x^2+\frac{1}{2}\log y - \log x$, but doesn't work with $u(x,y)=x$ if $xy=1$.
 A: What about using the method of characteristics? For every $a\ne0$, define the characteristic  curve $C_a$ parametrized by $t$ as the curve $t\mapsto (x_a(t),y_a(t))$ satisfying $$x'_a(t) = x_a(t),\qquad y'_a(t) = 2y_a(t),$$ with the initial condition $(x_a(0),y_a(0)) = (a,a^{-1})$. The solutions are $$x_a(t) = ae^t,\qquad y_a(t) = a^{-1}e^{2t}.$$ Note that $$e^{3t} = x_a(t)y_a(t),\qquad x_a(t)^2y_a(t)^{-1}= a^3.$$
On $C_a$, considering $v_a(t)=u(x_a(t),y_a(t))$, the PDE becomes $$v_a'(t) = x_a(t)^2 = a^2e^{2t},$$ with the initial condition $v_a(0) = 1$. The solution is $$v_a(t) = \tfrac{1}{2}a^2(e^{2t} -1) + 1,$$ that is, recalling that  $v_a(t)=u(x_a(t),y_a(t))$ and expressing everything in terms of $(x,y)$, $$u(x,y) = \tfrac{1}{2}\left(x^2y^{-1}\right)^{2/3}\left(x^{1/3}y^{1/3} - 1\right) + 1 = \tfrac{1}{2}\left(xy^{-1/3} - x^{2/3}y^{-2/3}\right)+1.$$
A: $$
u = f(x) g(y) \\
u_x = f'(x) g(y) \quad u_y = f(y) g'(y)
$$
then the homogenous PDE turns into
$$
x f'(x) g(y) + 2y f(x)g'(y) = 0 \iff \\
x \frac{f'(x)}{f(x)} = - 2y \frac{g'(y)}{g(y)} = C \iff \\
f'(x) - \frac{x}{C}f(x) = 0 \wedge 
g'(y) + \frac{2y}{C}g(y) = 0
$$
with solutions
$$
f(x) = f(0) e^{x^2/(2C)} \wedge
g(y) = g(0) e^{-y^2/C}
$$
which gives
$$
u_h(x,y) = u_h(0,0) e^{\frac{x^2-2y^2}{2C}}
$$
A solution of the inhomogenous PDE is
$$
u_p(x,y) = \frac{1}{2} x^2 + c
$$
This leads to
$$
u(x,y) = u_h(0,0) e^{\frac{x^2-2y^2}{2C}} + \frac{1}{2} x^2 + c
$$
However I do not see how to merge this solution with the condition $u=1$ along $y(x) = 1/x$. 
