Partial Differential Equation -- method of characteristics (ode solve)

I've been asked to solve

$\displaystyle u_t + cos(\pi x) u_x = 0$ using the method of characteristics. This amounts to solving the following odes:

$\displaystyle dt/ds = 1, t(0) = 0$ which implies $\displaystyle t = s$ and

$\displaystyle dx/ds = cos(\pi x), x(0) = x_0$.

This ode yields (if I'm right):

$\displaystyle |sec(\pi x) + tan(\pi x)| = Ce^{\pi s}$.

However, I cannot solve this explicitly for x, and therefore cannot solve the pde by the method of characteristics? Can anyone shed insight? Have I done something wrong? Is there a missing trig identity somewhere?

Thanks

Re: Partial Differential Equation -- method of characteristics (ode solve)

Quote:

Originally Posted by

**davismj** I've been asked to solve

$\displaystyle u_t + cos(\pi x) u_x = 0$ using the method of characteristics. This amounts to solving the following odes:

$\displaystyle dt/ds = 1, t(0) = 0$ which implies $\displaystyle t = s$ and

$\displaystyle dx/ds = cos(\pi x), x(0) = x_0$.

This ode yields (if I'm right):

$\displaystyle |sec(\pi x) + tan(\pi x)| = Ce^{\pi s}$.

However, I cannot solve this explicitly for x, and therefore cannot solve the pde by the method of characteristics? Can anyone shed insight? Have I done something wrong? Is there a missing trig identity somewhere?

Thanks

Your PDE...

$\displaystyle u_{t}+ \cos (\pi x)\ u_{x}=0$

... is 'nonhomogeneous' and equivalent to then system...

$\displaystyle d t=\frac{d x}{\cos \pi x}$

$\displaystyle d u=0$ (2)

...the solution of which is...

$\displaystyle c_{1}= v(x,t)= t-\frac{1}{\pi}\ \ln\ |\tan (\frac{\pi}{2} x +\frac{\pi}{4})|$

$\displaystyle c_{2}= u$ (3)

... so that the solution of (1) is...

$\displaystyle u= \gamma\{v(x,t)\}$ (4)

... where $\displaystyle \gamma(*)$ is any continous function with continous derivative...

Kind regards

$\displaystyle \chi$ $\displaystyle \sigma$