I am trying to solve this PDE using method of characteristics:
$u_y + 3u_x = -u^2, u(x,0)=f(x)$
This is how I started:
$\frac{dy}{ds}=1$
$\frac{dx}{ds}=3$
$\frac{du}{ds}=-u^2$
I then integrated these equations and got:
$y=s+y_0$
$x=3s+x_0$
$u=\frac{1}{s+u_0}$
Next step, find $s$ and $u_0$. I let $y_0=0$ so $s=y$. To get my $u_0$:
$u_0=u(x_0,0)=f(x_0)$
$x_0=x-3y$
$u_0=f(x-3y)$
Finally, I put $s$ and $u_0$ in my expression for $u$ to get the solution:
$u(x,y)=\frac{1}{y+f(x-3y)}$
But that isn't the same solution as the one my professor got. I don't understand what I did wrong. Is there something wrong with my use of the initial condition?