Different Solutions to Heat Equation Confusion

I'm currently studying Partial Differential Equations and I'm really now starting to understand why they are quite difficult to understand and solve.

(Please forgive any LaTeX formatting issues. I'm still very much a newcomer to the langauge)

Recently, I've learned about the Heat/Diffusion Equation: $$u_t = ku_{xx}$$

And I've come across the fact that two different types of solutions appear but, to me, they have very different structure. The first solution that I've come across is this: $$u(x,t) = \sum_{n=t}^\infty A_n\,\sin\left(\frac{n\pi x}{L}\right)e^{\frac{-n^2\pi^2 kt}{L^2}},\; \text{where}\;\;\; A_n = \frac{2}{L}\int_{0}^L f(x)\sin\left(\frac{n\pi x}{L}\right)\,dx$$ And the second solution is this: $$u(x,t) = \frac{1}{\sqrt{4k\pi t}} \int_{-\infty}^{\infty} e^{\frac{-(x-y)^2}{4kt}} f(x)\,dx$$

So from here, I've got a few questions:

1. One of the things that I took away from my ODE (Ordinary Differential Equations) class was that there was basically an algorithm to solve the ODEs I was doing. I would always get a solution that was a the sum of a particular and homogenous solution. Then I would use the initial and boundary value conditions to solve for the constants that arise either due to integration or from looking at the problem through the eyes of Linear Algebra.

My question here is does this way of thinking not apply when in the realm of PDEs? Do the initial and boundary conditions change form or structure of solutions?

1. On my PDE journey, I have come across multiple different solution approaches. For first order PDEs, in essence, I really only know the Method of Characteristics/Geometric Method and then some algebraic manipulation and substitutions for other first order linear PDEs so that the Method of Characteristics/Geometric Method can be used. For second order PDEs, I am aware of Separation of Variables, something with Fourier Series, Fourier Transform and Laplace Transform (maybe?), and then the "general" solutions to the heat and wave equations. However, I am absolutely clueless when it comes to knowing when to use a particular solution method for a given problem.

What are the conditions that have to be met? Why choose one method over another?

I can't seem to find answers to these questions. It again, seems to come down to the initial and boundary conditions but I'm not sure

These are my primary sources that I have used to learn PDEs. I've tried textbooks but they are just really dense, especially Strauss' book which is my class book. The only exception is Peter J Olver's PDE book but it still is somewhat confusing at times:

(The third link actually follows my class quite closely and has been the most helpful but still does not answer my 2nd question.)

Any help at all, especially with question 2 would be greatly appreciated! Thank you very much Math Stack Exchange community!

• The first one solves the problem when $u(0,t)=u(L,t)=0$, provided these conditions also hold for the initial data. The second one solves the problem on the whole line, provided the initial data is "nice enough". Regarding your first question, yes, structure is changed by the boundary conditions, though this is true for ODEs also. Regarding the second question...this is complicated, and in most real situations irrelevant, because no such analytic solution method exists anyway.
– Ian
Feb 24 '21 at 20:46
• "Why choose one method over another?" Simply because one method may not work for another type of PDE or because applying a certain method would be an overkill. The most important thing is to solve a PDE, after that comes speed of evaluation. Feb 24 '21 at 20:51