As we see, to minimize the error we need to calculate derivative of *Ψt**(x), *our trial solution which contains neural network and terms that contain boundary conditions*. *In the paper (1) there is exact formula for NN derivatives, but whole trial solution can be too big to take derivatives by hand and hard-code them. We will use more elegant solution later, but for the first time we can code it: