To get rid of the inhomogeneous boundary conditions at and
, use the following trick:
Trick: Find any function that satisfies the inhomogeneous
boundary conditions at
and
and substract it from
.
The remainder, call it
, will have homogeneous boundary
conditions.
So, we try to find a that satisfies the same boundary
conditions as
:
A linear function of works:
You could use something more complicated than a linear function if you
like to make things difficult for yourself. Go ahead and use
if you really love to integrate error functions
and Bessel functions. It will work. I prefer a linear function
myself, though. (For some problems, you may need a quadratic instead
of a linear function.)
Under certain conditions, there may be a better choice than a low
order polynomial in . If the problem has steady boundary
conditions and a simple steady solution, go ahead and take
to be
that steady solution. It will work great. However, in this case the
boundary conditions are not steady; we are assuming that
and
are arbitrary given functions of time.
Having found , define a new unknown
as the remainder when
is substracted from
:
To do so, first, of course, we need the problem for to solve. We
get it from the problem for
by everywhere replacing
by
. Let's take the picture of the problem for
in front
of us and start converting.
First take the boundary conditions at and
:
We continue finding the rest of the problem for . We replace
by
into the PDE
,
The final part of the problem for that we have not converted yet
is the initial condition. We replace
by
in
,
The problem for is now the same as the one for
, except that
the boundary conditions are homogeneous and functions
and
have
changed into known functions
and
.
Using separation of variables, we can find the solution for in
the form: