Month: August 2026

  • Building the Sine Function Term by Term

    In this post we will solve the following basic second-order equation with corresponding initial conditions:

    \displaystyle y'' = -y, \qquad y(0) = 0, \qquad y'(0)=1

    This equation can be solved very easily exactly. The answer is y(x) = sin(x). Now, let’s pretend that we don’t know how to solve this equation exactly. We introduce a parameter \epsilon and consider the family of equations

    \displaystyle y'' = -\epsilon y
    \displaystyle y'' +\epsilon y = 0

    and the function y(x) in the form:

    \displaystyle y_{\epsilon}(x) = a_0(x) + a_1(x)\epsilon + a_2(x)\epsilon^2 + a_3(x)\epsilon^3 + ...
    \displaystyle y_{\epsilon}''(x) = a_0''(x) + a_1''(x)\epsilon + a_2''(x)\epsilon^2 + a_3''(x)\epsilon^3 + ...

    The differential equation becomes (up to three terms):

    \displaystyle y'' +\epsilon y = 0
    \displaystyle a_0''(x) + a_1''(x)\epsilon + a_2''(x)\epsilon^2 + a_3''(x)\epsilon^3 + \epsilon (a_0(x) + a_1(x)\epsilon + a_2(x)\epsilon^2 + a_3(x)\epsilon^3) = 0
    \displaystyle a_0''(x) + (a_1''(x) + a_0(x))\epsilon + (a_2''(x) + a_1(x))\epsilon^2 + (a_3''(x) + a_2(x)) \epsilon^3 = 0

    This implies that:

    \displaystyle a_0''(x) = 0 \implies a_0(x) = x
    \displaystyle a_1''(x) + x = 0 \implies a_1(x) = -\frac{1}{3!}x^3
    \displaystyle a_2''(x) -\frac{1}{3!}x^3 = 0 \implies a_2(x) = \frac{1}{5!}x^5
    \displaystyle a_3''(x) +\frac{1}{5!}x^5 = 0 \implies a_3(x) = -\frac{1}{7!}x^7

    and

    \displaystyle y_{\epsilon}(x) = x -\frac{1}{3!}x^3 \epsilon + \frac{1}{5!}x^5 \epsilon^2 - \frac{1}{7!}x^7 \epsilon^3

    Setting \epsilon =1 to recover the original problem leads to:

    \displaystyle y_{\epsilon}(x) = x -\frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \frac{1}{7!}x^7

    which corresponds to the first terms of the Taylor series of sin(x) (the exact solution).