I'm trying to do discretization to the following system:$\frac{{\partial \rho }}{{\partial t}} =  - \frac{{\partial \rho }}{{\partial x}}u - \rho \frac{{\partial u}}{{\partial x}}$$\frac{{\partial u}}{{\partial t}} =  - u\frac{{\partial u}}{{\partial x}} - \frac{\partial }{{\partial x}}\left[- {\frac{1}{{\sqrt \rho  }}\frac{{{\partial ^2}(\sqrt \rho  )}}{{\partial {x^2}}}} \right]$with the boundary conditions: $\rho (x,t = 0),\,\,\,\,u(x,t = 0)$For the first equation everything is good:$\frac{{\rho _i^{n + 1} - \rho _i^n}}{{\Delta t}} =  - \frac{{\rho _{i + 1}^n - \rho _i^n}}{{\Delta x}}u_i^n - \rho _i^n\frac{{u_{i + 1}^n - u_i^n}}{{\Delta x}}$And I can explicitly solve for $\rho _i^{n + 1}$.But for the second equation. i'm struggling with the term:$\frac{\partial }{{\partial x}}\left[ { - \frac{1}{{\sqrt \rho  }}\frac{{{\partial ^2}}}{{\partial {x^2}}}\left( {\sqrt \rho  } \right)} \right]$So my questions are as follows:Should I use the chain rule in a straight forward manner like this:$\frac{\partial }{{\partial x}}\left[ { - \frac{1}{{\sqrt \rho  }}\frac{{{\partial ^2}}}{{\partial {x^2}}}\left( {\sqrt \rho  } \right)} \right] = \frac{1}{\rho }\left[ { - \frac{1}{{2{\rho ^2}}}{{\left( {\frac{{\partial \rho }}{{\partial x}}} \right)}^3} + \frac{1}{\rho }\left( {\frac{{\partial \rho }}{{\partial x}}} \right)\left( {\frac{{{\partial ^2}\rho }}{{\partial {x^2}}}} \right) - \frac{1}{{2\rho }}\left( {\frac{{{\partial ^3}\rho }}{{\partial {x^3}}}} \right)} \right]$and afterwards discretize the derivatives using forward Euler like in the first equation ?If I'm using the approach above, how should I calculate the third derivative ?Should I use some other clever way to discretize the term ? maybe calculating the square root of $\rho$ before hand ? I don't know if it's more efficient that way
Discretization of a multi-function term
numerical analysis;finite difference;hyperbolic pde