You are on page 1of 8

1

Return to List of Lessons



Introduction

To start Wolfram Mathematica 7, you can either click Start and move down to All Programs to find
Wolfram Mathematica 7. Or you can click the icon of Wolfram Mathematica 7 on your desktop if its
shortcut has already been set up.
When it is activated, a welcome screen opens in the middle of your window and a blank notepad named
Untitled 1 opens to the left-hand side. If the Welcome screen does not come up, it can be found on the
Help dropdown menu.


2

Looking into the welcome screen,



you will find the guidance provided by Wolfram Research INC. that can help you learn how to get started.


There are many guided examples and hands-on tutorials from these links that basically teach you how to
use Mathematica in a short period of time by yourself. Also you can watch a short video tour to get a
general view of what people are doing with Mathematica. We particularly recommend that you work
your way through Learn with guided examples right away.

3

Lesson 1. Plotting a Graph of a Function Over a Given Interval



In this lesson we will learn how to use Mathematica to plot a single graph over a given interval.
In the next lesson we will learn how to plot multiple graphs over a given interval in the same box because
in many occasions you may want to make comparisons between two or more graphs in the same box.

To get ready for plotting a graph of a function, first minimize the welcome screen and then click Palettes
from the tool bar located at the top of your window.

From the dropdown menu of Palettes, you will find the Classroom Assistant. It brings up the
Calculator that can help you type mathematical terms and symbols very conveniently and quickly,
especially when you are still a new user.

Next you will see how to use Mathematica to plot graphs.
Example 1. Plot the graph of x x f sin ) ( = over the interval ] 2 , 2 [
4

First click in the blank notepad to makes sure the cursor is flashing.
Type Plut|Stn|x], {x, -2a, 2a]]
[Note] The initial letter of any function or command must be typed in upper case and the variable
must be enclosed by square brackest, such as: Plot[ ], , ] [x Sin , ] [x Cos , ] [x Abs and ]. [x Tan
The range of x-values must be defined and enclosed by curly brackets, such as: {x, -2n, 2n]. You
can insert the character by clicking on it on the Classroom Assistant. Notice that when you point
to a character such as on the Classroom Assistant that it also shows you the keys to type to enter
that character. In this case you could enter by pressing the Esc key, p, and Esc. For those who
are reasonably good typists it is worth memorizing these key strokes for the more commonly used
characters.
To get the result, you either press Shift + Enter on your keyboard, or use your mouse to click Enter on
the Classroom Assistant panel. The graph will be shown as below.


Example 2. Plot the graph of 3 2 ) (
2
= x x x f over the interval ] 5 , 5 [
Press Enter on your keyboard to exit the previous work. Then you start to type when the cursor is
flashing.
Type Plut|x
2
- 2x - 3, {x, -5, 5]]
[Note] To type in the term x
2
in the notebook, you either use your keyboard to enter keys x, Ctrl
6, 2, right arrow, or use your mouse to click the symbol of exponent on the Classroom Assistant
panel.
To get the result, you do the same thing as you did in Example 1 --Using the mouse to click Enter on the
Classroom Assistant panel. The graph will be shown as
-6 -4 -2 2 4 6
-1.0
-0.5
0.5
1.0
5



Example 3. Plot the graph of
2
1
) (

=
x
x f over the interval ] 5 , 1 [
Click Enter to exit the previous work and make sure the cursor is flashing.
Type Plut|
1
x-2
, {x, -1, 5]]
[Note] In this example you learn how to enter fractions. To type in the term
1
x-2
, you either use the
symbol for fraction from the Classroom Assistant, or press Ctrl / from your keyboard. After
completing the denominator press the right arrow key to get back to the base line of type.
The graph should look like


-4 -2 2 4
5
10
15
20
25
30
-1 1 2 3 4 5
-3
-2
-1
1
2
3
6

Example 4. Plot the graph of


2
4 ) ( x x f = over the interval ] 4 , 4 [
Type Plut|4 - x
2
, {x, -4, 4]]
[Note] In this example you learn how to type in square-root functions. To type in the term
4 - x
2
, you either use the symbol of square-root from the Classroom Assistant, or press Ctrl 2
from your keyboard. After you type
2
4 x you need to press the right arrow twice, first to exit
the exponent, then to exit the square-root symbol.
The graph will be shown as


Example 5. Plot the graph of | 1 2 | ) ( = x x f over the interval ] 3 , 2 [
Type Plut|Abs|2x - 1], {x, -2, 3]]
[Note] Mathematica uses its own function Abs[ ] for the absolute-value functions, instead of
using double lines, so when entering | 1 2 | ) ( = x x f

you need to type in ] 1 2 [ x Abs . The result
should look like


-4 -2 2 4
0.5
1.0
1.5
2.0
-2 -1 1 2 3
1
2
3
4
5
7

In the last part of this lesson you will learn how to type texts inside a graph box. Lets revisit Example 2.
Example 2. Plot the graph of 3 2 ) (
2
= x x x f over the interval ] 5 , 5 [
Plut|x
2
- 2x -3, {x, -5, 5]]



To add texts to the graph box, you need to right-click on the graph and a short menu pops up. On the
menu you scroll your mouse to Drawing Tools and click. A small panel 2D Drawing will drop into
your window


At the bottom of the 2D Drawing panel, there are two symbols and .
will let you type in texts in a normal form and let you type in texts in mathematical form.

-4 -2 2 4
5
10
15
20
25
30
8

First click on . The cursor will change. You click it on the graph at an appropriate place you want to
type in your texts. For instance you can type in It is a parabola ! For these words, you can also
change their sizes and fonts using the Format command located at the top of your screen.

Clicking on Format opens a menu that allows you to change many aspects of the text including font
size, face, color, etc.
Next lets click on to add y = x
2
-2x -S to the graph. Remember to press Ctrl 6 when typing
in the term of x
2
just like what we did before. The Format commands can also be used to change the
characteristics of this text. At last, click on the arrow on the 2D Drawing panel.

You can pull out an arrow pointing from the text y = x
2
- 2x - S to the curve. The result looks like

Return to List of Lessons
y = x
2
- 2 x - 3
It is a parabola !
-4 -2 2 4
5
10
15
20
25
30

You might also like