Recently, I was able to solve the following (partial differential equations) initial value problem which we will call $(*)$:
\begin{cases} u_t+b \cdot (D_{x}u)+cu = h(x,t)&\text{in }\, \mathbb{R}^{n} \times (0, \infty)\\ u(x,0) = g(x)&\text{on }\, \mathbb{R}^{n} \times \{t =0\}\\ \end{cases}
by finding an explicit formula for a function $u(x,t)$ (note that $b \in \mathbb{R}^{n}$ is a constant vector and $c \in \mathbb{R}$). By using the method of characteristics (which reduces the problem to an ordinary differential equation), I was able to determine that $$u(x,t) = u(x-bt,0)e^{-ct} = g(x-bt)e^{-ct}$$ is an explicit formula for any point $(x,t) \in \mathbb{R}^n$. However, after further reading I started formulating a question I was not able to answer simply by looking up pointers:
Question:
How would we solve the same initial value problem but instead of $c \in \mathbb{R}$ being a constant we have a function $f: \mathbb{R}^{n} \times [0,t) \to \mathbb{R}$ in its place such that the problem becomes:
\begin{cases} u_t+b \cdot (D_{x}u)+f(x,t)u = h(x,t)&\text{in }\, \mathbb{R}^{n} \times (0, \infty)\\ u(x,0) = g(x)&\text{on }\, \mathbb{R}^{n} \times \{t =0\}\\ \end{cases}
What steps would I take to find a function $u(x,t)$ that satisfies this? I am assuming $u(x,t)$ will be similar to the function I found for the original problem but with some additional integrals (after playing with it for a little), but I am unsure.
I am fairly new to partial differential equations so any help will be appreciated.
Note: Here is my work for $(*)$: let $u(x,t)$ be a solution to the equation along the vector $(b,1) := (b_{1},...,b_{n},1)$. Therefore, defining $z(s) := u(x+bs, t+s)$ such that $$\frac{dz}{dt}(s) = u_{t}(x+bs, t+s) + b \cdot D_{x}u(x+bs, t+s) = -cz(s).$$ So for all $(x,t) \in \mathbb{R}^{n}$ we have that $$u(x,t) = u(x-bt, 0)e^{-ct} = g(x-bt)e^{-ct}.$$
I'll illustrate with $n=2$, but of course this process is true for any dimension. I'll also adopt the $t,x$ convention, i.e writing $u(t,x_1,x_2)$. Writing the equation in typical form, and giving it some general initial data $$\partial_tu+b_1\partial_1u+b_2\partial_2u=h-f~u \\ u(\boldsymbol\gamma(r_1,r_2))=\varphi(r_1,r_2)$$ Where $\boldsymbol\gamma:\mathbb R^2\to\mathbb R^3$ is a parametric surface in $(t,\boldsymbol x)$ space (parameterized by, in this case, I am using $\boldsymbol{r}$ as the parameters). In our example of course $$\boldsymbol\gamma(r_1,r_2)=(0,r_1,r_2)$$ We write our characteristic equations, where I have introduced the notations $\boldsymbol x=(x_1,x_2)$, $\boldsymbol b=(b_1,b_2)$ and $\boldsymbol r=(r_1,r_2)$ to save space $$\partial_st(\boldsymbol{r},s)=1 \\ \partial_s\boldsymbol{x}(\boldsymbol{r},s)=\boldsymbol{b} \\ \partial_s v(\boldsymbol{r},s)=h(t(\boldsymbol r,s),\boldsymbol x(\boldsymbol r,s))-f(t(\boldsymbol r,s),\boldsymbol x(\boldsymbol r,s))~v(\boldsymbol{r},s)$$ Coupled with the initial data $$t(\boldsymbol{r},0)=0 \\ \boldsymbol x(\boldsymbol{r},0)=\boldsymbol{r} \\ v(\boldsymbol{r},0)=\varphi(\boldsymbol{r})$$ I have chosen $v$ as the function so that, once we have inverted these expressions to find $\boldsymbol r(t,\boldsymbol x),s(t,\boldsymbol x)$ that $$u(t,\boldsymbol x)=v(\boldsymbol r(t,\boldsymbol x),s(t,\boldsymbol x))$$ Your equation in your comment is not quite right. Forgetting some rigor when it comes to arguments, it should read roughly $$v'(s)=h(x,t)-f(x,t)v(s)$$ Not just $$v'(s)=-f(x,t)v(s)$$