Key Points - Mathematics and Statistics - The University...

98
AMA126 - 1 - AMA126 Differential and difference equations

Transcript of Key Points - Mathematics and Statistics - The University...

Page 1: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 1 -

AMA126 Differential and difference equations

Page 2: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 2 -

University of Sheffield, Dept of Applied Mathematics2007

Revision of Integration (Indefinite Integration)

When a function f(x) is known we can differentiate it to obtain its derivative df/dx. The reverse process is to obtain the function f(x) from knowledge of its derivative. This process is called integration and it has numerous applications in all areas of sciences.

Suppose we differentiate the function y=x2. We obtain

Integration reverses this process and we say that the integral of 2x is x2. Schematically we can regard the process of integration in the following way

In reality the situation is a bit more complicated because differentiating any of

yields 2x. In fact, any function of the form x2+c, where c is a constant, will be the answer to our question since when we differentiate the constant term we obtain zero. Consequently, when we reverse the process of differentiation, we do not know what the original constant term might have been. So we include in our answer an unknown constant, c say, called the constant of integration and we state that the integral of 2x is x2+c. This constant must always be included when finding an indefinite integral. The solution containing the constant c defines a family of curves all being solutions of the

differentiate

integrate

x2 2x

Page 3: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 3 -

integral. If one of these curves is a solution of the integral, they all are. To select between them we need more information. This problem defines so called initial conditions, a topic you will meet later when solving differential equations. The indefinite integration is represented by the symbol ∫ known as an integral sign. Accompanying the integral sign is always a term of the form dx, which indicates the independent variable involved in the integration, in this case x. So we write

____________________________________________________Example (a) State the derivative of x3

(b) Hence find the indefinite integral of 3x2

Solution(a) From our knowledge of differentiation, the derivative of x3 is 3x2.(b) Indefinite integration reverses the process of differentiation, and so we write

We always include the additional constant of integration when finding indefinite integrals. Note that our answer can be checked by differentiating x3+c to obtain 3x2.More generally, we have the following relationship between derivatives and indefinite integrals:

In the expression ∫ f(x) dx, the function f(x) is referred to as the integrand. When we have calculated ∫ f(x) dx, we say f(x) has been integrated with respect to x to yield F(x)+c.

In what follows we are going to discuss some techniques which can be used to evaluate many types of integrals.

I. Integration by parts

If f and g are differentiable functions, then by the Product Rule

where the dash means the differentiation of the function with its argument. Integrating both sides of the previous equation gives us

Page 4: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 4 -

The simplest is to perform the first integral on the right side and the integral is f(x)g(x)+C (why???). Since another constant of integration results from the second integral, it is unnecessary to include C in the formula; that is

If we let u=f(x) and v=g(x), so that du=f′(x)dx and dv=g′(x)dx, then the preceding formula may be written (integration by part)

______________________________________________________Example: Find

SolutionThere are four possible choices for dv, namely dx, xdx, e2xdx or xe2xdx. If we let dv= e2xdx, then the remaining part of the integrand is u; that is u=x. To find v we integrate dv to obtain v=e2x/2. Note that a constant of integration is not added at this stage of the solution. Since u=x we see that du=dx. For ease of reference it is convenient to display these expressions as follows

Substituting these expressions in the definition equation, we obtain

The integral on the right hand side may be found using the integrals of exponential functions (see in the table below). This gives us

It takes considerable practice to become proficient in making a suitable choice for dv. To illustrate, if we had chosen dv=xdx, then it would have been necessary to let u=e2x, giving us

Page 5: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 5 -

Integrating by parts we obtain

Since the exponent associated with x has increased, the integral on the right is more complicated than the given integral. This indicates an incorrect choice of dv. ______________________________________________________

II. Trigonometric integrals

In many cases evaluating an integral we can meet trigonometric functions. For example, integrals of the type ∫sinnxdx require new method of solving. If n is an odd positive integer, we begin by writing

Since the integer n-1 is even, we may then use the fact that sin2x=1-cos2x to obtain a form which is easy to integrate.

______________________________________________________ExampleEvaluate ∫sin5xdx.

SolutionAs discussed earlier we have

We next employ the method of substitution, letting u=cosx and du=-sinxdx. Thus

_____________________________________________________A similar technique can be employed for odd powers of cos x, specifically, we write

Page 6: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 6 -

and use the fact that cos2x=1-sin2x in order to obtain an integrable form. If the integrand is sinnx or cosnx and n is even, then the half-angle formulas

may be used to simplify the integrand.______________________________________________________ExampleEvaluate ∫sin4xdx

Solution

We apply a half-angle formula again and write

Substituting in the last integral and simplifying gives us

_____________________________________________________Integrals of the form ∫sinmxcosnxdx where m and n are positive integers may be found by using variations of the previous techniques. If m and n are both even, then half-angle formulas should be employed first. In n is odd, we can write

and express cosn-1x in terms of sinx by using the identity cos2x=1-sin2x. The substitution u=sinx then leads to an integrand which can be handled easily. A similar technique can be used if m is odd.

III. Trigonometric substitutions

If an integrand contains the expression where a>0, then the trigonometric substitution x=asinθ leads to

When making this substitution or the other trigonometric substitutions in the next examples, we shall assume that θ is in the range of the corresponding inverse

Page 7: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 7 -

trigonometric function. Thus, for the sine substitution above –π/2≤θ≤π/2. Consequently cosθ≥0 and . Of course, if occurs in a denominator we make the further restriction –π/2<θ<π/2.

______________________________________________________ExampleEvaluate

SolutionLet x=asinθ , where –π/2<θ<π/2. It follows that

Since x=asinθ, we have dx=acosθdθ. Substituting in the given integral

It is now necessary to return to the original variable of integration x. A simple method of doing so is to use a geometrical approach. If 0<θ<π/2, then since sinθ=x/a, we may interpret θ as an acute angle of a triangle having opposite side and hypotenuse of lengths x and a, respectively. The length of the adjacent side is calculated by means of the Pythagorean Theorem.

Referring to the triangle we see that

Page 8: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 8 -

It can be shown that this formula is also valid if –π/2<θ<0. Thus the above figure can be used whether θ is positive or negative. Substituting the new form of cotθ in the result obtained for the integral, we have

______________________________________________________If an integrand contains , where a>0, then the substitution x=atanθ will eliminate the radical sign. When using this substitution it will be assumed that θ is in the range of the inverse tangent function; that is –π/2<θ<π/2. After making this substitution and evaluating the resulting trigonometric integral, it is necessary to return to the original variable, x. The preceding formulas show that

For integrands containing we substitute x=asecθ, where θ is chosen in the range of the inverse secant function; that is either 0≤θ≤π/2 or π≤θ<3π/2. After evaluating the integral, we have to return to the original variable and we use

______________________________________________________Example

Evaluate

SolutionLet us substitute as follows

Consequently

and therefore

Page 9: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 9 -

Since secθ=x/3 we may refer to the changing rule into the old variable and we write

_____________________________________________________

III. Partial Fractions

It is easy to verify that

The expression on the right side of the equation is called the partial fraction decomposition of the expression on the left side. This decomposition may be used to find the indefinite integral of the expression on the left side. We merely integrate each of the fractions which make up the decomposition independently, obtaining

It is theoretically possible to write any rational expression f(x)/g(x) as a sum of rational expressions whose denominators involve powers of polynomials of degree not greater than two. More specifically, if f(x) and g(x) are polynomials and the degree of f(x) is less than the degree of g(x), then it follows from a theorem in algebra that

where each of Fi has one of the forms

for some non-negative integers m and n, and when ax2+bx+c is irreductible, in the sense that this quadratic expression has no real roots, that is b2-4ac<0.

To find the fraction decomposition of a rational expression f(x)/g(x) it is essential that f(x) have lower degree than g(x). If this is not the case, then long division should be employed to arrive at such expression. For example, given

Page 10: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 10 -

we obtain, by long division,

The partial fraction decomposition is then found for the last term in the right side.

In order to obtain the decomposition of a rational expression of the form f(x)/g(x), we begin by expressing the denominator g(x) as a product of factors px+q or irreductible quadratic factors ax2+bx+c. Repeated factors are then collected so that g(x) is a product of different factors of the form (px+q)m or (ax2+bx+c)n, where m and n are non-negative integers and the quadratic forms are irreductible. We then apply the following rules

Rule 1. For each factor of the form (px+q)m where m≥1, the partial fraction decomposition contains a sum of m partial fractions of the form

where each of Ai is a real number.

Rule 2. For each of the factor of the form (ax2+bx+c)n where n≥1 and b2-4ac<0, the partial fraction decomposition contains n partial fractions of the form

where each of Ai and Bi are real numbers._____________________________________________________ExampleEvaluate

SolutionBy Rule 1, there is a partial fraction of the form A/(x+1) corresponding to the factor x+1 in the denominator of the integrand. For the factor (x-2)3 we apply Rule 1 (with m=3), obtaining a sum of three partial fractions B/(x-2), C/(x-2)2, and D/(x-2)3. Consequently, the partial fraction decomposition has the form

Page 11: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 11 -

Multiplying both sides by (x+1)(x-2)3 gives us

Two of the unknown constants may be determined easily. If we let x=2 then

24-72+58-4=3D, 6=3D, and D=2

Similarly, letting x=-1 we obtain

-3-18-29-4=-27A, -54=-27A, and A=2

The remaining constants may be found by comparing the coefficients. If the right side of the decomposition is expanded and like powers of x collected, we see that the coefficient of x3 is A+B. This must equal the coefficient of x3 on the left, that is

A+B=3

Since A=2, it follows that B=1. Finally, we compare the constant terms by letting x=0. This gives us

-4=-8A+4B-2C+D

Substituting the values we have already found for A, B and D leads to

-4=-16+4-2C+2

which has the solution C=-3. The partial fraction decomposition is, therefore

To find the given integral we integrate each of the partial fractions on the right side of the last equation. This gives us

______________________________________________________Obviously, there are many characteristic types of indefinite integrals with their own rules. To see them all, please consult any book on calculus.

Differential equations

Definition: A differential equation is an equation which involves derivatives or differentials. Since the equations we are going to study contain only one variable, these

Page 12: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 12 -

equations are called ordinary differential equations. The primary objective of this lecture is to develop techniques for solving certain basic types of ordinary differential equations.

Introduction

An equation of the form

, 2.1

where F is a function of n+2 variables, y is a function of x, and y(k) denotes the k-th derivative of y with respect to x, is called an ordinary differential equation of order n. The following are examples of ordinary differential equations of orders 1, 2, 3, and 4, respectively:

If, in (2.1), F is a polynomial function, then by definition the degree of the differential equation is the greatest exponent associated with the highest order derivative y(n). The degrees of the preceding differential equations are 1, 1, 4, and 2, respectively.

If a function f has the property that when f(x) is substituted for y in a differential equation, the resulting expression is an identity for all x in some interval, then f(x) (or simply f) is called a solution of the differential equation. For example, if C is any real number, then a solution of y’=2x is

because substitution of f(x) for y leads to the identity 2x=2x. We call x2+C the general solution of y’=2x, since every solution has this form.___________________________________________Example If C1 and C2 are any real numbers, prove that

is a solution of y’’-25y=0.

SolutionSince

Page 13: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 13 -

we have f″(x)-25f(x)=0. This shows that f(x) is a solution of the equation y″-25y=0.

The solution given in the above Example is called the general solution of y″-25y=0. Observe that the differential equation is of the order 2 and the general solution contains two arbitrary parameters C1 and C2 (for connections to integrals, see why these parameters arise in the recap about integrals).

It can be shown that the general solution of the n-th order differential equation contains n independent parameters C1, C2, …, Cn. A particular solution is obtained by assigning specific values to the parameters. ___________________________________________Example Find the particular solution of y’=2x which satisfies the condition that y=5 if x=2.

SolutionLet us write the general solution of y’=2x in the form y=x2+C. If the given condition is to be satisfied, then necessarily 5=4+C or C=1. Hence the desired particular solution is y=x2+1.___________________________________________Conditions of the type stated in the previous Example are called boundary conditions for the differential equation. If the general solution contains one parameter, one boundary condition is sufficient to find the particular solution. If, as in the first Example, the general solution contains two parameters, then two boundary conditions are needed for particular solutions. Similar statements hold if more than two parameters are involved.The solutions we have considered express y explicitly in terms of x. Solutions of certain differential equations are stated implicitly. In this case, implicit differentiation is used to check the solution, as illustrated in the following example___________________________________________Example Show that x3+x2y-2y3=C is an implicit solution of

SolutionIf the first equation is satisfied by y=f(x), then differentiating implicitly,

Thus y=f(x) satisfies the differential equation.___________________________________________

Page 14: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 14 -

The simplest type of differential equation is one which can be written in the form

2.2

where M and N are continuous functions. If y=f(x) is a solution of the equation (2.2), then

If f′(x) is a continuous function, then indefinite integration leads to

or equivalently,

The last equation is an (implicit) solution of (2.2). A device which is useful for remembering this method of solution is to write equation (2.2) as

and then change to the following differential form

2.3

The solution is then found by formally integrating each term. The differential equation (2.2) is said to be separable, since the variables x and y may be separated as indicated in (2.3).___________________________________________Example Solve the differential equation

SolutionThe given equation may be written as

Assuming that (y+3)(x2-4)≠0, we may divide both sides by this product and express the equation in the differential form (2.3) as follows

Page 15: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 15 -

Thus the given differential equation is separable, and integration gives us

This may also be written as

.

It can be shown, furthermore, that the solution is

for every nonzero C. In explicit form,

Since it was assumed that (y+3)(x2-4)≠0, the cases x=±2 and y= -3 require special attention. Direct substitution shows that y= -3 is a solution of the given differential equation; however, y′ is undefined if x=±2. Consequently, the above solution given in explicit form is the solution if C is any real number.

___________________________________________Example Prove that y=ex(C1cos x+C2sin x) is a solution of the differential equation

Example Solve the differential equation

Page 16: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 16 -

Sometimes a substitution is necessary to turn an equation into separable variables, e.g. use the substitution z=2x+y to solve the ordinary differential equation

Obviously, first we will need to see how the new variable (and its derivative) will look like. For this we differentiate the new variable with respect to x

So the original differential equation is transformed into

which now can be solved by variable separation. Integrating we have

and the solution can be found solving the following chain

A very important case (i.e. with many applications in various fields) is the differential equation

This equation can be solved by variable separation. Supposing that y≠0, we have

Page 17: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 17 -

The above equation is an example of an ordinary differential equation with constant coefficients. This type of equation will play a very important role in the second chapter of this course (population dynamics). Let us discuss some of the properties of this differential equation

1. Set t=0, then y(0)=A, so y(t)=y(0)ekt

2. If k>0, we have an exponential growth, if k<0 we have an exponential decay3. Half-life (when k<0)

We set ek=2-1/T, in other words

then

T is called the “half-life” and it is widely used in sciences and engineering (e.g. radioactive decay)

The snowfall problem: Before noon snow starts to fall at a steady rate. At noon a snow plough begins ploughing forward along a straight road of constant width. It shifts a constant volume of snow per unit time. It clears a two mile stretch by one o’clock and a further one mile by two o’clock. At what time did the snow begin to fall?

SolutionLet the snow begin to fall at time T. Then the depth of snow at time t (≥T) is c(t-T). Let the snow plough advance from x to x+Δx in the time interval t to t+Δt. The volume of snow removed in this time interval is ωc(t-T)Δx, where ω is the width of the plough. Thus the rate of snow removal is

which is a constant. Thus we have (t-T)dx/dt=C, or

Page 18: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 18 -

This differential equation can be solved by separating the variables as

which can be rewritten as

where B=e-A/k and a=e1/k. We have three unknown constants (T, B, a) which must be determined. We have to use the initial conditions, i.e.

Using these conditions we have

From the first equation we have B=-T, which introduced back into the remaining two equations yields

Calculating the ratio between these two expressions we have

Page 19: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 19 -

Having this constant, we can determine T as

Calculating this ratio, we obtain T= –0.618 hours=-37.1 min. Accordingly, the snow started to fall at 11.23 am.

HOMOGENEOUS DIFFERENTIAL EQUATIONS

A function f of two variables is said to be homogeneous of degree n if

3.1

for every t>0 such that (tx, ty) is in the domain of f. For example, if

then f is homogeneous of degree 4, since

Similarly, if

then f is homogeneous of degree -2, since

A homogeneous differential equation is an equation which can be written in the form

3.2

where P and Q are homogeneous functions of the same degree. Equations of this type can be transformed into separable equations by means of substitutions

3.3

and

Page 20: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 20 -

Thus, substitution of xv for y in (3.2) yields

If P and Q are homogeneous functions of degree n, then

Substituting in the preceding differential equation and dividing both sides by xn we obtain

This equation can be written in the separable form

3.4

provided non-zero denominators occur. We have proved that if y=xv is a solution of (3.2), then v is a solution of (3.4). Conversely, if v is a solution of (3.4), then reversing our argument shows that y=vx is a solution of (3.2). It is not advisable to memorize the final form of (3.4). Instead, remember the substitution y=xv which is used to simplify the homogeneous equation.

___________________________________________Example Solve the differential equation

SolutionIf P(x,y)=y2-xy and Q(x,y)=x2, then the functions P and Q are both homogeneous of degree 2. Hence the differential equation is homogeneous and we substitute

This leads to the following chain of equations

Page 21: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 21 -

Integrating each term gives us

ExampleSolve the differential equation

LINEAR DIFFERENTIAL EQUATIONS OF THE FIRST ORDER

A first-order linear differential equation is an equation of the form

3.5

where P and Q are continuous functions. If Q(x)=0 for all x, then equation (3.5) is separable and we may write

provided y≠0. Integrating, we obtain

We have expressed the constant of integration as ln|C| in order to change the form of the last equation as follows:

Page 22: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 22 -

We next observe that

Consequently, if we multiply both sides of (3.5) by e∫P(x)dx, then the resulting equation may be written as

This gives us the following (implicit) solution of (3.5)

3.6

Solving this equation for y leads to an explicit solution. The expression e∫P(x)dx is called an integrating factor of (3.5). We have shown that multiplications of both sides if (3.5) by this expression leads to an equation which has the solution (3.6).___________________________________________Example Solve the differential equation

where x≠0.

SolutionIn order to find the integrating factor we begin by expressing the given differential equation in the “standardized” form (3.5), where the coefficient of y′ is 1. Thus, dividing both sides by x2 we obtain

which has the form (3.5) with P(x)=5/x and Q(x)=- 3x3. From the preceding discussion, the required integrating factor is

Page 23: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 23 -

If x>0 then |x|5=x5, whereas if x<0 then |x|5=-x5. In either case, multiplying both sides of the standardized form by |x|5 gives us

Thus a solution is

.

___________________________________________

A generalization of the (3.5) is the Bernoulli equation

3.7

where n≠0. Evidently y=0 is a solution. If y≠0 we may divide both sides by yn, obtaining

3.8

If we let w=y 1-n, then

and hence

Replacing y-n y′ in (3.8) by the last expression gives us

This first-order linear diff. eq. may be solved for w using the integrating factor technique. After w was found, the solution (3.7) is given by y 1-n=w (and y=0).__________________________________________Example Solve the differential equation

Page 24: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 24 -

SolutionThe equation has the Bernoulli form (3.6) with n=3. If, as in the previous discussion, we multiply both sides by y-3 and substitute w=y1-n=y-2 we obtain

Since the integrating factor for the last equation is

supposing that x>0 (in fact it can be shown that considering x<0, eventually we would obtain the same result). Now we can write

Consequently

Finally, since w=y-2, the solution of the given equation is

___________________________________________Differential equations are indispensable in sciences (mathematics, physics, chemistry, engineering, biology, etc). The application of the theory of differential equations for physical problems will be solved in other modules and later in this module for population dynamics.

ExampleSolve the differential equations

Page 25: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 25 -

Linear differential equations of the second order

If f1, f2, … , fn and k are functions of one variable which have the same domain, then an equation of the form

4.1

is called a linear differential equation of order n. If k(x)=0 for all x, the equation is said to be homogeneous. Notice that this meaning of the word homogeneous is different from that we met earlier. If k(x)≠0 for some x, then the equation (4.1) is said to be non-homogeneous. We shall restrict our work to second-order equations in which f1 and f2 are constant functions. First we are going to discuss the homogeneous case.

The general second-order homogeneous differential equation with constant coefficients has the form

4.2

where a, b and c are constants. Before attempting to find particular solutions let us establish the following result.

Theorem: (the superposition principle) If y=f(x) and y=g(x) are solutions of the differential equation ay″+by′+cy=0, then

4.3

is a solution for all real numbers C1 and C2.

Proof: By hypothesis

If we multiply the first of these equations by C1, the second by C2, and add, the result is

Thus C1f(x)+C2g(x) is a solution.

It can be shown that if the solutions f and g in above Theorem have the property that f(x)≠Cg(x) for all real numbers C, and if g(x) is not identically 0, then y=C1f(x)+C2g(x) is a general solution of ay″+by′+cy=0. Thus, to determine the general solution it is sufficient to find two such functions f and g and employ Eq. (4.3).

Page 26: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 26 -

In our search for solution of (4.2) we shall use y=Aemx as a trial solution, where A is an arbitrary constant and we need to find m.

Then

Substituting in Eq. (4.2) gives

or, since emx≠0 and we are interested in non-trivial solutions (A≠0)

4.4

The equation (4.4) is called the auxiliary equation of eq. (4.2). It can be obtained from this differential equation by replacing y″ by m2, y′ by m and y by 1. In simple cases, the roots of the auxiliary equation can be found by factoring. If the factorisation is not obvious, then applying the quadratic formula, we see that the roots of the auxiliary equation are given by

4.5

According to the sign of b2-4ac in eq. (4.5), we could have three different cases

(i) Eq. (4.4) has distinct real roots (b2-4ac>0)(ii) Eq. (4.4) has distinct complex roots (b2-4ac<0) (see later for this case)(iii) Eq. (4.4) has repeated real roots (b2-4ac=0)

Theorem 1: If the roots m1 and m2 of the auxiliary equation are real and unequal, then the general solution of ay″+by′+cy=0 is

4.6___________________________________________ExampleSolve the differential equation

y″+10y′+16y=0

SolutionThe auxiliary equation is

Page 27: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 27 -

which means that m1=-8 and m2=-2. Since the roots of the auxiliary equations are real and unequal, it follows from Theorem 1 that the general solution is

with C1 and C2 two arbitrary constants. To find the two constants we need two boundary (or initial) conditions. For example, we may give two points the solution passes through or one point and the gradient for some value of x, or two gradients. In this case, if y=0 and dy/dx=1 when x=0, using the general solution given above we have

which eventually will lead to C1=-1/6 and C2=1/6. So, the final form of the solution is

________________________________________________Theorem 2: If the auxiliary equation has a double root m, then the solution of the equation ay″+by′+cy=0 is

4.7

Proof: Using (4.5) with b2-4ac=0, we obtain m=-b/2a or 2am+b=0. Since m satisfies the auxiliary equation, y=emx is a solution of the differential equation. According to the remark following the proof of Theorem (4.3), it is sufficient to show that y=xemx is also a solution. Substitution of xemx for y in ay″+by′+cy=0 gives us

which is what we wished to show.________________________________________________ExampleSolve the differential equation

y″-6y′+9y=0

SolutionThe auxiliary equation is m2-6m+9=0, or equivalently (m-3)2=0, has a double root 3. Hence by Theorem (4.7), the general solution is

Page 28: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 28 -

Example:Solve the differential equation:

Solution

The final case to consider is that in which the roots of the auxiliary equation are complex numbers. For many of you the notion of complex numbers might sound a bit strange but it is included in one of the module (SOM104) which runs parallel with this lecture.

The second case when deciding the nature of solution for a second order homogeneous differential equation corresponds to the case when b2-4ac<0. In this case the auxiliary equation is said to have complex roots.

Complex numbers may be represented by expressions of the form a+ib, where a and b are real numbers, and i is a symbol which may be manipulated in the same manner as a real number, but has the additional property that i2=-1.

Two complex numbers a+ib and c+id are said to be equal, and we write a+ib=c+id, if and only if a=c and b=d. Operations of addition, subtraction, multiplication and division are defined just as in the case of real numbers; in the case of complex numbers all letters denote real numbers, with the additional stipulation that whenever i2 occurs, it may be replaced by –1. For example, the formulas for addition and multiplication of two complex numbers a+ib and c+id are

We may regard the real numbers as a subset of the complex numbers by identifying the real number a with the complex number a+i0. A complex number of the form 0+ib is called an imaginary number.

Complex numbers are often required for solving equations of the form f(x)=0, where f(x) is a polynomial. For example, if only real numbers are allowed, then the equation x2=-4 has no solutions. However, if complex numbers are allowed, then the equation has a solution 2i, since

Page 29: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 29 -

Similarly, -2i is a solution of the equation x2=-4.

Since i2=-1, we sometimes use the symbol √(-1) in place of i and write

and so on.

A quadratic equation ax2+bx+c=0, where a, b and c are real numbers and a≠0, has roots given by the quadratic formula

If b2-4ac<0, then the roots are complex numbers. To illustrate, if we apply the quadratic formula to the equation x2-4x+13=0 we obtain

Thus the equation has two complex roots 2+3i and 2-3i.

The complex number a-bi is called the conjugate of the complex number a+bi. We see from the quadratic formula that if a quadratic equation with real coefficients has complex roots, then they must be conjugate complex numbers.

It follows from the previous discussion that if the auxiliary equation am2+bm+c=0 has complex roots, then they are of the form

where s and t are real numbers. We may anticipate, from Theorem (4.6), that the general solution of the differential equation ay″+by′+cy=0 is

4.8

In order to handle such complex exponents it is necessary to extend some of the concepts of calculus to include functions whose domain includes complex numbers. Since a complete development is beyond the scope of our work, we shall merely outline the main ideas.

The Euler’s Theorem

Page 30: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 30 -

For every complex number

It can be shown that the Laws of Exponents are true for complex numbers. In addition, formulas for derivatives developed earlier can be extended to functions of a complex variable z. One such formula is dekz/dz=kekz, where k is a complex number.

Reminder: Laws of exponents

It can be proved that the general solution of ay″+by′+c=0, where the roots of the auxiliary equation are complex numbers s±ti, is given by Eq. (4.8). The form of this solution may be changed as follows:

4.9

This can be further simplified by using Euler’s Formula. Specifically, we see from (4.8) that

from which it follows that

4.10

If we let C1=C2=1/2 in (4.9) and use (4.10) we obtain the particular solution y=esx costx of ay″+by′+cy=0. Letting C1= - i/2 and C2=i/2 gives us the particular solution y=esx

sintx. This is a particular proof of the next theorem.________________________________________________Example: Evaluate

________________________________________________

Page 31: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 31 -

TheoremIf the auxiliary equation am2+bm+c=0 has distinct complex roots s±ti, then the general solution of ay″+by′+cy=0 is

4.11________________________________________________ExampleSolve the differential equation

SolutionThe roots of the auxiliary equation m2-10m+41=0 are

Hence by Theorem (4.11), the general solution of the differential equation is

________________________________________________ExampleFind the particular solution of the differential equation 2y″-3y′+2y=0 which satisfies the boundary condition y=0 and y′=2 when x=0.

SolutionThe roots of the auxiliary equation 2m2-3m+2=0 are

According to (4.11), the solution of the given differential equation can be written as

This solution contains two constants which can be determined using the boundary conditions. It is obvious that y(0)=C1=0. In order to use the second boundary condition we have differentiate the solution y(x) with respect to x

Taking into account that C1=0, we obtain that

Page 32: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 32 -

Solving this equation for C2, we obtain that

The final form of the solution will be

Example: Solve the differential equation:

________________________________________________A special second order homogeneous differential is the Euler-Cauchy differential equation:

where a and b are constants. Although this equation does not seem to be an equation with constant coefficients, it can be reduced to that form using a new variable

Since we changed the variable, we have to change y′ and y″, as well. To do so, we use the chain rule :

Page 33: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 33 -

Introducing all derivatives back into the original equation, we have

which now is a second order homogeneous differential equation with constant coefficients. Therefore, we use the previous results to solve this equation.

The auxiliary equation is

and the solution of the Euler-Cauchy differential equation can be found according to the nature of the roots of the auxiliary equation.

a. Real and distinct roots (m1 and m2)

b. Real but equal roots

c. Complex roots (m12=α±iβ)

ExampleSolve the differential equation

Solution

Page 34: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 34 -

Non-homogeneous linear differential equations

In this section we shall consider second-order non-homogeneous linear differential equations with constant coefficients, that is, equations of the form

5.1

where a, b and c are constants and the function k(x) is continuous. The function k(x) is often called the forcing term or the source term. It is convenient to use the differential operator symbol D and D2 where if y=f(x), then

We shall also employ the linear differential operator

where by definition

Using this notation, equation (5.1) can be written in the compact form L(y)=k(x). It is easy to verify that for every real number C,

5.2

Also, if y1=f1(x) and y2=f2(x), then it can be shown that

5.3

Given the differential equation (5.1), that is, L(y)=k(x), the corresponding homogeneous equation L(y)=0 is called the complementary equation. Suppose that yp is a particular solution of L(y)=k(x) and yc is any solution of the complementary equation. Since L(yp)=k(x) and L(yc)=0

which means that yp+yc is a solution of (5.1).

Page 35: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 35 -

Theorem If yp is a particular solution of the differential equation L(y)=k(x) and if yc is a general solution of the complementary equation L(y)=0, then the general solution of L(y)=k(x) is y=yc+yp. (5.4)

If we use the results of the previous section to find the solution yc of L(y)=0, then according to the above theorem all that is needed to determine the general solution of L(y)=k(x) is one particular solution yp.

ExampleSolve the differential equation

y″-4y=6x-4x3.

SolutionWe see by inspection that yp=x3 is a particular solution of the given equation. The complementary equation y″-4y=0 which by (4.6), has solution

Applying the theorem, the general solution of the given non-homogeneous differential equation is

In most cases a particular solution of (5.1) cannot be found by inspection as it was done in the previous Example. Given the differential equation

where enx is not a solution of L(y)=0, it is reasonable to expect that there is a particular solution of the form yp=Aenx, since enx is the result of finding ay″+by′+cy=0. This suggests that we use Aenx as a trial solution in the given equation and attempt to find the value of the coefficient A. This technique is called the method of undetermined coefficients, and is illustrated in the next example

ExampleSolve the differential equation

y″+2y′-8y=e3x.

SolutionSince the auxiliary equation m2+2m-8=0 of y″+2y′-8y=0 has roots 2 and -4 it follows that the general solution of the complementary equation is

Page 36: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 36 -

From the preceding remarks we seek a particular solution of the form yp=Ae3x. Since yp

′=3Ae3x and yp″=9Ae3x, substitution in the given equation leads to

Dividing both sides by e3x we obtain

Thus yp=(1/7)e3x and by Theorem (5.4), the general solution is

After all, the method of undetermined coefficients is based on ‘guessing’ the right form for yp. The ‘guess’ is based on experience and comes down to a few rules:

1. If k(x) is a polynomial of degree q, try

i.e. a polynomial of the same degree. 2. If k(x)=acosmx+bsinmx (including the cases when a=0 or b=0), try

4. If k(x)=aepx and p is not a root of the auxiliary equation, try

5. If k(x)=aepx and p is a root of the auxiliary equation, try

6. If k(x)=xepx and p is not a solution of the auxiliary equation then try a particular solution of the form

7. If k(x)=esxsintx or k(x)=esxcostx and s+ti is not a solution of the auxiliary equation, then try a particular solution of the form

Page 37: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 37 -

8. If k(x) is a sum of simpler functions in the list above, find the particular integral for each of these simpler functions and add them together.

ExampleFind the general solution of the equation

SolutionThe characteristic equation is

which means that the complementary solution is

For the particular solution, try yp=at+b. Accordingly, yp′=a, yp″=0. We substitute back into the equation

This means that general solution

Example: Solve the non-homogeneous differential equation

Solution:y=1-sinx-cosx

Page 38: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 38 -

ExampleSolve the differential equation

SolutionThe characteristic equation is

The complementary solution is

Since m≠4, we try a particular solution of the form yp=ae4t, i.e. yp′=4ae4t, yp″=16ae4t. Introducing these expressions back into the original equation we have

Finally, the general solution is

ExampleSolve the differential equation

given that y=0 and dy/dt=0 when t=0.

SolutionThe characteristic equation is

Page 39: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 39 -

Here e-2t is part of the complementary solution so we must try a particular solution of the form yp=ate-2t. Accordingly

Introducing back into the original equation, the left hand side will look like

Note that the terms in te-2t cancel out, this will always happen. Comparing the two sides of the equation we obtain that a=-1. So, the general solution of the equation is

Now we have to find the two constants, A and B, using the initial conditions given. When t=0, y=0, i.e. 0=A+B. To use the other condition we calculate

.

When t=0, we have 0=-2A-B-1. Combining the two relations obtained for the two constants we obtain A=-1 and B=1. So, the final solution is

.

Example Solve the differential equation

and describe the behaviour of the solution as t→∞.

Solution

Page 40: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 40 -

Population dynamics

Population dynamics is concerned with numbers in populations and factors which cause them to change. In addition to natural curiosity, population dynamics is useful in studying problems involving economic and social situations, e.g. farming, fishing, spread of epidemics, conservation (killing of whales, Amazon rain forests, etc. ).

In studying population dynamics we shall be concerned with either one species (e.g. humans) or two interacting/competing species (rabbits and foxes).

Population dynamics tries to answer questions like:

What will be the population of a certain country in 10 years? How are we protecting the resources from extinction?

To try to answer to these types of questions we construct simple mathematical models of real life situation then use models to predict future changes.

Models simplify the real situation and aim to isolate the main factors and study their effect on the main population. These models may be crude but they can give surprisingly accurate predictions.

In order to be able to model these situations we have to make some assumptions:1. the number of individuals in a given area can be represented by a single variable,

x, measured in terms of some chosen unit of population, so x is the population density. By treating the population as a whole, we ignore age and sex differences.

2. x is a continuous and differential function of t, taken as a continuous variable. This may seen a surprising assumption since we might expect to take x as an integer, the population of any species changing by integer amounts. However if a given population is very large and it is increased by a few in short time intervals, those changes are very small compared to the total population and a graph of x with respect to t looks like a continuous function and indeed a differentiable function and as we assume that it is.

We have in mind populations such as the human population which has no fixed breeding season. Some species such as sheep have a single breeding season and for these it may be more sensible to measure x at discrete time intervals, the ends of the breeding seasons, for example. This leads to difference equation models which will be studied later.

One species models

Page 41: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 41 -

(e.g. number of people in the world, number of bacteria in an experiment, number of trees in the forest, etc.)

Let x(t) the number of members of a population. Large population if increase/decrease not too drastically than it is reasonable to approximate the function x(t) by a continuous and differentiable function of t.

Let the number, x(t), of members of a population at time t be large enough for x(t) to be continuous. If x(t0) is known, can the number be predicted at subsequent times?In general the time scale depends on the population type: for humans in years, for bacteria in hours or days.

To model the growth we consider the rate at which the population changes. The instantaneous growth rate at time t is dx/dt. The instantaneous relative growth (or rate of change per individual) is

The population dynamics operate with a few models which are surprisingly accurate.

In order to model the problem, we are going to use two types of first order differential equations already presented previously. In what follows we are revising the methods of solving these types of equations

1. Separation of variables: if the differential equation can be written as

2. The integrating factor: if the differential equation can be written as

then the equation is solved by using the integrating factor

Example11. Solve the differential equation x′(t)=ax, where a is a constant for x≥0 such that (i) x=x0 when t=0(ii) x=x0 when t=t0

SolutionThis equation can be solved by variable separation

Page 42: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 42 -

Integrating both parts we have

which is the general solution, A is an arbitrary constant. Now we are going to use the initial conditions

(i) of x=x0 when t=0, then we have

which is a particular solution(ii) if x=x0 when t=t0, then

Example2 Find the solution of the differential equation x′(t)=ax(b-x), where a and b (b>0) are constants for 0≤x≤b which satisfies x(0)=x0.

SolutionThis equation can be solved again using variable separation. Accordingly we write

Now, the integrand of left-hand side can be decomposed as

This equation must be valid for all values of x. Putting first x=0 we have 1=Ab, so A=1/b. Then we put x=b and we obtain 1=Bb, so B=1/b. Using these values, the integrand can be decomposed as

which means that the integral is

Page 43: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 43 -

since 0≤x≤b. Returning to the differential equation obtained after separating the variables we have

where A=A′b, A′ and c=ab are constants. If x=x0 when t=0

ExampleFind the general solution of the differential equation

where a, b and A are constants.

SolutionThis is a linear differential equation with P(t)=a and Q(t)=Aebt. Therefore the integrating factor is

Multiplying the original differential equation by the integrating factor gives

Since we have multiplied the differential equation by the integrating factor, the left-hand side of the above relation can be written as

Page 44: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 44 -

since

and so

Integrating both sides with respect to t gives

where B is an arbitrary constant. From above relation, x can be expressed as

Exponential model (The Malthusian model)

Is the simplest model when we suppose that the instantaneous relative growth, r(t), is constant (a)

This model says that the rate of change of the population is proportional to the existing population. If x=x0 when t=t0, we obtained

If a>0 then this result gives an exponential growth a<0 then this result gives an exponential decay and a is called

growth (decay) rate

Page 45: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 45 -

here x(t)=P(t) and x0=2 and a=0.2

A useful measure of the growth of a population is the doubling time. If t1-t0= time required for population to double, then at t=t1, x=2x0 and so

Example: (Application to world human population) In 1961 the world population was 3.06x109. Over the next 10 years it increased at relative growth rate of 2% per year. Calculate the doubling time.

SolutionApplying the formula, with t0=1961, a=0.02, x0=3.06x109, we have

and the doubling time is ln2/0.02=34.7 years. Estimates from 1700 to 1961 suggest that the doubling time was 35 years, which means that this model gives good agreement with reality.

What about future predictions: In 1991 a population of 5,575 million, in 2389 a population of 15,969,164 million (the surface area of the Earth is approximately 16,700,500 million m2)

That means that the exponential model gives unreasonable predictions for the future. For positive growth rate, when time tends to infinity, the population number tends to infinity which is in contradiction with the available resources or environment limitations. Therefore it is obvious that a new model has to be used which can give reasonable results for large times.

The logistic model (Verhulst-Pearl model)

The exponential model (besides that it gives too large predictions for large times) does not reflect the competition between individuals, the limits of the resources and food supply. For many species with a finite food supply the population tends to an upper limit which depends on the environment conditions. The idea behind the logistic model says that while the population will continue to grow as time goes on, the rate at which it does this growing gets smaller.

Let us denote by c the reproductive parameter, x(t) the population density and k the carrying capacity of the environment (or a limiting size of population). Then the proposed logistic equation (Verhulst 1844) is

Page 46: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 46 -

In general, k is large. For small values of x, cx2/k is negligible compared to cx and initially the population grows exponentially. When x is large, the cx2/k term is no longer small and slows down the rate of increase of x.

The logistic equation can be interpreted if we expand out the logistic equation

which suggests a situation when the birth rate is still constant cx, but in which there is a mortality term, cx2/k, that dominates when the population is high.

If x>k, then dx/dt<0 and the population decreases, when x=k then the population growth is a constant.

Now

putting a=c/k, b=k ab=c, using Example2

Since

it follows from the above form of the solution that xk as t∞ for any x0.

Page 47: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 47 -

(here c≡r)

Let us take the logistic equation

This equation has two population levels x=0 and x=k for which dx/dt=0. These are called equilibrium levels. Suppose that the population is closed to one of these levels at some time and we want to see whether it will remain close to that level for all t?

If it does, we say that the population is locally stable, if it does not remain close then it is unstable. From the graph, the point x=k is locally stable but x=0 is unstable. We can gain this information without sketching the graph as follows:For x=k write x=k+X(t), where X(t) is a small quantity; then dx/dt=dX/dt, since k=constant, and from the logistic equation

Since X(t) is a small quantity we can neglect the term containing the X2 term, so

Since c>0, X→ 0 as t→∞, i.e. x remains close to x=k and so is locally stable.

Harvesting

The population of fish in the North Sea can be described by the logistic equation

Page 48: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 48 -

putting s=c/k a positive number.

Suppose that the fish are caught (harvested) at a constant rate h, i.e. in the absence of all other factors

To account for harvesting the logistic equation must be modified to

Let us first discuss the equilibrium levels of this model. The equilibrium levels are at x=xe, such that dxe/dt=0, i.e.

(*)

Solving this second order equation we obtain

Case (a) If the determinant is positive, i.e. k2/4-h/s>0, then (moderate fishing).

In this case, there are two positive real roots (i.e. two equilibrium levels) x1 and x2 where

and

Page 49: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 49 -

Case (b) If the determinant is negative i.e. k2/4-h/s<0, then (over intensive

fishing).

In this case there are no real roots, i.e. there are no equilibrium levels. Completing the squares, dx/dt can be written as

(**)

dx/dt< 0 for all values of x, i.e. since dx/dt never reaches 0, we have no equilibrium levels.

Case (c) If the determinant is zero, i.e. . k2/4-h/s=0. Equation (*) has a repeated root

From equation (**)

for all values of x except x=xe.

(ii) Local stability. First we consider case (a) where we have two equilibrium levels. Let x=xe+X(t), where xe=x1 or x2. Then

When xe=x1

Neglecting terms proportional to X2, we arrive at a simple first order differential equation which can be solved by separating the variables

where A is a constant. Since x1>x2, X0 as t∞ and so x1 is locally stable.

When xe=x2

Page 50: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 50 -

and so x2 is unstable.

(iii) Graph of x(t)

First of all we note that

Forx>x1 dx/dt<0 => x decreasingx2<x<x1 dx/dt>0 => x increasing0<x<x2 dx/dt<0 => x decreasing

Here x0=x(0). If x0<x2, the graph intersects x=0 at a finite time T. From

Case (b)

In this case we have no equilibrium levels, i.e. dx/dt <0 for all values of x.

Page 51: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 51 -

In either case x becomes zero in a finite time.

Case (c) h=sk2/4. The graph can be obtained easily from case (a) when the two roots are identical, i.e. x1=x2.

Conclusions: Although limited, this modelling of harvesting indicates that there is a maximum harvesting rate

at which the population can sustain itself in equilibrium. Any greater rate leads to a depletion of stock eventually to zero. At h=ck/4 the equilibrium level is k/2 (not the equilibrium level k of the logistic model). Any harvesting of depleted species will result in extinction.

Two species model. Predator-prey

Suppose an island supports a crop of foliage and populations of foxes and rabbits. The foxes eat the rabbits. The rabbits eat the foliage (i.e. limited supply). What happens with the populations???

Page 52: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 52 -

Assuming no other interference with the system, we might expect the two populations to oscillate.

Let x(t) be the population of rabbits at time t. With no foxes around, we assume that x(t) obeys the logistic equation

a/b being the carrying capacity or saturation level.

Let y(t) be the population of foxes at time t. Assuming that the number of encounters per unit time between foxes and rabbits is proportional to x and y and that a certain proportion of these results in rabbit being eaten, i.e. the rate of decrease in the rabbit population is proportional to xy. In this case the differential equation becomes

(1)

If no rabbits are present, we assume foxes die out exponentially, i.e.

With rabbits present, the rate of increase of foxes is proportional to the number of successful encounters with rabbits and so the differential equation becomes

(2)

The two populations are therefore determined by the coupled pair of nonlinear ordinary differential equations (1) and (2). Putting b=0 (=> an abundance of foliage) gives the Lotka-Volterra (LV) equations

(3)

(4)

Equilibrium populations. Let x=xe and y=ye the equilibrium populations and they are given by the usual conditions dxe/dt=0, dye/dt=0, i.e.

(5) (6)

Equation (5) is satisfied by xe=0 or ye=a/c.

Page 53: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 53 -

If xe=0, then from Eq. (6) we obtain that ye=0. If ye=a/c, then from Eq. (6) we obtain that -p+qxe=0 => xe=p/q.

The equilibrium populations are therefore

Are these equilibrium populations stable?

Let us take the Lotka-Volterra equations (Eqs. (3) and (4)) and we consider

where the quantities X and Y are small increments. These expressions are introduced back into the Lotka-Volterra equations and we obtain

=>

(7)

(8)

This is a system of two coupled first order ordinary differential equations. In order to solve this system, we use the usual procedure, i.e. first we differentiate Eq. (7) with respect to t and we use the derivative of Y with respect to t from Eq. (8)

(9)

To find the governing equation for Y, we follow the same way, i.e. we differentiate Eq. (8) with respect to t and use Eq. (7)

(10)

The general solution of (10) is

(11)

Page 54: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 54 -

putting ω2=ap.To find the solution for X, we use Eq. (8) which gives

(12)

[Using Eq. (9) to find X introduces extra constants which are connected to A and B via Eq. (8)]

Suppose that at t=0, X=X0 and Y=Y0. Then A=Y0 and B=X0aq/cω, so that

The above equations show that X and Y are bounded and so stay close to x=p/q, y=a/c for all t, so this point is locally stable.

Also

(13)

putting

where we have used the trigonometrical identity

Page 55: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 55 -

For the other equilibrium level (0,0), we put

x=0+X=X, y=0+Y=Y

then from Eqs. (3) and (4) we have

Having in mind that X and Y are small quantities, we can neglect the 2nd order terms XY

X grows exponentially in time since a>0, i.e. X∞ as tω the point (0,0) is unstable

N.B. Only need either X or Y to grow exponentially for an unstable point.

Summary

I. One species

I.a Exponential model: (comparison with data

I.b Logistic model: limited resources, saturation level k

-solution -graph

I.c Harvesting: constant rate h, the rate proportional to x and the differential equation of the form similar to the logistic model

Page 56: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 56 -

Equilibrium levels (x=xe): dxe/dt=0 Local stability (instability): take x=xe+X(t) and neglect second order terms in XII. Two species II.a Predator-prey (notes) II.b Competing species (example sheet 9, 11) Equilibrium levels and stability

Discrete Mathematics and Difference Equations

Discrete mathematics is the branch of mathematics dealing with objects that can assume only distinct, separated values. The term "discrete mathematics" is therefore used in contrast with "continuous mathematics," which is the branch of mathematics dealing with objects that can vary smoothly (and which includes, for example, calculus). Whereas discrete objects can often be characterized by integers, continuous objects require real numbers.

The study of topics in discrete mathematics usually includes the study of algorithms, their implementations, and efficiencies. Discrete mathematics is the mathematical language of computer science, and as such, its importance has increased dramatically in recent decades.

Mathematical computations frequently are based on equations that allow us to compute the value of a function recursively from a given set of values. Such an equation is called a “difference equation” or “recurrence equation”. These equations occur in numerous settings and forms, both in mathematics itself and in its applications to statistics, computing, electrical circuit analysis, dynamical systems, economics, biology, etc.

ExampleIn 1626, Peter Minuit purchased Manhattan Island for goods worth $24. If the $24 could have been invested at an annual interest rate of 7% compounded quarterly, what would it have been worth in 2004?

SolutionLet y(t) be the value of the investment after t quarters of a year. Then y(0)=24. Since the interest rate is 1.75% per quarter, y(t) satisfies the difference equation

Computing y recursively, we have

Page 57: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 57 -

In 378 years, or 1512 quarters, the value of the investment is

y(1512)=24(1.0175)1512≈5.9x1012 (about 5.9 trillion dollars!)

ExampleIt is observed that the decrease in the mass of a radioactive substance over a fixed time period is proportional to the mass that was present at the beginning of the time period. If the half life of radium is 1600 years, find a formula for its mass as a function of time.

SolutionLet m(t) represent the mass of the radium after t years. Then

m(t+1)-m(t)=-km(t)

where k is a positive constant. Then

m(t+1)=(1-k)m(t), t=0,1,2…

Using iteration as in the previous example, we find

Since the half life is 1600 years

(In physics, this problem is usually solved using an integral of a differential equation. The solution presented here is somewhat shorter and employs only elementary algebra)

The starting equations in the above examples were all difference equations. By definition, an equation which expresses the value an of a sequence {an} as a function of the term an-1

is called first-order difference equation. If we can find a function f such that an=f(n), n=1, 2, 3…, then we will have solved the difference equation.

Both examples had a general difference equation of the form

From the above examples, it is obvious that if x0 is the initial value, then

Page 58: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 58 -

Given the constants A and B, a difference equation of the form

is called a first-order linear difference equation. Note that the linear difference equation reduces to the difference equation if B=0. In order to solve this type of equation, we write

Note that if A=1, this gives us

as the solution of the difference equation xn+1=xn+B. If A≠1, we know that

Hence

is the solution of the first-order linear difference equation xn+1=Axn+B, when A≠1. ____________________________________________________Example (Newton’s law of cooling)If T0 represents the initial temperature of the object, S the constant temperature of the surrounding environment and Tn the temperature of the object after n units of time, then the change in the temperature over one unit of time is given by

where k is a constant which depends upon the object. This difference equation is known as Newton’s law of cooling. Suppose a cup of tea, initially at a temperature of 82 C, is placed in a room which is held at a constant temperature of 26 C. Moreover, suppose that after one minute the tea has cooled to 80 C. What will the temperature be after 20 minutes?

SolutionIf we let Tn be the temperature of the tea after n minutes and we let S be the temperature of the room, then we have T0=82, T1=80, and S=26. Newton’s law of cooling states that

Page 59: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 59 -

where k is the constant which we have to determine. To do so, we make use of the information given about the change in the temperature of the tea during the first minute. When n=0, we have

Thus, the original equation reduces to

Now the last equation is in the standard form of a first-order linear difference equation, so from the solution (according to the method of solving presented earlier)

In particular,

So after 20 minutes the tea has cooled to just below 54 C. ____________________________________________________An equation of the type

where a, b and c are constants and f(n) a given function is called a second order constant coefficient difference equation. The equation is said to be homogeneous if f(n)=0 and inhomogeneous if f(n)≠0.

a. Homogeneous second order difference equations

We can have an idea on how these equations can be solved by looking first at first-order equation with constant coefficient

which has the solution

Page 60: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 60 -

where A is any constant. With this in view, we attempt to find solutions of

in the form

where p is a constant. Thus

for all n. The solution p=0 leads to the trivial solution un=0. We are interested in the roots of the equation in the brackets which is called the characteristic equation. According to the nature of the roots of the characteristic equation, we can have different solutions.

Case 1: Distinct rootsThe general solution of the second-order difference equation for distinct roots p1 and p2 of ap2+bp+c=0 is

for any constant A and B.

ExampleFind the general solution of

SolutionThe characteristic equation is p2-p-6=0 or (p-3)(p+2)=0. This means that the roots are p1=3 and p2=-2. Hence the general solution is

ExampleFind the solution of

that satisfies u0=1, u1=2.

Page 61: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 61 -

SolutionThe characteristic equation is

The roots are p1=-3 and p2=1. Hence the general solution is

Using the initial conditions

Hence A=-1/4 and B=5/4. The required solution is

Case 2: Equal roots(p1=p2=p)The general solution of is

(please note the difference in the form of the second-order difference equation)

Case 3: Complex rootsThe general complex solution of , where b2<4ac, is

This solution can be written in other form by writing the complex numbers in polar coordinates (r,θ). The connection between the two forms of writing a complex number is

So the general solution of a second-order homogeneous difference equation with complex roots can be also written as

ExampleObtain the general solution of

Page 62: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 62 -

SolutionThe characteristic equation is p2+1=0, giving roots p1=i and p2=-i. Therefore

In polar form, r=1 and

where k is an integer number. So, the solution is

b. Inhomogeneous second-order difference equations

The general inhomogeneous equation is

We write un=vn+qn, where vn is the general solution of the corresponding homogeneous equation. Substitute this form of un into the general equation

or

Since vn satisfies the homogeneous equation, it follows that

which means that qn must be a particular solution of the inhomogeneous equation. As in the theory of differential equations, vn is known as the complementary function.

We construct particular solutions by appropriate choices of functions usually containing adjustable parameters which are suggested by the form of the function f(n). In the following table you will find the suggested forms of particular solutions

Page 63: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 63 -

ExampleObtain the general solution of

SolutionFrom the example solved earlier, the complementary solution is

For the particular solution, we try qn=C (see the table above). Then

Hence qn=-2/3, and the general solution is

ExampleObtain the general solution of

SolutionFrom a previous example, we know that the complementary solution is

In this case we expect a particular solution of the form qn=C. However, if we introduce this form into the general solution, we would obtain that the left-hand side of the equation is identical zero. That means that this choice of the particular solution fails, so we are choosing qn=Cn. Then

Hence the general solution is

Page 64: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 64 -

Numerical methods for solving ordinary differential equations.

Most ordinary differential equations arising in real-world applications cannot be solved exactly. These equations can be analyzed qualitatively. However, qualitative analysis cannot give accurate answers. A numerical method can be used to get an accurate approximate solution to a differential equation.

1. Euler’s method

We will focus on this method as the simplest numerical method used for solving ordinary differential equations. In order to emphasize the importance of numerical methods, let us take first an example: solve the equation y′=2x with y(0)=0.

It is obvious that this simple equation has as solution y=x2, i.e. a formulaic solution. On the other hand, say we were to use a numerical technique. The resulting numerical solution would be a table of values. To have a better idea of these two solutions, let us compare them side by side, along with the graphs

Notice that the graph derived from the formulaic solution is smoothly continuous, consisting of infinite number of points on the interval shown. On the other hand, the graph based on the numerical solution consists of just a few points as the numerical method apparently only found the value of the solution for x-increments of size 0.2.

The first question you could ask is “ then what good is the numerical solution if it leaves out so much of the real answer?”. Well, we can answer to this question in several ways:

1. The numerical solution still looks like it is capturing the general trend of the ‘real’ solution => if we are looking for a qualitative view of the solution, we can still get it from the numerical solution.2. The numerical solution can be even improved by playing ‘join-the-dots’ with the set of points it produces. 3. Using a numerical approach, we can find the value of the solution at a specific point.4. If a formulaic expression for solution is not possible, here the numerical solutions are the only possibility to find solutions (errors)

Page 65: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 65 -

In what follows we will concentrate mainly on first order equations only. In order to develop a technique for solving first order differential equations when the initial values are given (or initial value problems). We assume that the studied equation has the form y′=f(x,y) with y(x0)=y0. Our goal is to find a numerical solution, i.e. we must find a set of points which lie along the initial value problem’s solution. This means that we actually know one point of the solution, i.e. (x0,y0)-initial value.

Now, remember we do not know the true solution of the problem, but let us act as if we do know this elusive solution for a moment. Let us pretend that its ‘ghostly graph’ could be superimposed onto our previous picture to get this

Since we are after a set of points which lie along the true solutions, we must now derive a method of generating more solutions in addition to the initial condition. Let use the other part of the problem, namely the form of the differential equation itself.

Remember that one interpretation of the quantity y′ appearing in this expression is as the slope of the tangent line to the function y. But the function y is exactly what we are looking for as solution of the problem, i.e.

slope of the function=f(x,y)

Now we have to think how can we use this slope to find subsequent points on the graph. Actually, we can obtain the slope by substituting values for x and y into the function f. These values, of course, must be the coordinates of a point lying on the solution’s graph—they cannot just be the coordinates of any point anywhere in the plane. Therefore we use the initial value as starting point, i.e. we can find the slope of the graph at the initial value

Page 66: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 66 -

slope of the solution at (x0,y0)=f(x0,y0)

Remembering that this gives us the slope of the function’s tangent line at the initial point we could put this together with the initial point itself to build the tangent line at the initial point

Looking at the two graphs, we can observe that close to the initial value the two curves are every close to each other. Let us say we move a short distance away, to a new x-coordinate of x1. Then we could locate the corresponding point lying on our tangent line. It might look like this

Notice that our new point, called (x1,y1), is not too far away from the true value of the solution at this x-coordinate, up on the curve. So we now have two points as part of our numerical solution a. (x0,y0): an exact value, known to lie on the solution curveb. (x1,y1): an approximate value, known to lie on the solution curve’s tangent line through (x0,y0).

We must now attempt to continue our quest for points on the solution curve. Next we will repeat our last step, constructing a tangent line at our new point

Page 67: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 67 -

There is a problem here: since our new point did not actually lie on the true solution, we cannot actually produce a tangent line to the solution at this point. But we can still substitute our new point (x1,y1), into the formula

slope of the function=f(x,y)

to get the slope of a pseudo-tangent line to the curve at (x1,y1). We hope that our approximate point, is close enough to the real solution that the pseudo-tangent line is pretty close to the unknown real tangent line. We now attempt to use this new pseudo-tangent line to get another point in the approximate solution. As before, we move a short distance away from our last point, to a new x-coordinate of x2. Then we locate the corresponding point lying on our pseudo-tangent line. The result might look something like this

We now have three points in our approximate solution:a. (x0,y0): an exact value, known to lie on the solution curveb. (x1,y1): an approximate value, known to lie on the solution curve’s tangent line through (x0,y0)c. (x2,y2): an approximate value, known to lie on the solution curve’s pseudo-tangent line through (x1,y1).

This method can be repeated making new points for as long as we like.

Now let us see what the theoretical background of the Euler’s method is. We are solving the initial value problem

Page 68: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 68 -

As said before, the basic idea is to use a known point as a starter, and then use the tangent line through this known point to jump to a new point. Let us use the names (xn,yn) for the known point (xn+1,yn+1) for the new point

Our picture, based on the previous experience, should look like something like this

Our task is to find formulas for the coordinates of the new point, xn+1. Clearly, it lies on the tangent line, and this tangent line has a known slope, namely f(xn,yn). Let us mark the sizes of the jumps in the x and y direction as we move from the known point to the new point.

From the formula relating xn and xn+1 is obvious that Also we know from basic algebra that slope=rise/run, so applying this idea to the triangle in our picture, the formula becomes

which can be rearranged to solve for Δy giving

But, we are really after a formula for yn+1. Looking at the picture, it is obvious that yn+1=yn+Δy. Replacing Δy by our new formula, this becomes

.

ExampleSolve the initial value problem

Page 69: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 69 -

numerically, finding a value for the solution at x=1, and using steps of size h=0.25.

SolutionWe apply the theoretical formulas found before. The interval we want to find intermediate points is [0,1]. In our case f(x,y)=x+2y and the starting point is x0=0, y0=0. We generate values for x1, y1.

The x-iteration formula, with n=0 gives

The y-iteration formula, with n=0 gives

So the second point in our numerical solution is x1=0.25, y1=0.

We move on to get the next point in the solution, (x2,y2), n=1.

So the third point is x2=0.5, y2=0.0625.

The x-iteration and y-iteration, with n=2 gives

So the fourth point is x3=0.75, y3=0.21875

Carrying on with the same method we obtain that the fifth point is x4=1, y4=0.515625.

We could summarise the results of all our calculations in a tabular form, as follows

Page 70: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 70 -

A question you should always ask yourself at this point using a numerical method to solve a problem is “How accurate is my solution?” Sadly, the answer is “Not very!”. The true solution of the given initial value problem turns out to be

If we use this formula to generate a table similar to the one above, we can see just how poorly our numerical solution did

We can get an even better feel for the inaccuracy we have incurred if we compare the graphs of the numerical and true solutions, as shown here

The numerical solution gets worse and worse as we move further to the right. We might even be prompted to ask the question “What good is a solution that is bad?” The answer is “Very little good at all!”. So should we quit using this method? No! The reason our numerical solution is so inaccurate is because our step-size is so large. To improve the solution, we have to shrink the step-size. For h=0.02 we would get a much better agreement (see the graph).As you can see, the accuracy of this numerical solution is much higher than before, but so is the amount of work needed.

DIFFERENTIAL EQUATIONS AND MAPLE

Maple’s diversity makes it particularly well suited to performing many calculations encountered when solving many ordinary and partial differential equations. In many cases, Maple’s built-in functions can immediately solve a differential equation by providing an explicit, implicit, or numerical solution. The advantages of using Maple in

Page 71: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 71 -

the study of differential equations are numerous, but perhaps the most useful is that of being able to produce the graphics associated with solutions of differential equations.

In what follows you will see how we can solve various types of differential equations using Maple. By now you already have a vast knowledge of Maple (SOM104), so we can start directly with applications without introducing basic concepts about Maple.

Generally, the commanddsolve -Solves ordinary differential equations (ODEs)

Calling sequences: dsolve(ODE, y(x), extra_args) dsolve({ODE, ICs}, y(x), extra_args) dsolve({sysODE,ICs},{funcs}. extra_args)

Parameters ODE -an ordinary differential equation y(x) - any indeterminate function of one variable ICs - initial conditions {sysODE} - a set with a system of ODEs {funcs} - a set with indeterminate functions attempts to solve the given differential equation for the specified function of one variable.

ExampleVerify that the differential equation y′=-ycosx has infinitely many solutions

SolutionWe use dsolve to solve the first-order linear equation and name the result sol. We interpret the result to mean that if C is any number, a solution to the equation is y=Ce-sinx. Thus, the equation has infinitely many solutions

>sol:=dsolve(diff(y(x),x)=-y(x)*cos(x),y(x));

sol:=y(x)=_C1e(-sin(x))

We can plot several solutions using the plot command

>pict:={seq(subs(_C1=I,rhs(sol)), i=-5..5)}: plot(pict,x=0..4*Pi);

Page 72: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 72 -

In many applications we are given not only the differential equation to solve but also one or more conditions that must be satisfied by the solution(s) as well. In the calling sequence of dsolve, ICs means initial conditions.The following commands illustrate how to plot some members of the family of solutions by substituting various values of C into the general solution. We also plot the solution to the problem

First we use seq to generate a table of functions x3-2x2+C for C=-10, -8,…,8, 10, naming the resulting set of function toplot. The set of functions toplot is not displayed (for length reasons) because a colon (:) is included at the of the command

> cvals:=seq(2*I,i=-5..5): toplot:={seq(x^3-2*x^2+c,c=cvals)}: plot(toplot,x=-2..3,view=[-2..3,-15..15])

Page 73: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 73 -

Example (The Logistic Equation) The logistic equation is

where r and a are constants, subject to the condition y(0)=y0. This equation can be also written as y′=ry-ay2, where the term –y2 represents an inhibitive factor. Under the

Page 74: Key Points - Mathematics and Statistics - The University …maths.dept.shef.ac.uk/maths/courses/MAS103/lect_notes.doc · Web viewA homogeneous differential equation is an equation

AMA126 - 74 -

assumptions made, the population is allowed neither to grow out of control not to grow or decay constantly. The logistic equation is separable and, thus, can be solved by separation of variables:

Applying the initial condition y(0)=y0 and solving for K, we find

After substituting this value into the general solution and simplifying, the solution can be written as

We are also able to use dsolve to solve this initial-value problem. First, we use dsolve to solve the initial-value problem, naming the resulting output Sol.

> y:=′y′: Sol:=dsolve({diff(y(t),t)=(r-a*y(t))*y(t), y(0)=y0},y(t));

Then we use assign to name y(t) the result obtained in Sol and simplify to simplify y(t) > assign(Sol): simplify(y(t));