I know the method of constructing solutions. For example I have a BVP:
$$ u_{xx} + u = 0 $$ subjected to: $$ u_{x}(0) = f_1, $$ $$ u_{x}(1) = f_2 $$
If I want to check the correctness of my numerical implementation, just plug in $u(x) = \sin(x)$ and then $f_1 = \cos(0), f_2 = \cos(1)$ and then run the script for implementation. If the graphs of the numerical solution and that of $u(x) = \sin(x)$ approximately matches then I have the correct implementation.
This may present some problems when constructing solutions with not-so-simple differential equations. Currently I am having trouble finding one for: $u_t = ku_{xx}$.
Are there any other methods or is there a simple function for this one?