Solutions of a differential equation

The differential equation is:

$$x^2 \frac {\partial f}{\partial x}(x,y)- y^2 \frac {\partial f}{\partial y}(x,y)=2f(x,y).$$

Express $f(x, y)$ as

$$f(x,y) = X(x) Y(y),$$

so

$$x^2 Y \dfrac{dX}{dx} - y^2 X \dfrac{dY}{dy} = 2XY $$

$$x^2 \frac{1}{X} \dfrac{dX}{dx} - y^2 \frac{1}{Y} \dfrac{dY}{dy} = 2$$

$$x^2 \frac{1}{X} \dfrac{dX}{dx} = y^2 \frac{1}{Y} \dfrac{dY}{dy} + 2$$

You can define

$$ x^2 \frac{1}{X} \dfrac{dX}{dx} = -k,$$

which means

$$ X(x) = C_1 e^{k/x}.$$

For $Y(y)$ you have

$$ -k = y^2 \frac{1}{Y} \dfrac{dY}{dy} + 2,$$

which means that the solution is

$$Y(y) = C_2 e^{(2+k)/y}.$$

Yes, at some point, I have to apply boundary conditions, unfortunately, I don't understand the boundary conditions you are using, so I cannot keep solving it.


$$x^2 \frac {\partial f}{\partial x}(x,y)- y^2 \frac {\partial f}{\partial y}(x,y)=2f(x,y).$$ Search for the general solution (without taking account of the boundary condition) with the method of characteristics :

The characteristic ODEs are : $$\frac{dx}{x^2}=\frac{dy}{-y^2}=\frac{df}{2f}$$ A first characteristic equation comes from $\frac{dx}{x^2}=\frac{dy}{-y^2}$ : $$\frac{1}{x}+\frac{1}{y}=c_1$$ A second characteristic equation comes from $\frac{dx}{x^2}=\frac{df}{2f}$ : $$e^{2/x}f=c_2$$ The general solution expressed on the form of implicite equation is : $$\Phi\left(\frac{1}{x}+\frac{1}{y}\:,\:e^{2/x}f \right)=0$$ where $\Phi$ is an arbitrary function of two variables. This function has to be determined later according to boundary conditions.

Or, equivalently on explicit form : $e^{2/x}f=F\left(\frac{1}{x}+\frac{1}{y} \right)$

$$f(x,y)=e^{-2/x}F\left(\frac{1}{x}+\frac{1}{y} \right)$$ where $F$ is an arbitrary function. This function has to be determined later according to boundary conditions.

BOUNDARY CONDIION :

In the original wording of the question, the boundary condition is not clearly defined. A discussion took place in the comments.

To the question : Is the boundary condition $f(x,y)=x+y$ on the unit circle $x^2+y^2=1$ ? the OP answered "that should be it", which is not really affirmative. So, this supposed boundary condition can be suspected to be mistaken.

Supposing that the boundary condition is $f(x,y)=x+y$ on the unit circle $x^2+y^2=1$, thus $y=\pm\sqrt{1-x^2}$ , my comment is :

The function $F$ has to be determined from : $$x\pm\sqrt{1-x^2}=e^{-2/x}F\left(\frac{1}{x}+\frac{1}{\pm\sqrt{1-x^2}} \right)$$

In fact, it is theoretically possible to find the function $F$ but the calculus is rather arduous and the function $F$ is very complicated. This draw to think that something might be wrong in the wording of the question. The OP should re-examine what is really the boundary condition. To help him, it should be necessary that the OP re-edit his question with a detailed explanation how he got the above boundary condition.


The differential equation

$X(f) = 2f, \tag 1$

where $X$ is the vector field

$X = x_1^2 \dfrac{\partial}{\partial x_1} - x_2^2 \dfrac{\partial}{\partial _2}, \tag 2$

may also be written in the form

$\dfrac{\partial f}{\partial t} = 2f, \tag 3$

where $t$ is the running parameter along the integral curves of $X$; here we make the usual identification

$X \equiv \dfrac{\partial}{\partial t}. \tag 4$

It will be noted that in fact (3) is simply an ordinary differential equation; thus, along any trajectory of $X$, we may in the usual manner write

$X(\ln f) = \dfrac{\partial (\ln f)}{\partial t} = \dfrac{1}{f} \dfrac{\partial f}{\partial t} = 2, \tag 5$

which may be integrated 'twixt $t_0$ and $t$ to yield

$\ln \left ( \dfrac{f(t)}{f(t_0)} \right ) = \ln(f(t) ) - \ln(f(0)) = 2(t - t_0), \tag 6$

or

$f(t) = f(t_0)e^{2(t - t_0)}, \tag 7$

which expresses the evolution of $f$ along any trajectory of $X$ in terms of the parameter $t$ such that (4) binds.  The reader will no doubt recognize that (7) presents

$f:\Bbb R \to \Bbb R \tag 8$

as a function of the single parameter $t$, whereas the question specifies that

$f:\Bbb R^2 \to \Bbb R \tag 9$

is indeed dependent upon the two variables $x_1, x_2$; in reconciling these dual points of view we will exploit the fact that, along the integral curves of $X$ the coordinates $x_1, x_2$ must satisfy the differential equations

$\dot x_1 = x_1^2, \tag{10}$

$\dot x_2 = -x_2^2; \tag{11}$

these equations are both of the general form

$y = ay^2, \tag{12}$

and the solution is derived below in an appendix to this answer.  We in fact have:

$x_1(t) = x_{10}(1 - x_{10}(t - t_0))^{-1}, \; x_1(t_0) = x_{10}, \tag{13}$

$x_2(t) = x_{20}(1 + x_{20}(t - t_0))^{-1}, \; x_2(t_0) = x_{20}; \tag{14}$

then what we have written as

$f(t) = f(x_1(t), x_2(t)), \tag{15}$

and we may find $f(x_1, x_2)$ for arbitrary $x_1, x_2$ by discovering an $x_{10}, x_{20}$, $t$ and $t_0$ (if indeed such concurrently exist) such that (13) and (14) bind, where $x_{10}$ and $x_{20}$ are the coordinates of a point at which $f(t_0)$ is specified; typically, $x_{10}$, $x_{20}$ will lie in some submanifold, in the present instance in fact a curve in $\Bbb R^2$ that is, apparently, the circle $(\cos \theta, \sin \theta)$ on which we have

$f(\theta) = \cos \theta + \sin \theta; \tag{16}$

we may, via (13) and (14), express $x_1$, $x_2$ by means of a coordinate transformation which gives them in terms of $t$ and $\theta$:

$x_1(t, \theta) = \cos \theta (1 - \cos \theta (t - t_0))^{-1}, \tag{17}$

$x_2(t, \theta) = \sin \theta (1 + \sin \theta (t - t_0))^{-1}; \tag{18}$

in these coordinates we have, by (7),

$f(t, \theta) = e^{2(t - t_0)} (\cos \theta + \sin \theta); \tag{19}$

in principle, the transformation (17)-(18) may be reversed; in so doubg, the identity

$\sin^2 \theta + \cos^2 \theta = 1 \tag{20}$

may prove useful, allowing as it does the expression $\sin \theta$ in terms of $\cos \theta$.

Appendix:

$\dot y = ay^2, \; y(t_0) = y_0; \tag 1$

$y^{-2}\dot y = a; \tag2$

$y_0^{-1} - y^{-1} = \displaystyle \int_{y_0}^y y^{-2}dy = \int_{t_0}^t a \; ds = a(t - t_0); \tag 3$

$y^{-1} = y_0^{-1} - a(t - t_0) = y_0^{-1} - y_0^{-1} y_0 a(t - t_0) = y_0^{-1}(1 - y_0 a(t - t_0));\tag 4$

$y = y_0(1 - y_0 a(t - t_0))^{-1} = \dfrac {y_0}{1 - y_0 a (t - t_0)}; \tag 5$

we apply these calculations to find (locally) the integral curves of the vector field

$X = x_1^2 \dfrac{\partial}{\partial x_1} - x_2^2 \dfrac{\partial}{\partial _2} \tag 6$

with initial condition

$x_1(t_0) = x_{10}, \; x_2(t_0) = x_{20}; \tag 7$

the formula (5) applies to this situation when we take

$a = 1, \; y = x_1; \; a = -1, y = x_2; \tag 8$

we have

$x_1(t) = x_{10}(1 - x_{10}(t - t_0))^{-1}, \tag 9$

$x_2(t) = x_{20}(1 + x_{20}(t - t_0))^{-1}, \tag{10}$