Numerical method for solving equation with $u \frac{\mathrm{d}u}{\mathrm{d}x} + u$

52 Views Asked by At

I'm looking for a finite difference method to solve

$$a(x) u \frac{\mathrm{d}u}{\mathrm{d}x} + u = b(x)$$

where $u(0) = c$.

I tried to do a lagging convergence on the $u$ ie

$$a(x) u^{(n)} \frac{\mathrm{d}u^{(n+1)}}{\mathrm{d}x} + u^{(n+1)} = b(x)$$

But it was very slow to converge and the derivative is extremely noisy.

Are there better methods to solving this? I tried looking at Navier-Stokes literature but did not see anything.