I have the following pde:
$xu_{x}-yu_{y}+u=x $, with the initial condition $u=1$, when $y=x^2$
Solving it with the method of characteristics:
$\frac{dx}{ds}=x $, $\hspace{5mm} x(r,0)=r $
$ \frac{dy}{ds}=-y $, $\hspace{5mm} y(r,0)=r^2 $
$\frac{dz}{ds} = x-z $, $\hspace{5mm} z(r,r^2)=1$
And I find
$x(r,s)=re^s$, $\hspace{5mm} y(r,s)=r^2e^{-s}$ and $\hspace{5mm} z(r,s) = \frac{1}{2}re^{2s} +e^{r^2}-\frac{1}{2}r $
But function $z$ doesn't apply the 3rd equation. I think I am not getting right the initial condition $u(x,x^2)=1$
Thank you
You have $z=z(r,s)$, not $z=z(x,y)$ as the third equation for the characteristics seems to assume. So, the correct intial conditions for $z$ are that $z=1$ along the curve with $s=0$ and $r$ free. So is,
$\dfrac{dz}{ds} = x-z$
$z(r,0)=1$
Solvig it and applying the initial conditions:
$z=\dfrac{r}{2}e^s+C e^{-s}\implies 1=\dfrac{r}{2}+C$ and $C=1-\dfrac{r}{2}$
$z=\dfrac{r}{2}e^s+\left(1-\dfrac{r}{2}\right)e^{-s}$
Isolating $r$ and $s$ from the first two equations:
$e^s=\sqrt[3]{\dfrac{x^2}{y}};\;r=\sqrt[3]{xy}$
From here, $u=z(x,y)=\dfrac{x}{2}+\left(1-\dfrac{\sqrt[3]{xy}}{2}\right)\dfrac{\sqrt[3]{xy}}{x}$
that satisfies the inital conditions.