# Solve wave equation with non-constant wave speed using method of characterstics?

I am trying to get a better understanding of wave pulses in a domain with a non-constant wave speed. I am trying to solve either one of the two equations: $$\frac{\partial^2u}{\partial t^2}-c(x)^2\frac{\partial^2u}{\partial x^2}=0,$$ $$\frac{\partial^2b}{\partial t^2}-\frac{\partial}{\partial x}\left(c(x)^2\frac{\partial b}{\partial x}\right)=0.$$ These equations describe the velocity, $$u$$, and magnetic field, $$b$$, amplitude of an Alfvén wave. Ideally, we would solve one of these equations by the method of characteristics and not separation of variables as I find solutions to the method of characteristics easier to interpret for this problem. I have found a way to nearly factorise the second equation's operator: $$\left(\frac{\partial}{\partial t}+c(x)\frac{\partial}{\partial x}\right)\left(\frac{\partial}{\partial t}-c(x)\frac{\partial}{\partial x}\right)=\frac{\partial^2}{\partial t^2}-c(x)\frac{\partial}{\partial x}\left(c(x)\frac{\partial}{\partial x}\right),$$ however, it is not quite what we require. But we are only missing a factor two in the last term if the derivatives are fully expanded. Does anyone know a change of variables we could do to make this factorisation work? Does anyone know any forms $$c(x)$$ could take such that nice analytic solutions can be obtained? I am really trying to study under what conditions a wave reflects and how much reflects so a $$c(x)$$ which gives reflection, for example $$c(x)=2+\tanh(x)$$, would be ideal. I am interested to know if anyone has any nice analytic solutions for some $$c(x)\neq\text{constant}$$.