# First order partial differential equation - method of characteristics

I am trying to solve following PDE:

$$\frac{\partial g}{\partial t} = (1 - x) \mu \frac{\partial g}{\partial x} - \tau (1 - x) g, \quad g = g(x,t)$$ where $$g(x,0) = x^{n_0}, \quad x(1,t) = 1$$

I wanted to solve this by method of characteristics. First, I have parameterized my variables with parameter $s$ with initial conditions $$t(0) = 0, \quad x(0) = x_{0}$$ from which \begin{align} \frac{\partial g}{\partial t} &= \tau (x - 1) g \\ \frac{\partial t}{ \partial s} &= 1, \quad \implies t = s \\ \frac{\partial x}{\partial s} &= \mu (x - 1) \implies x - 1 = (x_{0} - 1) e^{\mu s} \end{align} From first differential equation (using third) $$\ln \frac{g(x,t)}{g_{0}} = \frac{\tau}{\mu} (x_{0} - 1) e^{\mu t} \implies g(x,t) = g_{0} \exp \left\{ \frac{\tau}{\mu}(x_{0} - 1) e^{\mu t} \right\}$$ From boundary condition $g(x,0) = x^{n_{0}}$ we have $$g_{0} = x^{n_{0}} \exp \left\{ - \frac{\tau}{\mu} (x_{0} - 1) \right\}$$ Using third differential equation again $$g_{0} = x^{n_{0}} \exp \left\{ - \frac{\tau}{\mu} (x - 1) e^{- \mu t} \right\}$$ and so I got $$g(x,t) = x^{n_{0}} \exp \left\{ \frac{\tau}{\mu}(x-1)(1 - e^{-\mu t}) \right\}$$

I would be generally satisfied with this solution... but mathematica gives: $$\left\{\left\{g(x,t)\to \left(1 + (x-1)e^{-\mu t} \right)^{n_0} \exp \left(\frac{\tau}{\mu} (x-1)(1-e^{-\mu t}) \right) \right\}\right\}$$ And I have no idea what I did wrong.... Any ideas?

I forgot to consider, that also $g_0$ can be $x_0$ depended.... Corrected solution is following:
\begin{align} \frac{\partial g}{\partial t} &= \tau (x - 1) g \\ \frac{\partial t}{ \partial s} &= 1, \quad \implies t = s \\ \frac{\partial x}{\partial s} &= \mu (x - 1) \implies x - 1 = (x_{0} - 1) e^{\mu s} \end{align} Using third equation on first one $(s = t)$ $$\ln \frac{g(x,t)}{g_{0}(x_{0})} = \frac{\tau}{\mu} (x_{0} - 1) e^{\mu t} \implies g(x,t) = g_{0}\left[ (x-1)e^{-\mu t} + 1 \right] \exp \left\{ \frac{\tau}{\mu} (x - 1) \right\}$$ where we have used, that constant $g_{0}$ can be also $x_{0}$ depended. From boundary condition $g(x,0) = x^{n_{0}}$ we have $$g_{0}[x] = x^{n_{0}} \exp \left\{ - \frac{\tau}{\mu} (x - 1) \right\} \implies g_{0}\left[ (x-1)e^{-\mu t} + 1 \right] = ((x-1)e^{-\mu t} + 1)^{n_{0}} \exp \left\{ - \frac{\tau}{\mu} (x-1)e^{-\mu t} \right\}$$ and so we have $$g(x,t) = \left(1 + (x-1)e^{-\mu t} \right)^{n_0} \exp \left\{ \frac{\tau}{\mu} (x-1)(1-e^{-\mu t}) \right\}$$