Quickstart: Mathematica for Calculus I (Version 9.0) C. G. Melles Mathematics Department United States Naval Academy September 2, 2013

Similar documents
Basic Exercises about Mathematica

Algebra. Mathematica QuickStart for Calculus 101C. Solving Equations. Factoring. Exact Solutions to single equation:

Using Mathematica to solve ODEs (part 1)

1. How Mathematica works

H* Define 2 Points in R 3 *L P = 81, 2, 3< Q = 84, 6, 6< PQvec = Q - P. H* Plot a Single Red Point of "Size" 0.05 *L

Representations of Curves and Surfaces, and of their Tangent Lines, and Tangent Planes in R 2 and R 3 Robert L.Foote, Fall 2007

PART 1 PROGRAMMING WITH MATHLAB

REPRESENTATION OF CURVES IN PARAMETRIC FORM

Parametric Curves, Polar Plots and 2D Graphics

Graphs of Functions, Limits, and

Graphing Calculator Tutorial

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

Models for Nurses: Quadratic Model ( ) Linear Model Dx ( ) x Models for Doctors:

Mathematica Basics. Exponential Functions Exp[expression] Natural Logarithms (ln) Log[expression]

Examples of Fourier series

Plot f, x, x min, x max generates a plot of f as a function of x from x min to x max. Plot f 1, f 2,, x, x min, x max plots several functions f i.

AP Calculus AB Unit 2 Assessment

ü 1.1 Getting Started

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

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

Teaching Complex Analysis as a Lab- Type ( flipped ) Course with a Focus on Geometric Interpretations using Mathematica

Objectives. Materials

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

Mathematica Assignment 1

Mathematica for Dirac delta functions and Green functions

Ph3 Mathematica Homework: Week 6

LAB 1 General MATLAB Information 1

First of all, we need to know what it means for a parameterize curve to be differentiable. FACT:

Introduction to Engineering gii

Excel Tool: Calculations with Data Sets

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

MEI GeoGebra Tasks for AS Pure

A Mathematica Tutorial - 1. Basic Operations

Basic Operations and Equivalent Expressions - Step-by-Step Lesson

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano

Math 21a Homework 22 Solutions Spring, 2014

Experiment 1: Introduction to MATLAB I. Introduction. 1.1 Objectives and Expectations: 1.2 What is MATLAB?

MEI STRUCTURED MATHEMATICS METHODS FOR ADVANCED MATHEMATICS, C3. Practice Paper C3-B

September 18, B Math Test Chapter 1 Name: x can be expressed as: {y y 0, y R}.

Casio fx-cg20. Calculator Instructions A B C D E F G. Contents:

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

Overview: The original Mathematica was a computer algebra system (CAS) released by Stephen Wolfram in 1988.

Math-2. Lesson 3-1. Equations of Lines

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment

Math 115 Second Midterm March 25, 2010

GRAPH 4.4. Megha K. Raman APRIL 22, 2015

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

Green Globs And Graphing Equations

Approximate First and Second Derivatives

Principles of Linear Algebra With Mathematica Linear Programming

OffPlot::"plnr"; OffGraphics::"gptn"; OffParametricPlot3D::"plld" Needs"Graphics`Arrow`" Needs"VisualLA`"

GRAPHICAL REPRESENTATION OF SURFACES

Introduction to Matlab

Getting Started. Chapter 1. How to Get Matlab. 1.1 Before We Begin Matlab to Accompany Lay s Linear Algebra Text

Integrating Equations of Motion in Mathematica

A model for an intramuscular injection of a medication.

AP Calculus. Slide 1 / 213 Slide 2 / 213. Slide 3 / 213. Slide 4 / 213. Slide 4 (Answer) / 213 Slide 5 / 213. Derivatives. Derivatives Exploration

ipad App User Guide Getting Started with Desmos Tables Variables and Sliders Settings, Zoom, and Language Graphable Expressions Supported Functions

A Mathematica Tutorial

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

Introduction to Classic Maple by David Maslanka

Defining and Plotting a Parametric Curve in 3D a(t)=(x(t),y(t),z(t)) H* clears all previous assingments so we can reuse them *L

Calculus III. 1 Getting started - the basics

Some Examples to Show That Objects Be Presented by Mathematical Equations

Math 1191 Mathematica Introduction

How to prepare interactive Mathematica demonstrations for classroom

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

Section 1.1 The Distance and Midpoint Formulas

Quickstart for Desktop Version

The following information is for reviewing the material since Exam 3:

Matlab Notes for Mathematical Modeling. Lia Vas

Casio fx-cg20. Calculator Instructions A B C D E F G. Contents:

Zajecia 1. Krotkie wprowadzenie do srodowiska Mathematica 4^ D D 1. ?

MEI Desmos Tasks for AS Pure

MATH 19520/51 Class 6

An Introduction to Maple and Maplets for Calculus

Excel Spreadsheets and Graphs

1 The Inverse Problem

Lecture 1: What is MATLAB?

A General Introduction to Matlab

STEPHEN WOLFRAM MATHEMATICADO. Fourth Edition WOLFRAM MEDIA CAMBRIDGE UNIVERSITY PRESS

Mathematics Computer Laboratory - Math Version 11 Lab 7 - Graphics c

Calculus I Review Handout 1.3 Introduction to Calculus - Limits. by Kevin M. Chevalier

Computer Programming in MATLAB

Objectives. Materials

Making Holes and Windows in Surfaces

1 Introduction to Matlab

Basic stuff -- assignments, arithmetic and functions

Quickstart for Web and Tablet App

Arithmetic expressions can be typed into Maple using the regular operators:

Plot f, x, x min, x max generates a plot of f as a function of x from x min to x max. Plot f 1, f 2,, x, x min, x max plots several functions f i.

Lab1: Use of Word and Excel

Introduction to Matlab to Accompany Linear Algebra. Douglas Hundley Department of Mathematics and Statistics Whitman College

Python Lists: Example 1: >>> items=["apple", "orange",100,25.5] >>> items[0] 'apple' >>> 3*items[:2]

Euler s Method for Approximating Solution Curves

Beginner s Mathematica Tutorial

Dr Richard Greenaway

Section Polar Coordinates. or 4 π (restricting θ to the domain of the lemniscate). So, there are horizontal tangents at ( 4 3

John's Tutorial on Everyday Mathcad (Version 9/2/09) Mathcad is not the specialist's ultimate mathematical simulator

Introduction to MATLAB

Transcription:

Quickstart: Mathematica for Calculus I (Version 9.0) C. G. Melles Mathematics Department United States Naval Academy September, 0 Contents. Getting Started. Basic plotting. Solving equations, approximating numerically, and finding roots. Lists and plotting with the Table command 5. Implicit plotting with ContourPlot 6. Defining and evaluating functions 7. Derivatives 8. Combining graphs with the Show command. 9. Symbols and Greek letters 0. The Simplify command. Limits. Integrals. Getting started Open a new Mathematica notebook by selecting File - New - Notebook. You will see a small white tab with a + sign at the top left. Click below and type a command, e.g., the first plot below, then press shiftenter to execute the command. You will see In[]:= appear before your first line of input and Out[]:= before your first output. Click below your output to enter another command. To enter some text, select Format - Style - Text or Alt - 7. To enter Mathematica commands again, click below the text and select Format - Style - Input or Alt-9. To delete a cell or cells, click on the vertical cell markers on the right of the screen and press delete.. Basic plotting.. Plot the graph of sin (x) from x = 0 to x = p. Notice that Plot, Sin, and Pi must all be capitalized. Pay attention to the types of brackets used: [ ] vs { }.

In[]:= Plot@Sin@xD, 8x, 0, * Pi<D Out[]= 5 6 -.. Plot the graphs of the exponential function, the natural logarithm function, and the equation y=x on the same axes from x = - to x=. Note: In Mathematica, the natural logarithm function is Log. We use { } brackets for the list of expressions to be graphed. In[]:= Plot@8Exp@xD, Log@xD, x<, 8x, -, <D 6 Out[]= - - - - -.. Plot Exp[x], Log[x], and x from x=- to x= with the plot range of y restricted to [-,]. Note: The arrow is obtained by typing - and >.

In[]:= Plot@8Exp@xD, Log@xD, x<, 8x, -, <, PlotRange 8-, <D Out[]= - - - - - -.. Plot the tangent and inverse tangent (arctangent) functions from -p/ to p/ with the first plot in red and the second in blue. In[]:= Plot@8Tan@xD, ArcTan@xD<, 8x, - Pi, Pi <, PlotStyle 8Red, Blue<D Out[]= -.5 -.5 - - -.5. Plot the top and bottom halves of the circle x ^ + y =, adjusting the Aspect Ratio to show the same scales on both axes.

In[5]:= Plot@8- Sqrt@ - x ^ D, Sqrt@ - x ^ D<, 8x, -, <, AspectRatio AutomaticD Out[5]= - -. Solving equations, approximating numerically, and finding roots.. Solve the equation x - = 0 for x. Note the double == signs in the Mathematica command. We see that two of the solutions are imaginary. In[6]:= Out[6]= Solve@x ^ - Š 0, xd ::x - >, :x - ä >, :x ä >, :x >>.. Select the th solution from the list of solutions. In[7]:= Out[7]= Solve@x ^ - Š 0, xd@@dd :x >.. Find the real solutions of the equation x -=0. In[8]:= Out[8]= Solve@x ^ - Š 0, x, RealsD ::x - >, :x >>.. Numerically approximate the real solutions of the equation x -=0. In[9]:= Out[9]= NSolve@x ^ - Š 0, x, RealsD 88x -.<, 8x.<<.5. Find a solution of the equation x -=0 in the interval 0<x<.

In[0]:= Out[0]= Solve@x ^ - Š 0 && 0 < x <, xd ::x >>.6. Numerically approximate a root of x -=0 near x=.5. In[]:= Out[]= FindRoot@x ^ -, 8x,.5<D 8x.<.7. Numerically approximate the value of In[]:= Out[]=. N@Sqrt@DD.. Lists with the Table command.. Use Table to make a list of the values of x for integers x from to 5. Note that the output has { } brackets around it, indicating that it has the structure of a list. In[]:= Out[]= Table@x ^, 8x,, 5<D 8,, 9, 6, 5<.. Use Table to make a list of values of x for x in {,,5,7,,,7} and name it PrimeSquares. Note the { } brackets around the list of x values. In[]:= Out[]= PrimeSquares = Table@x ^, 8x, 8,, 5, 7,,, 7<<D 8, 9, 5, 9,, 69, 89<.. Select the 5th element of the list PrimeSquares. In[5]:= Out[5]= PrimeSquares@@5DD.. Construct a list of expressions c*x, for c in the list {-,-,-,,,}, and give it the name LineList. In[6]:= Out[6]= LineList = Table@c * x, 8c, 8-, -, -,,, <<D 8- x, - x, - x, x, x, x<.5. Use Table to plot the lines in the list LineList. 5

6 In[7]:= Plot@LineList, 8x, -, <D Out[7]= - - -.6. Use Table to plot the lines in LineList with the colors orange, yellow, green,cyan,purple,black, and brown. In[8]:= Plot@LineList, 8x, -, <, PlotStyle 8Orange, Yellow, Green, Cyan, Purple, Black, Brown<D Out[8]= - - - 5. Implicit plotting with ContourPlot 5.. Plot the circle x + y = using ContourPlot. Note the double == signs in the command. We must specify the intervals for both x and y.

In[9]:= ContourPlot@x ^ + y ^ Š, 8x, -, <, 8y, -, <D Out[9]= 0.0 - - 0.0 5.. Plot the same circle but with axes and no frame. In[0]:= ContourPlot@x ^ + y ^ Š, 8x, -, <, 8y, -, <, Axes True, Frame FalseD Out[0]= - - 5.. Plot the family of circles x + y = c for c in the list {,,}, x in the interval [-,], and y in the interval [-,], using red, blue, and green. Because of the order in which Mathematica executes commands, we need to tell the program to evaluate the list of equations before plotting with ContourPlot. 7

8 In[]:= Out[]= In[]:= CircleEquations = Table@x ^ + y ^ == c ^, 8c, 8,, <<D 9x + y Š, x + y Š, x + y Š 6= ContourPlot@Evaluate@CircleEquationsD, 8x, - 5, 5<, 8y, - 5, 5<, ContourStyle 8Red, Blue, Green<D Out[]= 0 - - - - 0 6. Defining and evaluating functions In[]:= 6.. Define f HxL = x. f@x_d := x ^ 6.. Evaluate f at x=5 in two different ways. The arrow is obtained by typing - and >. In[]:= Out[]= In[5]:= Out[5]= In[6]:= f@5d 5 f@xd. x 5 5 6.. Define g Hx, yl = x + y. g@x_, y_d := x ^ + y ^ 6.. Evaluate g at x=, y= in two different ways. In[7]:= Out[7]= In[8]:= Out[8]= g@, D 5 g@x, yd. 8x, y < 5

7. Derivatives In[9]:= Out[9]= In[0]:= Out[0]= 7.. Find the derivative of the function f HxL = x defined above. Two methods are shown. D@f@xD, xd x f '@xd x 7.. Evaluate f (5) in two different ways. In[]:= Out[]= In[]:= Out[]= f '@5D 75 D@f@xD, xd. x 5 75 7.. Find the second derivative of f. Two methods are shown. In[]:= Out[]= In[]:= Out[]= f ''@xd 6x D@f@xD, 8x, <D 6x 7.. Find the derivative of x +y with respect to x when y is a function of x. Note that we must specify that y is a function of x by writing y[x]. In[5]:= Out[5]= D@x ^ + y@xd ^, xd x + y@xd y @xd 7.5. Given x +y -5=0, solve for y [x] by implicit differentiation. Give the result the name Slope. In[6]:= Out[6]= Slope = Solve@D@x ^ + y@xd ^ - 5, xd == 0, y '@xdd x ::y @xd >> y@xd 7.6. Find the value of y [x] at x=, y=. Note that we need to type y[x], not just y. In[7]:= Out[7]= Slope. 8x, y@xd < ::y @D - >> 8. Combining graphs with the Show command 8.. Plot the circlex +y -5=0 and its tangent line at (,) on the same axes. Note that we use ; at the end of a command when we do not need to see the result. In[8]:= CircleGraph = ContourPlot@x ^ + y ^ - 5 Š 0, 8x, - 6, 6<, 8y, - 6, 6<, Axes True, Frame FalseD; 9

0 In[9]:= In[0]:= TangentGraph = Plot@- H L * Hx - L +, 8x, - 6, 6<, PlotRange 8-6, 6<, AspectRatio AutomaticD; Show@CircleGraph, TangentGraphD 6 Out[0]= -6 - - 6 - - -6 9. Symbols and Greek letters 9.. The symbol is obtained from esc inf esc. 9.. The symbol ¹ is obtained from esc! = esc. 9.. The symbol is obtained from esc < = esc ( and similarly for ³). 9.. The Greek letter q is obtained from esc theta esc. Other Greek letters are obtained in a similar manner. 9.5. The arrow is obtained by typing - and > or esc -> esc. 0. The Simplify command In[]:= Out[]= 0.. Simplify the expression cos HqL + sin (q). Simplify@Cos@qD ^ + Sin@qD ^ D. Limits.. Find the limit of Exp[-x] as x. In[]:= Out[]= Limit@Exp@- xd, x InfinityD 0.. Find the limit of Log[x] (natural logarithm) as x 0+.

In[]:= Out[]= Limit@Log@xD, x 0, Direction - D -.. Find the limit of /x as x 0-. In[]:= Out[]= Limit@ x, x 0, Direction D -.. Find the limit of Exp[-c*x] as x, with the assumption that c>0. In[5]:= Out[5]= Limit@Exp@- c * xd, x Infinity, Assumptions 8c > 0<D 0.5. Find the limit of ExpA-c *x] as x, with the assumption that c is a real number and c¹0. Note: Type!= or esc!= esc for ¹. In[6]:= Out[6]= Limit@Exp@- c ^ * xd, x Infinity, Assumptions Element@c, RealsD && c ¹ 0D 0. Integrals.. Find the indefinite integral of x. Mathematica does not supply the +C. In[7]:= Integrate@x ^, xd x Out[7]=.. Find the definite integral of x from 0 to. In[8]:= Integrate@x ^, 8x, 0, <D Out[8]=.. Numerically approximate the integral of x from 0 to. In[9]:= Out[9]= NIntegrate@x ^, 8x, 0, <D 0.