Solve the Cauchy problem: $$xu_x+yu_y=u+1,$$ if $u(x,x^2)=x^2$ for all $x\in \mathbb{R}.$
Attempt. Using the method of characteristics (as in What is the geometric interpretation of the solution to PDE $xu_x+yu_y=0$) we reach $u(x,y)=x\,f(y/x)-1$ for some $C^1$ function $f$. Since $u(x,x^2)=x^2$, we have $\displaystyle xf(x)-1=x^2$, so $f(x)=x+\frac{1}{x}$ and: $$u(x,y)=y+\frac{x^2}{y}-1.$$
which is the valid solution, since it satisfies the PDE (just plug it in) and $u(x,x^2)=x^2$.
My main concern is the following: I have seen answers that finish here. On the other hand, we have the restriction that $y$ should be non-zero. So
how may we speak about the solution to the initial problem since we exclude the $y$-axis?
Why the initial problem was not given as: $xu_x+yu_y=u+1$ for $y\neq 0$, if $u(x,x^2)=x^2$ for all $x\in \mathbb{R}$, in order to avoid the above? (the arguments, as given, would then be enough).
is it a general practice in such problems to be a bit "loose" at this point, regarding the restrictions? (since i have seen solutions in such problems, that neither inserts restrictions on the initial problem, neither comment on the restrictions on the "solution", when they appear).
All the above hold, unless the initial problem is equivalent to the following one:
Solve, wherever it can be solved, the Cauchy problem: $$xu_x+yu_y=u+1,$$ if $u(x,x^2)=x^2$ for all $x\in \mathbb{R}.$
Thanks in advance for the help.