A Mathematica Tutorial

Similar documents
Calculus II - Math 1220 Mathematica Commands: From Basics To Calculus II - Version 11 c

Lab 2B Parametrizing Surfaces Math 2374 University of Minnesota Questions to:

1. How Mathematica works

Dynamical Systems - Math 3280 Mathematica: From Algebra to Dynamical Systems c

y= sin( x) y= cos( x)

MATH 162 Calculus II Computer Laboratory Topic: Introduction to Mathematica & Parametrizations

Parametric Surfaces and Surface Area

Mathematica Assignment 1

Section 7.6 Graphs of the Sine and Cosine Functions

Calculus III. 1 Getting started - the basics

Summer Packet 7 th into 8 th grade. Name. Integer Operations = 2. (-7)(6)(-4) = = = = 6.

Pre Calculus Worksheet: Fundamental Identities Day 1

Section 1.1 Definitions and Properties

Choose the file menu, and select Open. Input to be typed at the Maple prompt. Output from Maple. An important tip.

AP Calculus Summer Review Packet

A Brief Introduction to Mathematica

Integer Operations. Summer Packet 7 th into 8 th grade 1. Name = = = = = 6.

1 Maple Introduction. 1.1 Getting Started. 1.2 Maple Commands

Basics of Computational Geometry

Chapter 1 Section 1 Lesson: Solving Linear Equations

2.2 Limit of a Function and Limit Laws

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology

ü 1.1 Getting Started

2.9 Linear Approximations and Differentials

Multi-step transformations

Using Fundamental Identities. Fundamental Trigonometric Identities. Reciprocal Identities. sin u 1 csc u. sec u. sin u Quotient Identities

2 A little on Spreadsheets

Calculus WIZ and The Mathematical Explorer advanced use

Computer Algebra Systems: An Introduction

GCSE-AS Mathematics Bridging Course. Chellaston School. Dr P. Leary (KS5 Coordinator) Monday Objectives. The Equation of a Line.

Table of Laplace Transforms

INTRODUCTION TO DERIVE - by M. Yahdi

Performing Matrix Operations on the TI-83/84

Accuplacer Arithmetic Study Guide

5.2 Verifying Trigonometric Identities

Use the indicated strategy from your notes to simplify each expression. Each section may use the indicated strategy AND those strategies before.

Ph3 Mathematica Homework: Week 1

CurvesGraphics. A free package for Advanced Calculus illustrations. Gianluca Gorni. Arrows on 2D curves. Motivation

The Addition Formulas in Trigonometry. Scott Fallstrom Faculty Director, Math Learning Center

( 3) ( 4 ) 1. Exponents and Radicals ( ) ( xy) 1. MATH 102 College Algebra. still holds when m = n, we are led to the result

Math 340 Fall 2014, Victor Matveev. Binary system, round-off errors, loss of significance, and double precision accuracy.

AP Calculus AB. Table of Contents. Slide 1 / 180. Slide 2 / 180. Slide 3 / 180. Review Unit

Verifying Trigonometric Identities

Prime Time (Factors and Multiples)

Student Success Center Arithmetic Study Guide for the ACCUPLACER (CPT)

!"!!!"!!"!! = 10!!!!!(!!) = 10! = 1,000,000

(Refer Slide Time: 02:59)

Divisibility Rules and Their Explanations

AP Calculus AB. Table of Contents. Slide 1 / 180. Slide 2 / 180. Slide 3 / 180. Review Unit

MAT 003 Brian Killough s Instructor Notes Saint Leo University

Contents 10. Graphs of Trigonometric Functions

Computational Mathematics/Information Technology. Worksheet 2 Iteration and Excel

6.1 Evaluate Roots and Rational Exponents

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

MATLAB Project: Getting Started with MATLAB

5.5 Multiple-Angle and Product-to-Sum Formulas

2.Simplification & Approximation

Goals: Course Unit: Describing Moving Objects Different Ways of Representing Functions Vector-valued Functions, or Parametric Curves

Unit 4 Graphs of Trigonometric Functions - Classwork

SOME PROPERTIES OF TRIGONOMETRIC FUNCTIONS. 5! x7 7! + = 6! + = 4! x6

Lab#1: INTRODUCTION TO DERIVE

Topic 3: Fractions. Topic 1 Integers. Topic 2 Decimals. Topic 3 Fractions. Topic 4 Ratios. Topic 5 Percentages. Topic 6 Algebra

TI-89 Calculator Workshop #1 The Basics

Chapter 4 Using Fundamental Identities Section USING FUNDAMENTAL IDENTITIES. Fundamental Trigonometric Identities. Reciprocal Identities

John Perry. Spring 2017

Working with Algebraic Expressions

x 2 + 3, r 4(x) = x2 1

Learning Log Title: CHAPTER 3: ARITHMETIC PROPERTIES. Date: Lesson: Chapter 3: Arithmetic Properties

Polar Coordinates

An interesting related problem is Buffon s Needle which was first proposed in the mid-1700 s.

MEI GeoGebra Tasks for A2 Core

CALCULUS II. Parametric Equations and Polar Coordinates. Paul Dawkins

Functions and Graphs. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996.

FSA Algebra 1 EOC Practice Test Guide

3-1 Writing Linear Equations

In math, the rate of change is called the slope and is often described by the ratio rise

Mathematics Computer Laboratory - Math Version 11 Lab 6 - Trigonometric Functions c

Section Graphs and Lines

CALCULUS - PRACTICAL II - ELEMENTARY CALCULUS

Using the Equation Palette

Symbolic and Automatic Di erentiation in Python

SAMLab Tip Sheet #1 Translating Mathematical Formulas Into Excel s Language

Generating Functions

Graphing Calculator Tutorial

MATH (CRN 13695) Lab 1: Basics for Linear Algebra and Matlab

Grade 8 FSA Mathematics Practice Test Guide

Applied Calculus. Lab 1: An Introduction to R

Functions f and g are called a funny cosine and a funny sine if they satisfy the following properties:

Walt Whitman High School SUMMER REVIEW PACKET. For students entering AP CALCULUS BC

Properties and Definitions

Verifying Trigonometric Identities

0.6 Graphing Transcendental Functions

What is log a a equal to?

Welcome. Please Sign-In

9 Using Equation Networks

MATLAB Project: Getting Started with MATLAB

CGF Lecture 2 Numbers

Guidelines for Writing Mathematical Proofs

EC121 Mathematical Techniques A Revision Notes

Review of Trigonometry

Transcription:

A Mathematica Tutorial -3-8 This is a brief introduction to Mathematica, the symbolic mathematics program. This tutorial is generic, in the sense that you can use it no matter what kind of computer you have. However, this means that it doesn t discuss features which are specific to your version of Mathematica. Hence, if you can find a tutorial designed for your system, you might find it more useful. This tutorial assumes that you know how to perform basic operations with your computer. If not, you should consult the documentation that came with your machine. I ll start with basic arithmetic. Here is the Mathematica command to compute 3 : 3^ Type it in, then execute it by pressing Shift-Enter. (That is, hold down one of the Shift keys, press Enter, then release both keys.) (If you are using the Macintosh version or the Microsoft Windows version, move the mouse until your cursor turns into a horizontal I-beam. Click the mouse; a horizontal line appears. When you start typing, your input should replace the horizontal line. When you are finished typing, press Shift-Enter to execute the command.) The long number that appeared is 3. Notice that Mathematica put In[]:= next to your input and Out[]= next to your output. Mathematica labels all of its input and output in this way so that you have an easy way to refer to things you ve done earlier. Notice that I m using a different font and typeface for Mathematica commands. A Mathematica command will always look like this: (* Here is a Mathematica comment. *) That way you can tell it apart from normal text. As you go through the rest of the tutorial, my explanations will be interspersed with Mathematica commands for you to try. You should execute the commands as you read to see how they work. Here are some things to pay particular attention to: Spaces (or the absence of spaces) can be important! For example, xy and x y are not the same! The first is the -letter name of a variable, i.e. a single word. The second is x times y. If you want x multiplied by y you can either leave a space between x and y or write a multiplication sign like this: x y. Certain letters must be capitalized. For example, most of Mathematica s built-in functions start with a capital letter, and some have capital letters in the middle. Plot3D is correct; plot3d is not. Pay attention to punctuation. For example, (, [, and { mean different things.. More arithmetic. Here is how to use Mathematica to perform addition, subtraction multiplication, and division. Execute the commands below; for practice, make up a few yourself. + 7-3 77 * 99 77 99 63 / 9. Numerical results. Of course, you can use Mathematica to compute transcendental functions. Execute the next line:

Sin[3] The result isn t very enlightening. To express a result in approximate (decimal) form, use the N[] function: N[Sin[3]] Mathematica (like most mathematicians) reads angles in radians unless you tell it otherwise. So Sin[3] means the sine of 3 radians. The names of Mathematica s built-in functions, like Sin, always start with capitals. Some even have capitals in the middle of their names (like ParametricPlot ). You must have exactly the right letters capitalized, or Mathematica won t know what you mean. Notice that when you want to apply a function to something, you must use square brackets: [ and ], not parentheses. That is, instead of writing y = f(x) the way you do in calculus, you would need to write f[x] in Mathematica. So you write Sin[3], not Sin(3). Suppose you want the sine of 3 to 5 places. Execute the next command: N[%, 5] The 5 tells N[] to approximate the result to 5 places. What about the %? This is shorthand for the previous output. It is useful when you want to avoid retyping a long formula, or when you want to use the last result in your next computation. Execute the following commands to compute some other transcendental functions: N[ArcTan[7]] Notice that the function is ArcTan, not Arctan! Mathematica represents the constant e =.788... with a capital E: E. So here s the approximate value of e : N[E^] Note that Log is the natural log function: N[Log[]] 3. Symbolic algebra. Mathematica really shines as a tool for symbolic manipulation. I ll discuss a few of its capabilities below. Execute the commands as you go. Here is a binomial expansion: Expand[(x + y)^] The Expand function is good for multiplying stuff out. You can also use Mathematica to put things together. For example, here is how to combine fractions over a common denominator: Together[/(x + ) - 5/(x^ + )] You can also take a fraction apart (i.e. obtain its partial fractions decomposition). This will be familiar to people who have seen it used as an integration technique. Apart[%] Mathematica can also simplify expressions: Simplify[x^/(x - ) - /(x - )]

Mathematica combined the fractions over a common denominator, then noticed that the numerator was divisible by the denominator and performed the cancellation. Mathematica makes reasonable assumptions about how you d like a simplification performed. However, the program can t anticipate every human intention, and sometimes you will have to play around to get answers in the form that you want. Sometimes, it s even necessary to teach Mathematica simplification rules that it doesn t know! If you re doing serious work with Mathematica, you should refer to the manual for other functions and techniques that are useful in performing algebraic manipulations.. Solving equations. You can use Mathematica to solve equations, or systems of equations. For example: Solve[{x + y ==, x - y == }, {x, y}] In some cases, Mathematica can t obtain an exact solution: Solve[x^5 + x == 7, x] You can use N[] to obtain a numerical approximation to the solution: N[%] Here s how to compute d x dx sinx+cosx : D[x/(Sin[x] + Cos[x]), x] 5. Calculus. You can also compute higher-order derivatives. This is the 3-rd derivative of D[x/(Sin[x] + Cos[x]), {x, 3}] You can also compute partial derivatives: D[(x^ + y^) E^(-x^ - y^), x] Mathematica has a sizeable repertoire of integration rules: Integrate[Cos[x]^, x] It is also possible to teach Mathematica rules that it doesn t know. x sinx+cosx : If Mathematica can t evaluate a definite integral in closed form, you can use N[] as usual to obtain a numerical approximation: Integrate[E^(x^), {x,, }] N[%] 6. -dimensional Graphs. This is how to draw the graph of y = xsin x for 3 x 3: Plot[x Sin[/x], {x, -3, 3}] 3

.8.6.. -3 - - 3 -. Parametric plots are also very simple: ParametricPlot[{Cos[t]^3, Sin[t]^3}, {t, - Pi, Pi}].5 - -.5.5 -.5 - The aspect ratio defaults to /GoldenRatio; if you want better scaling, you can set the aspect ratio yourself, or have Mathematica do it automatically: ParametricPlot[{Cos[t]^3, Sin[t]^3}, {t, - Pi, Pi}, AspectRatio->Automatic].5 - -.5.5 -.5 - There are many other options for the graphics functions; see the Mathematica manual for details. 7. 3-dimensional Graphs. Here is the graph of z = sinxsiny, for x 3π and y 3π:

Plot3D[Sin[x] Sin[y], {x,, 3 Pi}, {y,, 3 Pi}].5 8 -.5-6 6 8 Many surfaces can t be represented as graphs of functions. Suppose I want to plot x = (+cosu)cosv, y = +sinu, z = (+cosu)sinv. Mathematica s ParametricPlot3D[] function plots parametrized surfaces. Notice that the three surface expressions are enclosed in square brackets: ParametricPlot3D[{( + Cos[u]) Cos[v], + Sin[u], ( + Cos[u]) Sin[v]}, {u,, Pi}, {v,, Pi}] 3.5.5 - - Note: I split the last command into two lines so it would fit on this page, but you aren t required to do that when you type it in. Mathematica will often break lines for you automatically as you type, or you can press Enter to make a line break remember that Shift-Enter actually executes a command. c 8 by Bruce Ikenaga 5