# Method of characteristics please guide me in right direction

1. Dec 27, 2016

### fahraynk

1. The problem statement, all variables and given/known data
$$U_t+U_x+\frac{1}{x} = 0\\ U(x,0)=\phi(x)$$

2. Relevant equations

3. The attempt at a solution
I learned somewhat of an algorithm for method of characteristics. It works for a different problem :
$$U_t + U_x - KU = 0 \\ U(x,0)= \phi(x) \\$$
Method :
$$x_s = 1\\ t_s = 1\\ x=s+x_0\\ t=s+t_0=s+0\\ x-t=x_0\\ U_s -KU = 0\\ U=Ae^{Ks}\\ U=\phi(x-t)e^{kt}$$

For this problem... its not working -_-
The first part is the same, mainly :
$$x_s=1\\ t_s = 1\\ x=s+x_0\\ t=s\\ x-t=x_0\\$$
But the next part...
$$U_s + \frac{1}{x} = 0$$
I think x should be x0, so:
$$U_s + \frac{1}{x_0} = U_s + \frac{1}{x-s}$$or$$U_t +\frac{1}{x-t} = 0$$
(since x=s+x0 or x=t+x0)
$$U= ln(x-t)$$

I'm not sure what to do here... can someone point me in the right direction please...
The books answer is $$-ln(t+1) + \phi(x-t)$$

I think the main transformation from $$U_x+U_t +KU = U_s + KU$$ comes from the fact that if U(x,t) and x(s), t(s), than $$U_s = U_x*x_s + U_t*t_s$$
with $$x_s = 1 \\t_s=1$$
So shouldn't this be the same for the next problem, with x = x0... ?

2. Dec 27, 2016

### Orodruin

Staff Emeritus
Why do you think that? It is x that appears in the original differential equation. You need to write it as a function of s in order to have an ODE in s.

3. Dec 27, 2016

### Orodruin

Staff Emeritus
Also note that the answer given by the book is false. It does not satisfy the given differential equation.

4. Dec 28, 2016

### fahraynk

Thanks for pointing that out...
x-s=x0.
So I guess if I keep it x it would become X0+S = X0 + t

Us+1/(X0+S)=0, U=Aln|X0+S|
U = F(x-t) ln |X0+t|

So since book is wrong... is that right? (since you said books answer is wrong, which is a relief)

5. Dec 28, 2016

### Orodruin

Staff Emeritus
Do not put it in terms of t - the entire point is to exchange x and t for s!
something strange happened in this integration ...
No, see above. Note that you can easily check whether you are right or not by inserting your result in the original differential equation.

6. Dec 28, 2016

### haruspex

That does not appear to be a solution to the equation either.
I am not familiar with the method you are trying to use. I don't understand how it works, since it implies x-t is constant, yet x and t are independent.

The problem is not hard if you apply the usual process of solving the homogeneous equattion then finding a particular integral.

Edit: I see Orodruin replied 30 minutes ago, yet that only showed up for me after I replied.

7. Dec 28, 2016

### fahraynk

$$U_s + \frac{1}{X_0+s} = 0\\ U(s)=-ln|x_0+s|+C\\ U(x,t)=-ln|x_0+t|+C\\ U(x,0) = -ln|x_0|+C = \phi(x_0)\\$$
Yeah... I think I am missing something still... I guess my book has not explained this method well enough for me... I feel like I'm stabbing in the dark. Ill try again tomorrow.

Also thanks for help all.

8. Dec 28, 2016

### Orodruin

Staff Emeritus
You have reached the conclusion that $U(x_0,0) = - \ln(x_0) + C = \phi(x_0)$ - this allows you to determine the constant in terms of $x_0$. Once you have that, you can eliminate $x_0$ and $s$ in favour of $t$ and $x$. You are almost there.

Note that the constant $C$ is constant with respect to $s$. I would not write $U(x,t) = -\ln(x_0+t) + C$.

The method of characteristics. You have a differential equation of the form
$$\vec v(\vec x) \cdot \nabla u = f(u,\vec x).$$
If you write down the change in $u$ along the flow lines of the vector field $\vec v$, you obtain a first order ordinary differential equation along each flow line. In order to determine $u$, you need a condition on $u$ on one point on each flow line. The price you pay for reducing it to an ordinary differential equation is that you have to find the flow lines. However, in the case of constant coefficients (as in this case), this is trivial.

9. Dec 28, 2016

### Ray Vickson

Since you are having trouble with the non-homogeneous pde, eliminate the trouble by looking at the new function
$$V(x,t) = U(x,t) + \ln x .$$
What is the pde satisfied by $V?$ What is the boundary condition on $V(x,0)?$

Last edited: Dec 28, 2016
10. Dec 29, 2016

### fahraynk

$$U_s+\frac{1}{s+x_0}=0\\ U(s)=-ln|s+x_0| + C(x,t)\\ U(x,0)=-ln|x_0|+C(x,t)=\phi(x)=\phi(t+x_0)\\ C=\phi(t+x_0)+ln|x_0|\\ U(x,t)=-ln|t+x_0|+\phi(t+x_0)+ln|x_0|$$
Checking:
$$U_t+U_x=-\frac{1}{x}\\ U_t=-\frac{1}{t+x_0}\\ U_x=0\\ -\frac{1}{t+x_0}=-\frac{1}{x}\\ x=t+x_0\\ -\frac{1}{x} =-\frac{1}{x}$$

I guess thats right?
By the way... this book does not explain how $$U_x+U_t=-\frac{1}{x}$$ becomes $$U_s=-\frac{1}{x}$$
Can anyone give me some insight into that transformation please? is it something like :
$$U_x=U_sS_x\\ U_y=U_sS_y$$ with S' of x,y = 1, since the coefficients are both constants of 1 in this case... and then that is why by setting $$\frac{dx}{dS}=1\\ \frac{dt}{dS} = 1\\$$ it works out... but it doesnt because then it the new equation would be $$2U_s=-\frac{1}{x}$$

11. Dec 29, 2016

### Orodruin

Staff Emeritus
No, you are working in terms of $s$ and $x_0$ now. Your integration constant should depend on $x_0$, not $x$ and $t$.

You cannot write $U$ in terms of $x$ and $t$ and still keep $x_0$. First find $U(s)$ and then change variables to $x$ and $t$.

This is just the chain rule:
$$\frac{df}{ds} = \frac{dt}{ds} \frac{\partial f}{\partial t} + \frac{dx}{ds} \frac{\partial f}{\partial x}$$

12. Dec 30, 2016

### fahraynk

Thanks... I get this now. I don't know why I was messing up that ODE it was so easy if I would have thought about it.