Differential Equations Day 1 -- Introduction & Slope Fields

Introduction and Algebra Equations
The first thing we absolutely must discuss is what a differential equation [i]is[/i]. [br][br]By the end of this activity you should know what a differential equation (or "DiffyQ" for short) is, what it means for a function to be a solution of a differential equation, and how you can verify--both geometrically and algebraically--with GeoGebra that a function is in fact a solution to a differential equation. [br][br]First, let's review something you're already familiar with: an algebraic equation. For instance these are two algebraic equations:[br][br]1. [math]5x+10=15[/math][br][br]2. [math]\left|x\right|=5[/math][br][br]For equation 1, the answer is [math]x=1[/math]. You can verify that [math]x=1[/math] is a solution by putting 1 in place of [i]x[/i] and then verifying that there is equality between the left and right side:[br][br]1. [math]5\cdot1+10=15[/math][br][br]For equation 2, the answers are [math]x=-5[/math] and [math]x=5[/math]. You can verify that these are both solutions by putting -5 and 5 in for [i][math]x[/math][/i] (one at a time) and verifying that in both equations there is equality between the left and right sides. [br][br]2. [math]\left|-5\right|=5[/math][br][br]In an algebraic equation, generally the unknown quantity "[i][math]x[/math][/i]" is a number. An algebraic equation is "solved" when a specific number is found that can be put in place (or "substituted") for the unknown, and equality is maintained. You probably already know this, but you may have never thought about it in this way before. [br][br]It's important that you stop and think through this basic fact about Algebra before proceeding. This way of thinking about algebraic equations and their solutions sets the stage nicely for defining a differential equation.
Differential Equations
[b]Definition: [/b]A [b]differential equation[/b] is an equation in which the unknown is a function, and various derivatives of the unknown function are related to each other in an equation. A differential equation is said to be [b]solved[/b] when a function (or family of functions) is found which can be  substituted for the unknown function, and equality is maintained. [br][br]For example here are two differential equations:[br][br]1. [math]f'=3x^2[/math][br][br]2. [math]f'=\frac{x}{f}[/math][br][br]In both of the examples, the unknown function is [i][math]f[/math][/i], or [math]f(x)[/math]. Differential equations are often re-written with [i][math]y[/math][/i] instead of [i][math]f[/math][/i] (or instead of [math]f(x)[/math] ), and [math]f'[/math] re-written as [math]dy/dx[/math]. In other words [i][math]f[/math][/i], [math]f(x)[/math], and [i][math]y[/math][/i] all essentially mean the same thing. Similarly, [i][math]f'[/math][/i], [i][math]f'(x)[/math][/i] and [i][math]dy/dx[/math][/i] all essentially meant the same exact thing.[br][br]For instance the above differential equations are often re-written as the following equivalent differential equations:[br][br]1. [math]\frac{dy}{dx}=3x^2[/math][br][br]2. [math]\frac{dy}{dx}=\frac{x}{y}[/math][br][br]You may also see [i][math]y'[/math][/i] as shorthand for [math]dy/dx[/math]. I sincerely apologize about the variety of notation used in denoting differential equations! Unfortunately, there's nothing I can do about it.[br][br]Throughout this course we will be learning to categorize differential equations based on characteristics they exhibit. We'll also then learn algebraic solution techniques for finding solution functions of the equations. However, you only need basic Calculus 1 derivative skills to verify that a function is in fact a solution to a differential equation. [br][br]For instance let us check that the following are solutions to the above differential equations.[br][br]1. [math]f\left(x\right)=x^3+C[/math][br][br]The derivative of this family of functions is [math]f'\left(x\right)=3x^2[/math]. Note that I have to say "family of functions" because of the "[math]+C[/math][i]". [/i]In reality, [math]f\left(x\right)=x^3+C[/math] is an infinite family of functions, one for each possible value of [i][math]C[/math][/i] from negative infinity to positive infinity. Don't sweat this now however. Focus on how this function is in fact a solution to the differential equation. In fact, there's nothing to do. The differential equation was [math]f'=3x^2[/math] and the derivative of [i]f[/i] is the same thing as the differential equation.[br][br]2.[math]f\left(x\right)=\pm\sqrt{x^2+c}[/math][br][br]The derivative is [math]f'(x)=\pm\frac{1}{2}(x^2+c)^{-1/2}2x=\pm\frac{x}{\left(x^2+c\right)^{\frac{1}{2}}}=\pm\frac{x}{\sqrt{x^2+c}}[/math]. Replacing [math]\pm\sqrt{x^2+c}[/math] with [i][math]f[/math] [/i]shows us that [i][math]f[/math][/i] is a solution of the differential equation [math]f'=x/f[/math].
Visualizing Differential Equations and Solutions With Slope Fields
The most powerful tool for visualizing differential equations and their solutions are called [b]slope fields[/b]. A slope field plots [math]dy/dx[/math] as tiny slope marks by thinking of [math]dy/dx[/math] as a function of two variables [i][math]x[/math][/i] and [i][math]y[/math][/i]. [br][br]It's possible to plot slope fields by hand, but we'll mostly explore slope fields with the assistance of GeoGebra. [br][br]First we will look at the differential equation [math]\frac{dy}{dx}=3x^2[/math][br][br]You can create slope fields in GeoGebra by being sure [math]dy/dx[/math] is isolated on the left side of the equation, and then passing the right hand side to the function [code]slopefield()[/code] in the input bar. For instance, this code will plot the slope field of the above differential equation:[br][br][code]slopefield(3x^2) [/code][br][br]The family of solution functions can then be plotted by typing this code into the input bar (and I agreed to "Create a Slider for c" when prompted).[br][br][code]f(x)=x^3+c[/code][br][br]Look at the applet below. Try adjusting the slider for [code]c[/code] to explore how changes in [code]c[/code] impact [code]f[/code]. What do you notice about how [code]f[/code] relates to the slope field of the differential equation. Notice that the visual cue that a function is a solution to the differential equation is that the slope field always matches the tangent line of every function at every point. In other words, the function precisely follows the "guides" the slope field tick marks offer.[br][br]
Now try out equation 2 and its solution on your own below.[br][br]Equation 2:[br][math]\frac{dy}{dx}=\frac{x}{y}[/math] -- code: [code]slopefield(x/y)[/code][br]Solution to Equation 2:[br][math]f\left(x\right)=\pm\sqrt{x^2+c}[/math] -- code [code]f_1(x)=sqrt(x^2+c)[/code] and [code]f_2(x)=-sqrt(x^2+c)[/code] -- SAY YES to create a slider for c!
Using GeoGebra to Check a Solution of a Differential Equation
[code][/code]You can also use the Algebra Pane of GeoGebra to check if a function is a solution to a differential equation.[br][br]First, rearrange the summands of the differential equation so that everything is on one side of the equation, and the other side is 0. For instance, in the case of [br][br][math]y'=\frac{x}{y}[/math][br][br]this would mean[br][br][math]y'-\frac{x}{y}=0[/math][br][br]or[br][br][math]\frac{x}{y}-y'=0[/math][br][br]It doesn't matter which of the above you use. [br][br]Now to use GeoGebra to check that[br][br][math]f(x)=\pm\sqrt{x^2+c}[/math][br][br]is a solution, first type both functions into GeoGebra with[br][br][code]f_1(x)=sqrt(x^2+c)[/code][br][br]and[br][br][code]f_2(x)=-sqrt(x^2+c)[/code][br][br]Be sure to agree to create a variable [code]c[/code].[br][br]Now calculate their derivatives with[br][br][code]derivative(f_1)[/code][br][br]and [br][code][br]derivative(f_2)[/code][br][br]Now the key step is to type this into GeoGebra[br][br][code]simplify(f_1'-x/f_1)[/code][br][br]and[br][br][code]simplify(f_2'-x/f_2)[/code][br][br]both of these should be 0. If not, then the functions are not solutions. Note that the input to [code]simplify( )[/code] in both of the above commands is the non-zero side of the differential equation, but with the functions [code]f_1[/code] and[code] f_2[/code]. All of this has been done for you in the applet below![br]

Information: Differential Equations Day 1 -- Introduction & Slope Fields