Complex Math Simple Life


Second Order Difference Equations

Posted in complex, difference, equation by beauangel on February 19, 2007

Standard Form

a_0y_t + a_1y_{t-1} + a_2y_{t-2} = f(t) or a_0y_{t+2} + a_1y_{t+1} + a_2y_t = f(t)

The solving of a second order difference equation is very similar to the method of solving a second order differential equation, which is discussed in this previous post here.

The General Solution of a second order difference equation has a Complementary Function and a Particular Solution.

The Complementary Function (CF) is found by writing the auxiliary equation

a_0m^2 + a_1m + a_2 = 0 and solving it to find the two roots of such a quadratic equation.

When there are two different roots, m1 and m2, the CF is written as
y_t = A\left( m^t_1 \right) + B \left( m^t_2 \right) where A and B are arbitrary constants.
When there are two equal roots, such that m1 = m2 = m, then the CF is written as
y_t = (A + Bt)m^t.
When there are two complex roots, u + iv and u - iv, then the CF is

y_t = r^t (A \cos t\theta + B \sin t\theta) where r = \sqrt{u^2 + v^2} and \tan \theta = \frac{v}{u}.

Based on the standard form of the second order difference equation, the Particular Solution depends on the form f(t), the function in t on the RHS of the difference equation.

Again, similar to the case of differential equations, the Particular Solution (PS) is the same form as f(t) but contains undetermined coefficients which are determined by comparing them with the function in the RHS of the given difference equation.

If the function is a constant, say c, then the general form of the PS is k, an unknown constant.

If the function is in the form c \left( a^t \right), then the general form of the PS is k\left( a^t \right).

If the function is in the form at+ b, then a general linear function in t, A_1t + A_2, is the general form of the PS.

A homogeneous second order difference equation has zero on the RHS. Its standard form is a_1y_{t+2} + a_2y_{t+1} + a_3y_t = 0.

First Order Difference Equations

Posted in difference, equation by beauangel on February 19, 2007

Standard Form

y_t = a\: y_{t-1} + b where a and b are constants.

The solution of the first order difference equation of the form above is given by the following formula:

y_t = \left( y_o - \frac{b}{1-a} \right) a^t + \frac{b}{1-a} if a \neq 1

y_t = y_0 + b\:t if a = 1 where y_0 is the value of y when t=0.

One of the economic models that employs First Order Difference Equations is the Cobweb model.

In the model, p_{t-1} determines q_t, which in turn determines p_t, according to the rules

q_t = q^S(p_{t-1}), \quad p_t = p^D(q_t)

where q^S is the supply function and p^D the inverse demand function.

II Order Differential Equations with Constant Coefficients

Posted in differential, equation by beauangel on February 17, 2007

Standard Form

a_0 \frac{d^2y}{dx^2} + a_1 \frac{dy}{dx} + a_2y = f(x) where a_0, a_1, a_2 are constants.

The general solution of such a differential equation contains two parts; the Complementary Function and the Particular Integral.

To find the Complementary Function:

Write the auxiliary equation in the form: a_0m^2 + a_1m + a_2 =0 where the differential equation is in the standard form.

Solving the auxiliary equation, a quadratic, will yield two roots, say m1 and m2.

The Complementary Function (CF) is then written based on the roots.

  • If m1 and m2 are real and different, then the CF is y = Ae^{m_1x} + Be^{m_2x}
  • If m1 and m2 are real and equal, ie m1 = m2 = m, then the CF is y = (A + Bx)e^{mx}
  • If m1 and m2 are complex roots of the form \alpha + i\beta and \alpha - i\beta, then the CF is y = e^{\alpha x} (A \cos \beta x + B \sin \beta x) where A and B are arbitrary constants.

The Particular Integral is similar to the function of x, f(x) on the RHS of the differential equation and it is determined by the method of undetermined coefficients.

If the RHS of the equation is a constant, then we use a trial PI of K (a different constant). A trial PI of a general first degree form A_0x +A_1 and a general second degree form A_0x^2 + A_1x + A_2 is used for functions of ax + b and ax^2 + bx +c respectively. If the function is of the form be^{ax}, then we use Ke^{ax}, the same exponential function. Similarly, trigonometric functions will have trial PIs of the form L \cos bx + K \sin bx.

K, L, A_0, A_1, A_2 are undetermined coefficients. By finding \frac{dy}{dx} and \frac{d^2y}{dx^2} and substituting y, \frac{dy}{dx} and \frac{d^2y}{dx^2} into the given differential equation, the values of the undetermined coefficients can be obtained. Hence the Particular Integral is found.

Combine the Complementary Function and the Particular Integral and we will get the General Solution of the Second Order Differential Equation with constant coefficients.

I Order Differential Equations Part II

Posted in differential, equation by beauangel on February 17, 2007

Linear Differential Equations

Standard Form:

\frac{dy}{dx} + p\:y = Q(x) where p and Q are functions of x.

To solve this type of differential equation, we multiply the equation throughout by the factor e^{\int p dx} called the Integrating Factor and hence convert the LHS into an exact differential.

Multiplying throughout by e^{\int p dx}, we get

e^{\int p dx}. \frac{dy}{dx} + e^{\int p dx}.p\:y = Q\:e^{\int p dx}

which becomes

\frac{d}{dx} \left( e^{\int p dx}y \right) = Qe^{\int p dx}

Integrating both sides w.r.t x, we get

\int \frac{d}{dx} = \int Q e^{\int p dx}dx

ie, e^{\int p dx}y = \int Q e^{\int p dx}dx

Therefore, the formula for the General Solution of a Linear Differential Equation is:

ye^{\int p dx} = \int Q e^{\int p dx}dx

I Order Differential Equations Part I

Posted in differential, equation by beauangel on February 16, 2007

Standard Form

\frac{dy}{dx} = f(x).g(x)

To solve:

  • Make sure that the given differential equation is in the standard form of a variable separable equation.
  • Collect the function of x and the differential dx to one side and the function of y and dy to the other side of the differential equation.
  • Integrate both sides with respect to the corresponding variables and get the solution. Add the constant of integration to one side.

An example

Find the solution of the differential equation

\frac{dy}{dx}= \frac{(x^2+1\sqrt{y^3+1}}{xy^2}, given that y^3=\tfrac{5}{4} when x = e.

\frac{y^2}{\sqrt{y^3+1}}\frac{dy}{dx} = \frac{(x^2+1)}{x}dx

\therefore \int (y^3+1)^{- \tfrac{1}{2}}.y^2 dy = \int \frac{(x^2+1)}{x}dx

\frac{1}{3} \frac{(y^3+1)^{\tfrac{1}{2}}}{1/2} = \frac{x^2}{2} + \ln x + c

\therefore the general solution:

\frac{2}{3}\sqrt{y^3+1} = \frac{1}{2}x^2+\ln x+c

Given: when x=e, y^3 = \tfrac{5}{4}

Substituting, we get \frac{2}{3}\sqrt{\frac{5}{4}+1} = \frac{1}{2}e^2 + \ln e +c

\frac{2}{3}\sqrt{\frac{9}{4}} = \frac{1}{2}e^2 + 1 + c

\left( \frac{2}{3}\right) \left( \frac{3}{2}\right) = \frac{1}{2}e^2 + 1 + c

1 = \frac{1}{2}e^2 + 1 + c

\therefore c = -\frac{1}{2}e^2

the particular solution:

\frac{2}{3}\sqrt{y^3+1} = \frac{1}{2}x^2 + \ln x - \frac{1}{2}e^2

ie, \frac{2}{3}\sqrt{y^3+1} = \frac{1}{2}(x^2-e^2) + \ln x.

De Moivre’s Formula

Posted in complex, de moivre, theorem, trigonometry by beauangel on January 17, 2007

For any complex number (and in particular any real number) x, and any integer n,

\left( \cos x + i \sin x \right)^n = \cos (nx) + i \sin (nx)

This is the equation that Abraham de Moivre came up with to link two branches of mathematics together, that of trigonometry and complex numbers.

This formula can be used to find the nth root of a complex number say z.

Written in polar form,

z = r (\cos x + i \sin x)

then,

 z^{\tfrac{1}{n}} = \left( r(\cos x + i \sin x) \right)^{\tfrac{1}{n}} = r^{\tfrac{1}{n}} \left\{ \cos \left( \frac{x+2k\pi}{n} \right) + i \sin \left( \frac{x+2k\pi}{n} \right)\right\}

where k varies from 0 to n — 1 to give the n roots of the complex number.