I solved/analyzed the below PDE
$$\left\{\begin{matrix} u_x+u_y+u=e^{x+2y}\\ u(x,0)=0 \end{matrix}\right.$$
and have a question to the one of the steps involving the integration, see below
Using method of characteristic $$ \frac{dx}{dt}=1, \ \ \frac{dy}{dt}=1, \ \ \frac{du}{dt}=-u+e^{x+2y} $$
from the first and second ODE $$ dx=dy, \quad y=x+c. \quad c=y-x$$
and from the first and third ODE $$\frac{du}{-u+e^{x+2y}}=dx$$ which gives $$u_x+u=e^{x+2y}$$ multiplying both sides by $e^x$ and using product rule gives $$(e^x u)'=e^{2y+x}$$ substituting for y=x+c $$(e^x u)'=e^{3x+2c}$$ integrating both sides $$e^x u = \frac{1}{4} e^{4x+2c}+ \color{red}{f(c)}$$
Question:
The only way to get the correct general solution is to add f(c) as the constant part of the above integration. My question is how do one know it should be a function of c f(c) and not just some constant c here? Using c only gives a different equation.
Furhter substituting for c gives the general solution to the PDE $$u(x,y)=\frac{1}{4} e^{x+2y}+e^{-x}f(y-x)$$
Using the initial condition one can get the specific solution $$u(x,y)=\frac{1}{4} e^{x+2y}+\frac{1}{4} e^{x-2y}$$