Sei sulla pagina 1di 103

JKGraph Program Tutorial

The purpose of this tutorial is to explain a few of the basic features of the program called JKGraph. This
tutorial is intended to help first-time users get started using the program and is provided in addition to three
other help files that accompany the program. If you are a first-time user we recommend you print this entire
tutorial so you can read these instructions from a paper copy while you view the output on your screen. This
tutorial is 103 printed pages. It takes a little over an hour to run all the examples and read all the material
contained in this tutorial.

This tutorial assumes you are either a student or a teacher in a first semester calculus class, or beyond. If you
are in pre-calculus some of the concepts and terminology may be unfamiliar, but you can still read this tutorial
and use the program to help you graph functions. Perhaps you should first try the Help menu item that says
Quick Start For Beginners. If you are at or beyond the 2nd semester in calculus you should have no difficulty
following all the examples and you will only wish you could have used this program when you started calculus.

Briefly put, JKGraph is a program for graphing and analyzing graphs of various kinds of 2D functions that
students are likely to encounter in the first two semesters of calculus. JKGraph handles a wide variety and
combination of 2D functions, including curves given in either polar or parametric form and it includes both
infinite series and Fourier series and it can graph implicit functions in the form 0 ÐBß CÑ œ !. If you have access
to both a graphing calculator and a personal computer we think you will find JKGraph the more desirable
alternative because of its increased graphics resolution and use of color, an expanded feature set of options and
functionality, and its ability to integrate with other applications in the Windows environment. When you finish
this tutorial you will have a better idea of what the program can and cannot do.

There are four other programs by the same author that are available on his Web site for graphing 3D parametric
curves and 3D surfaces and even 3D vector fields that students would normally encounter in the 3rd semester of
calculus. (Go to http://homepage.smc.edu/kennedy_john to learn about many other free programs
related to math and computer science.)

When you first start JKGraph it should appear in a maximized mode. This means the program should take up
most of the space on your computer screen. Although you can make it take up less space, when first using the
program for this tutorial you can leave it in its maximized mode. There may be a small amount of unused space
on the right vertical side of your screen that is normal when the program starts in a special mode that makes a
true aspect ratio.

The top of the program screen consists of three bars called the title bar, the main menu bar, and the tool bar.
When we first use any terminology special to this program (and a few times thereafter) it will appear in bold
and blue. Button names, menu items, and other Window control names or labels will usually be written in a
black bold font. Other numerical values or expressions that you type in, or are output values generated by the
program itself, may appear in bold and red. The main middle part of the screen that takes up the majority of
space is used to show the graph of your function. The very bottom of the screen is a status line that displays
various hints and other information depending on the operation you are currently performing.

When first run, the program title bar should show the default function that is three times the =38/ of the variable
B.

page 1
Program initialization consists of two stages; the first of which creates the examples that are shown in this
tutorial. Next, the program looks for a file named StartupFuns.txt. If that file is found then its contents
are read and overwrite the tutorial examples. Since, if the StartupFuns.txt file exists, we cannot
guarantee its contents will match the tutorial examples, we suggest you delete that file. Later, after you are
familiar with this program, you can save any default examples you want by just naming your saved file
StartupFuns.txt. The file StartupFuns.txt can thus be changed, or deleted or overwritten with
impunity. To insure the tutorial examples appear as intended, no file named StartupFuns.txt is distributed
as part of any new installation. If you have already been using the program we suggest you close it down and
re-start it so what we describe in this tutorial will match what you see on your screen.

The main menu bar appears as:

The tool bar consists of a variety of yellow-colored and green-colored buttons and some gray-colored buttons
and three white buttons.

The four left-most buttons in the tool bar are colored yellow. These buttons control the four Trace Modes of
the program. Without pressing any mouse buttons, just move your mouse slowly over the four yellow buttons
and you should see little tool-tip pop-up hints that tell what modes these buttons control. In addition to the
popup hints, the status line also provides more information about the use of each button.

We will first go through the use of all the buttons on the tool bar. It turns out that although there appears to be a
lot of functionality within the menus of JKGraph, most of your work can be accomplished without ever pulling
down a menu. This is possible because the tool bar buttons duplicate much of the functionality of the menu
items, and each button performs a different but related function depending on whether it is clicked with a left or
right mouse button. If you are a traditional Windows user you should realize that JKGraph makes a lot of use
of the right mouse button. In this tutorial we will use the terminology left-click or right-click that means click
an object with either the left or right mouse button respectively. If we just say click some object, without
specifying a direction, it means click with the left mouse button. We will always be specific about right-button
clicks.

The second yellow button from the left has the letter G on its face and it should show the hint Graph
Trace Mode whenever the mouse is resting over this button. Left-click your mouse on this button and you
should see the button change to a white background indicating the Graph Trace Mode is active. Then click the
left mouse button in the middle of the graph and while holding down the left mouse button, drag the mouse
across the graph left and right and then let up on the mouse. Your screen should look something like that shown
in Figure 1 below after you let up on the mouse.

page 2
Figure 1. The main screen just after selecting the Graph Trace Mode.

Read what the status line hint at the bottom of the screen is telling you. Then hold down the left mouse button
while dragging the mouse from left to right across the graph and you will see a graph cursor that traces points
along the graph. You will also see the B and C coordinates of the trace point called T in the status line at the
bottom of the screen. Wow! What an easy way to read the points on a graph.

You may note the vertical position of the mouse is irrelevant when in the Graph Trace Mode. Only the
horizontal position of the mouse is used to trace points on the curve. Newcomers sometimes try to make the
mouse cursor stay directly on top the graph trace point, but this exercise is futile. The only relationship between
the graph trace point and the mouse is that the two always stay aligned at the same horizontal screen position.

The mouse can travel anywhere across your entire screen as long as you start the initial left mouse-down
position anywhere within the JKGraph program window. The domain of the current C œ 0 ÐBÑ function maps
across the entire horizontal span of your screen display, relative to the JKGraph program window width. So

page 3
when the mouse is near the far left of the screen the trace point is closer to the left endpoint of the function
domain. When the mouse is near the far right of the screen the trace point is closer the right endpoint of the
function domain. The midpoint of your screen corresponds to the midpoint of the current function domain for
this example function.

Next, left-click the 3rd yellow button that has the letter T on its face. This turns off any other active trace
mode and turns on the Tangent Line Trace Mode. This mode is similar to the Graph Trace Mode, but in
addition to showing the trace point along the curve, the Tangent Line Trace Mode also shows a tangent line to
the curve at the trace point. The status line at the bottom of the screen shows the equation of the tangent line in
slope-intercept form. Drag the mouse across the graph while holding down the left mouse button and you
should see the status line information changes to keep you informed of the current tangent point and tangent
line equation corresponding to the current horizontal mouse position.

Next, left-click the yellow button with the letter N. Like any other yellow button, pressing one button
turns off any other yellow button that may happen to be turned on at the time. The new mode is called the
Normal Line Trace Mode. This mode is almost identical to the Tangent Line Trace Mode, except the line
shown is what is called the normal line to the graph. The normal line is simply the line that is perpendicular to
the tangent line. So normal lines should appear to be perpendicular to the graph at each point on the curve. Drag
the mouse back and forth across the screen and watch how the normal line equation changes in the status line.
Again, the trace point remains attached to the function curve and only the horizontal position of the mouse
relates to the horizontal position of the trace point on the graph.

Finally, left-click the first yellow button with the letter C. This turns on the mode called the Coordinate
Trace Mode. Left-click in the middle of the graph and while holding down the left mouse button, drag the
mouse both up and down as well as left and right across the graph. In this mode you can drag the mouse
anywhere over the screen and the point shown at the tip of the mouse cursor has its coordinates shown in the
status line. This mode is useful whenever you want to read the coordinates of points that are off the graph of
any function curve.

Now again left-click the first yellow button with the letter C. This should turn off the Coordinate Trace
Mode that means no trace mode should be currently selected. The four yellow buttons act as a group like radio
buttons in that only one can be selected at a time, and as soon as you press one, any other button that was
selected gets un-selected. Left clicking on a yellow button that is already selected (its background will appear
white) will also un-select that button, leaving you with no trace mode active.

Ok, that covers a lot (but not everything) of what you need to know about the four yellow buttons. So what are
the four green buttons for and why are they colored green? The four green buttons do not select a mode, but
rather they are used to perform an immediate automatically animated action. Think of the color green like the
color of a traffic light. Green means GO, and when you press one of the green buttons the program
automatically starts running a little animation.

page 4
Finding Maxima And Minima

Left-click the green button that shows the two abbreviations Max and Min. We will refer to this button
as the Max/Min Button. The program will automatically start moving a tangent line across the graph. The
default range sweeps over the graph between -7 and +7 and when the animation stops the program will mark
two special points on the curve. The two points represent the highest and lowest C -coordinates of all points on
the graph whose B-coordinate is in the closed interval [-7,7]. If you are a first-semester calculus student you
will realize this one green button can save you the work of computing the first derivative and solving the
equation where that derivative is zero or undefined. You can run the animation again by left-clicking the
Max/Min Button and the whole process will be repeated.

If you leave the mouse over the Max/Min Button and don't move it anywhere else on the toolbar, then you will
also see the four coordinates of the Max/Min points in the status line when the process stops. Only the most
recently found pair of Max/Min points is reported when a function has multiple points with equal extreme
values. For this example you should see Min=(-1.568, -3) Max=(1.568, 3) in the status line. We
can interpret the two B-coordinates as being „ 1/2. The C-coordinates are „ $. After moving the mouse
anywhere else off the Max/Min Button the status line hint will change and will probably clear itself. The
program can automatically sound a beep when the Max/Min search ends if you turn on the Speaker Sounds
menu item under the Options menu. If you don't like the beeping noise, you can turn it off by unchecking the
same Speaker Sounds menu item under the Options menu.

You can change the speed at which the tangent lines move across the graph by right-clicking the Max/Min
Button and changing the Time Delay value in the dialog box. You can also press the ESCAPE key on your
keyboard to abort any animation sequence while it is running.

The two points that remain marked on the graph can be erased by left-clicking the gray-colored Redraw
Button whose caption shows the word Redraw. The purpose of the Redraw Button is to clear away any
special graphics elements that get added to the graph of a function. When you press the Redraw Button the
entire screen gets redrawn with only the active function curve. If you haven't already done so, left-click the
Redraw Button now and the two points that were marked on the graph will disappear.

Computing A Couple Of Integrals

Now left-click the third green button whose face shows a little filled-in area under a curve. This button
represents the calculation and display of an integral. We will refer to this button as the Integral Button. The
program will draw a series of vertical rectangles that represent a Riemann sum that approximates the area
between the graph of the function and the B-axis. If you haven't learned about Riemann sums or integrals, don't
worry. In your first exposure you can just think of both terms as having something to do with area. Like the
Max/Min Button, if you leave the mouse resting over the Integral Button after you left-click it, then you will
see the answer to the integral calculation in the status line when the animation ends. But if you move the mouse
elsewhere off the Integral Button then the answer left in the status line will be cleared. In this case the answer
we get is 9.1073E-19. This is a number in scientific notation that is very close to zero. The true answer
should be exactly zero.

page 5
The value you see may differ slightly from this one, depending on your display screen resolution and the size of
your current JKGraph window. In fact, some numbers in this tutorial may differ slightly from what you see
when you run the program. Whenever we write output numbers in the color red, you should not be surprised if
you see numbers that differ slightly from ours.

Figure 2. A Riemann Sum Approximation with 50 Rectangles for an Integral.

To clear away the rectangles, left-click the Redraw Button. You should then just see the plain graph of the
current function. Ok, so far every mouse click you have performed has been with the left button. Are you ready
for a little right-button action? Right-click the Integral Button and you should see a dialog box like that shown
in Figure 3 below.

page 6
Figure 3. The Integral Domain dialog box.

This dialog box contains many choices. We will not discuss all the details here, but the most significant point to
remember is that you can select any one of 11 different kinds of integral methods. There are 7 methods for
finding 2D plane areas, one method for arclength, one method for a 3D surface area, and two methods for
finding 3D volumes. The default method is for an Area : Midpoint Riemann Sum. You may also recognize
that you can change the limits of integration as well as the Number of Subintervals. Change the Number of
Subintervals from 50 to 15. Then select the method Area : Trapezoid Rule. Then click the OK button. You
should see the graph shown in Figure 4 below. Note that the 50 rectangles have now been replaced by 15
trapezoids. The new answer is slightly different from the previous answer, -1.5902E-18, but it is still very
close to the true answer of zero.

page 7
Figure 4. The result of applying the Trapezoid Rule with 15 equally spaced subintervals.

Again right-click the Integral Button on the toolbar to bring up the dialog box for integral parameters. Make
the Number of Subintervals even smaller, say make it 8. Change the limits of integration so that the Upper
Limit is -PI. You can type the string -PI directly into the Upper Limit edit box, and when needed, the program
will automatically compute the decimal value and enter all the digits for you in the edit box. Select the method
for Volume : Cylindrical Shells Vertical Rotation Line and click the OK button. You should see the graph
shown in Figure 5 below in which there are 8 cylindrical shell slices that cover the left interval [-5,-PI]
and rotate around the vertical line B œ ! that is the C -axis. The answer to this problem is 104.18 cubic units of
volume.

page 8
Figure 5. A volume of rotation using 8 Cylindrical Shells.

When you use the program to make a 3-D shell drawing like that shown in Figure 5 above, you need to make
sure the line of rotation lies outside the interval of integration. If this condition is not met the program will warn
you with a message like the following:

Figure 6. An example error message.

It is up to you to insure the line of rotation lies on one side or the other of the interval of integration. The
program will always draw the cylindrical shells so that the average radius of rotation decreases from largest to
smallest. You will also need to be careful to not choose too large a number of subintervals when you make
cylindrical shells if you want a really meaningful figure. The purpose of the Alternate Disk/Shell View
checkbox (for this example) is to show the shells from either above or from below. The view in Figure 5 is
from above the shells as if you were looking down from on top of the shells.

page 9
Now again right-click the Integral Button. Change the Number of Subintervals back to 50 that is its default
value and change the Upper Limit of integration back to its default value of +5. Select the next to the last
method that appears as the choice Volume : Disks/Washers Horizontal Rotation Line. Now click the OK
button and the program should automatically draw a graph like that shown in Figure 7 below.

The volume is obtained by rotating the graph of the function over the B-axis, between the integration limits of
-5 and +5. This volume is 149.11 cubic units.

Figure 7. The Disk Volume with 50 slices obtained by rotating the curve over the B-axis.

Solving The Equation 0 ÐBÑ œ !

Now left-click the Redraw Button to make the disks disappear. Then right-click the fourth green button
that shows Solve ? for a caption and has a picture of a graph that intersects the B-axis in a couple of unknown
points. The Solve Button is used to find points of intersection of a function with the B-axis when the current
function is of the form C œ 0 ÐBÑ. As with all the buttons on the toolbar, right-clicking a button brings up a
dialog box related to that button. In the dialog box that now appears click on the radio button in the lower-right
corner that shows Single-Step and then click the OK button in that dialog box.

You should then see the first step in the solution of the equation 0 ÐBÑ œ ! using Newton's Method. When this
method is run you will see a series of tangent lines drawn on the graph. Each tangent line intersects the B-axis at

page 10
a point that becomes a new approximation point. The program will draw a vertical line from the current
approximation B-value on the B-axis, up or down, to the point T on the graph of the function with coordinates
T ÐBß 0 ÐBÑÑ. It will also compute the equation of the tangent line through T and find its B-intercept and
display all of this information in the status line at the bottom of the screen. You will also note that another
control window has popped up that appears as

The program is now waiting on you to press the button labeled Next Step to continue the solution. The status
line will appear as:

Click the Next Step button and you should see the next B-value approximation. Read the information in the
Status Line at the bottom of the screen. Then continue to press the Next Step button five more times, each time
pausing to view the graph and to read the information in the status line. After pressing the Next Step button for
a sixth time the solution process will come to an end and the status line will indicate the final result. Close
To Zero: F(2.1043E-25)=6.3129E-25. We interpret these two numbers that are in scientific notation
as saying that 0 Ð!Ñ œ !. It is clear by looking at the graph that the function probably goes through the origin.

Of course any other problem may require many more steps before a solution is arrived at, or a problem might
also be such that the process diverges from a solution. The other two buttons in the control window can help
you with these other cases. If you press the Abort button in the above control windowß the process will end
immediately. You can also press the Automatic button to continue the solution in an automatic way. You can
also press the escape key ESC on your keyboard to abort an automatic solution that is not converging. If
necessary in another problem, you can move this control window out of the way and leave it anywhere on your
desktop. The next time the control window appears it will remember its previous screen position. However, this
control window only appears when you select the single-step control option.

Now we will automate the process. Right-click the Solve Button and this time select the Control Option
choice for Automatic Animation and then click the OK button. The program will then run through the entire
process without showing the control action form. There should be about a 1-second time delay between each
successive approximation, depending on the speed of your computer. You may want to left-click the Solve
Button to run this animation more than once so you can observe everything going on. In particular, if you view
the status line while Newton's Method is running you can see the equations of the various tangent lines and you
can see each next root approximation. A sound may signal the end of the animation sequence if you turn on the
Speaker Sounds option under the Options menu. You can also right-click the Solve Button to bring up the
dialog box shown in Figure 8 below and set the Time Delay value higher or lower than its default value of
1000 to make the animation sequence run slower or faster. This number is the number of milliseconds between
iterations. So a value of 1000 should correspond to a 1-second time delay and value of 2000 should make a 2-
second time delay. The number 500 would represent a ½ second time delay between iterations.

When Newton's Method finishes the status line should show that the function value is sufficiently close to 0 so
the solution method ended. Now right-click the Solve Button and you should see the dialog box shown in
Figure 8 below.

page 11
Figure 8. The Solve F(X)=0 Parameters Dialog Box.

Select the Solution Method choice that is labeled Successive Bisections and click the OK button. Now the
program will apply a different solution method. When the Successive Bisections method is performed the
program draws a series of horizontal line segments, each new one underneath the preceding one. For this
example the first line covers the initial search interval [-4.6,6]. Each new length is 1/2 that of the previous
one and consists of either the left or right half of the previous segment. The solution should always lie within
the interval depicted. Eventually the interval lengths become so short so as to appear as a single screen pixel
that extends vertically down the screen. As with Newton's Method, you may want to run this method more than
once so you can see everything going on. In particular, the status line shows the successive intervals as the
method converges to a solution. When the method ends it shows the final solution. Close To Zero:
F(3.1416)=-3.2675E-9. We interpret this as saying 0 Ð1Ñ œ !. The hourglass cursor is an indication for
you to wait until the process ends. The cursor will then return to the default or normal pointer shape.

Note the horizontal line segments near the top of the graph in Figure 9 below. The first half-length segment is
the right-half of the top segment. In fact, you can read the successive halves in the order RIGHT, LEFT,
RIGHT, RIGHT, RIGHT, LEFT, RIGHT, LEFT, and then the segments become so short that it is
impossible to tell how the intervals split after that because all that shows on the screen is a segment that is one
screen pixel wide.

page 12
Figure 9. Top of graph shows intervals derived by the Successive Bisections method.

The first horizontal line segment shows the extent of the original search interval. In this example the initial
search interval is determined by the first and second point B-coordinates that appear in the top two edit boxes of
Figure 8 above.

Performing Zooming Operations

Continuing across the tool bar, the next button is called the Zoom Button and it first appears as

This button does NOT perform zooming, its real purpose is only to display the current Zoom Mode, and it can
also be left-clicked to change the Zoom Mode between In and Out. Left-click this button a couple of times and
the only change you will see is that the words In and Out on the button alternate. Leave the Zoom Mode in the
Out state and move the mouse until it points directly at the origin.

Ok, so how do you perform zooming? Well the answer is easy. Just place the mouse at the point that is at the
center of the region you want to zoom and then double-click the left mouse button. Do this now and you should
see the graph window changes and should appear somewhat like that shown in Figure 10 below.

page 13
Figure 10. The new graph after zooming out once from the origin point.

The numbers that you see near the graph borders will probably differ slightly from those shown in Figure 10
above. Each time you zoom in or out by double-clicking, the dimensions of the current graph window are either
doubled or halved. In this case the graph borders have been doubled and normally they would extend between
-14 and +14 for B, and extend between -10 and +10 for C . In fact, these four numbers are referred to as the
BC extent numbers.

Unlike some other programs, JKGraph does not have or need a user-adjustable zoom factor. When you zoom
out the zoom factor is 200% and when you zoom in the zoom factor is 50%. In Figure 10 above neither the B
extents nor the C extents are exactly at 14 and 10 because the mouse position was not on the exact pixel of the
origin when it was double clicked. In general you need only approximate the center of your zoom position and
you should not worry if the extent numbers become non-symmetric or inexact.

To change the current Zoom Mode from Out back to In, you do NOT need to click the Zoom Button on the
tool bar. If you point the mouse anywhere over the graph without any trace modes turned on you can right-click
once and the Zoom Button will change to the opposite mode. For now, right-click the mouse a couple of times
and watch the Zoom Button face change to show the new mode. Leave the Zoom Mode in the In state and we
will next demonstrate a couple of different methods for zooming In.

page 14
The usual method for zooming in is to place the mouse cursor at the point of interest and then double left-click.
For example, with the mouse pointing at the origin, double left-click and the graph should change back to near
its default range. Then double left-click again at the origin and you should see the BC extents become nearly
half of their original values of 5 and 7. For example, if we read the BC-extents in the graph in Figure 11 below
we see the values are nearly between -3.5 and +3.5 for B and nearly between -2.5 and +2.5 for C. Again,
the BC extents do not have to be exact or symmetrical to be useful. It is natural to see round-off errors (1 or 2
parts per 100) in the extent numbers.

Figure 11. The default graph after zooming in at the origin.

An alternative method for zooming in is to point the mouse cursor at the upper left corner of a zoom-in
rectangle and while holding down the CTRL key on your keyboard, right-drag the mouse until it is positioned
at the lower-right corner of the desired zoom-in region and then let up on the right mouse button, and then let up
on the CTRL key. The rectangle that you see drawn just before you let go of the right mouse button becomes
the entire new graph area. Because you can draw the zoom rectangle directly (perhaps after zooming out),
JKGraph has no real need to use a zoom factor. Of course drawing a rectangle like this is possible only for a
zoom-in operation.

Try using the rectangle drawing method of zooming by positioning the mouse pointer just above and to the left
of the point that is approximately (-3,+1) and with the CTRL key on your keyboard held down, click the
right mouse button down, then drag the mouse until it is just below and to the right of the point (+2,-2). You
should see a broken-line rectangle drawn as shown below just before you let up on the right mouse button.

page 15
Figure 12. Defining the new window rectangle in the BC -plane.

After you let up on the right mouse button the area defined by the broken-line rectangle becomes the new entire
window view.

Figure 13. The new graph after zooming in by drawing a rectangle surrounding (-3,+1) and (+2,-2).

page 16
The placement does not have to be exact. After you let up on the right mouse button you should see a new graph
somewhat like that shown in Figure 13 above. Your B and C extent numbers will probably differ from those
shown in the figure. This new figure shows the graph appears to go through the origin point (0,0).

Now left-click the yellow Graph Trace Mode Button and drag the mouse slowly across the graph until you
see the trace points fall into the picture. You should be able to read the trace point coordinates in the status line
even when the trace point moves outside the graph window. See how close you can get the trace point to the
origin point. Finally, left-click the Graph Trace Mode Button to turn off the Graph Trace Mode.

You should now understand how easy it is to perform zooming operations with JKGraph. But we caution you
to not get too carried away with zooming. It is best to set up your graph so that you can see those parts of
interest that you are going to work on. Zooming is a feature you should seldom have to use, but it is there when
you need it. Just remember that one right-click over the graph is all that is needed to toggle the Zoom Mode
between In and Out. Double left-clicking at the point of interest will perform the zoom. Holding down the
CTRL key on your keyboard and using the mouse to right-drag a rectangle will always perform a zoom-in
operation with the zoom rectangle defining the BC extents of the new graph.

The program performs a special type of scaling operation when you zoom very far out in a graph. This means
the program will not draw too large a number of either axes tic marks or grid lines. Instead, it will automatically
skip drawing some tic marks or grid lines so that neither becomes too numerous for the display. For tic marks in
particular however, the program will show the correct numeric values associated with those marks that it does
draw. The grid marks should therefore be easy to read in all cases except when you give BC extents that are
extremely and unusually large compared to your axes and grid spacing values. In extreme cases the B-axis
numbers will tend to crowd together. To correct any crowding of B-axis graph labels you must set larger
spacing values.

Performing Small Horizontal & Vertical Graph Window Translations

In addition to zooming, sometimes you just need to make small horizontal and/or vertical translations with the
current graph window. For example, you might need to move an area of interest to make it more centered in the
window. Or you may just want to move an object a little more left or right or up or down to bring more or less
of it into view.

You can perform small graph translations by holding down the CTRL key on your keyboard. Then left click the
mouse near the graph center and while continuing to hold down the CTRL key and the left mouse button, drag
the mouse around in any direction. You should see the mouse cursor change to a hand and the graph should
appear to move with the hand. As you move the graph around note how the four numbers at the middle screen
edges track along with the mouse movements. You can see the four BC -extent numbers dynamically change so
you can always tell where you are, especially when either or both axes go out of view. Let up on the mouse and
then the CTRL key on the keyboard to fix the current graph window position. Try moving the current graph
window around by simultaneously holding down the CTRL key on your keyboard and dragging the mouse with
the left mouse button held down.

The program may not respond to dragging the mouse with the CTRL key held down if any yellow trace mode
buttons are active. If you ever find the program is not responding to mouse dragging with the CTRL key held
down, then click the Redraw button. The mouse dragging mode always gets reset whenever you press the
Redraw button or whenever any active yellow trace mode button is made inactive.

page 17
After performing any zooming operations or graph translations you may want to return to the original graph
window. You can do this most easily by right-clicking the Zoom Button in the tool bar. Do this now. Right-
click the Zoom Button in the tool bar you will see the dialog box for setting what are called the World Graph
Parameters, like that shown in Figure 14 below. In fact, the X and Y Maximum and Minimum Values shown
in Figure 14 are those left over from the Figure 13 graph.

Figure 14. The World Graph Parameters Dialog Box.

At the bottom is a push button labeled Restore Default Extents & Exit. Press this button now and the above
dialog box will automatically close and the original default graph like that in Figure 1 or Figure 9 will re-
appear.

There is one operational note you should remember about using the above World Graph dialog box. If you use
this dialog box to type in the four BC -extent numbers that are the X-Minimum, X-Maximum, Y-Minimum, and
Y-Maximum values, you should also turn off the checkbox near the upper-left that appears as

Otherwise, if this checkbox is checked then the program will automatically determine the X-Maximum value
and this may differ from what you have typed in for the X-Maximum. This behavior may not be what you are
expecting. This behavior can also be experienced if you try to manually stretch the Window horizontally using

page 18
your mouse and the program Window refuses to respond to your mouse movements. If this happens, open the
World Graph dialog and turn off the Apply True Aspect Ratio checkbox. Then you can use your mouse to
resize the JKGraph program window just like any normal Windows application.

The World Graph dialog box can be used to define any rectangular area for the graph window view and that
rectangle will map onto the entire rectangle that is the JKGraph program window. However, when the True
Aspect Ratio is turned on, then the program automatically determines how the mapping gets made and it will
do so such that one unit in either the vertical or horizontal directions uses up the same amount of screen space
in either direction. When the checkbox is turned off then squares and circles may appear more squashed or
stretched in either the horizontal or vertical directions, depending on the BC-extent numbers you have chosen.
The checkbox is turned on by default and sometimes this can prevent you from defining the exact BC -extent
numbers that you have entered or it can prevent stretching the Window with the mouse. Sometimes you may
want graphs that are stretched, but probably most of the time you don't. Turning on the True Aspect Ratio
means limiting the stretching in either direction. Turning off the True Aspect Ratio allows a graph to be
stretched to any size in either direction.

Setting Line Drawing Colors And Styles

The next button in order on the tool bar is the Redraw Button that we have already introduced. Left-click this
button to erase the graph window and redraw only the currently active function. Now right-click the Redraw
Button and you will see the dialog box shown in Figure 15 below.

Figure 15. The Line Drawing Colors And Styles Dialog Box.

page 19
This dialog box can be used to set various line drawing colors and to set the thickness of lines as well as the
graph background color. One nice feature of this dialog box is that you can see the immediate effect of any
changes you make because the dialog box contains a sample graph of the current function.

Above the sample graph shown in the Figure 15 dialog box is what is called a Color Grid that consists of 16
color patches. Just below the Color Grid you can see four tabs (they look like upside-down office file folder
tabs) with the captions Background, XY Axes, Polar Grid, and Function Curve. There are actually 12 tabs
total, with the final eight initially invisible. The final eight tabs have the captions Derivative Curve, Integral
Curve, Inverse Curve, Combined Curve, Tangent Line, Lattice Grid, Arc Length, and Infinite Series. To
scroll all twelve tabs into view you must left-click the mouse on the two small arrows at the lower right corner
of the Color Grid.

The default highlighted (colored yellow) tab is the one for Background. Click the patch of green color in the
Color Grid and note how the sample graph background immediately changes so that it is all green. Then click
the red color patch and note how the background changes to all red. Finally, click the white color patch in the
very lower-right corner of the Color Grid. Now you should be back to where you started. Note that the
currently selected color is marked by the letters FG that normally represent ForeGround, but in this case it is
actually the Background color that is marked. The English name of the selected color appears just above the
Color Grid.

Next, click the tab with the caption XY Axes (that tab will turn yellow when it is selected) and then click the
red color in the Color Grid. The axes will change to red in the sample graph. Click the green color in the Color
Grid and the axes will turn green. Finally click the blue color to change the axes back to their default color that
is blue. Now click the tab with the caption Background.

Note the text just above the line thickness control says Rectangular Border. Now click the mouse under the
color grid on the tab with the caption Function Curve. The Function Curve tab should turn yellow. The text
above the line thickness control should change to show Function Curve. Then click the color red in the Color
Grid and note how the graph of the function curve immediately changes to red.

The Line Thickness control changes the object it applies to as you select different tab items. Click the up-arrow
of the Line Thickness control once and the value will change from 1 to 2. Note how the function curve is now
drawn two pixels thick. Click the up-arrow again and the thickness value will increase from 2 to 3 and the
function curve will get even more gaudy! Now click the down-arrow of the line thickness control twice so that
the function curve thickness value returns back to its default value of 1.

Well that should be enough of playing with colors. If you thought the thick lines looked a little ugly on your
display screen you could be right. The real reason for providing such fine control over line thickness has to do
with printing on high resolution laser printers. A default VGA display has a resolution of about 96 dots per inch
while a laser printer can have a resolution from about 300 to 1200 dots per inch. So if you make a line 3 pixels
thick, it may look too thick for the display screen but it may look absolutely gorgeous on your printer. Lines
that look good at 1-pixel thickness on your display screen may appear a little thin on a high resolution printer.
In any case, you have absolute control over the color and thickness of all lines. Click the color Black in the
color grid to put the Function Curve color back to its default value. Then click the OK button to get back to
the main graph window.

page 20
Overlaying Other Graphs

You can overlay one function graph on top of another. In fact, if you use graph types other than standard
rectangular functions you should note that you can overlay a polar curve or a parametric curve. Any graph type
can be overlaid on any other graph type.

For example look at the graph in Figure 16 below.

Figure 16. The graph of Y=3*SIN(X) and its derivative.

To make this graph pull down the nested menu items Action then Overlay Other Graph Types and finally
select Derivative Graph. The new curve that has been added is the derivative curve, which for those who know
a little calculus can compute that it should be the function Y=3*COS(X). The second graph function looks like
a cosine curve with an amplitude of 3 that is exactly what it should be. The derivative graph is made by
numerically approximating the derivative value at each point on the original curve.

Now press the Redraw Button in the tool bar to make the derivative graph disappear. This time pull down the
nested menu items Action then Overlay Other Graph Types and finally select Inverse Graph. You should
see the graph shown in Figure 17 below.

page 21
Figure 17. The graph of Y=3*SIN(X) and its inverse.

In this case the inverse curve gets added to the graph of the original function. The inverse curve is colored red.
Now press the Redraw Button in the tool bar to make the inverse graph disappear.

Later we will explain even more significant applications of working with multiple functions. For now all you
need to know is that you can draw multiple function curves overlaying the current function curve. The overlaid
curves can even be of a different type than the current function curve type.

Setting The Background Grid

The next button on the tool bar is called the Grid Button. This button is used to change the axes and the
background grid. Essentially there are three distinct elements that go into the make-up of the background grid.
The three elements are the xy-axes, a polar coordinate grid, and a lattice line grid. If you look at the screen you
can see the first and third of these elements in combination. The polar coordinate grid is usually only used when
making graphs involving polar coordinates.

So what is supposed to happen when you press the Grid Button on the tool bar? The background grid simply
switches to the next combination of the three grid elements. In fact, there are 8 total grid combinations. The
default for a Y=F(X) function curve includes the BC -axes and the lattice line grid but does not include the polar
coordinate grid. The grid choices may be summarized as shown in the list below. Each click on the Grid
Button selects the next choice in order, and after the bottom of the list is selected then the selections wrap
around and start at the top of the list.

page 22
No axes or grids
XY-Axes only
XY-Axes & Lattice Grid
Lattice Grid Only
Polar Grid Only
XY-Axes & Polar Grid
Lattice Grid & Polar Grid
XY-Axes & Lattice Grid & Polar Grid

So the Grid Button serves a very simple purpose. If you have already clicked the Grid Button a couple of
times you should click it some more until you see both the BC-axes and the Lattice Grid. Whenever you right-
click the Grid Button you will bring up the World Graph Parameters dialog box that was shown above in
Figure 14, but don't do this now.

Copying A Graph To The Clipboard

One of the main reasons the author wrote JKGraph was to create graphs that could easily be incorporated into
word processors. In particular JKGraph can export graphs in two distinct formats, one of which is a color
bitmap and the other is as a Windows metafile. JKGraph also allows you to set the exact size of the graph
before you export it. For bitmaps you can not only set the exact size of the graph you can also set the resolution
in terms of the number of pixels per inch.

To give an example of how to export a graph to the Windows clipboard, pull down the Formulas menu and
select the submenu Copy Graph To Clipboard (Bitmap)... and you should see a dialog box like that shown in
Figure 18 below.

Figure 18. The dialog box for copying a graph to the Windows clipboard.

The top of this dialog box indicates the graph image size in screen pixels. This size depends on your graphic
display hardware and the options you set when you installed windows and the current size of your graph
window on your screen display.

page 23
Next you should press the pushbutton that shows Set Exact Screen Size. When you do this you will probably
see the Horizontal and Vertical sizes in inches will change. We always recommend you try this pushbutton
before saving a bitmap. Since we don't need to copy anything to the clipboard for this tutorial, you can just click
the Cancel button to close the dialog box. Otherwise, after you press the Copy Graph To Clipboard button
you could later paste the current graph into another Windows application.

A useful thing to do before saving a graph is to set the exact graph window size. You can do this by selecting
the File menu item Set The Exact Graph Window Size. You should then see a dialog box similar to the
following.

Figure 19. The dialog box for setting the exact size of the graph window.

The numbers in the blue text are for the size of the graph window that currently exists at the time this dialog is
shown. Those numbers will change after you set a new graph window size.

When using this dialog we generally recommend turning off the True Aspect Ratio. This dialog allows you to
then set the exact size of the graph window. We usually do this before we copy a graph to the clipboard and just
before we paste the graph into another application. Usually Metafiles are better to use than bitmaps. For now
you can click the Cancel button to close this dialog because we don't need to actually set or change the window
size.

Numeric Formats and Fonts

Before concluding the first part of this tutorial we would like to make a comment regarding the format of the
numbers that the program outputs. Select the menu item Options | Numeric Formats…, you should see a
dialog box like the following.

page 24
Figure 20. The Numeric Formatting Options dialog box.

For those times when you wish to display more decimal digits, you will need to bring up this dialog box and
increase both the Significant Digits count and the Decimal Places count. As you increase these numbers the
sample numbers shown in the dialog box will expand to show more digits. The General format is the default
format, but you can force numbers into Scientific Notation by selecting that format. Normally the program will
not show trailing zeros in decimal numbers. In fact this is the reason why the default scale marks on the
coordinate axes usually do not show any trailing digits. If you want to see the most number of digits, you can
click the Maximum button to increase both the Significant Digits and the Decimal Places to 18 each. Clicking
the Default button sets both the Significant Digits and Decimal Places values to 5 as shown in the above
dialog box.

There are two format categories, one for Calculated Results and one for the scale and extent numbers
associated with Graph Labels. Usually you will want the graph scale labels to show a minimal number of
decimal places and significant digits, but you will want Calculated Results to show many more decimal places
and significant digits. Click the OK button to close the dialog box.

Another program option, not related to numeric formatting, is the font used to display numbers. The default font
used to display numbers is normal black 8-point MS Sans Serif. To change the font characteristics, select the
menu item Options | Font…. You should see the standard dialog shown in Figure 21 below for selecting any
installed font and choosing its point size and style as well as color.

page 25
Figure 21. Font selection for axes tic marks and BC-plane extent labels.

This font choice only affects the numbers you see drawn for the scale marks and BC extent numbers in the graph
that are considered graph labels. There may be times when you wish to show a different and perhaps larger or
bolded font with perhaps a different color like blue to match the default coordinate axes color. The choices are
up to you. Click the OK button to close the Font dialog box.

Setting The Function Type

The next button on the tool bar is called the Function Type Button and it can take on any one of the following
five captions:

page 26
Each time you press this button the program changes the current active function type. The Y=F(X) type
represents a standard rectangular type graph in which Y is a function of X. Polar represents a graph using
polar coordinates in which case the formula is of the form R=F(@) where we use the symbol @ as the ASCII
character that comes closest to matching any of the Greek letters Alpha, Phi or Theta for an angle. If you are
not familiar with polar functions or the polar coordinate system you need not be concerned with this
information. The Param caption represents a parametric function in that each of B and C are functions of two
generally independent functions of the variable T that represents time.

The PolPM caption represents a polar type of function in that both the radius and the angle are functions of
time T. We call this last type of curve a polar parametrized curve. Many users may not be familiar with this type
of curve because it does not ordinarily appear in standard calculus textbooks. But if you are familiar with both
parametric equations and polar coordinates then this last type is not too difficult to figure out.

The X=F(Y) caption represents a function in the rectangular BC-plane in which X is a function of Y. All of the
JKGraph program functionality that has already been demonstrated for Y=F(X) functions can also be applied
to functions in the form X=F(Y). Whenever we refer to a rectangular function we mean either a normal
rectangular function in the form Y=F(X) or a function in the form X=F(Y). JKGraph can differentiate or
integrate with respect to either X or Y after you first select the appropriate kind of rectangular function.

Since many users may not have much experience with the last four kinds of function curves we will not discuss
them in any detail in this tutorial that is only intended to be an introduction to the program. Advanced users will
quickly learn how to enter and manipulate these other curve types. JKGraph also has representations for
infinite series, and implicit functions, but these are considered a sixth special type of graph that is distinct from
the main five function groups as represented by the Function Type button. Infinite series, including power
series and Fourier series, and implicit functions, are briefly discussed at the end of this tutorial. What makes
both infinite series and implicit functions different from the main five function types is that none of the yellow
or green toolbar buttons work with infinite series nor implicit functions. The Multi-Graph parameter that is
discussed later in this tutorial does work with implicit functions but does not work with either infinite series
type.

Before continuing make sure the Y=F(X) caption appears on the Function Type button.

Working With Multiple Functions

Our next goal in this tutorial is to explain a few of the many options for entering and working with multiple
functions of the same function type. Although the above paragraphs indicate JKGraph can work with five
distinct function types, in fact JKGraph provides two examples for each function type that means at any one
time JKGraph actually holds ten different functions. In function type pairs, the two functions can either be
linked or unlinked that provides an even more significant capability as will be demonstrated below.

The next two buttons on the tool bar that appear as

control the use of the function pairs and their linking and unlinking.

page 27
When JKGraph starts up in its default mode it displays the single function Y=3*SIN(X). This function is
called the Primary Function. Now left-click the button

The new graph you see is what was originally the secondary Y=F(X) function, but after clicking the

button the primary and secondary functions have been exchanged. The function Y=3*SIN(X) is now the
secondary Y=F(X) function while Y=COS(X) has just become the new primary Y=F(X) function. The title
bar caption always shows the formula(s) of the active functions. You can associate the number 1 with the
Primary Function and the number 2 with the Secondary Function and you can think of the button

as the Primary-Secondary Exchange Button. (Read the tilde symbol ~ as the word 'exchange').

Next left-click the button that appears as

This same button will change and appear as

and you will now see the two Y=F(X) functions are graphed simultaneously. When you see the button with the
caption

then the secondary function is said to be linked to the primary function. We will call this button the Secondary
On/Off Button.

Look at the title bar at the top of the screen. The caption shows the two linked function formulas with the
indicators of 1st and 2nd placed between two period symbols. Thus you can tell at a glance, which formula is
primary and which is secondary.

.1st. F(X)=COS(X) .2nd. G(X)=3*SIN(X)

When the two functions are linked, JKGraph can perform special operations that use both curves. For example,
left-click the yellow Graph Trace Mode button and then left-click and drag the mouse left and right across the
screen. Note that you see two trace points, one for each curve, and it is natural to watch these two points
coalesce at any point of intersection between the two curves.

In the status line, the point on the primary function curve is labeled as P while Q serves as the label for the point
on the secondary function curve. We will next show how you can find the intersection points in a more precise
manner than reading coordinates in the Graph Trace Mode. Whenever the main window caption shows the
two sets of formulas then you know both the primary and secondary functions have been linked.

page 28
Although the Graph Trace Mode operates on both functions, both the Tangent Line Trace Mode and the
Normal Line Trace Mode only operate on the primary function. If you want to see either tangent or normal
lines traced on the secondary function, then the easiest thing to do is to click the button to exchange the
functions and then operate the desired trace mode. When finished you can press the button again to put the two
functions back the way they were.

Finding Points Of Intersection Between Two Functions

When done tracing points on the two curves, left-click the yellow Graph Trace Mode button to turn off all
trace modes and right-click the leftmost green button that has the abbreviation Intersect. We will refer to
this button as the Intersection Button. You should see the dialog box as shown below in Figure 22. This
dialog box is used to set the parameters for finding points of intersection between the Primary and Secondary
curves. Note that the number of sample points is 5000 that may seem like a large number. In fact, this is about
ten times as many points as might be needed to just graph the functions. To be more precise in finding
intersection points requires more fine precision. Left-click the OK button to close this dialog box.

Figure 22. The Intersection Points Domain and Parameters Dialog Box.

You should then see the program graph the two curves and automatically start tracking two points along the two
curves. When the two trace points intersect they leave behind an intersection trace point and the status line at
the bottom of the screen counts the number of intersection points and displays their coordinates. Wow! With a
computer program like this students could forget about learning algebra to solve equations because they can
now use a computer to find where one expression equals another!

page 29
Figure 23. Five Intersection Points of COS(X) and 3*SIN(X) over [-7, +7].

If the animated action went too slow you can speed it up by right-clicking the Intersection Button to bring up
the above dialog box. Set the Time Delay value to a higher or lower number to run the animation slower or
faster. Set the Time Delay value to 0 to run the animation at maximum speed. Otherwise, left-click the
Intersection Button again but keep the mouse over that button and sit back and relax and enjoy the action. In
particular, you should just read the status line as it dynamically changes to show you the intersection points.
The final graph should appear as shown in Figure 23 above. You can left-click the Intersection Button again
if you want to see the animation again. Like the Integral Button and the Max/Min Button, when you left-click
the Intersection Button you may want to leave the mouse resting over that button so the status line continues
to show the result of the calculation after the animation sequence ends. You can also press the ESCAPE key on
your keyboard to abort the intersection animation while it is running.

Now right-click the Intersection Button and when the dialog box comes up click on the check box to Show
The Final Result In A Table. Then click the OK button and watch the animated sequence one last time. When
it ends, you should see a table that contains the following information organized into rows and columns. You
can scroll the columns left and right to see more of the table, and if you are familiar with moving the partitions
in a spreadsheet you can also use the mouse to widen or narrow the default width of the columns. Just use the
mouse to grab the column dividing lines near the top of each column.

page 30
X Y
Point #1 -5.9612 0.94861
Point #2 -2.8196 -0.94861
Point #3 0.322 0.9486
Point #4 3.4636 -0.9486
Point #5 6.6052 0.9486
.1st. F(X) = COS(X) .2nd. G(X) = 3*SIN(X)
Two Function Curve's Intersection Points

Click the OK button to exit from the table.

Sometimes you need to choose a large number of sample points, even more than you might expect. Especially
with other types of function curves such as polar or parametric curves you may need to choose 50,000 sample
points or even more. If you think the program should be finding points of intersection that it isn't finding, then
try increasing the number of sample points. The moral here is never trust any result given by a machine.
(Florida voters take note!) Another problem is finding too many intersection points. To help control this,
JKGraph will usually only report a new intersection point after it has computed function values at least 50
positions away from the last intersection point. If you are making a table of intersection points JKGraph will
only store in the table the first 48 intersection points that it finds.

Integrals With Multiple Functions

When finished using the Intersection Button, left-click the Redraw Button to clear away the five intersection
points. Then right-click the Integral Button and if necessary change the method back to the default method that
is for area using a Midpoint Riemann Sum. After you click the OK button, you will see the approximating
rectangles extend between the two graphs. Note that the graphs alternate in terms of which is on top and which
is on the bottom and the integral answer for the Midpoint Riemann Sum is -1.921. The integral just
computed formed the integrand by subtracting the secondary curve from the primary curve. In this case the total
signed area is negative. See Figure 24 below.

page 31
Figure 24. Integral Rectangles That Extend Between Two Linked Functions

Now right-click the Integral Button. In the Integral dialog box click on the check box for applying the
Absolute Value function to the integrand. Note the integrand |f(x)| next to the large integral symbol is
surrounded by absolute value bars.

Figure 25. The checkbox to Apply Absolute Value To Integrand.

Click the OK button and when the new integral gets evaluated you may note the answer is different from what
was computed above. Now the answer is +20.677. To find the total area between two curves just apply the
absolute value function as in this example. Also note that since the two functions are linked, the integral area
extends between the graphs of the two functions. When only the single primary function is active the
approximating rectangles extend to, and stop on, the B-axis. Thus there is a real difference between having the
two functions linked or not. Compare Figure 24 with Figure 2.

page 32
You can also link two functions and calculate volumes of revolution using cylindrical shells or disks. Just
remember the integrand is formed by subtracting the secondary function from the primary function. For normal
problem setups you can think that the primary function should be on top and the secondary function should be
on the bottom. This program can integrate with respect to either B or C, but you must select the function type
X=F(Y) before you can integrate with respect to C.

The Built-In Functions

Ok, everything we have done so far has been with the sine and cosine functions and by now you may be getting
tired of these two functions. So next we will explain how you can key in your own function formulas.
JKGraph is quite versatile in allowing you to enter almost any function expression. Perhaps it would be easiest
to just say that JKGraph provides all the functions you would find on a scientific calculator and then some.

The following is a list of all 61 built-in functions. There are 39 unary functions, 18 binary functions, and 4
functions that take on three arguments. In the list below we show the variable X as the input for each unary
function, but X can represent any expression. When working with parametric equations you can think of
replacing X with the variable T that represents time. When working with polar equations you can think of
replacing X with the variable @ that is the variable JKGraph uses to represent angles. When working with
B œ 0 ÐCÑ functions think of replacing X with Y. We show (A,B) as the two inputs for the binary functions and
we show (A,B,C) as the inputs for the functions with 3 arguments. As with X, any one of A, B, or C may
be any general expression.

If you use polar functions, all angle ranges you enter for the variable @ in dialog boxes should be considered in
degrees. Internally JKGraph works in radians, but angle domains in terms of degrees are much easier for
humans to work with and type in. All the polar functions in JKGraph that use the variable @ have the default
domain from 0 to 360 in any dialog box where you might enter an @-value. You should think that all
trigonometric functions work only in radians mode and you should think that when @ appears as a variable in
any polar function formula then @ will be treated as a radian value. The degrees nature of @-values only applies
to entering constants in dialog boxes for the @ variable. Later, when a function formula is evaluated, JKGraph
will automatically convert any and all degree constant @-values to radian measure. But you will only see and
enter degree values in edit boxes that accept @-values.

Function/Description Syntax
------------------------------------ -----------
Absolute Value ABS(X)
Inverse Cosine ARCCOS(X)
Inverse Hyperbolic Cosine ARCCOSH(X)
Inverse Cotangent ARCCOT(X)
Inverse Hyperbolic Cotangent ARCCOTH(X)
Inverse Cosecant ARCCSC(X)
Inverse Hyperbolic Cosecant ARCCSCH(X)
Inverse Secant ARCSEC(X)
Inverse Hyperbolic Secant ARCSECH(X)
Inverse Sine ARCSIN(X)
Inverse Hyperbolic Sine ARCSINH(X)

page 33
Inverse Tangent ARCTAN(X)
Inverse Hyperbolic Tangent ARCTANH(X)
Binomial Coefficient (A choose B) BinCoef(A,B)
Between logical function tests A<C<B BT(A,B,C)
Between logical function tests A<C<=B BTE(A,B,C)
Between logical function tests A<=C<B BET(A,B,C)
Between logical function tests A<=C<=B BETE(A,B,C)
Ceiling Function CEIL(X)
Cosine COS(X)
Hyperbolic Cosine COSH(X)
Cotangent COT(X)
Hyperbolic Cotangent COTH(X)
Cosecant CSC(X)
Hyperbolic Cosecant CSCH(X)
Digit (extract the Nth digit) DIGIT(X,N)
Equal logical function tests A=B EQ(A,B)
Even logical function EVEN(X)
Factorial FACT(X)
Floor Function FLOOR(X)
Fractional Part FRAC(X)
Greatest Common Factor GCF(A,B)
Greater than logical function tests A>B GT(A,B)
Greater than logical function tests A>=B GTE(A,B)
Integer Part INT(X)
Least Common Multiple LCM(A,B)
Natural Logarithm (base e) LN(X)
Less than logical function tests A<B LT(A,B)
Less than logical function tests A<=B LTE(A,B)
Common Logarithm (base 10) LOG(X)
Logarithm base B LOGB(B,X)
Maximum of A and B MAX(A,B)
Minimum of A and B MIN(A,B)
Modulo function (remainder A/B) MOD(A,B)
Not Equal logical function tests A!=B NEQ(A,B)
Odd logical function ODD(X)
Parity Function = (-1)^X PARITY(X)
Quotient function (integer part A/B) QUOTIENT(A,B)
Normal Random Number (A=Mean, B=Std.Dev.) RandomG(A,B)
Uniform Random Number (between A and B) RandomU(A,B)
Nth Root (N=radical index) ROOT(N,X)
Round function (Nth decimal position) Round(X,N)
Secant SEC(X)
Hyperbolic Secant SECH(X)
Signum or Sign SIGN(X)
Sine SIN(X)
Hyperbolic Sine SINH(X)
Square (X^2) SQR(X)
Square Root SQRT(X)
Tangent TAN(X)
Hyperbolic Tangent TANH(X)

page 34
Ok, that is a pretty healthy list of basic functions. You might note that all 6 trigonometric functions and their
inverses are present, as are all six hyperbolic functions, including all their inverses. The best news is that you
can compose all these basic functions to build expressions with any level of complexity you desire. See the
Special Topics help file to learn the technical details for any of the above functions.

In addition to the above 61 built-in functions, JKGraph has 5 binary operators and two unary operators. The
binary operators are addition, subtraction, multiplication, division, and exponentiation. Negation is one of two
unary operators. Plus also acts as a unary operator that essentially does nothing. For example +SIN(+X) gets
parsed as just plain old SIN(X), where essentially both + signs are thrown away because they have no effect.

JKGraph uses the caret symbol ^ to represent exponentiation. Some examples are:

8^3 = the cube of 8.


8^(1/3) = the cube root of 8.
SIN(8)^3 = the cube of the sine of 8.
SIN(8^(1/3)) = the sine of the cube root of 8.
SIN(8)^(1/3) = the cube root of the sine of 8.
SIN(8^3)^(1/3) = the cube root of the sine of 8 cubed.
E^T = the natural exponential function
10^T = the common anti-logarithm function
B^T = general exponential with constant base B ÐB Á 0 and B Á 1)

JKGraph also uses two special constants for the numbers Pi=3.14159265359 and e=2.71828182846.
Just type PI or E whenever you need to use these constants in an expression. Note that JKGraph expressions
are entered in all UPPER CASE. You don't really need to worry about UPPER CASE because JKGraph
automatically traps and changes all characters you type into UPPER CASE. Maybe you just need to know that
it is pointless to try and enter anything in lower case. (One exception is infinite series formulas, an example of
which is given at the end of this tutorial. The formulas that define infinite series can be entered using all lower-
case letters if you prefer.)

JKGraph has the special feature that whenever you are asked to enter a numerical value, you can enter any
expression that evaluates to a constant. Rather than type in the long decimal constant 0.866025403785 you
can just type in the simpler but equivalent expression SQRT(3)/2. This means you should never have to
manually calculate a decimal constant on a hand calculator to enter any decimal values in any edit box that is
expecting you to type in a number that can be represented by a simpler mathematical expression. It is faster and
more accurate to just type 2*PI rather than try to type the decimal digits 6.28318530718. As other less
useful examples, the number -14 could be entered by typing in the equivalent expression
COS(PI)*SQRT(196)and the number +5 could be entered by typing in the expression LOGB(7,7^5).

Some of these functions require their arguments to be non-negative integers, (in some cases just a signed
integer), but you can still feed them any kind of a signed decimal value and the program will automatically first
compute the integer part (and perhaps absolute value) of the argument before it evaluates the function. For
example, computing FACT(-PI)=6 is the same as computing the factorial of +3. Also, computing
LCM(SQRT(50),E)=14 is the same as computing the Least Common Multiple of 7 and 2 even though

page 35
SQRT(50)=7.07106781187 and E=2.71828182846. In these cases the arguments are automatically
truncated to an appropriate integer value before the real function gets evaluated. Those functions that require
integer-only arguments are BinCoef(A,B), DIGIT(X,N), EVEN(X), FACT(X), ODD(X), GCF(A,B),
LCM(A,B), PARITY(X), and Round(X,N).

DIGIT(X,N) expects its second argument to be a nonzero integer. DIGIT(X,N) extracts the Nth decimal
digit from X where the counting is done starting at the decimal point. A positive N gets the Nth digit to the right
of the decimal point while a negative N gets the |N|th digit from the left of the decimal point. For example,
DIGIT(354.129,-2)=5 while DIGIT(354.129,3)=9. The Round(X,N) function uses its second
argument in the same way as DIGIT does when N is nonzero. Round(X,N) allows the 2nd argument to be
any signed integer. When N is positive the rounding is to the right of the decimal point. When N is negative the
rounding is to the left of the decimal point.

For examples, Round(3.14159,4)=3.1416 while Round(314159.0,-2)=314200. Round(X,-1)


rounds X to the nearest integer. Round(X,0) yields the sign or signum of X. ROOT(N,X) expects only its
first argument to be a positive integer. Note however that MOD(A,B) does NOT require A or B to be integers
and does NOT truncate A and B to integers. When B=0, then MOD(A,B)=A whereas when B is nonzero then
MOD(A,B)=A-B*INT(A/B).

Showing The Formula Tree Structure

A menu item under Formulas allows advanced users to see the parse tree structure of any function expression
that is entered. Sometimes this is useful to see when you enter a complex expression. For example, consider the
typeset expression:

B  È*  B#

=382ÐBÑ ƒ -9=ÐBÑ  68


È /B  kBk 
#  >+8ÐBÑ
$

When this is entered as a function formula in JKGraph it must be entered in the form:

(X+SQRT(9-SQR(X)))/(SINH(X)/COS(X)+LN((2-TAN(X))/ROOT(3,E^X+ABS(X))))

Once entered, you can then view the parse tree structure for this expression by selecting the menu item
Formulas | Show Formula Tree Structure…. The structured outline tree view for the above expression is:

page 36
Figure 26. The outline tree structure of a moderately complex formula.

The above outline together with the function formula can be copied to the Windows clipboard from the dialog
box that shows both.

Labeling Graphs and the Drawing Extras

JKGraph is not a graphics editor. However, it does have a feature that allows you to add graphic elements to
any graph to make that graph more presentable. As an example, the graph below is rather plain.

page 37
Figure 27. The plain graph of f(X)=1/(X-2.5) + 1.5.

If we wanted to emphasize the asymptotes and label parts of the graph and mark the B-intercept as a special
point and add some special labels we could show the following enhancements to the graph.

page 38
Figure 28. The same graph as Figure 27 but with special elements added.

These extra graph parts were added by choosing the menu item Options | Drawing Extras…. This opens a
dialog box that has three tabbed pages for defining extra points, and extra lines and extra text labels that can be
added to a graph. In the above figure we made a special yellow point and a special text label for the B-intercept
in the graph. We also added two dotted lines for the horizontal and vertical asymptotes and we added three lines
with arrows to point to parts of the graph. A couple of the text labels run at odd angles. The regular help file
contains the technical details of how to add graphic elements like this. You just need to know that JKGraph
has the ability to add titles and legends and labels to any graph and those elements can all be saved along with
your function in a regular text file. These elements will automatically load when you open the text file that
contains your function.

The next figure shows several possible ways of drawing text at different angles, and it shows various line and
point styles using several colors. So if you really want to add extra parts to a graph it is possible to do so in
many different ways.

page 39
Figure 29. Various examples of extra drawing elements.

Graphing Implicit Functions

JKGraph can be used to graph functions given by implicit formulas. If you click the button you should
see the following dialog box.

Figure 30. The Implicit Function Dialog Box.

page 40
This dialog box is used to enter a formula for an implicit function and to set the domain for that function. Note
that you only enter the left side of the equation that is assumed to be of the form 0 ÐBß CÑ œ !. You can then set a
rectangular domain and set the number of partitions to make for both the B and C variables. The number of
partitions determines the denseness of your graph. Making too few partitions results in a skimpy graph, and
setting too large a number of partitions causes the program to take a long time to create the graph. Probably
most partition numbers should be in the range between 200 and 800, depending on the size of the rectangular
domain. The default partition values are 500. The B and C range of values need only be sufficiently large so as
to encompass the graph parts you wish to see. Normally this rectangular domain will be a subset of the regular
graphing domain of the current function graph.

The implicit function graph is drawn on top of the current active function. The above dialog box is modeless
and stays on top, so if you have a large enough screen you can move this dialog out of the way and work with
the regular graph window and with the implicit function formula at the same time. Otherwise, when your screen
real estate is limited you can try pressing the Minimize button and the above dialog box will shrink to a
minimal vertical height. If after doing this the dialog box still overlays too much of your graph window then
you should just setup the implicit function and close the dialog box. Then use the menu item Action | Overlay
Other Graph Types | Implicit Function Graph to make the implicit graph overlay the current function graph.
Implicit function graphs always grow from the bottom of the graph window in the upward direction. Just be
patient and wait for all parts of the graph to complete. The hourglass cursor will return to a normal arrow cursor
when the graph is complete. Most of the implicit function examples below were made in 10 seconds or less.

To make the next few graphs we set the current function to 0 ÐBÑ œ ) so that the graph of the current function is
out of the way and is not seen. The next graph shows the above default implicit function.

Figure 31. The graph of the default implicit function X*X*X-3*X*Y+Y*Y=0.

page 41
Note that you can also cause the implicit function to be drawn after you close the above dialog box by choosing
the menu item Action | Overlay Other Graph Types | Implicit Function Graph. This way the dialog box
won't obscure parts of the graph. The next several graphs show an interesting variety of implicit functions.

Figure 32. The graph of the implicit function Y*Y-X*(X-1)*(X-2)=0.

Figure 33. The graph of the implicit function SQR(X*X+Y*Y)-16*X*X*ABS(Y)=0.

page 42
Figure 34. The graph of the implicit function TAN(X+Y)-3=0.

Figure 35. The graph of the implicit function SIN(X*Y)=0.

page 43
Figure 36. The graph of the implicit function SIN(2*X)+COS(4*Y)=0.

Figure 37. The implicit function SIN(2*X)+COS(4*Y)-1=0.

page 44
Compare the formula in Figure 37 with the formula in Figure 36.

Figure 38. The graph of the implicit function TAN(16/(X*X+Y*Y+1))-(X*Y)=0.

Figure 39. The graph of the implicit function Y*Y*Y*Y-4*Y*Y-X*X*X*X+9*X*X=0.

page 45
Figure 40. The graph of SIN(X*X)+COS(Y*Y*Y)+X*Y=0 is an "odd" function.

All of the above implicit functions are available in text files that can be loaded with the Implicit Function
Graphs dialog box. You can make an amazing array of graphs using implicit functions. You are limited only by
your imagination! You can also use the Multi-Graph parameter M as part of your implicit function formula. In
that case you will probably want to first set the Multi-Graph parameter values before you try to graph any
implicit function that uses the M variable. You can read about Multi-Graphs later in this tutorial.

Conclusion of the basic part of this tutorial

At this point we have covered most of the basics of the JKGraph program. The remainder of this tutorial
contains more advanced material that may only be of interest to more advanced users. So if you are ready for a
break, this is a good place to pause. The rest of this tutorial will still be here for you to read later. You should
also consult the regular on-line help file when you have questions about any menu items, or dialog boxes or
when you want to read more explanatory type of material that is in the special topics section of Help.

On the other hand, if you would like to continue and learn more about how to work with multiple functions and
how to enter more advanced functions then keep reading.

page 46
More On Switching Between Primary and Secondary Functions

Earlier we said JKGraph holds ten different functions or curves. Even more significant is that each function
has its own set of graph and other parameters. To demonstrate the importance of this last statement, click the
button

to turn off the secondary function. You should now just see the graph of the primary function F(X)=COS(X)
and the button you just clicked should now appear as

Thus this button not only turns On or turns Off the secondary function, the button caption words On and Off tell
you the current state of the secondary function. Right-click the Zoom Mode button to bring up the World
Graph Parameters dialog box. In this box edit and change the four BC -extent values to the following new
values:

X Minimum = -14 X Maximum = +14 Y Minimum = -10 Y Maximum = +10

and then click the OK button. The new graph you see has doubled the size of the old graph window in the
BC-plane.

Now left-click the button

and note how the views of the primary and secondary functions are very different. In fact, you can click this
button to exchange the secondary and primary graphs a couple times to really understand how the two graphs
have very different graph parameters.

If necessary, click the Primary-Secondary Exchange button one more time to bring the F(X)=COS(X) graph
into view. Now click the button

to link the two functions. Because the F(X)=COS(X)function was the primary function when we turned
linking on, the old function G(X)=3*SIN(X) had its World Graph parameters changed to match the extents
of the primary function.

To more fully understand this last point, click the Primary-Secondary Exchange button and then click the
Secondary On-Off button. You should now just see the graph of F(X)=3*SIN(X). Right-click the Zoom
Mode button to bring up the World Graph Parameters dialog box. Change the four BC -extent values back to
their default values.

X Minimum = -7 X Maximum = +7 Y Minimum = -5 Y Maximum = +5

page 47
and then click the OK button.

Left-click the Primary-Secondary Exchange button so you can see the graph of F(X)=COS(X) still has the
double extents. Then left-click the Primary-Secondary Exchange button again to bring back the graph of
F(X)=3*SIN(X) and then click the Secondary On/Off button to link the two functions. Then click the
Secondary On/Off Button to unlink the two functions and click the Primary-Secondary Exchange button to
bring back the F(X)=COS(X) function. Note that the BC -extents are no longer doubled. The reason is because
F(X)=3*SIN(X) was the active function at the time we turned linking on. When you turn linking on, the size
of the BC -extents of the primary function get copied into the secondary function. Left-click the Primary-
Secondary Exchange button one more time.

So if you want to keep and work with two independent functions with different graph parameters you should
never turn linking on. Before continuing with this tutorial, you should see only the primary function as
F(X)=3*SIN(X) and the secondary function that you don't see should be F(X)=COS(X).

Entering A Custom Function Expression

To give an example of entering a different expression, right-click the button and you should see the
dialog box for entering a new rectangular function formula.

Figure 41. The dialog box for entering a new function expression.

page 48
Type in the expression X^(2/3) that represents the variable X raised to the two-thirds power. Then click the
OK button. You should see the graph shown below.

Figure 42. The graph of the function Y = X^(2/3)

JKGraph has a special algorithm for calculating powers using the ^ operator that goes beyond simply
calculating a logarithm and an anti-logarithm. Both the base and exponent can be any general expression,
including negative values, where negative values would be legal. The program will analyze both the base and
especially the exponent before deciding how the expression should be evaluated. For the above function when X
was negative the program actually computed a continued fraction approximation for the exponent that led to
eventually computing the equivalent of the cube root of the square of X.

Built-In Special Functions With Multiple Arguments

JKGraph has 21 special built-in functions that take on multiple arguments. The two simplest of these are
MAX(A,B) and MIN(A,B). These two functions yield the maximum and minimum of their respective
arguments. For example, if A>B then MAX(A,B) will always return A while MIN(A,B) would return B. A and
B in these cases can be any general expressions.

For example, try graphing the function MIN(3,2*X). Right-click the Function Type button,

page 49
to bring up the dialog box for entering a new function. Type in the expression

MIN(3,2*X)

and click the OK button. You should then see the graph shown below in Figure 43. Note that this graph looks
like it comes in two parts, one of which is 2*X, at least as long as X<1.5. If X>1.5 then the graph looks like
the constant Y=3 that is the horizontal line part. If X=1.5 exactly, the same point would be graphed on either
curve. Below we will explain how to enter a single function that consists of multiple (more than two) function
pieces.

Figure 43. The graph of the special function Y=MIN(3,2*X)

Again right-click the Function Type button, to bring up the dialog box for entering a new function.
Type in the expression

MAX(SIN(X),2*COS(X))

and click the OK button. You should see the somewhat strange-looking graph that is in Figure 44 below.

page 50
Figure 44. The graph of the special function MAX(SIN(X),2*COS(X)).

To help you better understand the above graph, the next figure shows the two separate functions SIN(X) and
2*COS(X) without taking their maximum value.

Figure 45. The separate graphs of SIN(X) and 2*COS(X).

page 51
After looking at the graph in Figure 45 above you should better understand why the graph of the maximum of
these two functions appears as it does in Figure 44. If you move along the top ridge of both functions you get
the graph in Figure 44.

There are of course many other special kinds of functions that we won't discuss in this tutorial. However, you
can read about these other functions in the regular help file for the JKGraph program. At some point you
should probably read the three special help topics that are titled Entering Function Expressions, Special
Functions, and Built-in Functions. In this tutorial we can only briefly show some of the possibilities for
entering expressions.

The Special Logical Functions

JKGraph has 12 special functions that are called logical functions. These functions test some condition and
return only one of the two values, 0 or 1, based on the results of that test.

The two simplest logical functions are EVEN(X) and ODD(X). Both functions take the integer part of X and
then decide if the resulting integer is either even or odd. When the test is true the result is the number 1 and
when the test fails the result is the number 0.

The remaining 10 logical functions all take on more than one argument and they test relationships between
those arguments. Like EVEN and ODD, the remaining 10 logical functions only return one of two values that are
either 0 or 1. The Max and Min functions described above are not considered logical functions because they
normally return values other than 0 or 1. So even though Max and Min test a relationship between their
arguments, they are not considered part of the group of the 12 logical functions.

The two simplest two-variable logical functions are GT(A,B) and LT(A,B). These are the Greater Than and
Less Than logical functions.

GT(A,B)=1 when and only when A>B. Otherwise GT returns 0. Similarly, LT(A,B)=1 when and only when
A<B. Otherwise LT returns 0. The GTE and LTE logical functions are almost the same as GT and LT except
they add additional tests for equality. Think of the additional letter E as representing equality. Thus GTE(A,B)
tests if A>=B and returns 1 only in this case. LTE(A,B) tests if A<=B.

The logical function BT(A,B,C) tests the condition if C is between A and B. Think of the two letters BT as
representing the word between. BT tests if the 3rd argument C is between the first two arguments. Thus when
A<C and C<B then BT returns 1. In all other cases BT returns 0. You may want to remember that the first two
arguments determine the test interval and the third argument is the one that is tested. In our syntax C is not
written between A and B even though the test is whether C is between A and B.

The BT logical function has three cousins named BET, BTE, and BETE. These other three logical between
functions allow you to test equality at either or both endpoints of the interval between A and B. When the letter
E appears to the left of the letter T the test for equality is at the left endpoint. When the letter E appears to the
right of T the test for equality is at the right endpoint. When the letter E appears both to the left and to the right
of T then the equality test gets applied to both endpoints. Thus we have:

page 52
BET(A,B,C)=1 when and only when A<=C and C<B.

BTE(A,B,C)=1 when and only when A<C and C<=B.

BETE(A,B,C)=1 when and only when A<=C and C<=B.

JKGraph also has two logical functions that test equality. EQ(A,B)=1 when and only when A=B. NEQ(A,B)
is a logical test for non-equality. NEQ(A,B)=1 when and only when A is NOT equal to B.

The reason for having all these logical functions is that they can be used to help build more complex functions
that normally consist of several logical parts that all need to be combined into one formula. Such functions are
normally called conditional functions. Before showing how to use these logical functions to build conditional
function expressions, we first want to show some graphs that may help explain the nature of the logical
functions. For example, the logical function LTE(X,5) is shown in Figure 46 below as the graph on the left in
that figure. This can be thought of as a step function going to the left. Similarly, the logical function
GTE(X,20) can be thought of as a right-step function, and this graph is on the right in Figure 46.

x-axis

Figure 46. The graphs of the example left and right step functions.

Next, consider the logical function BT(5,20,X). The mathematical definition of this function is shown
below.
Ú!
0 ÐBÑ œ Û "
if B Ÿ &

Ü!
if &  B  #!
if B   #!

Thus, the above example BT logical function is mostly 0, except BT is 1 if B lies in the open interval between 5
and 20. The three arguments to BT can also be general expressions, but as in the example above, usually A and
B are constants with A<B and the third argument is usually just X. If A>B then BT only returns the constant
value 0 no matter what X is. The intention is that the first argument should be less than the second, and the third
argument is tested for betweeness, between the first two arguments. When X is between A and B then

page 53
BT(A,B,X)=1 and otherwise BT(A,B,X)=0. The picture below shows a graph for the above example
BT(5,20,X) function.

Figure 47. The graph of the function BT(5,20,X).

As explained below, the logical functions LT, BT, and GT, and their cousins, all provide automatic conditional
branching or decision-making capabilities within what would otherwise be considered a static expression.
Anything we say in the following discussion about the logical functions LT, BT or GT functions also applies to
any of the 10 logical functions that have an E in the name. But we usually just use these three logical functions
to create complex conditional expressions.

Entering Schizophrenic Functions

By themselves, the logical functions LT, BT, and GT are perhaps not very interesting. Their real purpose is as
helper functions to build what may be called schizophrenic functions. Such functions are usually defined
piecewise over non-overlapping intervals. Some people might use the terms conditional function or piecewise
function, but we prefer the term schizophrenic function.

For example, consider the 4-piece function defined by:


Ú
Ý
ÝB if B Ÿ %
0 ÐBÑ œ Û È
-9=ÐBÑ if %  B  $
Ý
Ý B
Ü%
if $ Ÿ B  &
if B   &

This function can be entered using one expression that is a linear combination of the LT, BT, and GT and related
logical functions. Consider:

LTE(X,-4)*(X)+BT(-4,3,X)*(COS(X))+BET(3,5,X)*(SQRT(X))+GTE(X,5)*(4)

When writing linear combinations using these logical functions you should normally write each term in the sum
with the logical function first, multiplied by the real defining math expression part, as in the above example. In
typical use, a schizophrenic expression will start and end with at most, one each of LT and GT. A typical
schizophrenic expression will also consist of zero or more BT function parts in its middle. In the above example
there are two BT logical function parts for each of the two middle defining sections. The above example
expression starts with an LTE logical function on the left that normally extends to negative infinity in the left
direction and it ends with an GTE logical function on the right that extends to positive infinity in the right
direction.

page 54
JKGraph treats multiplications in a very special way that is sometimes called short-circuit evaluation. This
means whenever it evaluates a product in the form P*Q, it first computes the factor P, and if P is 0, then the Q
factor never even gets evaluated. This short-circuit evaluation feature is useful when you enter a schizophrenic
expression like

LTE(X,1)*SQRT(1-X) + GT(X,1)*LN(X)

This function can have a well-defined domain that extends all the way between minus infinity and plus infinity.
If X were large and positive, then evaluating SQRT(1-X) would normally lead to an error, but in this example
LTE(X,1) is a left-multiplicative factor that easily evaluates to 0 when X is large and positive and thus in this
case JKGraph never substitutes X into the part that is SQRT(1-X). No substitution is made in the square root
function part because LTE(X,1)*SQRT(1-X) is first seen as 0*SQRT(1-X) and this simplifies further to 0
without SQRT(1-X) ever being tried to be evaluated.

Similarly, trying to calculate LN(X) would normally cause an error when X is 0 or a negative. But in this
example, when X is 0 or negative JKGraph will recognize that the first factor, GT(X,1), is 0 and so the
product GT(X,1)*LN(X) is first seen as 0*LN(X) without the program ever trying to substitute X into
LN(X). Thus expressions like these in JKGraph are more than just static expressions. They have some
dynamic intelligence that decides which parts of the expression contribute to the function value when the entire
expression gets evaluated. Always write any logical function as the first factor.

To see the graph of this example, right-click the Function Type button to bring up the dialog box for
entering a new function. Type in the expression

LTE(X,1)*SQRT(1-X)+GT(X,1)*LN(X)

and click the OK button and you should see the graph shown below in Figure 48.

page 55
Figure 48. The graph of the schizophrenic function LTE(X,1)*SQRT(1-X)+GT(X,1)*LN(X)
The curve to the left of +1 is SQRT(1-X) while the curve to the right of +1 is LN(X)

Note that this function only consists of two parts so the expression does not use any BT logical type function in
its middle because it has no middle parts.

Again, we point out that usually none of the logical functions LT, BT, and GT are of interest by themselves. But
you may wish to experiment with these to help you understand how they can be used to build split-decision
making logic into mathematical expressions. The short-circuit evaluation feature allows such expressions to
have a little dynamic behavior or intelligence. Only one expression is needed to combine several complex graph
sections to make a conditional type function.

A 3D Integral With Washers Between Two Functions

As another example, right-click the Function Type button to bring up the dialog box for entering a new
formula. Type in the expression

LT(X,-PI)*(-0.8*X-2.5)+BT(-PI,0,X)*SIN(X)+GT(X,0)*SQRT(X)

and click the OK button and you should see the graph shown in Figure 49 below. This example consists of
three parts and it makes use of one BT logical function for its middle section.

page 56
Figure 49. The graph of the schizophrenic function
LT(X,-PI)*(-0.8*X-2.5)+BT(-PI,0,X)*SIN(X)+GT(X,0)*SQRT(X)
The left-most part between -7 and -PI is the line: -0.8*X-2.5;
The middle curve below the X-axis between -PI and 0 is part of: SIN(X);
The right-most curve in the first quadrant above the X-axis is: SQRT(X).

Ok, we admit we got a little carried away with the above example, but JKGraph is so much fun to play with
that it is worthwhile to try something unusual. Right-click the Integral Button and set the Horizontal Rotation
Line Disks/Washers : Y= value to -1.4. Then select the method Volume : Disks/Washers Horizontal
Rotation Line. Click the OK button to close the dialog box and you should see the graph in Figure 50 below
that is a very close rendition of a water glass lying on its side!

page 57
Figure 50. A water glass lying on its side.

Next, left click the button to turn on the secondary function. That same button should now appear as
. You can directly edit the secondary function formula by right-clicking the button to bring up
the secondary function formula dialog box and change what was the secondary function formula by typing in
the following new expression.

LT(X,0.4)*(-1.4)+GT(X,0.4)*(1.5*SQRT(X)-1.4)

Click the OK button to close the secondary formula edit box. Finally right-click the Integral Button and
change the Time Delay value to a nonzero value like 10 or 50 or 100 (depending on the speed of your
computer) and then click the OK button. This time you will see a different figure than that shown above in
Figure 50. This new figure is made by taking the difference between the Primary and Secondary functions and
rotating the difference slices over the selected horizontal line. If you run this integral animation at a slow
enough speed, you can see the middle portions of the rotated washer sections are filled in black to represent
washers as disks with holes in them. The black portions show the empty hole interior of the glass that would
hold the water between X=0.4 and X=+5. You can contrast this with the cross-sectional solid disk slices
shown above in Figure 50 by turning off the secondary function

and then left-clicking the Integral Button to run the solid disk integral animation again. If you leave the mouse
resting over the Integral Button you will see the solid volume is 170.54 cubic units. Then turn the secondary
function back on

page 58
and click the Integral Button one more time. This time the integral answer is only 82.746 cubic units
because the central section of the solid that would hold the water has been removed. Look closely at the middle
cross-sectional slices. This example demonstrates why you may want to slow down the integral animation
process so you can more closely view the washer slices as they are generated. The size of the middle black hole
changes its radius at different sections along the graph. Figure 51 below does not show the full graph, it shows
only that portion that extends from X=-5 to approximately X=+2.

Figure 51. Partial graph showing integral cross-section slices that are washers.

You may also find it instructive to right click the Integral Button to bring up the Integral dialog box and turn
on the checkbox for the Alternate 3-D Disk/Shell View.

After clicking the OK button to close the Integral dialog box you should see the above figure will be drawn
from right to left as opposed to being drawn from left to right. In fact it is instructive to run the integral
calculation several times, reversing the disk view each time. One view shows the disks from the right, the other
view shows them from the left. For each different view the program draws the disk in a different order from left
to right or from right to left.

Next, select the menu items Options | Fill Area Colors…, and you should see the dialog box shown below in
Figure 52.

page 59
Figure 52. Fill Areas and Regions Brush Properties

Click your mouse right in the middle of the green side of the Disks figure, or click the white folder tab labeled
Disks and the Region Type selected will change to show the Disks tab highlighted in yellow. Then click on the
Brush Style radio button that is labeled Cross Hatched x. The Disks figure will change to show the latest
brush style applied to the example Disk. Click the OK button to close this dialog box. Then left click the
Integral Button and you should generate a figure like that shown in Figure 53 below. Depending on the
Alternate 3-D Disks/Shell View checkbox setting of the Figure 3 dialog box you may see the figure below
drawn reversed from left-to-right.

page 60
Figure 53. The 3D Shape drawn with a special Cross-Hatched Brush.

When this drawing is made you can see the outer shell as well as the interior shell that would hold the water.
You can try generating this figure from both the left-to-right and right-to-left directions by bringing up the
Integral dialog box and checking or unchecking the checkbox for the Alternate 3-D Disk/Shell View. You
may also lengthen the time delay value. This is also a good example of why it may be desirable to control the
speed of animation. If you set the Time Delay for the integral calculation to 0 and you have a fast computer
then you won't see how the interior of the figure is generated. But if you set a sufficiently large Time Delay
value then you get a greater appreciation for the disk slicing process.

Making A Multi-Graph or a Sequence of Functions

JKGraph has the ability to graph a sequence of functions associated with any of its five function types. We
will have you work one example for the Y=F(X) type and then we will just show you two more examples for
that same type. First, turn off the secondary function and then right click the function type button
and key in the expression M*COS(X) as the function formula. Next click the OK button and you will
note that the graph does not seem to appear. In fact, the graph seems to have disappeared! That is because the
variable M has a default value of 0 so the current graph you see appears as just the line Y=0 that covers the
horizontal B-axis. Next, give the menu command Domains | Multi-Graph Domain and you will see a dialog
box similar to that shown in Figure 54 below.

page 61
Figure 54. The Multi-Graph Domain Dialog Box

Leave the starting value at 0 but change the ending value to 4 and make the number of subintervals 30 as
shown in the above dialog box. Make sure the Rectangular Y=F(X) Function type radio button is selected as
the Overlay Function Type and the three check boxes are as shown above. Then click the OK button.

You should see the graph shown in Figure 55 below where each cosine curve is generated one at a time,
starting with M=0 and continuing until M=4.

page 62
Figure 55. An Example of a Multi-Graph: M*COS(X).

We call the above graph a Multi-Graph. The entire graph is made by changing the M parameter value 30 times
from its starting value. Technically, this example results in making 31 related curves. The number of curves
made is always one more than the number of subintervals. Later you can read more details and see more
examples of making multi-graphs as a special topic under help. For now you may just remember that you can
use the global variable M as the Multi-Graph parameter when you enter any type of function formula.

At any other time you can give the menu command Action | Overlay Other Graph Types | Multi-Graph
Overlay to make the Multi-Graph overlay. But JKGraph will also draw the Multi-Graph overlay anytime
you click the OK button in the above dialog box. You can also right click the Redraw button with the control
key on your keyboard, CTRL ,held down to cause the Multi-Graph to be drawn.

The next two graphs are different function sequence examples where we just show you the final results. The
graph in Figure 56 shows that a sequence of continuous functions, in this case X^M, can have a limit that is not
continuous.

page 63
Figure 56. The first 15 terms in the sequence X^M defined over the interval (-1,+1).

The graph in Figure 57 shows another sequence of continuous functions that does not converge uniformly. In
Figure 57, when X=1/M then each sequence function value is always 1. The limit of the sequence of functions
in Figure 57 is the constant function 0 and when you study the graph you can see the functions creep lower and
are approaching the B-axis.

Figure 57. The first 15 terms of (2*M*X)/(1+SQR(M*X)) defined over [0,4+].

To make any sequence of functions just remember to use the global variable M as the sequence counter value in
your function formula and use the Multi-Graph Domain dialog box to set the parameters that control the use
of M. If you let M vary between 1 and some integer n then set the number of subintervals to n-1. Usually n
need not be larger than 50 to make an effective graph that represents a sequence of functions.

page 64
You might also note that in the first example of a Multi-Graph above we allowed the variable M to take on
non-integer values. Thus a Multi-Graph can be considered a little more general than a sequence of functions.
However, the first example function formula could also have been re-written in the form
(4*(M-1)/30)*COS(X) and we could then let M vary between 1 and 31 to make the same Multi-Graph.
In the original example it was much easier to just let M be used directly as the amplitude in the cosine waves and
this meant M would take on non-integer values. Since the number of subintervals is always an integer, each
Multi-Graph is equivalent to a finite sequence of function graphs. You are free to use M in any manner that
makes sense for your application. In some cases M will be used as a general graph parameter real value and in
other cases it may be used as a counter or integer in a true function sequence.

Setting Up and Working With Infinite Series

The two buttons on the toolbar that appear as allow you to enter and work with two kinds of
infinite series. The first button controls general Infinite Series, including power series, whereas the second
button is specific to Fourier Series.

Before continuing, you can right-click the Function button and key in the constant function F(X)=8
and then click the OK button to close the dialog box. The graph of the horizontal line F(X)=8 should not be
visible and you should now see what appears as a blank graph. Both kinds of infinite series just use the
background world graph window for the current function type to draw on. Usually this will be the Y=F(X)
window, but even polar or parametric backgrounds can be used. As previously mentioned, none of the yellow or
green toolbar buttons work with infinite series. In fact, all work done with infinite series is done using a single
dialog box that is devoted to each kind of series.

JKGraph allows you to define an Infinite Series and then you can compute the series value at a particular
point or you can graph that series over an interval. In fact, you can also automatically compute and/or graph the
two related series that are made by performing either term-by-term differentiation or term-by-term integration.
To bring up the regular infinite series dialog box you can simply click the series button in the toolbar,

or you can select the menu item Action | Infinite Series. After the dialog box appears, press the button
. You won't see anything happen. Then press the button . You should
then see a dialog box whose content matches the following figure.

page 65
Figure 58. The Infinite Series Dialog Box

The default series is the alternating harmonic series where the sum is for the first 500 terms, starting with n=1.
The computed value shown in blue text in the above dialog box should be the opposite of the natural logarithm
of the number 2. Next, click on the checkbox and then click the button and this
time you should see the following dialog box:

page 66
Figure 59. A table of values for the default infinite series.

The second column shows the terms of the a(n) sequence while the 4th column shows the terms of the
sequence of partial sums s(n). The sum of the two numbers in the 3rd column makes the number in the 4th
column. Note that you could print the series values as shown in the above table and you could also copy the
values to the Windows clipboard and from there you could paste them into any other Windows application,
including Excel if you use that spreadsheet. After inspecting the above table click the OK button to make the
table disappear.

This won't be obvious to many users, but the alternating harmonic series represents the function -Ln(x+1)
where the interval of convergence is a half-open interval excluding -1 and but including +1. You can gain a
better understanding of the series by graphing it. So next press the button . The dialog box shown
in Figure 58 will disappear and you should see the graph of the series function drawn with a blue color. This
graph looks like its domain is for X values between -1 and +1, with a potential vertical asymptote at X=-1.

page 67
Figure 60. The graph of the alternating harmonic power series function

Next, select the menu item Action | Overlay Other Graph Types | Infinite Series Derivative Graph and you
should see the following new graph.

Figure 61. The lower graph is the derivative of the alternating harmonic power series.

page 68
"
The new graph section that just got added below the B-axis should be the same as the function C œ B" where B
is restricted to the interval between -1 and  1. Next we will add another graph piece. This time select the
menu item Action | Overlay Other Graph Types | Infinite Series Integral Graph and you should see

Figure 62. The middle graph part is the integral of the alternating harmonic power series.

The little graph piece that was just added that appears to have the B-axis as a tangent at the origin point should
be the antiderivative of 68ÐB  "Ñ and those who know integration by parts can compute that this function
should be ÐB  "Ñ † 68ÐB  "Ñ  B. where B is restricted to the interval between -1 and  1.

So once an infinite series is defined you can do several things with it. Next we want to define the infinite series
that represents the cosine function. On paper this series would appear as

-9=ÐBÑ ¸ "
&!!
Ð"Ñ8 #8
B
8œ!
Ð#8Ñx

To enter this into the JKGraph program click the series button in the toolbar, or select the menu item

Domains | Infinite Series Domain and you will see the infinite series dialog box. In fact, using the menu item
Action | Infinite Series is the same as using the Domains menu item or clicking the button . Of course

just clicking the button in the tool bar is the simplest and fastest way to bring up the Infinite Series

page 69
dialog box. In any case, when the dialog box comes up, change the a(n) and b(n) formulas and change the n
starting value so these three items appear as shown below:

The formula for a(n) is an alternating sequence where the denominator is 2n factorial. The b(n) formula
needs to be changed so that it will yield only even terms for the cosine series, and the s value is 0 because the
cosine series sum starts with n=0.

We also need to change the graph interval. Make the X Start and X End values between -7 and +7 as follows:

Press the OK button to close the Infinite Series dialog box. Then select the menu item Action | Overlay Other
Graph Types | Infinite Series Graph and you should see the graph of the cosine function in the color blue. If
you then select the menu item Action | Overlay Other Graph Types | Infinite Series Derivative Graph you
should see the graph of =38ÐBÑ as the newly added function. Finally, if you select Action | Overlay Other
Graph Types | Infinite Series Integral Graph you should see the graph of the regular =38ÐBÑ function gets
added to the previous two graphs. So it is relatively painless to enter an infinite series and then graph the
integrated and differentiated series.

You can learn more about working with Infinite Series by pressing the Help button when the Infinite Series
dialog box is open, but don't read the Help now. Save that for later reading. JKGraph handles simple infinite
series and power series and can also do infinite series that are neither simple nor power series. Although you
will normally write the a(n) function as a function of n only, for those rare times when you need to enter a
special type of series that is not a power series you can consider that the a(n) function formula can also use
the variable X as well as n. In those cases you may also wish to make the other parts of the series disappear by
setting c=0 and b(n)=1 and g(X)=1. All work done with regular infinite series is done using the dialog box
in Figure 58.

Right click the button in the toolbar and type in the function COS(X) and close that function dialog
box. You should see the graph of a regular cosine function. Now assuming you still have the cosine infinite
series function set as indicated above we will demonstrate one more feature of the Infinite Series dialog.

Click the series button in the toolbar to bring up the Infinite Series dialog. In that dialog press the

button and you will see the Infinite Series dialog will automatically close and you
should see a new dialog with the title Show Progressive Graphs for the Series that appears near the upper-
right corner of the JKGraph program window.

page 70
Figure 63. The Show Progressive Graphs for a Series Dialog.

Now the cosine series was setup so that we could use up to 500 terms. The Progressive Series dialog allows
you to start with the first term and then by clicking the up arrow you can see the graph of 1, or 2, or 3 or more
terms, and those graphs will automatically overlay on top of the cosine graph so you can compare the function
graph with a finite series sum that approximates that graph.

As an example, when the Series M = n end value is set to 0, or 1 or 2 or 3 or 4 you should see the
following graphs of the partial series. Just click the up arrow in the Progressive Graphs window and watch the
graphs automatically change to show the next series approximation. The successive graphs are of polynomials
that we denote by :ÐBÑ for the general nth degree polynomial function.

Figure 64. The blue horizontal line is the first term in the cosine series. :ÐBÑ œ "

page 71
B#
Figure 65. The blue graph is :ÐBÑ œ " 
#x

B# B%
Figure 66. The blue graph is :ÐBÑ œ "  
#x %x

page 72
B# B% B'
Figure 67. The blue graph is :ÐBÑ œ "   
#x %x 'x

B# B% B' B)
Figure 68. The blue graph is :ÐBÑ œ "    
#x %x 'x )x

page 73
Each time we increase the Series M = n end value we will see a better and better polynomial
approximation to the graph of the cosine function. Of course, you can do this with ANY series to see how the
MacLaurin or Taylor polynomials approximate the graph of the original function. Clicking the up and down
arrows in the small Progressive Graphs for the Series dialog box is all that is needed to see the dynamic
action and gain a better appreciation for how adding more terms makes better approximations. In fact, since all
these blue polynomial graphs have endpoint behavior that goes to plus or minus infinity, an astute question to
ask is how can the infinite sum converge to the cosine function whose endpoint behavior never gets outside the
range between „ n? Now you can click the Close button in the Show Progressive Graphs for the Series
dialog box to close that dialog.

Before continuing, you can again right-click the Function button and key in the constant function
F(X)=8 and then click the OK button to close the dialog box. The graph of the horizontal line F(X)=8 should
not be visible and you should now see what appears as a blank graph.

Setting Up and Working With Fourier Series

JKGraph allows you to define and graph a Fourier series. To bring up the Fourier Series dialog box you can
select the menu item Action | Fourier Series or you can just click the button that is in the toolbar. You
should then see a dialog box similar to the following. We have set the maximum number of display digits and
we have already pressed the button to compute F(X)at the given B-value. The controls in this
dialog box are very similar to those found in the above Infinite Series dialog box, but this dialog box is specific
to Fourier Series.

page 74
Figure 69. The Fourier Series dialog box.

regular function kBk  " first defined only over the closed interval [-1,+1], and then this piece is used to
The default Fourier Series represents a function whose graph is shown below. This is the Fourier series for the

make a periodic function defined over all real numbers. The graph below was made by pressing the button
labeled . When you press this button the above dialog box will automatically close and you
should see the following graph gets overlaid on a blank graph.

page 75
Figure 70. The graph of the default Fourier series.

Now again click the button and in the dialog box click the button and you should see
the next graph shown below. The Fourier series dialog box automatically disappears whenever you make a
graph from that dialog box.

Figure 71. The graph of the derivative of the default Fourier series.

If you are familiar with Fourier Series you will notice the Gibbs phenomena in the upper and lower edges of
the square waves in the above graph. One last time, click the button in the toolbar to bring up the

Fourier Series dialog box. Then click the button and you should see the graph in the
next figure.

page 76
Figure 72. The graph of the anti-derivative of the default Fourier series with connected points.

You need to know that when JKGraph makes any graph from an infinite series or from a Fourier series, it uses
the current primary function World Graph parameters to make the graph. The most significant parameters are
the BC-plane extent values, the graph color for the infinite series, and the function curve type. The graph in
Figure 72 above was made with a Function Curve Type that had Connected Points. A better graph can be
made for this example by pressing the button . This will bring up the Line Colors
and Styles dialog box and within that dialog box you will see the option to change the current Function Curve
Type:

A better graph is made by choosing the Function Curve Type with Discrete Points. When graphing any
infinite series remember to consider how your graph might look if it was plotted using discrete points. You can
also change the color or line thickness associated with any infinite or Fourier series. When the Line Colors and
Styles dialog box is open just choose the color tabbed item to change the graph color or line thickness. The
function in Figure 73 below is really the same as that in Figure 72 above, but the curve type has been changed
to make the plot by graphing discrete points. If the graph in Figure 73 below looks a little thin it is because the
graphing domain used only 300 subintervals. By increasing the number of subintervals we could make a more
solid looking graph.

Figure 73. The graph of the anti-derivative of the default Fourier series with discrete points.

page 77
By reading the form of the Fourier Series in the dialog box in Figure 69 above you should be able to figure out
how to enter the appropriate formula expressions and parameters for any Fourier Series.

If you choose a large domain in the above dialog box for any of the three function graphs, the program will
automatically compute and graph the Fourier series extension that can have a domain over the entire B-axis. An
example periodic graph is shown below whose domain extends beyond the defined function domain interval
Ð1ß 1Ñ. The function was only defined over the interval Ð1ß 1Ñ and the ordinary conditional definition of
that function was given by:

0 ÐBÑ œ œ
" if 1  B  !
B if !  B  1

If you want to make the graph shown in Figure 74 below you will need to know the following about the
Fourier Series expansion for this simple conditional function.

< œ 1 ¸ $Þ"%"&*#'&$&*
1
+! œ "  ¸ #Þ&(!(*'$#'(*
#

a"b8  " a"b8 Ð"  1Ñ  "


+8 œ and ,8 œ
1 † 8# 81

This Fourier Series example is contained in the text file named Fourier021.txt that is mentioned in the
file list at the end of this tutorial. When we defined the graphing domain in the lower part of the dialog box in
Figure 69 above we made the graphing domain extend between -13.5 and 13.5 and the resulting graph is
shown in Figure 74 below. Note however that < œ 1 in terms of defining the function domain in the upper part
of the dialog box. The program automatically computed and graphed the periodic extension of the function to
the wider graphing domain.

Figure 74. The graph of the Fourier Series periodic extension of a simple conditional function.

page 78
All work with Fourier Series is done using the dialog box that is in Figure 69.

As with Infinite Series, you can press the button in the Fourier Series dialog box and
you will see the Fourier Series dialog will automatically close, but the Show Progressive Graphs for the
Series dialog will open near the upper-right corner of the JKGraph program window. In that new dialog you
can click the up and down arrows to change the number of terms used

Figure 75. The Progressive Graphs for a Series dialog box.

in the graph. So showing progressive graphs for a Fourier Series works just like it does with regular infinite
series. The next four figures show the progressive graphs for various numbers of terms in a Fourier Series for a
square wave whose setup appears in the Fourier Series dialog box as:

Figure 76. The setup of the Fourier Series for a square wave.

Note that the even terms in this series all have +8 œ !. Thus only when 8 is odd do we get anything
contributed to the sum. The first graph looks more like a cosine wave than a square wave.

page 79
Figure 77. The graph of the square wave Fourier Series with only 1 term. (M=1)
" #
:ÐBÑ œ  -9=Ð1BÑ
# 1

Figure 78. The graph of the square wave Fourier Series with only 2 terms. (M=3)

" # #
:ÐBÑ œ  -9=Ð1BÑ  -9=Ð$1BÑ
# 1 $1

page 80
Figure 79. The graph of the square wave Fourier Series with just 3 terms. (M=5)

" # # #
:ÐBÑ œ  -9=Ð1BÑ  -9=Ð$1BÑ  -9=Ð&1BÑ
# 1 $1 &1

Figure 80. The graph of the square wave Fourier Series with 6 terms. (M=11)

" # # # # # #
:ÐBÑ œ  -9=Ð1BÑ  -9=Ð$1BÑ  -9=Ð&1BÑ  -9=Ð(1BÑ  -9=Ð*1BÑ  -9=Ð""1BÑ
# 1 $1 &1 (1 *1 ""1

page 81
The last graph with the most number of terms really begins to look more like a true square wave.

To save either an infinite series or a Fourier series you need to use the menu item under Formulas | Save
Infinite Series Formula. You will first be prompted for the type of series.

Figure 81. The dialog to choose a regular infinite series or a Fourier Series.

After making your selection above you will see another dialog box that is a standard Windows file save dialog
that allows you to enter the name of the series file. We use the convention of naming any series file with the
name SeriesWhatever.txt. where you replace Whatever with your desired name. In this fashion, if you
later wish to make a slide show of just series files you can enter a file filter like Series*.txt and this
program will automatically load and display all matching files. The last part of this tutorial explains how to
create a slide show of function files. Note that although you use a special menu item to save a series (infinite or
Fourier) you can open either type of series file by using the regular Formulas | Open Function Formula(s)
menu item.

A Couple Of Polar Function Examples

The next example we give shows how to find the points of intersection of two polar curves. In general these are
difficult problems and the author of JKGraph began the design of the program just so it could help solve this
particular kind of problem.

Left-click once on the Function Type button and it should change from

to

Then, just to show a different kind of integral, left click the Integral Button and you should see the graph
shown below in Figure 82.

page 82
Figure 82. A polar function integral area example.

After admiring the above graph left-click the Secondary On/Off Button to turn on the secondary polar
function graph. You should now be looking at two polar curves. The primary curve is the cardioid and the
secondary curve is the 3-leaved rose.

Right-click the Intersection Button and when the dialog box appears note that the number of sample points is
15,000. While this may seem like a large number, remember that finding intersection points requires more
precision than that required for normal graphing. Click the OK button to close the dialog box and watch the
action on the screen.

When the search finishes you should see the graph shown in Figure 83 below.

page 83
Figure 83. The four points of intersection of a 3-leaved rose and a cardioid.

You can left-click the Intersection Button again and leave the mouse resting over that button while you watch
all the action. In particular, if you watch the status line at the bottom of the screen you can count the
intersection points and see each one occurs at just the right (correct) angle. If we were to change the number of
sample points to 1,000, the program might only find two of these points of intersection. So this again is
evidence of the need to have a large number of samples when finding intersection points. We might also point
out that by watching the points carefully we can determine that these two graphs do NOT intersect at the origin.

Now left-click the yellow Graph Trace Mode button and then drag the mouse from side to side across your
screen. This is amazing action! You just don't get the appreciation of the differences in these two graphs by
looking at static pictures on a page. With a program like JKGraph you can see and simultaneously feel how the
points on the two curves are plotted at different speeds, with the action on the 3-leaved rose seeming to occur
faster than that for the cardioid.

You may note that the program did not find the origin as a point of intersection of the two curves because the
curves pass through the origin at different times or angles. You can also sense this as you slowly and carefully
drag the mouse horizontally between about X=-1.25 and X=+1.25. It should be clear from your dragging
action that the two graphs do not intersect at the origin at the same time or angle. JKGraph can be used to
approximate other potential intersection points like this origin point by using the Graph Trace Mode. Left-
click the Graph Trace Mode button to turn off that trace mode.

page 84
When the mouse pointer is near the left screen-edge, the points should be chosen at the beginning of both
curve's domains. When the mouse gets near the right screen-edge the points are near the end of each curve's
domain. When the mouse is in the middle of the screen the points are at the middle of the curve's domain. So to
sweep out the entire domain, start with your mouse at the left edge of the graph and drag across the graph to the
right edge. If you use this program on a large computer screen, you should normally start a mouse drag
operation in the middle of the JKGraph program window. You can then continue to drag the mouse outside the
JKGraph program window and still see meaningful values. JKGraph uses the full width of your computer
screen to determine the mouse drag domain of polar and parametric curves. For Y=F(X) function curves
JKGraph also uses the entire screen width, but it first scales the domain values using only the width of the
current JKGraph program window.

Working With X=F(Y) Functions

We will just highlight a few features of the X=F(Y) function type. Click the Function Type button until it
shows the caption

Click the Secondary On/Off button to turn on the secondary function. Click the Graph Trace button
to turn on the Graph Trace mode. Now left click the mouse in the middle of the graph and try dragging
the mouse in only a vertical direction up and down. Notice how the trace points on the two curves track with the

vertical position of the mouse. Next click the Tangent Line Trace Mode button and continue dragging
the mouse up and down. The status line at the bottom of the screen continues to show the tangent line for the
primary function in regular slope-intercept form. Now you should understand the use of the trace buttons with
the X=F(Y) function type.

Next, left-click the Integral button and note how the program performs a Midpoint Riemann sum with
respect to C. You should see the graph shown in Figure 84 below. Note how both function curves seem to go
through the midpoints of each end of each rectangular slice.

page 85
Figure 84. The Midpoint Riemann sum rectangles between the functions
X=SIN(Y)-4.5 and X=COS(Y)-1.5.

Right-click the Integral button and select the radio button for the method Area : Lower Riemann Sum and
click the OK button. You should see the graph shown in Figure 85. Note how this graph compares with the
graph in Figure 84 above. In forming the lower Riemann sum, the rectangles are normally fully inscribed
between the two curves. Thus there is a subtle change between the rectangle ends in Figure 84 and Figure 85.

page 86
Figure 85. The Lower Riemann sum rectangles between the functions
X=SIN(Y)-4.5 and X=COS(Y)-1.5.

Right-click the Integral button again, and this time select the method Area : Upper Riemann Sum. After you
click the OK button you should see the graph in Figure 86 below. The Upper Riemann Sum will normally
show the rectangles as fully circumscribed. It is instructive to note the subtle changes between the function
curves and the rectangle ends between the graphs in Figure 84, Figure 85, and Figure 86.

page 87
Figure 86. The Upper Riemann sum rectangles between the functions
X=SIN(Y)-4.5 and X=COS(Y)-1.5.

In checking most integral calculations, the true answer should lie between the lower and upper Riemann sums,
with the midpoint Riemann sum giving the best approximation for a given number of rectangular slices. You
can give the program 1000 or even 5000 slices if you like, but in these cases the area appears nearly completely
filled in by the black color of the rectangle edges. When the number of subintervals is large you will almost
always want to set the Time Delay factor to 0 to make the fastest graph. If you are artistically inclined you can
change the colors of both the rectangle edges and the rectangle interiors by selecting the Fill Area Colors menu
item under the main Options menu.

Now right-click the Integral button and click the radio button for the method Volume : Disks/Washers
Vertical Rotation Line and click the OK button. You should see the graph of the bowl shape shown in
Figure 87 below.

page 88
Figure 87. The volume of a bowl determined by X=SIN(Y)-4.5 and
X=COS(Y)-1.5 rotated over the C-axis.

The view in Figure 87 is from above the bowl shape. Right click the Integral button and turn on the checkbox
to change to the Alternate 3-D Disk/Shell View. Click the OK button and you should see the graph in
Figure 88 below. This new view is from below the shape.

page 89
Figure 88. The same volume as in Figure 87 above, but this view is from below the shape.

Finally, right click the Integral button one more time and change the limits of integration for the interval
[1,4] and change the number of subintervals to just 10. Select the method Volume : Cylindrical Shells
Horizontal Rotation Line. Click the OK button to close the dialog box and you should see the graph shown in
the right side of Figure 89 below. We call this view a right view of the cylindrical shells because the figure is
made as if you were standing more to the right side of the shells. The non-alternate view shows the shells as if
you were standing more to the left side of the shells. The non-alternate view is shown in the left half of Figure
89. The two different views are for the same volume and can be made using the two states for the checkbox for
Alternate 3-D Disk/Shell View.

page 90
Figure 89. Two different views of the same cylindrical shell volume for the default X=F(Y) functions.

These examples should give you a glimpse of what it is like to work with functions in the form X=F(Y). All
the program functionality that can be applied to Y=F(X) functions can be applied to X=F(Y) functions and
vice versa.

Making Integral Graphs and Setting the Shift Constants

The next feature we will discuss in this tutorial is making what we call Integral Graphs. Left-click the
Function Type button until it shows the Y=F(X) caption for regular rectangular functions. Right-click the
same button and change the function formula to 3*SIN(X) that is the default Y=F(X) function when you start
the program. You may also want to make the function curve type have Connected Points. After clicking the
OK button in the dialog box you should see the graph shown in Figure 90 below.

page 91
Figure 90. The rectangular function Y=3*SIN(X).

Now select the menu item Action | Overlay Other Graph Types | Integral Graph and you should see the
following figure.

page 92
Figure 91. The rectangular function Y=3*SIN(X) and its Integral Graph

The new part that is in blue is what we call the Integral Graph. The Integral Graph is made by computing the
anti-derivative of the Y=F(X) function, and then making a new graph with the anti-derivative function
overlaying the current graph. Now anyone who would ordinarily calculate the anti-derivative of 3*SIN(X)
would come up with -3*COS(X)+K as the answer. Well the above function that is in blue could be the graph
of -3*COS(X)+K, but only if the constant of integration were something like +3.

So how does the program figure the constant of integration? Any constant could be used, of course, but the
program has to choose one. It chooses the constant of integration by first computing the B-coordinate of the
midpoint of the current graphing domain and then it computes K such that K will make the anti-derivative
function have its B-intercept at that midpoint. In other words, the particular anti-derivative function is chosen so
that the midpoint makes a C-value of 0 in that function.

If you want the Integral Graph to just be the simpler function -3*COS(X) you can get that by first selecting
the menu item Options | Integral Graph Shift Values… to bring up the following dialog box.

page 93
Figure 92. The rectangular Integral Graph Shift Values dialog box.

Change the First Integral Shift value to -3 and then click the OK button. Click the Redraw button in the
toolbar, , to erase the old Integral Graph and then select the menu item Action | Overlay Other Graph
Types | Integral Graph and you should see the following new graph.

Figure 93. The function Y=3*SIN(X) and its Integral Graph Y=-3*COS(X).

page 94
You should normally expect to have to change the constant of integration to force the anti-derivative graph to
be any particular anti-derivative that you want. It can sometimes be a little tricky to determine what that
constant should be because you really have to find the midpoint value that the program has automatically
determined and then use the opposite of that value for part of your constant.

We also mention that the same applies to computing Integral Graphs of polar and parametric functions. Except
in those cases the anti-derivative constant does not determine a vertical shift in the graph. In the case of a polar
function, you only use the First Integral Shift Value in the dialog box shown in Figure 92 above. For polar
functions adding a constant to all radii values has the effect of adding K*COS(@) to all B-coordinates and
adding K*SIN(@) to all C-coordinates and thus it is not easy to describe the graphical effect. Just be prepared
to experiment a little before you get what you might consider to be a satisfactory graph.

For parametric functions (both BC and polar parametrized) there are two constants for Integral Shift values
because the Integral Graph involves computing the anti-derivatives of two functions. For regular parametric
functions the first shift constant is associated with X and the second with Y. For polar parametrized functions
the first shift constant is associated with the radius and the second shift constant is associated with the angle.

The two Integral Shift constant values that appear in Figure 92 are global variables that apply to all Integral
Graphs. Thus these constants are not saved when you save any function formulas and they must usually be
changed whenever you change function types or change the graph domain of any function. In particular,
zooming in or out automatically changes the graph domain and will cause a corresponding change in any
Integral Graph. So be sure to fix your graph window before you experiment with these shift values. Every
time you zoom in or out the program will compute a new anti-derivative constant on its own that differs from
your custom constant.

When working with either infinite series or Fourier series, the program adds the First Integral Shift constant to
any series anti-derivative value or graph that the program makes. Thus if your series looks vertically shifted out
of place, you can set the First Integral Shift constant to any desired value.

In any case, being able to graph the anti-derivative of a given function is a nice feature to have and it serves to
complement the feature to graph a derivative. JKGraph does not perform symbolic calculations to find either
derivatives or anti-derivatives, but it does use Chebyshev polynomial approximations to help it calculate both
derivatives and anti-derivatives. This fact alone should encourage you to study more math to learn more about
the relationships between functions and to learn about the properties of particular functions.

Example Graphs

JKGraph comes with 103 sample graphs that are contained in text files that are listed below. You can load and
study these example graphs. They should provide you with about an hour and a half of mathematical
entertainment! If you load the files named YFXSine??.txt then be sure to turn on the secondary function.
These files show Taylor series approximations to the sine function. The file YFXWGlass.txt should also be
shown with the secondary function turned on. Most of the other examples should be viewed with the secondary
function turned off. Note that you can open Infinite Series files or implicit function files with the same menu
item that you use to open one of the five standard graph types. Normally you should choose Open Function
Formula(s)… under the Formulas menu item to open any of these text files. Implicit Function Files can also
be opened using the dialog box for implicit functions under the Action menu item.

page 95
Creating A Slide Show

The last menu item under the Action menu allows you to create a slide show of function files. When you select
Action | Show Example Functions… you should see the following dialog box.

Figure 94. The Example Functions dialog box for creating a slide show.

This dialog box takes one of two actions, depending on the choice you make to advance the slides. Manual
advance is the default, but of course you can also choose to advance slides automatically. You can enter a
desired time delay value to control the pace of an automatic slide show. The program will simply load file after
file and display the contents, pausing for the specified time delay. Note the default value of 3000 milliseconds is
really just a 3-second delay between slides.

To determine which files become slides in the slide show is determined by whether you enter a filepath filter or
whether you enter a specific filename. The default file filters have names like YFX*.txt or Series*.txt
or Polar*.txt or Param*.txt or Implicit*.txt. If you enter a name like one of these with a *
wildcard character then when you click the Start button the above dialog box will close and the slide show will
consist of all and only the files that match your wildcard specification. If there are no matching files you will be
given a warning to that effect.

A second option with the above dialog box is to enter the name of a special custom slide show text file that
gives you more control over the slide show. We use a name like SlideListJKGraph.txt to name our
special file. If you create your own file you will need to use a simple text editor like Notepad, or use your
favorite word processor but save your file as a simple text file. This text file should simply list the filenames,
one per line, that you want in your slide show. Thus you can control exactly which files will be loaded and
displayed and more important you can more specifically control the order of the slides. When you enter a
filepath filter the order is determined by the order the operating system finds the files on your disk.

page 96
When you click the Start button and you have chosen the Advance Slides option with the Manual mode, the
above dialog box will close and you will see three additional buttons in the toolbar, along with a filename label.
The first button is the Stop button that stops the entire slide show. The two arrow buttons are also called the
Previous and Next buttons.

As with the Automatic slide show, you click the Stop button to stop the slide show. Otherwise in the Manual
advance mode you can click the Next and Previous arrow buttons to change to the desired next or previous file
in your custom list. The very first click of the Next button simply performs a screen redraw without advancing,
but after that, each click of the Next button advances to the next file in your file list. Of course the Previous
button backs you up one file. The filename of the most recently loaded file will appear to the right of the Stop
button. When you click the Stop button to stop the slide show all the buttons and the filename will disappear
from the toolbar. The Stop button is used to end both automatic and manual slide shows.

The small button just above the path edit box is used to switch to the next wildcard file filter or to the
specific name SlideListJKGraph.txt. The following are the wildcard filters: YFX*.txt,
Polar*.txt, Param*.txt, PolPM*.txt, XFY*.txt, Series*.txt, Fourier*.txt, and
Implicit*.txt. All that pressing this button does is save you from typing any of these names. You should
be able to use any *.txt filter or use SlideListJKGraph.txt. Of course you can type in other automatic
or manual filenames, depending on how you name your graphs and slide show files.
SlideListJKGraph.txt is one of the standard distribution files that already contains the list of all the
other standard distribution graph files. So you should be able to use that filename for a slide show until you
delete that file or change that file. Our personal convention is to name all of our slide show lists with files
named like SlideListWhatever.txt.

More About the Example Files

The YFXMultiBand.txt and YFXDenseSpeckels.txt examples are Multi-Graphs. After you open
these, it is suggested you also open the Multi-Graph Domain menu item and use 50 subintervals with the
YFXMultiBand.txt example and that you use 100 subintervals with the YFXDenseSpeckels.txt
example. Both examples make good use of a couple of random number functions and both examples change the
Function Graph Type to use Discrete Points as opposed to Connected Points.

You might also note that the expression part +0*M allows the use of the Multi-Graph parameter within the
function formula without having the value of M affect the function values in any way. This use of the Multi-
Graph parameter might only make sense for functions that employ one of the two random number generating
schemes. The YFXMultiBand.txt example generates uniformly distributed random numbers between 1.5
and 3.5.

page 97
Figure 95. The YFXMultiBand example RANDOMU(1.5,3.5)+0*M shown with 50 subintervals.

The YFXDenseSpeckels.txt example generates Gaussian (normally) distributed random numbers with a
mean of 0 and a standard deviation of 1. In light of Stephen Wolfram's new book, A New Kind of Science,
these two examples may help stimulate an interest in multi-valued functions related to generating random
numbers.

page 98
Figure 96. The YFXDenseSpeckels example RANDOMG(0,1)+0*M shown with 100 subintervals.

The following list contains the names of the standard distribution files. You can give any type of name for any
files that you save. But you should also note our naming conventions where we use Polar*.txt for polar
functions, Param*.txt for parametric functions, and Implicit*.txt for implicit functions and
Series*.txt for infinite series and Fourier*.txt for Fourier series and PolPm*.txt for
PolarParametrized examples. Using naming conventions like these makes it easier to automatically create slide
shows of one particular type of function. For the two types of rectangular functions we use YFX*.txt and
XFY*.txt, depending on whether Y is a function of X or X is a function of Y.

The file ParamStrophoids.txt is a parametric curve that uses the M Multi-Graph parameter variable.
When this file is loaded you should set the M Multi-Graph parameter value to range between -2 and +2 with
18 samples and be sure to check the Parametric radio button in the Multi-Graph Domain dialog box when
you try to graph this series of curves. Under the Domains menu item you can select and open the Multi-Graph
Domain… submenu item.

page 99
Y=F(X) Function Graph Files
===========================
YFXDefaultFuns.txt
YFXDenseSpeckles.txt
YFXGreatestInteger.txt
YFXMultiBand.txt
YFXMultiGExample.txt
YFXSine01.TXT
YFXSine03.TXT
YFXSine05.TXT
YFXSine07.TXT
YFXSine09.TXT
YFXSine11.TXT
YFXSine13.TXT
YFXSine15.TXT
YFXSine17.TXT
YFXSine19.TXT
YFXMaxS2C.txt
YFXMin32X.txt
YFXSqrtLn.txt
YFXWGlass.txt
YFXX2Up3.txt

Polar Function Graph Files


==========================
PolarCochleoid.txt
PolarEars.txt
PolarEyes.txt
PolarFish.txt
PolarNut.txt
PolarRose.txt
PolarRound.txt
PolarStar.txt

Parametric Function Graph Files


===============================
Param1.txt
Param3.txt
Param3x3.txt
Param4.txt
ParamCrazy.txt
ParamCurlyQ.txt
ParamFigure8.txt
ParamFish.txt
ParamLongBow.txt
ParamSpiral.txt
ParamStrophoids.txt
ParamTearDrop1.txt

page 100
ParamTearDrop2.txt
ParamTriangle.txt
ParamUrchin.txt
ParamWraps.txt

Polar Parametrized Function Graph Files


=======================================
PolPmBalloonCurve.txt
PolPmCurvingCurve.txt
PolPmSpiral.txt

Infinite Series Files


=====================
SeriesAltHarm.txt
SeriesCosh.txt
SeriesCosine.txt
SeriesE2X.txt
SeriesSNSqr.txt
SeriesSine.txt
SeriesSinh.txt
SeriesSQWave.txt

Fourier Series Files


====================
Fourier021.txt
FourierNegOne.txt
FourierSqWave.txt
FourierTri.txt

Implicit Function Graph Files


=============================
ImplicitAbsPiriform.txt
ImplicitAgnesi.txt
ImplicitAround.txt
ImplicitBadTooth.txt
ImplicitBells.txt
ImplicitBernoulliLemniscate.txt
ImplicitBiFolium.txt
ImplicitCassiniOval.txt
ImplicitChoncoid.txt
ImplicitCircle.txt
ImplicitDescartesFolium.txt
ImplicitDiamonds.txt
ImplicitDoubleCusp.txt
ImplicitEggs.txt
ImplicitFig8Island.txt
ImplicitFilledSpokes.txt
ImplicitFingers.txt
ImplicitHyperbolas.txt

page 101
ImplicitHypocycloid.txt
ImplicitIsland.txt
ImplicitKisses.txt
ImplicitLandscapes.txt
ImplicitLines24.txt
ImplicitLituus.txt
ImplicitMultigraphLines.txt
ImplicitNicomedesConchoid.txt
ImplicitOddAround.txt
ImplicitOddity.txt
ImplicitOsculation.txt
ImplicitParallelLines.txt
ImplicitPiriform.txt
ImplicitSpider.txt
ImplicitSpreading.txt
ImplicitSquares.txt
ImplicitStrophoidH.txt
ImplicitStrophoidV.txt
ImplicitSunburst.txt
ImplicitUnsymmetric.txt
ImplicitWild1.txt
ImplicitWild2.txt
ImplicitWild3.txt
ImplicitWitch.txt
ImplicitY2XAndX2Y.txt
ImplicitYingYang.txt

Slide Show List


====================
SlideListJKGraph.txt

Note that we do not distribute any XFY*.txt example files.

Setting Up the Help System

The JKGraph program uses Adobe Acrobat PDF files for its help system. PDF stands for Portable Document
Format. The Adobe company makes a free program called Adobe Acrobat Reader that can be used to display
and print PDF files. Adobe also makes a program called Acrobat Professional that is not free that can be used
to edit, display, and print PDF files. You must at least install the free Adobe Acrobat Reader on your computer
to have the help system of JKGraph properly open any PDF help file. Just go to www.adobe.com to locate
and download the free Acrobat Reader program.

When JKGraph is installed on your computer one of the special files it has is named AdobeReader.ini.
This is just a text file that you can edit with the Windows text editor program named NotePad. In a new
installation the contents of this file is just one line that says UNKNOWN.

page 102
Once you have the program Adobe Acrobat Reader installed on your computer, you can edit the contents of
the AdobeReader.ini file to make it contain the path to the executable program file that is the Acrobat
Reader program. An example of such a path might be something like:

C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe

However, the true path depends on your individual computer system and how and where the Acrobat Reader
program is installed. If you have Acrobat Professional, you could also make the path to that program.

As long as either Acrobat Reader or Acrobat Professional is installed on your system you will be able to
display and print PDF files. If you don't change the path in AdobeReader.ini from UNKNOWN then the
program will still be able to open the help files, but it won't automatically jump to a designated help topic in a
help file until you make the correct path to one of the Adobe programs in the AdobeReader.ini file.

Conclusion

Ok, you are on your own. Have fun experimenting with JKGraph. If you should get stuck try consulting the
on-line help that contains more information than could be included in this introductory tutorial. Enjoy!

You should also know there is a whole suite of other programs related to math and computer science at the
author's homepage. See http://homepage.smc.edu/kennedy_john

page 103

Potrebbero piacerti anche