# Missing integration constants in solution to PDE

I am attempting to obtain the analytical solution (if possible) to the following:

$$a w^{(1,0)}(x,t)+b w^{(0,1)}(x,t)=p(x)+g w(x,t)$$ $$I.C.: w(x,0)=0 | B.C.: w(0,t)=z(t)$$

Clear["Global*"]
a = v;
b = 1;
g = -\[Lambda];
p = \[Psi]*Cos[Pi*x];
ic = w[x, 0] == 0;
bc = w[0, t] == z[t];
pde = a*D[w[x, t], x] + b*D[w[x, t], t] == g*w[x, t] + p
DSolve[pde, w[x, t], {x, t}]


$$\left\{\left\{w(x,t)\to \frac{e^{-\frac{\lambda x}{v}} \left(\pi ^2 v^2 c_1\left(\frac{t v-x}{v}\right)+\lambda ^2 c_1\left(\frac{t v-x}{v}\right)+\pi v \psi \sin (\pi x) e^{\frac{\lambda x}{v}}+\lambda \psi \cos (\pi x) e^{\frac{\lambda x}{v}}\right)}{\lambda ^2+\pi ^2 v^2}\right\}\right\}$$

However, the solution returned only has 1 integration constant, c_1, rather than the 2 I expected (i.e., an initial condition and a boundary condition). Thus, when I attempt the next step to apply the conditions I can only apply one, leading to an erroneous/incomplete solution.

Any guidance would be greatly appreciated. Using v11.2.

Update

Apparently c_1 is really a function and not a constant. In that case I am still left wondering how to proceed. There is a soluction when solving for IC OR BC but not both. Ideas/tricks on how to proceed?

DSolve[{pde, ic}, w[x, t], {x, t}]


$$\left\{\left\{w(x,t)\to \frac{\psi e^{-\frac{\lambda x}{v}} \left(-\pi v e^{\frac{\lambda (x-t v)}{v}} \sin (\pi (x-t v))-\lambda e^{\frac{\lambda (x-t v)}{v}} \cos (\pi (x-t v))+\pi v \sin (\pi x) e^{\frac{\lambda x}{v}}+\lambda \cos (\pi x) e^{\frac{\lambda x}{v}}\right)}{\lambda ^2+\pi ^2 v^2}\right\}\right\}$$

DSolve[{pde, bc}, w[x, t], {x, t}]


$$\left\{\left\{w(x,t)\to \frac{e^{-\frac{\lambda x}{v}} \left(-\lambda \psi +\pi ^2 v^2 z\left(\frac{t v-x}{v}\right)+\lambda ^2 z\left(\frac{t v-x}{v}\right)+\pi v \psi \sin (\pi x) e^{\frac{\lambda x}{v}}+\lambda \psi \cos (\pi x) e^{\frac{\lambda x}{v}}\right)}{\lambda ^2+\pi ^2 v^2}\right\}\right\}$$

DSolve[{pde, ic, bc}, w[x, t], {x, t}]


$$\text{DSolve}\left[\left\{v w^{(1,0)}(x,t)+w^{(0,1)}(x,t)=\psi \cos (\pi x)-\lambda w(x,t),w(x,0)=0,w(0,t)=z(t)\right\},w(x,t),\{x,t\}\right]$$

• You get function c1[t], not only a constant! – Ulrich Neumann Aug 3 at 15:05
• If you look at the StandardForm or FullForm of the solution you can see that C is an arbitray function rather than an arbitrary constant. – Bob Hanlon Aug 3 at 15:06
• Hmm, interesting. I would have never guessed that. – Scott G Aug 3 at 15:38
• Do the IC and BC apply to all values of $x$ and $t$, or just $x >0$ and $t > 0$? If it's the latter, then I think the ICs and BCs can be both be satisfied. If the former, they probably can't. (The solution along any characteristic is determined by its intersections with the IC and/or BC surface, and if the characteristics intersect said surfaces more than once, the solutions are overdetermined.) – Michael Seifert Aug 3 at 16:57
• Note that the code does work if you replace z[t] with a known function such as Sin[t]. – Michael Seifert Aug 3 at 18:43

While Mathematica does not seem to be able to solve the problem for a general unknown boundary condition $$w(0,t) = z(t)$$, it can generally solve it if $$z(t)$$ is replaced by a known function such as $$\sin(t)$$:

Clear["Global*"]
a = v;
b = 1;
g = -\[Lambda];
p = \[Psi]*Cos[Pi*x];
ic = w[x, 0] == 0;
bc = w[0, t] == Sin[t];
pde = a*D[w[x, t], x] + b*D[w[x, t], t] == g*w[x, t] + p
DSolve[{pde, bc, ic}, w[x, t], {x, t}]


Replacing $$z(t)$$ with a polynomial also results in a solution fairly quickly. I also tried $$z(t) = \ln(1+t)$$, which took longer but did eventually return a solution as well.

• Disclaimer: I believe this is the code I used when I tested it out two days ago. But I've got both my Mathematica kernels working on another problem right now and so I haven't personally tested this version. It should work, but let me know if it doesn't. – Michael Seifert Aug 5 at 21:04
• I double checked it and it works. – Scott G Aug 5 at 21:08