Posts on Differential Equations – 1

Next in line are differential equations. Here are links to some past posts on differential equations

Differential Equations Outline of basic ideas for AB and BC calculus

Slope Fields

Euler’s Method – a BC only topic

Domain of a Differential Equation mentioned on the new Course and Exam Description

Good Question 6  2000 AB 4

Additional post on differential equations next week.


 

 

 

 


 

Good Question 2: 2002 BC 5

This is the second in my occasional series on good questions, good from the point of view of teaching about the concepts involved. This one is about differential equations and slope fields. The question is from the 2002 BC calculus exam. Question 5. while a BC question, all but part b are suitable for AB classes.

2002 BC 5

The stem presented the differential equation \displaystyle \frac{dy}{dx}=2y-4x. Now the only kind of differential equation that AP calculus students are expected to be able to solve are those that can be separated. This one cannot be separated, so some other things must be happening.

Part a concerns slope fields. Often on the slope field questions students are asked to draw a slope field of a dozen or so points. While drawing a slope field by hand is an excellent way to help students learn what a slope fields is, in “real life” slope fields are rarely drawn by hand. The real use of slope fields is to investigate the properties of a differential equation that perhaps you cannot solve. It allows you to see something about the solutions. And that is what happens in this question.

In the first part of the question students were asked to sketch the solutions that contained the points (0, 1) and (0, –1). These points were marked on the graph. The solutions are easy enough to draw.

But the question did not stop there, as we shall see, using the slope field could help in other parts of the question.

Part c: Taking these out of order, we will return to part b in a moment. Part c told students that there was a number b for which y = 2x + b is a solution to the differential equation. Students were required to find the value of b and (of course) justify their answer.

There are two approaches. Since y = 2x + b is a solution, we can substitute it into the differential equation and solve for b. Since for this solution dy/dx = 2 we have

2=2\left( 2x+b \right)-4x

2=4x+2b-4x

1=b

So b = 1 and the solution serves as the justification.

The other method, I’m happy to report, had some students using the slope field. They noticed that the solution through the point (0, 1) is, or certainly appears to be, the line y = 2x + 1. So students guessed that b  = 1 and then checked their guess by substituting y = 2x + 1 into the differential equation:

2=2\left( 2x+1 \right)-4x

2=4x+2=4x

2=2

The solution checks and the check serves as the justification.

I like the second solution much better, because it uses the slope field as slope field are intended to be used.

Incidentally, this part was included because readers noticed in previous years that many students did not understand that the solution to a differential equation could be substituted into the differential equation to obtain a true equation as was necessary using either method for part b.

There is yet another approach. Since the solution is given as linear the second derivative must by 0. So

\displaystyle \frac{{{d}^{2}}y}{d{{x}^{2}}}=2\frac{dy}{dx}-4=2\left( 2y-4x \right)-4

2\left( 2y-4x \right)-4=0

4y-8x-4=0

4y=8x+4

y=2x+1

And again b = 1

Returning to part b.

Part b asked students to do an Euler’s method approximation of f(0.2) with two equal steps  of the solution of the differential equation through (0, 1). The computation looks like this:

f\left( 0.1 \right)\approx 1+\left( 2\left( 1 \right)-4\left( 0 \right) \right)\left( 0.1 \right)=1.2

f\left( 0.2 \right)\approx 1.2+\left( 2\left( 1.2 \right)-4\left( 0.1 \right) \right)\left( 0.1 \right)=1.4

So far so good. But this is is about the solution through the point (0, 1). Again referring to the slope field, there is no reason to approximate (except that students were specifically told to do so). Substituting into y = 2x + 1, f(0.2) = 1.4 exactly!

Part d: In the last part of the question students were asked to consider a solution of the differential,  g, that satisfied the initial condition g(0) = 0, a solution containing the origin. Students were asked to determine if g(x) had a local extreme at the origin and, if so, to tell what kind (maximum or minimum), and to justify their answer.

Looking again at the slope field it certainly appears that there is a maximum at the origin, and since substituting (0, 0) into the differential equation gives dy/dx = 2(0) – 4(0) = 0, it appears there could be an extreme there. So now how do we determine and justify if this is a maximum or minimum? We cannot use the Candidates’ Test (Closed Interval Test) since we do not have a closed interval, nor can we easily determine if there are any other points nearby where the derivative is zero (there are). Therefore, the First Derivative Test does not help. That leaves the Second Derivative Test.

To use the Second Derivative Test we must use implicit differentiation. (Notice that two unexpected topics now appear extending the scope of the question in a new direction).

\displaystyle \frac{{{d}^{2}}y}{d{{x}^{2}}}=2\frac{dy}{dx}-4

At the origin dy/dx = 0 as we already determined, so

\displaystyle \frac{{{d}^{2}}y}{d{{x}^{2}}}=2\left( 0 \right)-4<0

Therefore, since at x = 0, the first derivative is zero and the second derivative is negative the function g(x) has a maximum value at (0, 0) by the Second Derivative Test .

More: Can we solve the differential equation? Yes. The solution has two parts. First we solve the homogeneous differential equation \frac{dy}{dx}=2y, ignoring the –4x for the moment. This is easily solved by separating the variables y=C{{e}^{2x}}, which can be checked by substituting.

Because the differential equation contains x and y and ask ourselves what kind of function might produce a derivative of 2y – 4x? Then we assume there is a solution of the form y = Ax + B where A and B are to be determined and proceed as follows.

\displaystyle \frac{dy}{dx}=2y-4x

A=2\left( Ax+B \right)-4x=\left( 2A-4 \right)x+2B

Equating the coefficients of the like terms we get the system of equations:

A=2B

0=2A-4

A=2\text{ and }B=1

Putting the two parts together the solution is y=C{{e}^{2x}}+2x+1. This may be checked by substituting. Notice that when C = 0 the particular solution is y = 2x + 1, the line through the point (0, 1).

(Extra: It is not unreasonable to think that instead of y = Ax + B we should assume that the solution might be of the form y = Ax2 + Bx + C. Substitute this into the differential equation and show why this is not the case; i.e. show that A = 0, B = 2 and C = 1 giving the same solution as just found.)

Using a graphing program like Winplot, we can consider all the solutions. Below the slope field is graphed using a slider for C to animate the different solutions. The video below shows this with the animation pausing briefly at the two solutions from part a. Notice the maximum point as the graphs pass through the origin.

Slope field

But wait! There’s more!

The next post will take this question further – Look for it soon.

Update June 27, 2015. Third solution to part c added.

Slope Fields

Differential Equation 2 – Slope Fields

Of course, we always want to see the graph of an equation we are studying. The graph of a differential equation is a slope field.  A first derivative expressed as a function of x and y gives the slope of the tangent line to the solution curve that goes through any point in the plane.

Slope fields make use of this by imposing a grid of points evenly spaced across the Cartesian plane. At each point the value of the derivative is calculated and a short segment with that slope is drawn. These segments graphed together form the slope field.

Here is the slope field for the differential equation \displaystyle \frac{dy}{dx}=-\frac{x}{y}

Slope field 1

A good way to introduce slope fields to your class is to put or project a coordinate system on the board. Give each student one or two points (1, –3), (1, –2), (1, –1), (1, 1), (1, 2), etc. Have them calculate the derivative at their point(s) and then come to the board and draw a short segment through their point(s) with the slope they calculated. The result will be a slope field.  (This is, in fact, a common free-response question on the AP exams. Students are given a graph with 9 – 12 points plotted and they are asked to use them to draw a slope field for a given differential equation.)

The big idea with slope fields is to use them to get an idea of what the solutions look like, especially if the differential equation cannot be solved.  The solutions are lurking in the slope field. What do they look like in the figure? Circles of course. We solved this differential equation in the last post. The general solution is {{x}^{2}}+{{y}^{2}}={{C}^{2}}. Of course, they are not all that simple.

Since the solution graphs are lurking in the slope field, the next thing to do is to use the slope field to sketch a particular solution.  After plotting the initial condition (a point) students should draw a curve through the point that follows the slope field from edge to edge in both directions.

In the previous post (example 2) we found the particular solution of  \displaystyle \frac{dy}{dx}=-\frac{x}{y} with the initial condition point (4, –3) to be y=-\sqrt{25-{{x}^{2}}}. This is shown drawn on the slope field in the next graph. The black dot is the point (4, –3). Notice how the solution graph follows the slope field, but does not necessarily hit any of the segments. The solution will touch a segment only if the midpoint of the segment happens to be on the solution – this is not usually the case.

Slope field 2

Slope fields are tedious and time-consuming to draw by hand. It’s a job for computers. There are various graphing calculator programs available on the internet. Calculator screens are not the best for seeing slope fields; they are too small, and you should be sure to always be in a square window (or the slopes will not look right).

There are many websites that will draw slope fields and solution curves for you.  You can try this one. The figures in this post were done with Winplot (of course, my favorite). The good ones let you draw and animate solution curves over the slope field. (I have not found a good slope field generator app for iPads; if anyone makes apps, consider this a hint.)

Here is a brief example that shows how powerful an animated graph can be. In Winplot, follow the path Window > 2-dim > Equa > differential > dy/dx.  Enter the differential equation in the box and adjust the other settings as necessary.  Be sure you are in a square window (CTRL+Q).

The example below is from the 2002 BC exam question 5: dy/dx=2y-4x. Notice that this equation is not separable; students were not expected to solve it. They were asked to draw the solution curves through the two points (0, 1) and (0, –1) shown here in blue. These points are marked on the graph (Equa > point > (x,y)). The general solution, found by CAS, is y=C{{e}^{2x}}+2x+1. Enter this (Equa > 1.Explicit) and open the C slider (Anim > individual > C).

In the video below the C values go from –5 to 5. They stop momentarily at the two initial condition points (C = –2 for (0,–1) and C = 0 for (0, 1)). These are what the students were expected to sketch.

Slope field

The point is to see how the different values of C affect the equation, each giving its own particular solution, and to see the different solution hiding in the slope field.

Winplot may be downloaded here.

A DESMOS program that will draw slope fields is here.