First order differential equations

About this lesson plan

This is a lesson plan for indented for realization during 2h lesson activities.

It has been developed during work in iCSE4school project based on lesson carried out in 2015-2017 at XXXIII LO M. Kopernika w Warszawie.

It was prepared by Mirosław Malinowski based on his lesson.

Attention!

In each of the “code” cells you can change any number, text or instruction. In order to return to the original version refresh the webpage. Sometimes the next code depends on variables defined from the previous one, so one has to execute cells in order of apperance.

Lesson Plan

Based on the book C. Quinn, C. Sangwin, R. Haese. M. Haese, “Mathematics for the international student. Mathematics HL (Option): Calculus, Haese and Harris Publications 2013.

We will only consider differential equations of the form:

\(\normalsize f(x,y) \Large \frac{dy}{dx} \normalsize +g(x,y)=0\), where \(\normalsize y=y(x)\).

These are known as first order differential equations since there is only one derivative in the equation, and it is a first derivative.

A function \(y=y(x)\) is said to be a solution of a differential equation if it satisfies the differential equation for all values of \(x\) ** in the domain of \(y\) .

Slope Fields

Given any first order differential equation of the form \(\normalsize f(x,y) \Large \frac{dy}{dx} \normalsize +g(x,y)=0\), where \(\normalsize y=y(x)\) we can write

\(\Large \frac{dy}{dx} = \frac{-g(x,y)}{f(x,y)}\normalsize =h(x,y)\)

We may therefore deduce the gradient of the solution curves to the differential equation at any point :math:`(x,y)`in the plane where :math:`h(x,y)`is defined, and hence the equations of the tangents to the solution curves.

The set of tangents at all points :math:`(x,y)` is called the slope field of the differential equation .

By representing the gradients at many different grid points as line segments, we obtain a slope field of the tangents to the solution curves. Now the tangent to a curve approximates that curve at and near the points of tangency. Therefore, by following the direction given by the slope field at a given point, we can approximate solution curves of the differential equation.

*Example 1*

Consider the differential equation \(\Large \frac{dy}{dx} \normalsize =x(y-1)\).

  1. Construct the slope field using integer grid points for \(x, y \in [-4, 4]\).

  2. Sketch the particular solution curve through \(P(1, 2)\). Sketch the particular solution curves through several other points of your choice - adjust the parameters of the graph respectively.

  3. An isocline is the set of all points on a slope field at which the tangents to the solution curves have the same gradient. Identify any isoclines on your slope fields.

*Solution:*

EXERCISES

Using SAGE solve the following problems. You can modify the procedure given above or write your own.

  1. Consider the differential equation \(\Large \frac{dy}{dx} \normalsize =2x-y\).

  1. Find the general solution to the differential equation.

  2. Construct the slope field of the differential equation.

  3. Find the solution curve which passes through \(P(0, 1)\) and its equation.

  1. Consider the differential equation \(\Large \frac{dy}{dx} \normalsize =10y \tan(x)\), where \(x\) is measured in degrees. Draw the slope field using integer grid points, where \(x, y \in [-2, 2]\).

  2. Draw the slope field for the differential equation \(\Large \frac{dy}{dx} \normalsize = \Large \frac{-1+x^2+4y^2}{y-5x+10}\).

  1. Sketch the particular solution curve passing through the origin.

  2. Sketch the isocline corresponding to:

  1. \(\Large \frac{dy}{dx}\) being undefined.

  2. \(\Large \frac{dy}{dx} \normalsize =0\).

Separable Differential Equations

Differential equations which can be written in the form \(\large \frac{dy}{dx} \normalsize = \large \frac{f(x)}{g(y)}\), where \(y=y(x)\), are known as separable differential equations.

We can notice that if \(\Large \frac{dy}{dx} \normalsize = \Large \frac{f(x)}{g(y)}\), then \(\normalsize g(y) \Large \frac{dy}{dx} \normalsize = f(x)\). Now, integrating both sides of the equation with respect to \(x\) we get \(\large \int g(y) \large \frac{dy}{dx} \normalsize dx =\int f(x)dx\) and by the Chain Rule we can reduce the problem of solving the differential equation to the problem of finding two separate integrals

\[\large \int g(y)dy =\int f(x)dx\]

*Example 2:*

Find the general solution of the differential equation \(\Large \frac{dy}{dx} \normalsize = \Large \frac{x^2y+y}{x^2-1}\). Verify your results with SAGE and sketch the solution curve passing through the point \(P(x_0, y_0)\) if:

  1. \((x_0, y_0) = (2,3)\)

  2. \((x_0, y_0) = (0,0)\)

  3. \((x_0, y_0) = (-2,1)\)

*Solution:*

EXERCISES

  1. Solve the following initial value problems:

  1. \((2-x)\Large \frac{dy}{dx} \normalsize = 1\), \(y(4) = 3\).

  2. \(\Large \frac{dy}{dx} \normalsize - 3x \sec(x) = 0\), \(y(1) = 0\).

  3. \(e^y(2x^2 + 4x +1)\Large \frac{dy}{dx} \normalsize = (x+1)(e^y +3)\), \(y(0)=2\).

  4. \(x \Large \frac{dy}{dx} \normalsize = \cos^2(y)\), \(y(e) = \large \frac {\pi}{4}\).

  1. Solve \(\Large \frac{dy}{dx} \normalsize = \Large \frac{3y-xy}{x^2-1}\), \(y(0) = 1\).

Homogeneous Differential Equations

Differential equations of the form \(\large \frac{dy}{dx} \normalsize = f\large \left ( \frac{y}{x} \right)\), where \(\normalsize y=y(x)\) are known as homogeneous differential equations .

They can be solved using the substitution \(y=vx\), where \(v=v(x)\). The substitution will always reduce the differential equation to a separable differentiable equation.

*Example 3:*

Use the substitution \(y=vx\), where \(v=v(x)\), to find general solution of the differential equation \(\Large \frac{dy}{dx} \normalsize = \Large \frac{x+2y}{x}\). Verify your results with SAGE and find the particular solution if \(y=\large \frac{3}{2}\) when \(x=3\).

*Solution:*

The Integrating Factor Method

Suppose a first order linear differential equation is of the form \(\Large \frac{dy}{dx} \normalsize +P(x)y=Q(x)\), where \(\normalsize y=y(x)\).

  1. Calculate the integrating factor \(I(x) = e^ {\int P(x)dx}\). You do not need a constant of integration.

  2. Multiply the differential equation through by \(I(x)\).

  3. Simplify the LHS and hence obtain \(I(x)y=\int I(x)Q(x)dx +C\), where \(C\) is a constant.

  4. Integrate to obtain the general solution.

*Example 4:*

Solve the differential equation \(\Large \frac{dy}{dx} \normalsize +3x^2y=6x^2\). Find the particular solution of the equation for the initial condition \(y(0) = 1\).

*Solution:*

PROBLEM

Using the above procedure solve the initial value problem \(\cos x \Large \frac{dy}{dx} \normalsize =y \sin x + \sin 2x\), \(y(0) = 1\).

EXERCISES

  1. Solve the following using the integrating factor method:

  1. \(\Large \frac{dy}{dx} \normalsize +4y=12\).

  2. \(x \Large \frac{dy}{dx} \normalsize +y=x \cos x\).

  3. \(\Large \frac{dy}{dx} \normalsize -3y=e^x\), \(y(0) = 2\).

  4. \(\Large \frac{dy}{dx} \normalsize +y=x+e^x\), \(y(1) = 1.\)

  1. Solve the differential equation \((x+1)y + x \Large \frac{dy}{dx} \normalsize =x - x^2\).