PDE- method of characteristics, satisfy the given condition

How to solve this equation? Should I use method of characteristics? Question states: find the solution that satisfies this condition: \begin{aligned} xu_{x}-yu_y+u &= x\\ u&= x^2 \ when \ y=x \end{aligned}

I just plugged "u" and solved accordingly, at the end I got x=0 and x=1/3.

$$xu_x-yu_y=x-u$$ Charpit-Lagrange system of characteristic OEDs : $$\frac{dx}{x}=\frac{dy}{-y}=\frac{du}{x-u}$$ First characteristic equation from $$\frac{dx}{x}=\frac{dy}{-y}$$ : $$xy=c_1$$ Second characteristic equation from $$\frac{dx}{x}=\frac{du}{x-u}$$ : $$xu-\frac12 x^2=c_2$$ General solution of the PDE on the form of implicit equation : $$xu-\frac12 x^2=F(xy)$$ where $$F$$ is an arbitrary function, to be determined according to the boundary condition. $$u(x,y)=\frac12 x+\frac{1}{x} F(xy)$$ Condition : $$u(x,x)=x^2=\frac12 x+\frac{1}{x} F(x^2)$$ $$F(x^2)=x^3-\frac12 x^2$$ This determines the function $$F$$ : $$F(X)=X^{3/2}-\frac12 X$$ We put this function into the general solution where $$X=xy$$ : $$u(x,y)=\frac12 x+\frac{1}{x}\left((xy)^{3/2}-\frac12 (xy) \right)$$ $$u(x,y)=\frac{x-y}{2}+x^{1/2}y^{3/2}$$

• First of all, thanks a lot, but I couldnt get how did you use c1 and c2? – Karl Markov Mar 9 at 8:26
• This basic in the method of characteristics. See the theory. The general solution on the form of implicit equation is $c_2=F(c_1)$ or equivalently $c_1=G(c_2)$ with $F$ and $G$ arbitrary functions (in fact one being the inverse of the other). – JJacquelin Mar 9 at 8:32
• Thanks a lot, now everything is clear – Karl Markov Mar 9 at 8:54

Solving the PDE we get

$$u(x,y) = \frac{x^2+2\phi(x y)}{2x}$$

and the condition

$$u(x,x) = \frac{x^2+2\phi(x^2)}{2x} = x^2$$

gives

$$\phi(x^2) = x^3-\frac 12 x^2 = x^2\left(\sqrt{x^2}-\frac 12\right)$$

and finally

$$\phi(xy) = x y\left(\sqrt{x y}-\frac 12\right)$$