.. _greens-function: Green's Function ================== .. index:: Green's Function Green's Function for Second Order Differential Equations ---------------------------------------------------------- A general form of second order differential equations is written as .. math:: L[y] \equiv y'' + p(x) y' + q(x) y = f(x), for :math:`a\xi \end{cases} The boundary conditions give us .. math:: G(x\vert \xi) = \begin{cases} c x, &\quad x<\xi \\ d(x-1). & \quad x>\xi \end{cases} We also know that the Green's functon must be continuous, we then require .. math:: c\xi = d (\xi -1). Using the discontinuity of the first order derivative of the Green's function, we get .. math:: d_x d (x-1)- d_x cx = 1. With all these equation, we determine the Green's function, .. math:: G(x\vert\xi) = \begin{cases} (\xi -1 ) x , & \qquad x<\xi \\ \xi(x-1). & \qquad x>\xi \end{cases} To get the solution to :math:`y`, we integrate over :math:`\xi`, .. math:: y(x) &= \int_0^1 G(x\vert \xi) f(\xi) d\xi \\ & = (x-1)\int_0^x \xi f(\xi) d\xi + x \int_x^1 (\xi -1) f(\xi) d\xi . It is that easy. This is the super power of the Green's function.