DERIVE Exercises

course Mth 164

2/4 2pm

IntroductionThe computer program DERIVE can be used to plot data sets, fit function models to data, solve equations, simplify algebraic expressions, and perform many other useful mathematical tasks quickly and (almost) painlessly.

The present page presents an introduction to authoring and plotting algebraic expressions and data sets, solving equations and simplifying algebraic expressions, and fitting a selected function model to a data set.

Authoring Expressions and Solving Equations

Assuming that the icon is on the desktop, click on the DERIVE icon.

The program will load and you will see the initial DERIVE screen, labeled Algebra I at the top.

Near the bottom of the screen you will see the Enter Expression box. Click in that box or use the keyboard combination alt-A then E to Author an expression (note how the Author drop-down menu along the top of the screen is activated by alt-A).

Type in the equation 2x + 3 = 7 and use the Enter key to send this expression into the Algebra window above. The equation will appear as expression #1.

Suppose you wish to solve the equation. You could of course solve it by adding -3 to both sides then multiplying by 1/2. The result is clearly x = 2. Let DERIVE solve the equation for you. Click back in the Algebra window, on the equation you just entered, to reactivate the algebra window (if you find a way to do this using the keyboard please inform the instructor). Click on soLve or use alt-L and choose Expression, then click the Algebraically radio button then on the Solve button.

Again click on the equation, the on soLve, then Expression and click the Numerically radio button, and finally click on the Solve button. Note the difference in the solutions.

Now solve the equation (x-2)(x+3) = 0, as follows:

Click on Author, then on Expression. This will place the cursor in the 'expression

box' near the bottom of the screen.

Enter the equation (x - 2) ( x + 3) = 0 and hit the Enter key.

The equation will show above in the main window.

Look at the equation. Note that if x=-3, the equation is true. For what other obvious value of x is the equation true? Is it possible for any other value of x to make the equation true? Enter your response starting in the line below:

#$&*When I enter the equation (x-2)(x+3)=0 and note that x=-3 I also know that the other obvious value of x is 2 to make the equation true.

Now click on soLve, Expression and click on the Solve button.. You will get two expressions separated by sort of a wide V symbol, which indicates 'or'. Note that DERIVE gives you the solutions you should have expected.

The F3 button will copy the highlighted expression into the 'expression

box'.

Clear the 'expression

box' (there are many ways to do this; one was is to highlight the expression presently in that box and strike the deleted key).

Highlight the expression in the main window (you need only click on the expression to highlight it) and strike the F3 key. The expression will show in the 'expression

box'.

Copy and paste that expression into the line below.

#$&* (x - 2)·(x + 3)

SOLVE((x - 2)·(x + 3), x)

x = -3 ∨ x = 2

Author and solve the equation (x-2)(x+3) = 2x + 3, time selecting an Algebraic solution. The solutions will be in radical form, and would have to be approximated before you know how large or small the solutions are.

Click on Simplify, then Approximate (or use the keyboard if you choose) and note that you can choose the number of digits of precision. Then click the Approximate button. You can always use this process to render an expression in approximate decimal form.

Use F3 to place this expression into the 'expression

box' and copy and paste it into the line below:

#$&* (x - 2)·(x + 3)

SOLVE((x - 2)·(x + 3), x)

x = -3 ∨ x = 2

Solving Equations and Interpreting Graphs

Now run through the following exercise, in which you author and solve the same equation while plotting relevant graphs and using some helpful editing options:

Highlight the equation (x-2)(x+3) = 0. Press the F3 key and notice how the equation appears in the Expression box. Using the Delete or Backspace key and either mouse or arrows, delete the '= 0' part of the equation and hit the Enter key. The expression (x - 2) ( x + 3) should appear in the main window, as well as in your Expression box.

Plotting the expression

Plot the expression as follows:

First open a 2-dimensional plot window by clicking on the Window menu and selecting New 2D Plot Window (remember you can always use the indicated keyboard shortcuts if you wish; that won't be mentioned again, but keyboards are inherently faster than mice so their use is encouraged).

Be sure the expression (x-2)(x+3) is highlighted in the Algebra window (click on Window and choose the Algebra window). Then return to the Plot window. You can plot the expression by clicking on Insert, Plot. Note the icon next to Plot; it should appear on your toolbar and can also be used. Click on that icon and watch the graph replot in a different color.

Note that the graph window (probably) goes from x = -4 on the left to x = 4 on the right, and from y = -4 at the bottom to y = 4 at the top.

You can change the plot range of the graph. Click on Set then Plot Range. Change the range to plot from x = -10 to x = 10 and y = -5 to y = 5.

Before you click on OK, predict the graph you will obtain when the screen coordinates change, based on the graph you see. Sketch the graph in your notebook and record your prediction of where the graph will pass through the x axis.

Where does the graph pass through the x axis?

How does this compare with your prediction?

Why would you expect the graph to pass through the x axis where it does?

Do you think there are any points outside the window where the graph passes through the x axis? Why or why not?

Answer the above questions starting in the next line:

#$&* The graph passes through the x axis at -3,2. This compares identically to my prediction. I would expect the graph to pass through the x axis where it does because in the expression we found that -3 and 2 make the equation equal 0. I do not think there are any points outside the window where the graph passes through the x axis because those are the only two numbers that make the expression (x-2)(x+3)=0 true.

You should see that the graph passes through the x axis at x = 2.

Why should the graph of (x-2)(x+3) pass through the x axis at x=2?

Can you see another point where the graph passes through the x axis?

Answer these questions starting in the line below:

#$&*The graph of (x-2)(2-3) should pass through the x axis at 2 because 2 is a number that makes the expression true. I can see another point where the graph passes through the x axis and it is -3.

Change the range once more, this time going from -20 on the left to 20 on the right, and -30 on the bottom to 30 on the top. Before you enter your changes, predict what your graph will look like. Include a sketch in your notebook.

Starting in the line below, compare your prediction with the DERIVE graph:

#$&*My prediction of the graph is identical to the DERIVE graph. I predicted that the graph would be the same as the one above (a V-shape with points lying on the x axis at -3 and 2) only this graph would show more of the graph because it covers a larger plot area.

Make careful note of the following statement: An equation of the form [expression] = 0 , where [expression] is an algebraic expression involving one variable, will have solutions that coincide with the points where the graph of [expression] passes through the x axis. So to get an idea of where a solution is, plot [expression] and estimate where the graph passes through the x axis.

The Intersection of y = (x-2)(x+3) and 2x + 3

Now return to the main window (which is now called the Algebra window), and author the expression 2x + 3.

Predict the value or values of x for which this expression will be 0. Give your prediction in the line below:

#$&*I predict that the value of x for the equation 2x+3=0 is -3/2.

Go to the plot window and plot the expression.

Notice that the graph retains the ranges you chose last time you were in the Plot window.

Does the graph of the new expression pass through y = 0 where you expected? Answer starting in the line below:

#$&* Yes the graph for 2x+3=0 does pass through y=0 where I expected.

At what x coordinates do the graphs of (x-2)(x+3) and 2x + 3 intersect? How closely do you think you can predict these coordinates from the present graph? Answer starting in the line below:

#$&* At points (-2,3) and (-3,2) the graphs (x-2)(x+3) and 2x+3 intersect. I think I can clearly predict these coordinates from the present graph.

Change the ranges to x = -5 to 5, and y = -7 to 7. Again estimate the x coordinates of the intersection points. How closely can you predict the coordinates of the intersection points from this graph? How much closer is this than before?

Answer starting in the line below:

#$&* My estimate of the x coordinates of the intersection points is (-3,2) I can clearly see the coordinates of the intersection points from this graph.

Solving the equation (x-2)(x+3) = 2x + 7

You know that the above equation is a quadratic, and can be solved using the quadratic formula. You will use DERIVE to solve the equation and interpret its results.

You should now be in the Algebra window. Author the equation (x-2)(x+3) = 2x + 3.

Next solve the equation, choosing the Algebraic solution. You will get two expressions involving square root signs and fractions. If you know how to solve the equation (x-2)(x+3) = 2x + 3, you know how this notation comes from the quadratic formula. However if you are trying to locate the solutions on a graph the radicals are distraction here. So choose Simplify and Approximate the expressions.

Using F3 place your expression in the Expression window, then copy and paste it into the line below. You may then follow with any comments or insights you wish to offer:

#$&* x=3.541381265 and x=-2.541381265

Expanding Algebraic Expressions

Author the expression (2x - 3)(4x + 1). On paper, multiply this expression out using the Distributive Law of Multiplication over Addition.

Indicate your result, and how you got it, in the line below:

#$&* 8x^2+2x-12x-3 = 8x^2-10x-3. I got this by using the Distributive property of Multiplication over Addition and combined like terms.

Be sure that the expression is highlighted, then use Simplify, Expand to expand the expression. Be sure the radio button to the right is set on Rational.

Does the result agree with what you got when you multiplied the expression out?

Answer starting in the line below:

#$&* Yes, the result agrees with what I got when I multiplied the expression out.

Now author the expression (x² + 2x - 3)(3x² - 4x + 1). Don't bother multiplying it out. Just go ahead and use DERIVE to expand it. How much work, and how much potential for error, could the Expand option could save you on a complicated expression?

Answer starting in the line below:

#$&* There is a lot of work and a great potential for error in solving (x^2+2x-3)(3x^2-4x+1) and the expand option saves a lot of time and uncomplicates the problem. The answer to the problem is 3x^4+2x^3-16x^2+14x-3.

Plotting a Data Set and Making Predictions from the Graph

An experiment involves letting sand fall from a hole to build a pile. The bigger the pile the more it weighs. The data represents weight vs. the height of the pile.

If you have done the experiment, you can use your own data from the sand pile experiment. If not, use the numbers given below.

Being sure you are in the Algebra window, enter the data in as follows:

Suppose that the heights of the pile are 3.2, 4.1, 5.3 and 6.1 inches, with weights of 9, 25, 42 and 79 ounces. Then the first pile, with its 3.2 inch height and 9 ounce weight, would be represented by the vector [3.2,9].

Don't worry yet about exactly what a vector is. Just think of it as a set of expressions between two brackets [ ] and separated by commas.

The other three piles would be represented by vectors [4.1,25], [5.3,42], and [6.1,79]. These vectors correspond to the points you plotted to construct the graph of weight vs. height.

To enter your data, you will author a matrix consisting of the four vectors that represent the four piles. Even though you are authoring a matrix, choose Author Expression, not Author Matrix, and enter the matrix in the Expression Box as follows:

The matrix will start with a bracket [, which is followed by the vector [3.2,9] representing the first pile and then by a comma. After the comma we have the vector [4.1,25] representing the second pile followed by a comma, then the vectors [5.3,42] and [6.1,79] separated by a comma. This completes the four piles, and all we have to do is end with a bracket ] and we have constructed a vector consisting of four vectors.

Author the vector corresponding to your weight vs. height data set. The vector in the previous paragraph will read [ [3.2,9] , [4.1,25] , [5.3,42] , [6.1,79] ]. If you have done the experiment, your vector will probably look similar to this, but with different numbers and perhaps more or fewer than four piles represented.

When you have completed the expression hit the Enter key. If you have misplaced a comma, or a bracket, the program will indicate that you have an error. Be sure that your matrix begins and ends with a bracket, and the each of your data points is represented by an expression in brackets.

Copy the contents of the expression box into the first line below. Starting in the second line describe the matrix as it is displayed in the main window.

#$&* ⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 2 ⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x + b·x + c⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

The maxtix appears in the main window as a FIT equation to the supplied vectors.

If you graph the points (3.2,9) , (4.1,25) , (5.3,42) , (6.1,79) on a y vs. x coordinate system, you will see that they lie along a curve which is increasing at an increasing rate. You should do so. How closely do you think your points could be fit by a smooth curve?

Answer starting in the line below:

#$&* I do not believe the points would fit a smooth curve very closely.

Your Plot window is probably cluttered up by now with the graphs from the previous exercises. Use the Edit menu, then Delete Plot, then note the options (First, Last, Butlast). Use Butlast, which doesn't mean backwards but rather means 'all but the last'.

Now use DERIVE to plot your matrix, just as you would plot an expression.

Make sure the expression is highlighted, go to the Plot window and click on Insert > Plot, or strike the F4 key, or use the plot icon on the toolbar.

Use an appropriate set of ranges, or you might not see the points. For example, the x coordinates of the above data run from 3.2 to 6.1; an x range from 0 to 10 would contain these points with some space on either side. The y values run from 9 to 79, and increase more and more rapidly; a y range from 0 to 150 might leave enough room around the data points to see what is going on.

Describe your graph starting in the line below:

#$&* This question was not on the original DERIVE exercises so I do not know how to answer this question.

The graph should will consist of four points which are more or less similar to those you might have graphed for homework.

Remember that the y values on our graph represent the weights of the piles, the x value the heights of the pile.

Our goal is to predict the weight of a pile with a certain height. Let us say that the height of the pile is to be 16. How can we use DERIVE to predict the weight when the height is 16?

One way you might have predicted the weight when height is 16 would have been to to sketch a curve which approximates the data points. You could then attempt to predict how the curve will continue until the height finally reaches 16. If you could predict the x=16 point on the curve, you could easily see what weight is represented by the point.

Using the 'Fit' command to obtain a function model

In DERIVE, we can try to 'fit' a given function to our data. At this point in the course, you aren't expected to know for sure what function is appropriate to this situation. However, you do know that the linear function y = mx + b has a straight-line graph, unlike the graph in front of you, while the quadratic function y = ax² + bx + c has a curved graph, more appropriate to this data set. Maybe if the numbers a, b and c are just right, this curved quadratic graph will 'fit' the data points.

You could at this point pick three points and solve a set of simultaneous equations to get your quadratic model. However, not only will DERIVE save you all that work, it will find a model that doesn't depend on just the three points you choose. In fact it will find a model which is very close to the best possible quadratic model for this data, in the sense of minimizing the average of the squared deviations from the points.

We can easily find out whether there is a y = ax² + bx + c curve that reasonably fits the data. Be sure you are in the Algebra window and Author the expression

FIT( [x,ax²+bx+c], #**),

where ** stands for the number of the line containing the data matrix. For example, if the data matrix is in line 19, you would author the expression FIT( [x,ax²+bx+c], #19).

Copy your expression into the line below:

#$&* ⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 3 2 ⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x + b·x + c·x + d⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

Approximate this FIT(...) expression (Simplify, Approximate). Make sure the expression is highlighted first.

Copy the resulting expression into the line below:

#$&* 3 2

6.124566684·x - 78.88911694·x + 347.6444877·x - 496.3276044

Take a good look at the expression you obtain. Is it a quadratic function?

Plot this approximated expression, on the same graph which shows the four data points. How well does it fit the data points?

#$&* Yes this is a quadratic function. This approximated expression fits the data points almost exactly.

Open a window large enough to find the x = 16 point of the graph, and from the graph determine as nearly as possible what y value would correspond to x = 16 if this curve really represented the way the sandpile's weight increases as it grows.

Give your estimate in the line below, and then in the subsequent line describe how you obtained your result:

#$&* This question was not only the original DERIVE exercise, I do not know how to answer this question.

You can also find, for example, the height of the pile (x) which corresponds to a given weight (say, 55):

Author and plot the equation y = 55, and estimate the value(s) of x for which the graphs cross. This (these) will be the value(s) of x for which y is 55.

Set the quadratic expression equal to 55 (highlight the expression, choose Author, use the F3 key; then just type in the right-hand side = 55 to complete the equation). Show your expression in the line below:

#$&*

Choose soLve to find the value(s) of x for which the equation is solved. These are the x values at which the graphs cross. (Remember to approximate the expressions if the solutions you get are not in decimal form.)

#$&*

Finally, Author the expression consisting of the quadratic expression minus 55. Plot this expression and note where it passes through the x axis. What is the significance of these x values, and why should a plot of this expression go through the x axis at these values?

Give your expression in the line below, and add your answers to the questions starting in the line below that:

#$&* 2

6.467881773·x - 37.56946013·x + 65.0600058 - 55

2

6.467881772·x - 37.56946012·x + 10.0600058

Repeat this exercise, except using the 'cubic' function ax^3 + bx² + cx + d instead of the quadratic ax²+bx+c. Does the curve fit the data points better, or not as well? By how much does the prediction differ from the previous prediction?

Answer starting in the line below:

#$&*Yes the curve fits the data points exactly.

Try fitting each of the following functions to the data set:

y = a x²

y = a x^3

y = a x^4

y = a x^5

y = a x^1.5

y = a x^2.5

y = a x^3.5

y = a x^4.5

How well do these functions work? Do some work better than others? Do any work as well as the quadratic model? Do any work as well as the cubic model?

#$&* ⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 3 2 ⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x + b·x + c·x + d⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

3 2

6.124566684·x - 78.88911694·x + 347.6444877·x - 496.3276044

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 2⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

2

1.808536047·x

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 3⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

3

0.3295527286·x

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 4⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

4

0.05722465721·x

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 5⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

5

0.009690712687·x

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 1.5⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

1.5

4.107940314·x

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 2.5⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

2.5

0.7783665612·x

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 3.5⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

3.5

0.1379041398·x

⎛ ⎡ 3.2 9 ⎤⎞

⎜ ⎢ ⎥⎟

⎜⎡ 4.5⎤ ⎢ 4.1 25 ⎥⎟

FIT⎜⎣x, a·x ⎦, ⎢ ⎥⎟

⎜ ⎢ 5.3 42 ⎥⎟

⎜ ⎢ ⎥⎟

⎝ ⎣ 6.1 79 ⎦⎠

4.5

0.02360180308·x

The above functions are not quadratic functions, and (except for one) they aren't cubic polynomials. What kind of functions are the above functions?

#$&* The above functions are Trigonometric functions.

Remember to use the Edit, Delete command if the graph gets too cluttered. In case you have to replot your data points, remember the line number of your data vector. You can go to the line and highlight it, or you can at any time re-author the data set using the line number.

You did well here.

Do note that your responses should precede the #$&*, not follow it. There is a blank line before the #$&*, and that is where you should start your response.