Monthly Archives: November 2010

Differential Equations: Worked Examples Using Integrating Factor

$$\frac{dy}{dx} – 2y = 3x + 1$$
$$e^{ \int \! -2 \ dx } = e^{-2x}$$
$$e^{-2x} \frac{dy}{dx} – 2 e^{-2x} y = e^{-2x} \left( 3x + 1 \right)$$
$$\frac{d}{dx} \left( e^{-2x} y \right) = 3 x e^{-2x} + e^{-2x}$$
$$e^{-2x} y + C = \int \! 3 x e^{-2x} \ dx + \int \! e^{-2x} \ dx$$
$$e^{-2x} y = \int \! 3 x e^{-2x} \ dx – \frac{1}{2}e^{-2x} + K \ \ where \ \ K = \left( C_0 – C \right)$$

\( \int \! 3 x e^{-2x} \ dx \)

\( u = 3x \)

\( du = 3 \ dx \)

\( dv = e^{-2x} \ dx \)

\( v = – \frac{1}{2}e^{-2x}\)

\( \int \! 3 x e^{-2x} \ dx = – \frac{3}{2}xe^{-2x} + \int \! \frac{3}{2}e^{-2x} \ dx \)

\( \int \! 3 x e^{-2x} \ dx = – \frac{3}{2}xe^{-2x} – \frac{3}{4}e^{-2x} + C_1 \)

$$e^{-2x} y = – \frac{3}{2}xe^{-2x} – \frac{5}{4}e^{-2x} + C_2 \ \ where \ \ C_2 = \left( K + C_1 \right)$$
$$y \left( x \right) = – \frac{3}{2}x – \frac{5}{4} + C_2e^{2x}$$

 

$$\frac{dy}{dx} + \cos \left(x \right) y = \cos x$$
$$\mu = e^{ \int \! \cos x \ dx } = e^{ \sin x }$$
$$e^{ \sin x } \frac{dy}{dx} + e^{ \sin x } \cos \left(x \right) y = e^{ \sin x } \cos x$$
$$\frac{d}{dx} \left( e^{ \sin x } y \right) = e^{ \sin x } \cos x$$
$$\left( e^{ \sin x } y \right) = \int \! e^{ \sin x } \cos x \ dx + C$$

\( v = \sin x \)

\( dv = \cos x \ dx \)

\( \int \! e^v \ dv = e^v + K = e^{ \sin x } + C_1\)

$$\left( e^{ \sin x } y \right) = e^{ \sin x } + C_1 + C = e^{ \sin x } + C_2$$
$$y \left( x \right) = 1 + C_2 e^{ – \sin x }$$

Darboux Integral

Since the Completeness Property demands

$$L \left( f, \ P \right) \le \sup_P L \left( f, \ P \right) \le \inf_Q U \left( f, \ Q \right) \le U \left( f, \ Q \right)$$

the following definition for the Darboux Integral can be given. If \( f : \left[ a, \ b \right] \rightarrow \mathbb{R} \) is a bounded function then the Upper Darboux Integral is

$$\overline{ \int_a^b } f = \inf_Q U \left( f, \ Q \right)$$

Similarly, the Lower Darboux Integral is

$$\underline{ \int_a^b } f = \sup_P L \left( f, \ P \right)$$

Moreover, by definition

$$\underline{ \int_a^b } f \le \overline{ \int_a^b } f$$

Let \( f : \left[ a, \ b \right] \rightarrow \mathbb{R} \) be a bounded function on \( \left[ a, \ b \right] \). If

$$\overline{ \int_a^b } f = \underline{ \int_a^b } f$$

then the Darboux integral is

$$\int_a^b f = \overline{ \int_a^b } f = \underline{ \int_a^b } f$$

It is the case that \( f \) is Riemann integrable. Skip to the section on Riemann Sums for further discussion.

Comparing Upper & Lower Darboux Sums

If \( f : \left[ a, \ b \right] \rightarrow \mathbb{R} \) is a bounded function then for any partition \(P\) of \( \left[ a, \ b \right] \) by definition

$$m = \inf_{\left[ a, \ b \right]} f \left( x \right)$$
$$m_i = \inf_{\left[ x_{i-1}, \ x_i \right]} f \left( x \right)$$
$$M_i = \sup_{\left[ x_{i-1}, \ x_i \right]} f \left( x \right)$$
$$M = \sup_{\left[ a, \ b \right]} f \left( x \right)$$

and

$$m \le m_i \le M_i \le M$$

So by definition

$$m \left( b – a \right) \le L \left( f, \ P \right) \le U \left( f, \ P \right) \le M \left( b – a \right)$$

The above result suggests that \(P\) could be the refinement of some other partition. Consider the notion that the Lower & Upper Darboux Sums are defined using different partitions. Let

$$L \left( f, \ P \right)$$
$$U \left( f, \ Q \right)$$

Is it the case that \(L \left( f, \ P \right) \le U \left( f, \ Q \right)\)? If so then it is the case that any Upper Darboux sum is an upper bound for the set of all Lower Darboux sums. Similarly, any Lower Darboux sum will be a lower bound for the set of Upper Darboux sums.

Consider a refinement of both \( P \) and \( Q \), namely, \( R = P \cup Q \). Since any refinement \( R \) of \( P \) yields

$$L \left( f, \ P \right) \le L \left( f, \ R \right)$$

Since any refinement \( R \) of \( Q \) yields

$$U \left( f, \ R \right) \le U \left( f, \ Q \right)$$

Therefore, it is true that

$$L \left( f, \ P \right) \le L \left( f, \ R \right) \le U \left( f, \ R \right) \le U \left( f, \ Q \right)$$

Moreover, the Completeness Property of the Real Numbers states that every nonempty set of real numbers bounded above must have a least upper bound. Similarly, every nonempty set of real numbers that is bounded below must have a greatest lower bound. Let

$$A = \sup_P L \left( f, \ P \right)$$

and

$$B = \inf_Q U \left( f, \ Q \right)$$

Therefore, it must be the case that

$$L \left( f, \ P \right) \le A \le B \le U \left( f, \ Q \right)$$

Lower Darboux Sum

If \( f : \left[ a, \ b \right] \rightarrow \mathbb{R} \) is a bounded function then for an arbitrary partition of \(\left[ a, \ b \right]\) let

$$m = \inf_{\left[ a, \ b \right]} f \left( x \right)$$

and

$$m_i = \inf_{\left[ x_i, \ x_{i-1} \right]} f \left( x \right)$$

The Lower Darboux sum is defined as

$$L \left( f, \ P \right) = \sum_{i=1}^n m_i \left( x_i – x_{i-1} \right)$$

Note that \(f\) needs to be defined on \(\left[ a, \ b \right]\) but it does not have to be continuous. The following diagrams illustrate possible Lower Darboux sums. The diagrams should be understood as representative but not as definitive.

graphics coming soon

Notice that if \(P\) is any partition of \( \left[ a, \ b \right] \) then \( m \left( b-a \right) \le L \left( f, \ P \right) \). By definition \( m \le m_i \) therefore,

$$m \sum_{i=1}^n \left( x_i – x_{i-1} \right) = \sum_{i=1}^n m \left( x_i – x_{i-1} \right) \le \sum_{i=1}^n m_i \left( x_i – x_{i-1} \right)$$

it is the case that

$$\sum_{i=1}^n \left( x_i – x_{i-1} \right) = \left( x_1 – x_0 \right) + \left( x_2 – x_1 \right) + \left( x_3 – x_2 \right) + \dots + \left( x_{n-1} – x_{n-2} \right) + \left( x_n – x_{n-1} \right) = \left( x_n – x_0 \right) = \left( b – a \right)$$

therefore, \( m \left( b-a \right) \le L \left( f, \ P \right) \) as claimed.

If the partition \( P \) of the above graphics are refined to a partition \( R \) then

graphics coming soon

From the above diagrams it seems reasonable to suggest \( L \left( f, \ P \right) \le L \left( f, \ R \right) \).

Consider an arbitrary interval in \( P \), \( \left[ x_{i-1}, \ x_i \right] \) refined into \( \left[ x_{i-1}, \ t \right] \cup \left[ t, \ x_i \right] \). Let

$$m_{t^{-}} = \inf_{\left[ x_{i-1}, \ t \right]} f \left( x \right)$$
$$m_{t^{+}} = \inf_{\left[ t, \ x_i \right]} f \left( x \right)$$

By definition

$$m_i \le m_{t^{-}}$$
$$m_i \le m_{t^{+}}$$

The area of the refinement of is

$$m_i \left( x_i – x_{i-1} \right) = m_i \left( t – x_{i-1} \right) + m_i \left( x_i – t \right) \le m_{t^{-}} \left( t – x_{i-1} \right) + m_{t^{+}} \left( x_i – t \right)$$

Hence, reasoning inductively it is indeed true that

$$L \left( f, \ P \right) \le L \left( f, \ R \right)$$

Upper Darboux Sum

If \( f : \left[ a, \ b \right] \rightarrow \mathbb{R} \) is a bounded function then for an arbitrary partition of \(\left[ a, \ b \right]\) let

$$M = \sup_{\left[ a, \ b \right]} f \left( x \right)$$

and

$$M_i = \sup_{\left[ x_{i-1}, \ x_i \right]} f \left( x \right)$$

The Upper Darboux sum is defined as

$$U \left( f, \ P \right) = \sum_{i=1}^n M_i \left( x_i – x_{i-1} \right)$$

Note that \(f\) needs to be defined on \(\left[ a, \ b \right]\) but it does not have to be continuous. The following diagrams illustrate possible Upper Darboux sums. The diagrams should be understood as representative but not as definitive.

graphics coming soon

Notice that if \(P\) is any partition of \( \left[ a, \ b \right] \) then \( U \left( f, \ P \right) \le M \left( b-a \right) \). By definition \( M_i \le M \) therefore,

$$\sum_{i=1}^n M_i \left( x_i – x_{i-1} \right) \le \sum_{i=1}^n M \left( x_i – x_{i-1} \right) = M \sum_{i=1}^n \left( x_i – x_{i-1} \right)$$

it is the case that

$$\sum_{i=1}^n \left( x_i – x_{i-1} \right) = \left( x_1 – x_0 \right) + \left( x_2 – x_1 \right) + \left( x_3 – x_2 \right) + \dots + \left( x_{n-1} – x_{n-2} \right) + \left( x_n – x_{n-1} \right) = \left( x_n – x_0 \right) = \left( b – a \right)$$

therefore, \( U \left( f, \ P \right) \le M \left( b-a \right) \) as claimed.

If the partition \( P \) of the above graphics are refined to a partition \( R \) then

graphics coming soon

From the above diagrams it seems reasonable to suggest \( U \left( f, \ R \right) \le U \left( f, \ P \right) \).

Consider an arbitrary interval in \( P \), \( \left[ x_{i-1}, \ x_i \right] \) refined into \( \left[ x_{i-1}, \ t \right] \cup \left[ t, \ x_i \right] \). Let

$$M_{t^{-}} = \sup_{\left[ x_{i-1}, \ t \right]} f \left( x \right)$$
$$M_{t^{+}} = \sup_{\left[ t, \ x_i \right]} f \left( x \right)$$

By definition

$$M_{t^{-}} \le M_i$$
$$M_{t^{+}} \le M_i$$

The area of the refinement is

$$M_{t^{-}} \left( t – x_{i-1} \right) + M_{t^{+}} \left( x_i – t \right) \le M_i \left( t – x_{i-1} \right) + M_i \left( x_i – t \right) = M_i \left( x_i – x_{i-1} \right)$$

Hence, reasoning inductively it is indeed true that

$$U \left( f, \ R \right) \le U \left( f, \ P \right)$$

Definition of a Partition & Its Refinement

Let \( \left[a, \ b \right] \) be any closed bounded interval. Any sequence of numbers \( x_0, \ x_1, \ x_2, \ x_3, \ \dots, \ x_n \) that satisfy \( a=x_0 < x_1 < x_2 < x_3 < \ \dots < x_n = b\) defines a partition of \( \left[a, \ b \right] \) and we write \( P = \{ x_0, \ x_1, \ x_2, \ x_3, \ \dots, \ x_n \}. \)

Essentially, a partition of \( \left[a, \ b \right] \) establishes a set of \( n \) subintervals \( \left[x_i, \ x_{i-1} \right] \) where \( 1 \le i \le n \). Equivalently, \( \left[a, \ b \right] = \bigcup_{i=1}^n \left[x_i, \ x_{i-1} \right] \)

I think that it is important to emphasize the following: If \( \Delta x = x_{i} – x_{i-1} \) is constant then the partition is called regular. The definition of a partition does not require that \( \Delta x \) be constant.

A partition \( R \) is called a refinement of a partition \( P \) if \( P \) is a subsequence of \( R \). That is \( P \subset R \).

Using the Integrating Factor

Let \( g \) and \( h \) be continuous functions. The form of the following first order linear differential equation is solvable using an integrating factor.

$$\frac{dy}{dx} + g y = h$$

The left side of the equation almost looks like the result of the product rule. For example, if \(j\left(x \right) = \mu \left(x \right) y\left(x \right)\) then

$$\frac{dj}{dx} = \mu \frac{dy}{dx} + \frac{d \mu }{dx} y$$

Comparing

\( \frac{dy}{dx} + g y \)         to         \( \mu \frac{dy}{dx} + \frac{d \mu }{dx} y \)

suggests that if there exists a function \( \mu \left(x \right) \) such that

$$\frac{d \mu}{dx} = \mu g$$

then multiplying both sides of the original differential equation by \( \mu \left(x \right) \) yields

$$\mu \frac{dy}{dx} + \mu g y = \mu h$$

and since \(\frac{d \mu}{dx} = \mu g \)

$$\mu \frac{dy}{dx} + \mu g y = \frac{d \mu}{dx} y + \mu \frac{dy}{dx} = \frac{d}{dx} \left( \mu y \right)$$

which yields the integrable equation

$$\frac{d}{dx} \left( \mu y \right) = \mu h$$

Integrating yields a formula the for the solution to the differential equation in question

$$y = \frac{1}{\mu} \left( \int \! \mu h \ dx + C \right)$$

If this formula is to be of any practical use \( \mu \) must be determined. Recall that

$$\frac{d \mu}{dx} = \mu g$$

which is a separable differential equation. Therefore,

$$\mu = e^{ \int \! g\left(x \right) \ dx + K} = A e^{ \int \! g\left(x \right) \ dx}$$

Since the arbitrary constant will not affect the final answer it is convention to let \( A = 1 \). \( \mu \) is called the integrating factor. Substituting \( \mu \) into the general solution yields

$$y\left(x \right) = e^{ -\int \! g\left(x \right) \ dx} \left( \int \! e^{ \int \! g\left(x \right) \ dx} h\left(x \right) \ dx + C \right)$$

Logistic Differential Equation

general solution

$$\frac{dy}{dt} = ky \left( M – y \right)$$
$$\frac{dy}{y \left( M – y \right)} = k \ dt$$
$$\int \! \frac{dy}{y \left( M – y \right)} = \int \! k \ dt = kt + C_0$$

In order to integrate the right side of the equation the integrand must be decomposed and integrated by the technique commonly known as “integration by partial fractions.”

$$\frac{1}{y \left( M – y \right)} = \frac{A}{y} + \frac{B}{ \left( M – y \right)}$$
$$1 = A \left( M – y \right) + By = \left( B – A \right)y + AM$$

or

$$0y + 1 = \left( B – A \right)y + AM$$

For this equation to be true the coefficients must be equal. Therefore,

$$B – A = 0$$ and $$AM=1$$

$$A=B$$
$$A = \frac{1}{M}$$

Therefore, the decomposition is

$$\frac{1}{y \left( M – y \right)} = \frac{1}{My} + \frac{1}{ M\left( M – y \right)}$$

Replacing the integrand with its decomposition and splitting the integral yields

$$\int \! \frac{dy}{y \left( M – y \right)} = \frac{1}{M} \left( \int \! \frac{dy}{y} + \int \! \frac{dy}{M – y} \right)$$

From above it follows

$$\frac{1}{M} \left( \int \! \frac{dy}{y} + \int \! \frac{dy}{M – y} \right) = kt + C_0$$

Now integrating and solving for \( y \)

$$\frac{1}{M} \left( \ln \left| y \right| – \ln \left| M – y \right| + C_1 \right) = kt + C_0$$
$$\ln \left|y \right| – \ln \left| M – y \right| = Mkt + C_2$$
$$\ln \left| \frac{y}{M-y} \right| = Mkt + C_2$$

exponentiate both sides

$$\left| \frac{y}{M-y} \right| = e^{Mkt + C_2} = C_3 e^{Mkt}$$

The absolute value yields two cases.

$$\left| \frac{y}{M-y} \right| = \begin{cases} \ \ \frac{y}{M-y}, & \frac{y}{M-y} \ge 0 \\ -\left( \frac{y}{M-y} \right), & \frac{y}{M-y} < 0 \end{cases}$$

Solving the case for \(y \ge 0\) and assuming that \(y \left( 0 \right) = y_0\)

$$\frac{y_0}{M-y_0} = C_3 e^0 = C_3$$
$$\frac{y}{M-y} = \frac{y_0 e^{Mkt}}{M-y_0}$$
$$y = \frac{y_0 e^{Mkt}}{M-y_0} \left( M – y \right)$$
$$y \left( 1 + \frac{y_0 e^{Mkt}}{M-y_0} \right) = \frac{y_0 M e^{Mkt}}{M-y_0}$$
$$y \left( \frac{M – y_0 + y_0 e^{Mkt}}{M-y_0} \right) = \frac{y_0 M e^{Mkt}}{M-y_0}$$
$$y = \frac{y_0 M e^{Mkt}}{M – y_0 + y_0 e^{Mkt}}$$
$$y = \frac{y_0 M}{ y_0 + \left( M – y_0 \right) e^{-Mkt}}$$