SCCC Mathematica Tutorial, © 2007-2020, Seattle Central Community College Math Dept., contact: Greg.Langkamp@seattlecolleges.edu
Version 1.9/ March 2020
Version 1.9/ March 2020
Important! Click "Make Your Own Copy" in the black ribbon above to make this document interactive. You will also need to be logged into Wolfram Cloud
Lesson 2 Standard Mathematical Functions
Lesson 2 Standard Mathematical Functions
2.1 Introduction
2.1 Introduction
Mathematica has thousands of built-in mathematical functions. In this lesson we will focus on the functions that you are already familiar with from Precalculus; namely trigonometric, exponential and logarithmic functions.
There are two important rules that you need to remember when using Mathematica's built-in functions. 1. All functions start with a capital letter.2. All functions use square brackets (not parentheses) to enclose their input value.
The Absolute Value and Square Root FunctionsA simple example of the application of these rules is the absolute value function. On most calculators the absolute value function is represented by the function . The corresponding function in Mathematica is Abs[x] . Note that we start with a capital letter and use square brackets.
x
abs(x)
Abs[-6]
Earlier, we introduced the keyboard shortcut 2 to enter a square root. So to enter the square root function we would enter the keystrokes 2 .
x
x
The square root function is also represented in Mathematica by the built-in function Sqrt[x] (note that this function starts with a capital letter S). So the two expressions below are equivalent. You can use either, although in this tutorial we will continue to use the keyboard shortcut.
x
36
Sqrt[36]
2.2 Trigonometric functions
2.2 Trigonometric functions
◼
Use Mathematica to evaluate . Recall that the keyboard shortcut for π is p . We use Sin for the function name and enclose the input in square brackets.
sin
π
3
Sin[π/3]
Unlike a calculator, Mathematica gives an exact value.
The table below shows the syntax for the other trigonometric functions. Note that each function on the right starts with a capital letter and uses square brackets to enclose the function input.
togetthis, | weenterthis: |
sin(x) | Sin[x] |
cos(x) | Cos[x] |
tan(x) | Tan[x] |
csc(x) | Csc[x] |
sec(x) | Sec[x] |
cot(x) | Cot[x] |
-1 sin | ArcSin[x] |
-1 cos | ArcCos[x] |
-1 tan | ArcTan[x] |
Caution: Note that for the inverse functions two letters are capitalized; e.g., both A and T are capitalized in ArcTan.
Use the table above and the keyboard shortcut for π to enter and evaluate each of the following expressions.
◼
Evaluate
cos
π
4
value =
1
2
◼
Evaluate
sec
π
4
value =
2
◼
Evaluate
tan
π
4
value =
1
◼
Evaluate (1)
-1
tan
value =
π
4
Raising a trigonometric function to a powerSuppose you want to enter a power of trigonometric function such as . The correct Mathematica syntax in this case is: . Note in particular that you must place the exponent after the argument, , and not directly after the Sin. So the keystrokes for entering are: Sin[ π/3] ^ 2 . Try this below.
2
sin
π
3
2
Sin[π/3]
[π/3]
2
sin
π
3
◼
Evaluate . If you enter this correctly you should get as an output.
3
cos
π
4
1
2
2
Radians vs. DegreesAll trigonometric functions in Mathematica are based on radians. However there is an easy way to enter angles in degrees using the keyboard shortcut deg for the degree symbol ° . So to calculate cos(60°) enter Cos[60 deg ].
◼
Evaluate . If you enter this correctly you should get as an output.
cos(60°)
1
2
Exercise 2.2 A
Calculate
cos+sin
π
3
3π
2
Answer to Exercise 2.2A
Cos[π/3]+Sin[3π/2]
Exercise 2.2 B
Calculate sin(15°)
Answer to Exercise 2.2B
Sin[15°]
Exercise 2.2 C
Calculate -
-1
sin
1
2
Answer to Exercise 2.2C
ArcSin[-1/2]
Exercise 2.2 D
Have Mathematica calculate +.
4
sin
π
3
4
cos
π
3
Answer to Exercise 2.2D
value = 4
value = -3
value = 3
value = 0.693147
value = 1
value = 5
Exercise 2.3 A
Answer to Exercise 2.3 A
Exercise 2.3 B
Answer to Exercise 2.3 B
Exercise 2.3 C
Answer to Exercise 2.3 C