Equation Solving ******************* .. admonition:: More about Equation Solving :class: warning For more about equation solving please refer to another notebook of mine: `Intelligence `_. There are so many methods and techniques to solve an equation. Here we will review only some of them. Ordinary Differential Equations =================================== There are many important equations in physics. .. figure:: assets/2ndODEs.png :align: center Taken from Riley's book. The are many methods to solve an ODE, 1. Green's function. 2. Series solution 3. Laplace transform 4. Fourier transform Green's Function --------------------------- Definition of Green's Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The idea of Green/s function is very simple. To solve a general solution of equation .. math:: \frac{d^2}{d x^2} y(x) + y(x) = f(x), :label: eqn-green-function-example where :math:`f(x)` is the source and some given boundary conditions. To save ink we define .. math:: \hat L_x = \frac{d^2}{dx^2} + 1, which takes a function :math:`y(x)` to :math:`f(x)`, i.e., .. math:: \hat L_x y(x) = f(x). :label: eqn-green-function-example-1 Now we define the Green's function to be the solution of equation :eq:`eqn-green-function-example-1` but replacing the source with delta function :math:`\delta (x-z)` .. math:: \hat L_x G(x,z) = \delta(z-x). Why do we define this function? The solution to equation :eq:`eqn-green-function-example` is given by .. math:: y(x) = \int G(x,z) f(z) dz. To verify this conclusion we plug it into the LHS of equation :eq:`eqn-green-function-example` .. math:: & \left(\frac{d^2}{dx^2} +1 \right) \int G(x,z) f(z) dz \\ =& \int \left[ \left(\frac{d^2}{dx^2} +1 \right) G(x,z) \right] f(z) dz \\ =& \int \delta(z-x) f(z) dz \\ =& f(x), in which we used one of the properties of Dirac delta distribution .. math:: \int f(z) \delta(z-x) dz = f(x). Also note that delta function is even, i.e., :math:`\delta(-x) = \delta(x)`. So all we need to do to find the solution to a standard second differential equation .. math:: \left( \frac{d^2}{dx^2} + p(x) \frac{d}{dx} + q(x) \right)y(x) = f(x) is do the following. 1. Find the general form of Green's function (GF) for operator for operator :math:`\hat L_x`. 2. Apply boundary condition (BC) to GF. This might be the most tricky part of this method. Any ways, for a BC of the form :math:`y(a)=0=y(b)`, we can just choose it to vanish at a and b. Otherwise we can move this step to the end when no intuition is coming to our mind. 3. Continuity at :math:`n-2` order of derivatives at point :math:`x=z`, that is .. math:: G^{(n-2)}(x,z) \vert_{xz} ,\qquad \text{at } x= z. 4. Discontinuity of the first order derivative at :math:`x=z`, i.e., .. math:: G^{(n-1)}(x,z)\vert_{x>z} - G^{(n-1)}(x,z)\vert_{x