We are looking at the equation $$ \partial_t u+a(x) \partial_x u=g(x, t), \quad x \in[-2,2] $$ with $$ a(x)= \begin{cases}1.5 & |x| \leq 0.5 \\ 1 & \text { otherwise }\end{cases} $$ We are asked to derive $g(x,t)$ such that $u(x, t)=\sin (\pi(x-a(x) t))$ is the exact solution to the PDE. The context is DGFEM.
The word "exact" is confusing to me, the above solution satisfies the PDE weakly with $g(x,t)=0$ as one can simply split the integral into the different constant advection speeds and then get 0 inside each integral.
However, using something like method of charactericts with g(x,t)=0 you clearly get different solution as the wave travels faster in the middle it does not simply "jump" to a part further down the sine wave. As such we also obtain a different solution when using DGFEM to solve the PDE numerically.
There might just be something wrong with the exercise, but if there is I would at least like to know why. If everything was smooth, one could simply insert the solution to get the right hand side and thus any solution could work. I am also curious about uniqueness of weak solutions, as there clearly exists multiple here. Thank you!