Ma Thematic A Glossary

Embed Size (px)

Citation preview

  • 8/6/2019 Ma Thematic A Glossary

    1/50

    U s e f u l M a t h e m a t i c a C o m m a n d s

    J o h n B u r k a r d t

    N o v e m b e r 1 1 , 2 0 0 0

    A S u m m a r y f o r M A T H 1 6 6

    M a t h e m a t i c s D e p a r t m e n t

    1

    I o w a S t a t e U n i v e r s i t y

    2

    F a l l 1 9 9 6

    I n t r o d u c t i o n

    T h i s d o c u m e n t d e s c r i b e s t h e M a t h e m a t i c a c o m m a n d s a n d o p t i o n s t h a t y o u

    m a y n d u s e f u l f o r y o u r a s s i g n m e n t s i n t h i s c l a s s .

    T h e c o m m a n d s c o v e r e d a r e l i s t e d i n t h e T a b l e o f C o n t e n t s , ( 1 ) .

    T h e r e a r e t h r e e v e r s i o n s o f t h i s d o c u m e n t a v a i l a b l e :

    a P o s t S c r i p t v e r s i o n , c o m m a n d s . p s , a v a i l a b l e b y s e n d i n g m a i l t o J o h n

    B u r k a r d t

    3

    ; o r b y a n a n o n y m o u s F T P d o w n l o a d

    4

    ;

    T h e M a t h e m a t i c a N o t e b o o k s , ( 2 ) , s t o r e d i n t h e l e s c o m m a n d s 1 a n d

    c o m m a n d s 2 , a v a i l a b l e o n t h e M a t h e m a t i c s D e l t a S e r v e r i n t h e M a t h e -

    m a t i c s D e p a r t m e n t C o m p u t e r L a b

    5

    ;

    a n H T M L d o c u m e n t , c o m m a n d s . h t m l , v i e w a b l e b y N e t S c a p e , a v a i l a b l e

    a t h t t p : / / p r o b l e m . a m s . a m e s l a b . g o v / b u r k a r d t / c o m m a n d s . h t m l .

    I f y o u a r e u s i n g t h e H T M L d o c u m e n t , a n d y o u h a v e r e g i s t e r e d p r o p e r l y ,

    y o u w i l l b e g i v e n a u s e r n a m e a n d p a s s w o r d , w h i c h w i l l a l l o w y o u t o u s e t h e

    d o c u m e n t i n t e r a c t i v e l y . F o r d e t a i l s , s e e T h e H T M L D o c u m e n t , ( 3 ) .

    1 T a b l e o f C o n t e n t s

    T a b l e o f C o n t e n t s :

    I n t r o d u c t i o n

    1

    h t t p : / / w w w . m a t h . i a s t a t e . e d u

    2

    h t t p : / / w w w . i a s t a t e . e d u

    3

    m a i l t o : b u r k a r d t @ i a s t a t e . e d u

    4

    f t p : / / a n o n y m o u s . b u r k a r d t @ p v 3 4 e d . v i n c e n t . i a s t a t e . e d u / c o m m a n d s . p s

    5

    h t t p : / / w w w . m a t h . i a s t a t e . e d u / m a t h l a b /

    1

  • 8/6/2019 Ma Thematic A Glossary

    2/50

    T h e M a t h e m a t i c a N o t e b o o k s , ( 2 )

    { A c c e s s i n g t h e N o t e b o o k s ( 2 . 1 )

    T h e H T M L D o c u m e n t ( 3 )

    { E x e c u t i n g M a t h e m a t i c a i n H T M L ( 3 . 1 )

    A d v a n c e d F u n c t i o n s ( 4 )

    A n i m a t i o n ( 5 )

    A p a r t ( 5 )

    A s p e c t R a t i o ( 7 )

    A s s i g n m e n t s ( 8 )

    A x e s L a b e l ( 9 )

    A x e s O r i g i n ( 1 0 )

    C l e a r ( 1 1 )

    C o m m e n t s ( 1 2 )

    C u b e R o o t s ( 1 3 )

    D ( d i e r e n t i a t i o n ) ( 1 4 )

    D o ( 1 6 )

    D i s p l a y F u n c t i o n ( 1 5 )

    D S o l v e ( 1 7 )

    E x p a n d ( 1 8 )

    F a c t o r ( 1 9 )

    F i n d R o o t ( 2 0 )

    G r i d L i n e s ( 2 1 )

    I n n i t e S e r i e s ( 2 2 )

    I n t e g r a t e ( 2 3 )

    L i m i t ( 2 4 )

    L i s t P l o t ( 2 5 )

    L i s t s o f D a t a ( 2 6 )

    N ( N u m e r i c v a l u e ) ( 2 7 )

    2

  • 8/6/2019 Ma Thematic A Glossary

    3/50

    N D S o l v e ( 2 8 )

    N I n t e g r a t e ( 2 9 )

    N S o l v e ( 3 0 )

    N S u m ( 3 1 )

    P a r a m e t r i c P l o t ( 3 2 )

    P l o t ( 3 3 )

    P l o t a n d D D o n ' t M i x ( 3 4 )

    P l o t L a b e l ( 3 5 )

    P l o t R a n g e ( 3 6 )

    P o l a r G r i d s ( 3 7 )

    P o l a r P l o t ( 3 8 )

    P r i m e ( 3 9 )

    P r i n t ( 4 0 )

    R G B C o l o r ( 4 1 )

    S a m p l i n g P l o t C o o r d i n a t e s ( 4 2 )

    S e q u e n c e s ( 4 3 )

    S e r i e s ( 4 4 )

    S h o w ( 4 5 )

    S i m p l e F u n c t i o n s ( 4 6 )

    S i m p l i f y ( 4 7 )

    S o l v e ( 4 8 )

    S p e c i a l C o n s t a n t s ( 4 9 )

    S p e c i a l F u n c t i o n s ( 5 0 )

    S u m ( 5 1 )

    S u r f a c e O f R e v o l u t i o n ( 5 2 )

    T a b l e ( 5 3 )

    T a b l e F o r m ( 5 4 )

    T o g e t h e r ( 5 5 )

    3

  • 8/6/2019 Ma Thematic A Glossary

    4/50

    2 T h e M a t h e m a t i c a N o t e b o o k s

    O n e v e r s i o n o f t h i s d o c u m e n t i s a v a i l a b l e i n t h e f o r m a t o f M a t h e m a t i c a n o t e -

    b o o k s . T h e e x p l a n a t o r y p a r t a p p e a r s i n t e x t c e l l s , w h i l e t h e M a t h e m a t i c a c o m -

    m a n d s b e i n g d i s c u s s e d a p p e a r i n c o m m a n d c e l l s .

    T h e s e c o m m a n d s m a y b e e a s i l y e x e c u t e d s i m p l y b y c l i c k i n g i n a p a r t i c u l a r

    c o m m a n d c e l l a n d p r e s s i n g t h e E n t e r k e y , o r h o l d i n g d o w n t h e S h i f t k e y a n d

    p r e s s i n g R e t u r n .

    T h e o u t p u t f r o m s u c h a c o m m a n d w i l l a p p e a r j u s t b e l o w t h e c o m m a n d . Y o u

    c a n e a s i l y m o d i f y a n y o f t h e c o m m a n d s , o r t y p e i n n e w c o m m a n d s t h a t y o u w i s h

    t o t r y . Y o u m a y p r i n t a l l o r a p o r t i o n o f t h e d o c u m e n t , u s i n g t h e M a t h e m a t i c a

    P r i n t c o m m a n d f r o m t h e F i l e m e n u a t t h e t o p o f t h e w i n d o w .

    F u r t h e r d e t a i l s a r e a v a i l a b l e u n d e r A c c e s s i n g t h e N o t e b o o k s ( 2 . 1 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 . 1 A c c e s s i n g t h e N o t e b o o k s

    T h e M a t h e m a t i c a v e r s i o n o f t h i s d o c u m e n t i s a v a i l a b l e a s s e v e r a l n o t e b o o k l e s

    i n t h e M a t h e m a t i c s D e p a r t m e n t C o m p u t e r L a b

    6

    , w h i c h i s o p e n t o a l l I S U

    s t u d e n t s .

    T o a c c e s s t h e n o t e b o o k s , y o u r s t n e e d t o \ d i s c a r d " a n y o l d c o n n e c t i o n t o

    t h e M a t h e m a t i c s D e l t a S e r v e r , i f s o m e o n e e l s e a c c e s s e d i t b e f o r e y o u . L o o k

    a l o n g t h e r i g h t m a r g i n o f t h e M a c i n t o s h D e s k t o p f o r a l i t t l e o b j e c t l a b e l e d

    \ D e l t a S e r v e r " . I f y o u n d i t , p l a c e y o u r c u r s o r o n i t s i c o n , p r e s s a n d h o l d t h e

    m o u s e b u t t o n , a n d d r a g t h e c u r s o r ( a n d t h e S e r v e r ) i n t o t h e t r a s h c a n . R e l e a s e

    t h e m o u s e b u t t o n t o d i s c a r d t h e o l d c o n n e c t i o n t o t h e s e r v e r .

    S e c o n d l y , y o u n e e d t o m a k e a n e w c o n n e c t i o n t o t h e D e l t a S e r v e r , w h i c h

    r e c o g n i z e s t h a t y o u a r e e n t i t l e d t o a c c e s s , a n d a r e i n M a t h 1 6 6 . G o t o t h e

    \ A p p l e " m e n u i n t h e u p p e r l e f t c o r n e r o f t h e s c r e e n , a n d s e l e c t C h o o s e r . N o w

    c l i c k o n A p p l e S h a r e . A p p l e S h a r e s h o u l d s h o w t h a t y o u a r e i n t h e \ M a t h L a b "

    z o n e . N o w c l i c k o n t h e D e l t a S e r v e r . T h e M a c i n t o s h w i l l r e q u e s t a u t h e n t i -

    c a t i o n . T h e i n s t r u c t o r f o r y o u r c a l c u l u s c l a s s w i l l h a v e t o l d y o u w h a t t o t y p e

    h e r e . O n c e y o u h a v e b e e n a u t h e n t i c a t e d , a n e w s y m b o l s h o u l d a p p e a r o n t h e

    d e s k t o p , r e p r e s e n t i n g t h e D e l t a S e r v e r .

    N o w , t o g e t o n e o f t h e l e s , o p e n t h e D e l t a S e r v e r ( t h a t i s , c l i c k t w i c e o n i t s

    i c o n ) . O p e n t h e C l a s s e s f o l d e r , t h e n M a t h 1 6 6 , a n d n a l l y L a b s . T h e l e s

    c o m m a n d s 1 , c o m m a n d s 2 1 a n d c o m m a n d s 3 2 s h o u l d b e v i s i b l e n o w . Y o u

    s h o u l d c o p y e a c h l e t o t h e l o c a l h a r d d i s k , b y c l i c k i n g o n c e o n i t s i c o n a n d

    d r a g g i n g i t t o a f r e e a r e a o f t h e d e s k t o p .

    T o e x a m i n e t h e c o n t e n t s o f o n e o f t h e s e l e s , c l i c k t w i c e o n o n e o f t h e m .

    T h i s w i l l c a u s e M a t h e m a t i c a t o b e g i n r u n n i n g , a n d d i s p l a y i n g t h e i n f o r m a t i o n

    i n t h e l e .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    6

    h t t p : / / w w w . m a t h . i a s t a t e . e d u / m a t h l a b /

    4

  • 8/6/2019 Ma Thematic A Glossary

    5/50

    3 T h e H T M L D o c u m e n t

    O n e v e r s i o n o f t h i s d o c u m e n t h a s b e e n m a r k e d u p u s i n g H T M L , a n d c a n b e

    a c c e s s e d b y a n I n t e r n e t b r o s w e r , s u c h a s N e t S c a p e . T h e d o c u m e n t i s b r o k e n

    d o w n i n t o s u b p a g e s d e v o t e d t o a p a r t i c u l a r c o m m a n d .

    T h r o u g h t o o l s d e v e l o p e d b y t h e U C E S

    7

    ( U n d e r g r a d u a t e C o m p u t a t i o n a l E n g i n e e r i n g a n d S c i e n c e s P r o j e c t ) a t A m e s

    L a b o r a t o r y , a p e r s o n b r o w s i n g t h r o u g h t h e H T M L d o c u m e n t c a n a c t u a l l y e x -

    e c u t e t h e M a t h e m a t i c a c o m m a n d s d i s c u s s e d , a n d s e e t h e n u m e r i c o r g r a p h i c

    o u t p u t i n a s m a l l w i n d o w b e l o w t h e m a i n b r o w s e r w i n d o w .

    T o u s e t h e d o c u m e n t i n t h i s w a y , t h e u s e r n e e d s a v a l i d u s e r n a m e a n d p a s s -

    w o r d f o r t h e r e m o t e U C E S s e r v e r . C o n t a c t J o h n B u r k a r d t

    8

    i f y o u a r e i n t e r e s t e d

    i n l e a r n i n g m o r e a b o u t t h i s f e a t u r e .

    R e f e r t o E x e c u t i n g M a t h e m a t i c a i n H T M L ( 3 . 1 ) f o r d e t a i l s .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 . 1 E x e c u t i n g M a t h e m a t i c a i n H T M L

    I f y o u a r e a u t h o r i z e d f o r t h e r e m o t e s e r v e r , t h e n t o e x e c u t e a M a t h e m a t i c a

    c o m m a n d , c l i c k o n t h e c o l o r f u l a r r o w i c o n t h a t i s j u s t t o t h e l e f t o f t h e c o m m a n d .

    T h e r s t t i m e y o u d o t h i s , t h e f o l l o w i n g t e x t s h o u l d a p p e a r i n t h e s m a l l e r b o x

    b e l o w t h e m a i n o n e :

    H o w d o y o u p r e f e r t o r u n M a t h e m a t i c a :

    S U B M I T w h e n y o u ' r e d o n e :

    O I h a v e b o t h h a m l e t a n d M a t h e m a t i c a o n m y m a c h i n e .

    O I ' l l c u t - n - p a s t e t h e c o m m a n d s f r o m m y b r o w s e r t o M a t h e m a t i c a .

    O U s e a r e m o t e s e r v e r ( r e q u i r e s a p r o p e r u s e r n a m e a n d p a s s w o r d ) .

    C l i c k o n U s e a r e m o t e s e r v e r ( t h a t i s , c l i c k o n t h e l i t t l e o p e n d i a m o n d O

    i n f r o n t o f t h o s e w o r d s ) . T h e o p e n d i a m o n d s h o u l d c h a n g e t o a l l e d d i a m o n d .

    T h e n c l i c k o n S U B M I T . T h e r e m o t e c o m p u t e r w i l l a s k y o u f o r a u s e r n a m e

    a n d p a s s w o r d . O n c e y o u a r e a u t h e n t i c a t e d , t h e r e s u l t s o f y o u r M a t h e m a t i c a

    c o m m a n d s w i l l a p p e a r i n t h e s a m e b o x b e l o w t h e m a i n o n e .

    Y o u w i l l n o t b e a b l e t o e n t e r n e w c o m m a n d s o f y o u r o w n , h o w e v e r .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    4 A d v a n c e d F u n c t i o n s

    T h e s i m p l e s t u s e r - d e n e d f u n c t i o n s a r e t h e \ o n e - l i n e r s " , w h e r e t h e q u a n t i t y o f

    i n t e r e s t c a n b e c o m p u t e d b y a s i n g l e f o r m u l a . S u c h f o r m u l a s a r e d i s c u s s e d i n

    S i m p l e F u n c t i o n s ( 4 6 ) .

    7

    h t t p : / / u c e s . a m e s l a b . g o v

    8

    m a i l t o : b u r k a r d t @ i a s t a t e . e d u

    5

  • 8/6/2019 Ma Thematic A Glossary

    6/50

    I n s o m e c a s e s , y o u m a y n d i t i m p o s s i b l e t o d e n e t h e f u n c t i o n ' s v a l u e i n

    a s i n g l e s i m p l e f o r m u l a . I n s t e a d , y o u m a y n e e d t o c a r r y o u t s e v e r a l s t e p s o f

    c o m p u t a t i o n , u s i n g t e m p o r a r y v a r i a b l e s .

    Y o u m a y w a n t s e v e r a l i n p u t v a l u e s , a n d y o u m a y w a n t t h e u s e r t o g r o u p

    s o m e o f t h o s e i n p u t v a l u e s i n c u r l y b r a c k e t s .

    H e r e i s a n e x a m p l e o f a u s e r - d e n e d f u n c t i o n , w h i c h c o m p u t e s t h e l e f t R i e -

    m a n n s u m a p p r o x i m a t i o n t o t h e i n t e g r a l o f a f u n c t i o n f x ] f r o m a t o b , u s i n g

    n i n t e r v a l s :

    C l e a r f , l e f t R s u m , x ]

    l e f t R s u m f _ , { x _ , a _ , b _ , n _ } ] : =

    B l o c k { a p p r o x , d e l x , i } ,

    d e l x = ( b - a ) / n ;

    a p p r o x = N S u m ( f / . x - > a + d e l x * i ) * d e l x , { i , 0 , n - 1 } ] ]

    ]

    T h e r s t l i n e d e n e s t h e n a m e o f t h e f u n c t i o n t o b e l e f t R s u m , w i t h 5

    a r g u m e n t s . T h e l a s t f o u r a r g u m e n t s m u s t b e e n c l o s e d i n c u r l y b r a c k e t s .

    T h e B l o c k c o m m a n d m a r k s t h e b e g i n n i n g o f a g r o u p o f c o m m a n d s t h a t w i l l

    c a r r y o u t t h e p r o c e d u r e n a m e d l e f t R s u m .

    T h e s t a t e m e n t f a p p r o x , d e l x , i g d e n e s l o c a l v a r i a b l e s , t h a t i s , n a m e s f o r

    v a r i a b l e s w h i c h w i l l b e s e t a n d u s e d w i t h i n t h e p r o c e d u r e , b u t w h i c h a r e n o t

    f u n c t i o n a r g u m e n t s , a n d w h i c h s h o u l d n o t a l t e r t h e v a l u e s o f v a r i a b l e s w i t h t h e

    s a m e n a m e , d e n e d o u t s i d e t h e p r o c e d u r e .

    T h e r s t a s s i g n m e n t c o m m a n d h a s a s e m i c o l o n a f t e r i t t o s u p p r e s s o u t p u t .

    T h e v a l u e r e t u r n e d b y t h e f u n c t i o n w i l l b e t h e l a s t v a l u e c o m p u t e d , n a m e l y , t h e

    v a l u e o f a p p r o x . .

    T h e a s s i g n m e n t o f a p p r o x c a r r i e s o u t t h e R i e m a n n a p p r o x i m a t i o n , a n d

    c a u s e s t h e f u n c t i o n l e f t R s u m t o r e t u r n t h i s v a l u e .

    A s a n e x a m p l e o f h o w s u c h a r o u t i n e m i g h t b e u s e d , c o n s i d e r t h e f o l l o w i n g

    c o m m a n d s :

    f x _ ] : = x ^ 2

    l e f t R s u m f x ] , { x , 0 , 1 0 , 5 } ]

    F o r o t h e r e x a m p l e s o f t h i s k i n d o f f u n c t i o n , s e e t h e d i s c u s s i o n o f C u b e

    R o o t s ( 1 3 ) o r P o l a r G r i d s ( 3 7 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    6

  • 8/6/2019 Ma Thematic A Glossary

    7/50

    5 A n i m a t i o n

    W a r n i n g : I t i s n o t p o s s i b l e t o t r y o u t t h e a n i m a t i o n f e a t u r e i n t h e H T M L d o c -

    u m e n t !

    I f y o u d r a w a s e q u e n c e o f p l o t s , y o u c a n h a v e M a t h e m a t i c a a n i m a t e t h e

    p l o t s , t h a t i s , d i s p l a y t h e m o n e a f t e r a n o t h e r , a s t h o u g h t h e y w e r e i n d i v i d u a l

    f r a m e s o f a m o v i e .

    T o m a k e a n a n i m a t i o n , y o u m u s t r s t g e n e r a t e a s e q u e n c e o f p l o t s , u s i n g

    a n y o f t h e u s u a l g r a p h i c s c o m m a n d s , s u c h a s L i s t P l o t ( 2 5 ) , P a r a m e t r i c P l o t

    ( 3 2 ) o r P l o t ( 3 3 ) .

    Y o u s h o u l d t r y t o m a k e s u r e t h a t e a c h \ f r a m e " o r p l o t h a s t h e s a m e s h a p e

    ( w h a t M a t h e m a t i c a c a l l s t h e A s p e c t R a t i o ( 7 ) ) , a n d u s e s t h e s a m e x i n t e r v a l s ,

    a n d t h e s a m e y i n t e r v a l s ( w h i c h y o u c a n c o n t r o l w i t h t h e o p t i o n P l o t R a n g e

    ( 3 6 ) ) .

    H e r e i s a v e r y s i m p l e s e t o f f r a m e s t h a t s h o w h o w t h e s h a p e o f t h e f u n c t i o n

    y = a x

    3

    + x + 1 w i l l c h a n g e a s t h e c o e c i e n t a i s v a r i e d .

    C l e a r a , f , p 0 , p 1 , p 2 , p 3 , p 4 , p 5 , x ]

    f x _ ] : = a * x ^ 3 + x + 1

    a = 0 ;

    p 0 = P l o t f x ] , { x , - 2 , 2 } , P l o t R a n g e - > { - 2 , 4 } ]

    a = 1 ;

    p 1 = P l o t f x ] , { x , - 2 , 2 } , P l o t R a n g e - > { - 2 , 4 } ]

    a = 2 ;

    p 2 = P l o t f x ] , { x , - 2 , 2 } , P l o t R a n g e - > { - 2 , 4 } ]

    a = 3 ;

    p 3 = P l o t f x ] , { x , - 2 , 2 } , P l o t R a n g e - > { - 2 , 4 } ]

    a = 4 ;

    p 4 = P l o t f x ] , { x , - 2 , 2 } , P l o t R a n g e - > { - 2 , 4 } ]

    a = 5 ;

    p 5 = P l o t f x ] , { x , - 2 , 2 } , P l o t R a n g e - > { - 2 , 4 } ]

    I f y o u a r e n o t u s i n g a n o t e b o o k i n t e r f a c e , i t i s p o s s i b l e t h a t y o u c a n a n i m a t e

    t h e s e p l o t s u s i n g t h e c o m m a n d :

    7

  • 8/6/2019 Ma Thematic A Glossary

    8/50

    S h o w A n i m a t i o n { p 0 , p 1 , p 2 , p 3 , p 4 , p 5 } ]

    I n t h e n o t e b o o k i n t e r f a c e , w e \ s e l e c t " t h e f r a m e s t o b e a n i m a t e d - t h a t i s ,

    w e p l a c e t h e c u r s o r n e a r t h e b r a c k e t o n t h e r i g h t m a r g i n o f t h e r s t p l o t a n d

    c l i c k o n c e . N o w h o l d d o w n t h e s h i f t k e y , a n d c l i c k i n t h e r i g h t h a n d b r a c k e t s o f

    a l l t h e o t h e r p l o t s y o u w a n t t o i n c l u d e i n t h e a n i m a t i o n .

    N o w g o t o t h e G r a p h m e n u a n d s e l e c t A n i m a t e S e l e c t e d G r a p h i c s . T h i s

    s h o u l d c a u s e a b r i e f a n i m a t i o n o f y o u r p l o t s t o b e d i s p l a y e d . I t w i l l p r o b a b l y

    b e o v e r t o o q u i c k l y f o r y o u t o e n j o y . I n t h a t c a s e , g o b a c k t o t h e G r a p h m e n u

    a n d s e l e c t A n i m a t i o n . T h i s w i l l g i v e y o u a m e n u t h a t w i l l a l l o w y o u t o s p e c i f y

    h o w m a n y f r a m e s p e r s e c o n d s h o u l d b e d i s p l a y e d , a n d w h e t h e r t h e a n i m a t i o n

    s h o u l d l o o p f o r w a r d o n l y , o r f o r w a r d a n d b a c k a g a i n . A l i t t l e e x p e r i m e n t a t i o n

    s h o u l d m a k e a p l e a s i n g d i s p l a y .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    6 A p a r t

    A p o l y n o m i a l f r a c t i o n

    p ( x )

    q ( x )

    i s s a i d t o b e i m p r o p e r i f t h e d e g r e e o f p ( x ) i s g r e a t e r

    t h a n o r e q u a l t o t h a t o f q ( x ) .

    T h e A p a r t c o m m a n d c a n b e u s e d t o r e p l a c e a p o l y n o m i a l f r a c t i o n b y a

    \ w h o l e " p a r t , a n d a n e w f r a c t i o n w i t h t h e s a m e d e n o m i n a t o r , b u t a \ p r o p e r "

    n u m e r a t o r . T h i s i s s i m i l a r t o c h a n g i n g t h e \ i m p r o p e r " f r a c t i o n 1 7 / 5 t o 3 + 2 / 5 .

    T h e A p a r t c o m m a n d , a p p l i e d t o a p o l y n o m i a l f r a c t i o n , i s e s s e n t i a l l y c a r r y -

    i n g o u t t h e m e t h o d o f s y n t h e t i c d i v i s i o n . S y n t h e t i c d i v i s i o n i s a u s e f u l s i m p l i -

    c a t i o n , a n d i s m a n d a t o r y b e f o r e a p p l y i n g t h e m e t h o d o f P a r t i a l F r a c t i o n s t o a n

    i m p r o p e r p o l y n o m i a l f r a c t i o n .

    C l e a r x ]

    A p a r t ( x ^ 3 + 2 * x ^ 2 - x + 4 ) / ( x ^ 2 + x + 1 ) ]

    I n t h e n e x t e x a m p l e , w e c a n s e e t h a t M a t h e m a t i c a i s n o t o n l y d i v i d i n g o u t t h e

    i m p r o p e r p a r t o f t h e p o l y n o m i a l f r a c t i o n , b u t i s a l s o f a c t o r i n g t h e d e n o m i n a t o r

    a n d a p p l y i n g t h e m e t h o d o f P a r t i a l F r a c t i o n s :

    A p a r t ( x ^ 5 + 4 x ^ 4 + 2 x ^ 3 - 7 x ^ 2 + 4 x + 1 )

    / ( ( x ^ 2 + 1 ) * ( x + 3 ) ^ 2 ) ]

    T h e c o m m a n d T o g e t h e r ( 5 5 ) r e v e r s e s t h e o p e r a t i o n o f A p a r t .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    8

  • 8/6/2019 Ma Thematic A Glossary

    9/50

    7 A s p e c t R a t i o

    A s p e c t R a t i o i s a n o p t i o n t h a t m a y b e s p e c i e d i n t h e g r a p h i c s c o m m a n d s

    L i s t P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 ) , P l o t ( 3 3 ) , a n d S h o w ( 4 5 ) .

    S u p p o s e w e w a n t t o p l o t a q u a r t e r c i r c l e a n d a 4 5 d e g r e e r a y . W e c o u l d

    e x e c u t e t h e f o l l o w i n g M a t h e m a t i c a c o m m a n d s :

    C l e a r f , g , x ]

    f x _ ] : = S q r t 1 - x ^ 2 ]

    g x _ ] : = x

    P l o t { f x ] , g x ] } , { x , 0 , 1 } ]

    U n f o r t u n a t e l y , t h e c u r v e d o e s n ' t l o o k l i k e p a r t o f a c i r c l e , n o r i s t h e r a y a t

    4 5 d e g r e e s , b e c a u s e M a t h e m a t i c a h a s c h o s e n d i e r e n t x a n d y s c a l e s . W e c a n

    f o r c e t h e s e s c a l e s t o c o r r e s p o n d t o t h e r e l a t i v e l e n g t h s s i g n i e d b y t h e a c t u a l

    c o o r d i n a t e s b y s p e c i f y i n g t h e A s p e c t R a t i o - > A u t o m a t i c o p t i o n :

    f x _ ] : = S q r t 1 - x ^ 2 ]

    g x _ ] : = x

    P l o t { f x ] , g x ] } , { x , 0 , 1 } , A s p e c t R a t i o - > A u t o m a t i c ]

    Y o u m a y a l s o s p e c i f y a n u m e r i c v a l u e f o r t h e A s p e c t R a t i o . F o r i n s t a n c e ,

    s e t t i n g A s p e c t R a t i o - > 2 m a k e s a n e w p l o t t h a t i s t w i c e a s h i g h a s t h e a c t u a l

    d a t a w o u l d j u s t i f y .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    8 A s s i g n m e n t s

    T h e e a s i e s t w a y t o g i v e a v a r i a b l e a v a l u e u s e s a s i n g l e e q u a l s i g n , a s i n x = 1 .

    T h i s c a u s e s M a t h e m a t i c a t o n d t h e v a l u e o f t h e r i g h t h a n d s i d e o f t h e e q u a l s

    s i g n , a n d a s s i g n t h a t v a l u e t o t h e v a r i a b l e n a m e d o n t h e l e f t h a n d s i d e .

    C l e a r x , y ]

    x = 2 ;

    9

  • 8/6/2019 Ma Thematic A Glossary

    10/50

    y = 1 0 * x + 1

    W h e n a s i n g l e e q u a l s s i g n i s u s e d i n a n a s s i g n m e n t , t h e n t h e v a r i a b l e o n t h e

    l e f t h a n d s i d e i s g i v e n a v a l u e i m m e d i a t e l y . I f t h e q u a n t i t i e s o n t h e r i g h t h a n d

    s i d e a r e l a t e r c h a n g e d , t h i s w i l l n o t a e c t t h e l e f t h a n d s i d e . F o r i n s t a n c e , l e t ' s

    s e t x t o 1 , a n d s e t y t o b e t w o t i m e s x , u s i n g a s i n g l e e q u a l s s i g n .

    x = 1 ;

    y = 2 * x ;

    x

    y

    N o w l e t ' s c h a n g e x t o 1 0 . D o e s y c h a n g e t o 2 0 , o r s t a y a t 2 ?

    x = 1 0 ;

    x

    y

    I f y o u w a n t t o s p e c i f y t h a t y s h o u l d c h a n g e w h e n e v e r x c h a n g e s , t h e n y o u

    n e e d t o r e p l a c e t h e s i n g l e e q u a l s s i g n b y t h e c o m b i n a t i o n \ c o l o n - e q u a l s " .

    x = 1 ;

    y : = 2 * x ;

    x

    y

    N o w , w h e n w e c h a n g e x t o 1 0 , t h e v a l u e o f y w i l l c h a n g e a s w e l l :

    x = 1 0 ;

    x

    1 0

  • 8/6/2019 Ma Thematic A Glossary

    11/50

    y

    T h e d o u b l e e q u a l s s i g n i s u s e d w h e n d e s c r i b i n g a m a t h e m a t i c a l e q u a t i o n ,

    r a t h e r t h a n a n a s s i g n m e n t . T h u s , t o a s k t h e c o m m a n d S o l v e ( 4 8 ) t o n d t h e

    v a l u e s o f x t h a t m a k e a c e r t a i n e q u a t i o n t r u e , w e w r i t e

    S o l v e 4 x + 2 y = = 3 z - 1 , x ] .

    T h e d o u b l e e q u a l s s i g n t e l l s M a t h e m a t i c a t h a t w e a r e n o t t r y i n g t o a s s i g n a

    v a l u e t o t h e q u a n t i t y 4 x + 2 y , w h e r e a s a s i n g l e e q u a l s s i g n w o u l d c o n f u s e i t .

    O f t e n y o u d o n ' t w a n t t o a s s i g n a s i n g l e v a l u e , b u t t o s e t u p a f u n c t i o n a l

    r e l a t i o n s h i p . T o s e e h o w t o d o t h i s , r e f e r t o S i m p l e F u n c t i o n s ( 4 6 ) .

    T o s e e h o w t o a s s i g n v a l u e s t o a v e c t o r o r m a t r i x , r e f e r t o L i s t s o f D a t a

    ( 2 6 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    9 A x e s L a b e l

    A x e s L a b e l i s a n o p t i o n t h a t m a y b e s p e c i e d i n t h e g r a p h i c s c o m m a n d s L i s t -

    P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 ) , P l o t ( 3 3 ) , a n d S h o w ( 4 5 ) .

    A x e s L a b e l a l l o w s y o u t o l a b e l t h e x a n d y a x e s o f y o u r p l o t .

    C l e a r t ]

    P l o t 1 - E x p - t ] , { t , 0 , 1 } ,

    A x e s L a b e l - > { " T i m e " , " R a d i a t i o n " } ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 0 A x e s O r i g i n

    A x e s O r i g i n i s a n o p t i o n t h a t m a y b e s p e c i e d i n t h e g r a p h i c s c o m m a n d s

    L i s t P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 ) , P l o t ( 3 3 ) , a n d S h o w ( 4 5 ) .

    S o m e t i m e s , M a t h e m a t i c a w i l l n o t i n c l u d e t h e o r i g i n i n y o u r p l o t :

    C l e a r x ]

    P l o t S i n x ] + 4 , { x , 1 , 1 0 } ]

    I f y o u w a n t t h e p o i n t ( 0 , 0 ) i n c l u d e d , w i t h b o t h a x e s g o i n g t h r o u g h i t ( o r a t

    l e a s t p o i n t i n g t o w a r d s i t ) t h e n y o u m i g h t u s e t h e A x e s O r i g i n o p t i o n : .

    1 1

  • 8/6/2019 Ma Thematic A Glossary

    12/50

    P l o t S i n x ] + 4 , { x , 1 , 1 0 } , A x e s O r i g i n - > { 0 , 0 } ,

    P l o t L a b e l - > " S a m e p l o t , w i t h A x e s O r i g i n c o m m a n d " ]

    O f c o u r s e , a s n e a k y w a y t o f o r c e t h e x a x i s t o s h o w u p i s s i m p l y t o i n c l u d e

    t h e l i n e y = 0 i n y o u r g r a p h . T h e f u n n y t h i n g i s , t h i s g r a p h i s a l o t n i c e r t h a n

    t h e p r e v i o u s o n e !

    P l o t { S i n x ] + 4 , 0 } , { x , 1 , 1 0 } ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 1 C l e a r

    T h e C l e a r c o m m a n d t e l l s M a t h e m a t i c a t o \ f o r g e t " a n y t h i n g y o u m a y h a v e s a i d

    a b o u t a v a r i a b l e o r f o r m u l a , a l l o w i n g y o u t o r e d e n e i t o r u s e i t i n a n e w w a y .

    T h i s i s i m p o r t a n t , b e c a u s e t h e c o m m a n d s D ( 1 4 ) , I n t e g r a t e ( 2 3 ) , a n d P l o t

    ( 3 3 ) w i l l n o t w o r k p r o p e r l y i f t h e \ x " a r g u m e n t h a s b e e n p r e v i o u s l y a s s i g n e d a

    n u m e r i c a l v a l u e . H e r e i s a s a m p l e C l e a r c o m m a n d :

    C l e a r x ]

    H e r e i s a c a s e w h e r e C l e a r i s n e c e s s a r y . B e c a u s e x i s s e t t o 1 , t h e D c o m m a n d

    c a n n o t b e c a r r i e d o u t u n t i l a C l e a r c o m m a n d \ f r e e s u p " x :

    x = 1

    D S i n x ] , x ]

    C l e a r x ]

    D S i n x ] , x ]

    I n t h i s d o c u m e n t , w e u s e C l e a r a s t h e r s t c o m m a n d i n e v e r y e x a m p l e , s o

    t h a t v a r i a b l e s l e f t o v e r f r o m o t h e r e x a m p l e s w o n ' t a e c t t h e c u r r e n t e x a m p l e .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 2 C o m m e n t s

    W h e n y o u a r e u s i n g M a t h e m a t i c a t o s o l v e a h o m e w o r k p r o b l e m , i t c a n b e i m -

    p o r t a n t t o e x p l a i n w h a t y o u ' r e d o i n g , o r t o \ a n n o t a t e " y o u r r e s u l t s . T h e r e a r e

    t h r e e s i m p l e t h i n g s y o u c a n d o .

    1 2

  • 8/6/2019 Ma Thematic A Glossary

    13/50

    F i r s t , y o u c a n u s e t e x t c e l l s . A t e x t c e l l i s a p a r t o f a M a t h e m a t i c a n o t e b o o k

    t h a t i s s e t a s i d e f o r t e x t , r a t h e r t h a n c o m m a n d s . T o m a k e a t e x t c e l l , y o u

    s i m p l y s t a r t a n e w c e l l , a n d t h e n s e l e c t t h e c e l l i n t h e u s u a l w a y , b y c l i c k i n g i n

    t h e l i t t l e c e l l m a r k e r i n t h e r i g h t h a n d m a r g i n . T h e n , g o t o t h e S t y l e m e n u ,

    t h e n t o t h e C e l l S t y l e s u b m e n u , a n d c h o o s e T e x t . F r o m n o w o n , a n y t h i n g

    y o u t y p e i n t h i s p a r t i c u l a r c e l l w i l l b e c o n s i d e r e d t e x t . M a t h e m a t i c a w i l l p r i n t

    i t i n p l a i n s t y l e r a t h e r t h a n b o l d f a c e , a n d w o n ' t t r y t o e x e c u t e y o u r s e n t e n c e s

    a s c o m m a n d s .

    T h e s e c o n d t h i n g y o u c a n d o i s s i m p l e r , t h o u g h l e s s p r e t t y . Y o u c a n c a u s e

    M a t h e m a t i c a t o i g n o r e a p i e c e o f t e x t b y m a r k i n g i t a s a \ c o m m e n t " . Y o u b e g i n

    a c o m m e n t w i t h t h e s y m b o l s ( * a n d e n d w i t h * ) . T h u s , M a t h e m a t i c a w o n ' t b e

    c o n f u s e d b y t h e f o l l o w i n g c o m m a n d s :

    C l e a r a r e a , r ]

    r = 4

    ( * T h i s c o m m a n d c o m p u t e s t h e a r e a o f t h e c i r c l e ! * )

    a r e a = P i * r ^ 2

    T h e t h i r d t h i n g y o u c a n d o t o c o m m e n t y o u r c o m m a n d s i s s i m p l y t o u s e

    s h o r t s t r i n g s o f t e x t , m a r k e d o b y d o u b l e q u o t e s , t o a d d l a b e l s o r e x p l a n a t i o n s

    t o t h e n u m b e r s y o u c o m p u t e . I n t h i s c a s e , t h e q u o t e d s t r i n g w i l l a c t u a l l y b e

    p r i n t e d o u t r i g h t n e x t t o t h e n u m b e r y o u c o m p u t e .

    a r e a = N P i * r ^ 2 ] " i s t h e a r e a o f t h e c i r c l e . "

    T h i s i s n o t a l w a y s a g r e a t s o l u t i o n . F o r o n e t h i n g , y o u c a n ' t d o a n y m o r e

    c a l c u l a t i o n s w i t h a r e a , b e c a u s e i t s v a l u e i s n o t a n u m b e r ; i t ' s a n u m b e r f o l l o w e d

    b y a s t r i n g . F o r a n o t h e r , M a t h e m a t i c a h a s m a n y r u l e s f o r r e a r r a n g i n g r e s u l t s

    t h a t m a y h u r t y o u r i n t e n d e d o u t p u t . F o r i n s t a n c e :

    a r e a = P i * r ^ 2 " i s t h e a r e a o f t h e c i r c l e . "

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 3 C u b e R o o t s

    W e k n o w t h a t n e g a t i v e n u m b e r s d o n ' t h a v e s q u a r e r o o t s - a t l e a s t n o t i n t h e

    r e a l n u m b e r s y s t e m , s o w e a r e n o t s u r p r i s e d t h a t M a t h e m a t i c a w i l l n o t p l o t t h e

    S q r t f u n c t i o n o v e r a n e g a t i v e r a n g e , a n d r e t u r n s a c o m p l e x v a l u e f o r t h e s q u a r e

    r o o t o f - 3 .

    H o w e v e r , w e d o e x p e c t t h a t n e g a t i v e n u m b e r s h a v e a c u b e r o o t , a n d s o i t i s

    v e r y s u r p r i s i n g t o s e e t h a t M a t h e m a t i c a h a s a s t r a n g e i d e a a b o u t t h i s :

    1 3

  • 8/6/2019 Ma Thematic A Glossary

    14/50

    N ( - 1 ) ^ ( 1 / 3 ) ]

    A n d b e c a u s e M a t h e m a t i c a r e t u r n s c o m p l e x v a l u e s f o r s u c h c u b e r o o t s , y o u

    c a n ' t p l o t t h e c u b e r o o t f u n c t i o n t h e w a y y o u m i g h t l i k e :

    P l o t x ^ ( 1 / 3 ) , { x , - 2 , 2 } ]

    H o w e v e r , i t i s f a i r l y e a s y t o s e t u p a f u n c t i o n t h a t r e t u r n s t h e c u b e r o o t w e

    e x p e c t :

    C l e a r c u b e r o o t ]

    c u b e r o o t x _ ] : =

    B l o c k { v a l u e } ,

    v a l u e = S i g n x ] * ( A b s x ] ) ^ ( 1 / 3 )

    ]

    T h i s f u n c t i o n a l l o w s u s t o c o m p u t e t h e c u b e r o o t s w e e x p e c t :

    c u b e r o o t - 1 ]

    a n d t o p l o t t h e w h o l e f u n c t i o n :

    P l o t c u b e r o o t x ] , { x , - 2 , 2 } ]

    T h e s a m e p r o b l e m o c c u r s f o r a l l o d d r o o t s o f n e g a t i v e n u m b e r s , a n d c a n b e

    c o r r e c t e d s i m i l a r l y .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 4 D ( D i e r e n t i a t i o n )

    T h e c o m m a n d D f x ] , x ] w i l l d i e r e n t i a t e t h e f o r m u l a o r e x p r e s s i o n f x ] w i t h

    r e s p e c t t o t h e v a r i a b l e x .

    C l e a r f , x ]

    D x ^ 2 + 2 * x + 1 , x ]

    f x _ ] : = C o s x ] + x

    D f x ] , x ]

    Y o u c a n a l s o c o m p u t e h i g h e r o r d e r d e r i v a t i v e s :

    1 4

  • 8/6/2019 Ma Thematic A Glossary

    15/50

    D x ^ 2 + 2 * x + 1 , { x , 2 } ]

    T h e D c o m m a n d w i l l n o t w o r k p r o p e r l y i f t h e ( s y m b o l i c ) v a r i a b l e o f d i e r -

    e n t i a t i o n h a s b e e n a s s i g n e d a n u m e r i c v a l u e . I n s u c h c a s e s , y o u m u s t r s t u s e

    t h e c o m m a n d C l e a r ( 1 1 ) , t o \ f r e e u p " t h e v a r i a b l e .

    x = 1

    D C o s x ] , x ]

    C l e a r x ]

    D C o s x ] , x ]

    I f y o u h a v e w r i t t e n y o u r e x p r e s s i o n a s a f u n c t i o n o f a v a r i a b l e , t h e n y o u m a y

    a l s o c o m p u t e t h e d e r i v a t i v e u s i n g a n a p o s t r o p h e o r \ p r i m e " , w h i l e t h e s e c o n d

    d e r i v a t i v e u s e s t w o p r i m e s :

    f x _ ] : = C o s x ] + x

    f ' x ]

    f ' ' x ]

    Y o u c a n u s e f ' x ] i n t h e c o m m a n d s P l o t ( 3 3 ) o r S o l v e ( 4 8 ) .

    f x _ ] : = S i n x ]

    P l o t f ' x ] , { x , 0 , P i } ]

    Y o u m a y b e i n t e r e s t e d i n s e e i n g t h e e x a m p l e P l o t a n d D D o n ' t M i x ( 3 4 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 5 D i s p l a y F u n c t i o n

    S o m e t i m e s , y o u d o n ' t i m m e d i a t e l y w a n t t o s e e t h e o u t p u t o f a g r a p h i c s c o m -

    m a n d s u c h a s L i s t P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 ) , o r P l o t ( 3 3 ) . I n s t e a d , y o u

    p l a n t o s e t u p s e v e r a l p l o t s , a n d t h e n s h o w t h e m t o g e t h e r w i t h t h e c o m m a n d

    S h o w ( 4 5 ) .

    Y o u c a n e a s i l y h i d e t h e p r e l i m i n a r y p l o t s , a n d o n l y s h o w t h e c o m p o s i t e o n e ,

    b y u s i n g t h e D i s p l a y F u n c t i o n o p t i o n :

    1 5

  • 8/6/2019 Ma Thematic A Glossary

    16/50

    C l e a r p l o t 1 , p l o t 2 , x ]

    p l o t 1 = P l o t S i n x ] , { x , 0 , P i / 2 } ,

    D i s p l a y F u n c t i o n - > I d e n t i t y ]

    p l o t 2 = P l o t 1 , { x , P i / 2 , 3 . 0 } ,

    D i s p l a y F u n c t i o n - > I d e n t i t y ]

    S h o w p l o t 1 , p l o t 2 ,

    D i s p l a y F u n c t i o n - > $ D i s p l a y F u n c t i o n ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 6 D o

    T h e D o c o m m a n d a l l o w s y o u t o m a k e a l o o p t h a t r e p e a t s o n e o r m o r e o p e r a -

    t i o n s . T h e f o r m a t o f t h e D o c o m m a n d i s

    D o

    { c o m m a n d 1 ,

    c o m m a n d 2 ,

    . . .

    l a s t c o m m a n d } ,

    { c o u n t e r , s t a r t - v a l u e , e n d - v a l u e , i n c r e m e n t } ]

    F o r i n s t a n c e , t h e f o l l o w i n g D o l o o p c a l c u l a t e s t h e s q u a r e o f t h e o d d n u m b e r s

    b e t w e e n 1 a n d 9 a n d t h e n p r i n t s o u t t h e n u m b e r a n d i t s s q u a r e .

    W a r n i n g : t h i s c o m m a n d w o n ' t p r o d u c e a n y o u t p u t i n t h e H T M L d o c u m e n t !

    C l e a r n , n s q u a r e ]

    D o

    { n s q u a r e = n ^ 2 ,

    P r i n t " n = " , n , " n s q u a r e d = " , n s q u a r e ] } ,

    { n , 1 , 9 , 2 } ] }

    I n t h i s D o l o o p , t h e c o m m a n d s t o b e r e p e a t e d a r e g r o u p e d i n s i d e t h e c u r l y

    b r a c k e t s . ( I f t h e r e i s o n l y o n e c o m m a n d , y o u d o n ' t n e e d t h e b r a c k e t s ) . A f t e r

    t h e c o m m a n d s c o m e s a n i t e r a t o r , s i m i l a r t o w h a t y o u ' v e s e e n f o r t h e c o m m a n d

    T a b l e ( 5 3 ) . T h i s t e l l s M a t h e m a t i c a

    t h e c o u n t e r v a r i a b l e ( n i n o u r c a s e ) ;

    1 6

  • 8/6/2019 Ma Thematic A Glossary

    17/50

    t h e s t a r t i n g v a l u e o f t h e c o u n t e r ( 1 ) ;

    t h e e n d i n g v a l u e o f t h e c o u n t e r ( 9 ) ;

    h o w t h e c o u n t e r v a r i a b l e i n c r e a s e s o n e a c h s t e p ( a d d 2 t o t h e p r e v i o u s

    v a l u e ) .

    T h e D o c o m m a n d c a n c a r r y o u t a s i m p l e m e t h o d o f a p p r o x i m a t i n g t h e

    s o l u t i o n o f a d i e r e n t i a l e q u a t i o n . ( O f c o u r s e , t h e D S o l v e c o m m a n d i s b e t t e r ,

    i f y o u c a n u s e i t . ) L e t h , v , a n d a r e p r e s e n t t h e h e i g h t , v e l o c i t y , a n d a c c e l e r a t i o n

    o f a b a l l u n d e r t h e i n u e n c e o f g r a v i t y .

    S e t t h e i n i t i a l v a l u e s a t t i m e 0 :

    C l e a r a , d t , h , v ]

    h 0 ] = 2 0 0 ;

    v 0 ] = 5 0 ;

    a 0 ] = - 3 2 ;

    d t = 0 . 5 ;

    A n d n o w u s e a D o s t a t e m e n t t o c o m p u t e n e w v a l u e s , u s i n g t h e a p p r o x i m a -

    t i o n :

    h ( t + d t ) = h ( t ) + d t v ( t ) ( 1 )

    v ( t + d t ) = v ( t ) + d t a ( t ) ( 2 )

    a ( t + d t ) = 3 2 ( 3 )

    D o

    { h i ] = h i - 1 ] + d t * v i - 1 ] ,

    v i ] = v i - 1 ] + d t * a i - 1 ] ,

    a i ] = - 3 2

    } ,

    { i , 1 , 2 0 }

    ]

    W e c a n m a k e a p l o t t o s e e w h a t w e h a v e c o m p u t e d :

    h v a l s = T a b l e { i * d t , h i ] } , { i , 0 , 2 0 } ] ;

    L i s t P l o t h v a l s ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 7

  • 8/6/2019 Ma Thematic A Glossary

    18/50

    1 7 D S o l v e

    T h e D S o l v e c o m m a n d s o l v e s a d i e r e n t i a l e q u a t i o n , u s i n g e x a c t t e c h n i q u e s . I f

    t h i s c o m m a n d c a n n o t s o l v e y o u r e q u a t i o n , y o u m a y n e e d t o l o o k a t t h e c o m m a n d

    N D S o l v e ( 2 8 ) i n s t e a d .

    D S o l v e r e q u i r e s y o u t o s p e c i f y t h e f o l l o w i n g i n f o r m a t i o n :

    t h e d i e r e n t i a l e q u a t i o n s a n d t h e i n i t i a l c o n d i t i o n s ;

    t h e n a m e s o f t h e d e p e n d e n t v a r i a b l e s ;

    t h e n a m e s o f t h e i n d e p e n d e n t v a r i a b l e s .

    F o r a s i m p l e e x a m p l e , l e t ' s s o l v e

    d y

    d x

    =

    2 y

    x

    ( 4 )

    w i t h i n i t i a l c o n d i t i o n :

    y ( 1 ) = 1 ( 5 )

    w h i c h h a s t h e s o l u t i o n y = x

    2

    .

    N o t i c e t h a t w h e n y o u s p e c i f y t h e d i e r e n t i a l e q u a t i o n a n d i n i t i a l c o n d i t i o n ,

    y o u m u s t u s e t h e d o u b l e e q u a l s i g n .

    C l e a r x , y ]

    s o l u t i o n = D S o l v e { y ' x ] = = 2 * y x ] / x , y 1 ] = = 1 } , y x ] , x ]

    I f y o u n a m e d t h e o u t p u t o f t h e D S o l v e c o m m a n d , t h e n y o u c a n p l o t i t , o r u s e

    i t i n o t h e r f o r m u l a s , a s l o n g a s y o u u s e t h e \ r e p l a c e m e n t o p e r a t o r " s y m b o l i z e d

    b y \ / . " :

    P l o t y x ] / . s o l u t i o n , { x , 1 , 5 } ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 8 E x p a n d

    T h e E x p a n d c o m m a n d i s m o s t u s e f u l w h e n y o u w a n t t o f o r c e M a t h e m a t i c a t o

    s h o w y o u a n e x p r e s s i o n i n p o l y n o m i a l f o r m , w h i c h i s c u r r e n t l y w r i t t e n a s a s e t

    o f f a c t o r s , o r a s a p o l y n o m i a l r a i s e d t o a p o w e r .

    C l e a r x ]

    E x p a n d ( x + 1 ) * ( x - 3 ) ^ 2 ]

    T h e c o m m a n d F a c t o r ( 1 9 ) c a n u n d o t h e E x p a n d c o m m a n d .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    1 8

  • 8/6/2019 Ma Thematic A Glossary

    19/50

    1 9 F a c t o r

    T h e F a c t o r c o m m a n d t a k e s a p o l y n o m i a l e x p r e s s i o n a n d t r i e s t o w r i t e i t a s a

    p r o d u c t o f f a c t o r s . T h i s i s s i m i l a r t o r e p l a c i n g 1 2 b y 2 * 2 * 3 .

    C l e a r f o r m u l a , x ]

    f o r m u l a = 4 * x ^ 5 + 8 * x ^ 4 - 3 * x ^ 3 - 9 * x ^ 2

    F a c t o r f o r m u l a ]

    T h e c o m m a n d E x p a n d ( 1 8 ) c a n u n d o t h e F a c t o r c o m m a n d .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 0 F i n d R o o t

    T h e F i n d R o o t c o m m a n d t r i e s t o n d o n e v a l u e f o r a v a r i a b l e t h a t w i l l m a k e

    a n e q u a t i o n t r u e . T h e c o m m a n d u s e s a p p r o x i m a t e t e c h n i q u e s , s o t h e a n s w e r i s

    a l w a y s a n u m b e r , a n d i t i s n o t e x a c t . T h e c o m m a n d r e q u i r e s t h a t y o u s u p p l y a

    s t a r t i n g p o i n t , o r g u e s s , f o r t h e r o o t , a n d t h e c o m m a n d m a y f a i l i f t h e s t a r t i n g

    p o i n t i s n o t g o o d e n o u g h .

    W h e n y o u s p e c i f y t h e e q u a t i o n t o b e s o l v e d , y o u m u s t u s e t h e d o u b l e e q u a l

    s i g n .

    C l e a r x ]

    F i n d R o o t x ^ 2 = = 7 , { x , - 2 . 0 } ]

    F i n d R o o t c a n n d r o o t s f o r p r o b l e m s t h a t t h e c o m m a n d s N S o l v e ( 3 0 ) a n d

    S o l v e ( 4 8 ) c a n ' t h a n d l e . D o n ' t f o r g e t , t h o u g h , t h a t F i n d R o o t c a n o n l y n d a t

    m o s t o n e r o o t w h e n i t i s c a l l e d , n o m a t t e r h o w m a n y r o o t s t h e r e a c t u a l l y a r e .

    F o r t h i s n e x t p r o b l e m , t h e r e a r e r o o t s a t 2 a n d 4 , b u t w e ' l l o n l y h e a r a b o u t o n e

    o f t h e m .

    F i n d R o o t 2 ^ x = = x ^ 2 , { x , 3 } ]

    W a r n i n g : I f t h e v a r i a b l e y o u a r e s o l v i n g f o r a l r e a d y h a s b e e n a s s i g n e d a

    v a l u e t h r o u g h a n e q u a l s s i g n , t h e n t h e o u t p u t o f F i n d R o o t w i l l b e g a r b l e d .

    x = 1 7 ;

    1 9

  • 8/6/2019 Ma Thematic A Glossary

    20/50

    F i n d R o o t x ^ 2 = = 4 , { x , 3 } ]

    I n t h i s c a s e , y o u s h o u l d u s e t h e c o m m a n d C l e a r ( 1 1 ) j u s t b e f o r e t h e F i n d -

    R o o t c o m m a n d , t o \ f r e e u p " t h e v a r i a b l e x .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 1 G r i d L i n e s

    T h e G r i d L i n e s o p t i o n t o t h e c o m m a n d s L i s t P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 )

    a n d P l o t ( 3 3 ) a l l o w s y o u t o r e q u e s t t h a t g r i d l i n e s b e i n c l u d e d i n y o u r p l o t .

    T h e o p t i o n G r i d L i n e s - > A u t o m a t i c h a s M a t h e m a t i c a c h o o s e t h e p l a c e m e n t

    o f t h e l i n e s :

    P l o t S i n x ^ 3 ] , { x , - 2 , 2 } , G r i d L i n e s - > A u t o m a t i c ]

    Y o u m a y a l s o c h o o s e t h e l o c a t i o n o f g r i d l i n e s y o u r s e l f , b y s p e c i f y i n g a l i s t

    o f x c o o r d i n a t e s a n d a l i s t o f y c o o r d i n a t e s . Y o u m a y w a n t t o a d d t h e o p -

    t i o n A s p e c t R a t i o ( 7 ) s o t h a t t h e u n i t s o f m e a s u r e m e n t a r e t h e s a m e i n b o t h

    d i r e c t i o n s .

    P l o t A r c T a n x ] , { x , - 2 , 3 } ,

    G r i d L i n e s - > { { - 2 , - 1 . 5 , - 1 , - 0 . 5 , 0 , 0 . 5 , 1 , 1 . 5 , 2 } ,

    { - 1 , - 0 . 5 , 0 , 0 . 5 , 1 } } ,

    A s p e c t R a t i o - > A u t o m a t i c ]

    T o s e e h o w t o d e n e g r i d l i n e s f o r a p o l a r p l o t , s e e t h e d i s c u s s i o n o f P o l a r

    G r i d s ( 3 7 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 2 I n n i t e S e r i e s

    A n i n n i t e s e r i e s i s a n e x p r e s s i o n t h a t r e p r e s e n t s t h e s u m o f a n i n n i t e s e q u e n c e

    o f q u a n t i t i e s . T h e r e i s a s t a n d a r d m a t h e m a t i c a l n o t a t i o n f o r i n n i t e s e r i e s . F o r

    i n s t a n c e , t o r e p r e s e n t t h e i n n i t e s u m S o f t h e q u a n t i t i e s 1 ,

    1

    2

    ,

    1

    4

    ,

    1

    8

    , . . . , w e

    w o u l d w r i t e

    S =

    1

    X

    i = 1

    1

    2

    i

    : ( 6 )

    U s i n g l i m i t s , i t m a y b e p o s s i b l e t o a s s i g n a v a l u e t o a n i n n i t e s e r i e s . W e

    d o t h i s b y c o n s i d e r i n g t h e b e h a v i o r o f p a r t i a l s u m s i n t h e l i m i t . F o r i n s t a n c e ,

    l e t u s w r i t e S

    n

    t o r e p r e s e n t t h e s u m o f t h e r s t n t e r m s o f t h e s e r i e s . T h a t i s ,

    S

    n

    =

    n

    X

    i = 1

    1

    2

    i

    : ( 7 )

    2 0

  • 8/6/2019 Ma Thematic A Glossary

    21/50

    C e r t a i n l y , f o r a n y n , w e c a n c o m p u t e t h i s q u a n t i t y . T h e r s t f e w v a l u e s o f

    S

    n

    a r e 1 , 1 . 5 , 1 . 7 5 , 1 . 8 7 5 , . . . a n d w e m i g h t g u e s s ( c o r r e c t l y ) t h a t t h e v a l u e o f

    S

    n

    n e v e r r e a c h e s 2 , b u t c a n b e m a d e a s c l o s e t o 2 a s w e w a n t b y c h o o s i n g n

    l a r g e e n o u g h . I n o t h e r w o r d s ,

    l i m

    n > 1

    S

    n

    = 2 : ( 8 )

    I n s o m e c a s e s , t h e l i m i t i s i n n i t e , a n d w e s a y t h a t t h e s e r i e s d i v e r g e s t o

    i n n i t y . I n o t h e r c a s e s , t h e r e i s n o l i m i t a t a l l , a n d t h e s e r i e s c a n n o t b e a s s i g n e d

    a n y v a l u e .

    T h e r e f o r e , y o u m i g h t t h i n k t h a t o n e w a y t o a n a l y z e a s e r i e s w i t h M a t h e m a t -

    i c a i s t o d e n e t h e s e q u e n c e ( 4 3 ) o f p a r t i a l s u m s , a n d t h e n a p p l y t h e c o m m a n d

    L i m i t ( 2 4 ) . F o r o u r s i m p l e s e r i e s a b o v e , h e r e i s h o w w e c o u l d d o t h i s :

    C l e a r n , p a r t i a l ]

    p a r t i a l n _ ] : = S u m 1 / 2 ^ i , { i , 1 , n } ]

    L i m i t p a r t i a l n ] , n - > I n f i n i t y }

    S u c h a n a n s w e r i s u s e l e s s . M a t h e m a t i c a i s t e l l i n g u s i t d o e s n ' t k n o w h o w t o

    h a n d l e t h i s e x t r e m e l y s i m p l e p r o b l e m . W e c a n t r y a n o t h e r a p p r o a c h : s i m p l y

    u s e t h e S u m c o m m a n d w i t h a n i n n i t e u p p e r l i m i t :

    S u m ( 1 / 2 ) ^ i , { i , 1 , I n f i n i t y } ]

    T h i s s e e m s t o b e g e t t i n g u s n o w h e r e ! A c t u a l l y , h o w e v e r , M a t h e m a t i c a h a s

    c o m p u t e d t h e a n s w e r , b u t w e h a v e t o f o r c e i t o u t w i t h t h e c o m m a n d N ( 2 7 ) !

    N S u m ( 1 / 2 ) ^ i , { i , 1 , I n f i n i t y } ] ]

    A n o t h e r u s e f u l t o o l i s t h e R a t i o T e s t , w h i c h c o n s i d e r s t h e l i m i t o f t h e a b s o -

    l u t e v a l u e o f t h e r a t i o o f t h e n + 1 - s t a n d n - t h t e r m s . I f t h i s l i m i t i s l e s s t h a n 1 ,

    t h e n t h e i n n i t e s e r i e s h a s a ( n i t e ) l i m i t . I f t h e l i m i t i s g r e a t e r t h a n 1 , t h e n

    t h e i n n i t e s e r i e s d i v e r g e s , w h i l e i f t h e l i m i t i s e x a c t l y 1 , t h e t e s t i s i n c o n c l u s i v e .

    W e c a n m a k e t h i s t e s t e a s i l y :

    t e r m n _ ] : = 1 / 2 ^ n

    L i m i t t e r m n + 1 ] / t e r m n ] , n - > I n f i n i t y }

    Y o u m a y a l s o w a n t t o r e f e r t o t h e d i s c u s s i o n o f S e q u e n c e s ( 4 3 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 1

  • 8/6/2019 Ma Thematic A Glossary

    22/50

    2 3 I n t e g r a t e

    T h e I n t e g r a t e c o m m a n d c a n b e u s e d t o c o m p u t e t h e i n d e n i t e i n t e g r a l o f a

    f u n c t i o n .

    C l e a r c , x ]

    I n t e g r a t e x ^ 2 , x ]

    N o t i c e t h a t M a t h e m a t i c a d o e s n o t t a c k o n a s y m b o l i c c o n s t a n t l i k e C t o t h e

    a n s w e r . I f y o u w a n t t o i m p r e s s y o u r i n s t r u c t o r , y o u c a n d o i t y o u r s e l f :

    I n t e g r a t e S i n x ] , x ] + c

    T h e I n t e g r a t e c o m m a n d c a n a l s o b e u s e d t o c o m p u t e t h e d e n i t e i n t e g r a l .

    I n t h i s c a s e , y o u m u s t e n c l o s e t h e v a r i a b l e o f i n t e g r a t i o n a n d t h e l i m i t s o f

    i n t e g r a t i o n i n c u r l y b r a c k e t s .

    I n t e g r a t e x ^ 2 , { x , 0 , 3 } ]

    I n s o m e c a s e s , t h e I n t e g r a t e c o m m a n d c a n c o m p u t e a n s w e r s i n w h i c h t h e

    l o w e r l i m i t i s m i n u s I n n i t y o r t h e u p p e r l i m i t i s I n n i t y , ( 4 9 ) :

    I n t e g r a t e 1 / x ^ 3 , { x , 1 , I n f i n i t y } ]

    I n t e g r a t e c a n e a s i l y h a n d l e d e n i t e i n t e g r a l s i n v o l v i n g s y m b o l i c l i m i t s ,

    w h i c h i s u s e f u l w h e n c o n s i d e r i n g a n i m p r o p e r i n t e g r a l . ( O f c o u r s e , M a t h e -

    m a t i c a c a n h a n d l e i m p r o p e r i n t e g r a l s e a s i l y , b u t w e m a y w a n t t o s e e t h e s t e p s

    o u r s e l v e s . ) F o r i n s t a n c e , h e r e i s o n e w a y w e c o u l d c o m p u t e t h e v a l u e o f t h e

    i m p r o p e r i n t e g r a l o f

    1

    x

    2

    f r o m 1 t o I n n i t y :

    I n t e g r a t e 1 / x ^ 2 , { x , 1 , b } ]

    L i m i t 1 - 1 / b , b - > I n f i n i t y }

    I f M a t h e m a t i c a d o e s n o t k n o w a n e x a c t a n t i d e r i v a t i v e o f t h e f u n c t i o n , t h e n i t

    w i l l s i m p l y r e p r i n t t h e i n p u t y o u t y p e d . I f y o u d o n ' t t h i n k M a t h e m a t i c a i s g o i n g

    t o g i v e y o u a u s e f u l a n s w e r , a n d y o u n e e d a d e n i t e i n t e g r a l ( n o t a n i n d e n i t e

    o n e ! ) w i t h n u m e r i c ( n o t s y m b o l i c ! ) l i m i t s , t h e n y o u c a n t r y u s i n g t h e c o m m a n d

    N I n t e g r a t e ( 2 9 ) i n s t e a d .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 2

  • 8/6/2019 Ma Thematic A Glossary

    23/50

  • 8/6/2019 Ma Thematic A Glossary

    24/50

    p a i r s = T a b l e { x v a l s i ] ] , y v a l s i ] ] } , { i , 1 , 4 } ]

    L i s t P l o t p a i r s , P l o t J o i n e d - > T r u e ]

    Y o u m a y p r e f e r t o s e t u p y o u r d a t a i n a s i n g l e c o m m a n d :

    p a i r s = { { 0 , 4 } , { 1 , 1 } , { 3 , 5 } , { 2 , 4 } }

    Y o u c a n a s s i g n t h e o u t p u t o f t h e L i s t P l o t c o m m a n d a n a m e , a n d t h e n u s e

    t h e c o m m a n d S h o w ( 4 5 ) t o r e d i s p l a y i t .

    T h e r e a r e m a n y g r a p h i c s o p t i o n s a v a i l a b l e , i n c l u d i n g A s p e c t R a t i o ( 7 ) ,

    A x e s L a b e l ( 9 ) , A x e s O r i g i n ( 1 0 ) , G r i d L i n e s ( 2 1 ) , P l o t L a b e l ( 3 5 ) , P l o -

    t R a n g e ( 3 6 ) , a n d R G B C o l o r ( 4 1 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 6 L i s t s o f D a t a

    I n m a n y c a s e s , y o u w i l l w a n t t o s e t u p o r r e f e r e n c e d a t a i n a l i s t . I n M a t h e m a t i c a ,

    t h e s i m p l e s t k i n d o f l i s t c o r r e s p o n d s t o a \ v e c t o r " , a n d i s s i m p l y a l i s t o f n u m b e r

    o r s y m b o l i c v a l u e s , s e p a r a t e d b y c o m m a s a n d e n c l o s e d i n c u r l y b r a c k e t s :

    C l e a r c h a r t , d a t a x , v ]

    v = { 1 , S i n P i / 5 ] }

    I n d i v i d u a l e n t r i e s o f a l i s t m a y t h e n b e a c c e s s e d b y u s i n g d o u b l e s q u a r e

    b r a c k e t s . Y o u c a n u s e t h e c o m m a n d L i s t P l o t ( 2 5 ) t o p l o t s u c h d a t a .

    d a t a x = { 1 , 2 , 5 , 8 , 1 4 , 1 2 , 6 , 3 }

    d a t a x 3 ] ]

    W h a t a b o u t a t w o d i m e n s i o n a l a r r a y o r m a t r i x ? M a t h e m a t i c a t h i n k s o f s u c h

    q u a n t i t i e s a s s i m p l y a l i s t o f l i s t s . T h u s , a t w o d i m e n s i o n a l a r r a y i s a g a i n a l i s t

    o f q u a n t i t i e s s e p a r a t e d b y c o m m a s a n d e n c l o s e d i n c u r l y b r a c k e t s . W h a t m a k e s

    i t s p e c i a l i s t h a t t h e q u a n t i t i e s t h e m s e l v e s a r e l i s t s , n a m e l y , t h e r o w s o f t h e

    m a t r i x . I f w e c a l l o u r l i s t c h a r t , h e r e i s h o w w e m i g h t s e t i t u p :

    c h a r t = { { 1 1 , 1 2 , 1 3 , 1 4 } ,

    { 2 1 , 2 2 , 2 3 , 2 4 } ,

    { 3 1 , 3 2 , 3 3 , 3 4 } }

    a n d w e c a n r e f e r t o r o w 2 o f c h a r t a s :

    2 4

  • 8/6/2019 Ma Thematic A Glossary

    25/50

  • 8/6/2019 Ma Thematic A Glossary

    26/50

    2 8 N D S o l v e

    T h e N D S o l v e c o m m a n d i s s i m i l a r t o t h e c o m m a n d D S o l v e ( 1 7 ) i n t h a t i t i s

    u s e d t o s o l v e o n e o r m o r e d i e r e n t i a l e q u a t i o n s w i t h i n i t i a l c o n d i t i o n s . H o w e v e r ,

    i t i s d i e r e n t i n s e v e r a l r e s p e c t s .

    N D S o l v e d o e s n o t t r y t o c o m p u t e a n e x a c t , s y m b o l i c a n s w e r . I n s t e a d , i t

    u s e s s p e c i a l m e t h o d s t o a p p r o x i m a t e t h e a n s w e r .

    T h e r e f o r e , N D S o l v e c a n b e a p p l i e d t o a l l t h e p r o b l e m s D S o l v e c a n h a n d l e ,

    b u t c a n a l s o s o l v e p r o b l e m s f o r w h i c h n o e x a c t s o l u t i o n c a n b e f o u n d .

    H o w e v e r , b e c a u s e o f t h e w a y i t h a n d l e s t h e p r o b l e m , N D S o l v e d o e s n o t n d

    a f o r m u l a f o r t h e e x a c t a n s w e r . I n s t e a d , i t c o m p u t e s a n \ I n t e r p o l a t i n g F u n c -

    t i o n " . T h e i n t e r p o l a t i n g f u n c t i o n i s M a t h e m a t i c a ' s e s t i m a t e f o r t h e b e h a v i o r o f

    t h e f u n c t i o n . W h e n y o u c a l l N D S o l v e , y o u h a v e t o s p e c i f y a n a m e t o b e u s e d

    f o r t h e i n t e r p o l a t i n g f u n c t i o n .

    T h e f o r m a t o f t h e N D S o l v e c o m m a n d i s :

    n a m e = N D S o l v e { D i f f e r e n t i a l e q u a t i o n s , i n i t i a l c o n d i t i o n s } ,

    y x ] , { x , x m i n , x m a x } ]

    F o r e x a m p l e , t o s o l v e t h e p r o b l e m

    d y

    d x

    = ( 4 2 x ) y ( 9 )

    w i t h i n i t i a l c o n d i t i o n :

    y ( 0 ) =

    1

    6

    ( 1 0 )

    o v e r t h e i n t e r v a l

    0 x 5 : ( 1 1 )

    w e w o u l d i s s u e t h e f o l l o w i n g M a t h e m a t i c a c o m m a n d s :

    C l e a r s o l u t i o n , t a b l e 1 , x , y ]

    s o l u t i o n =

    N D S o l v e { y ' x ] = = ( 4 - 2 * x ) * y x ] , y 0 ] = = 1 / 6 } , y x ] , { x , 0 , 5 } ]

    I n o r d e r t o a c t u a l l y g e t n u m b e r s o u t o f o u r a n s w e r , w e h a v e t o u s e t h e / .

    s u b s t i t u t i o n o p e r a t o r . F o r i n s t a n c e , i f o u r f u n c t i o n y w a s d e n e d b y a f o r m u l a

    i n t h e u s u a l w a y , w e w o u l d g e t t h e v a l u e o f y a t 1 . 0 b y t y p i n g y 1 ] . N o w , o u r

    f u n c t i o n i s n o t a f o r m u l a , b u t a n i n t e r p o l a t i o n f u n c t i o n w h o s e p r o p e r t i e s a r e

    d e n e d i n t h e v a r i a b l e c a l l e d s o l u t i o n . T h e r e f o r e , w e h a v e t o u s e t h e f o l l o w i n g

    c o m m a n d t o e v a l u a t e y 1 . 0 ] :

    y 1 . 0 ] / . s o l u t i o n

    2 6

  • 8/6/2019 Ma Thematic A Glossary

    27/50

    S i m i l a r l y , w h e r e v e r w e w o u l d n o r m a l l y u s e a f o r m u l a l i k e y x ] , w e i n s t e a d

    m u s t u s e t h e e x p r e s s i o n y x ] / . s o l u t i o n . H e r e , f o r i n s t a n c e , w e m a k e a t a b l e

    o f t h e s o l u t i o n :

    t a b l e 1 =

    T a b l e { x , y x ] / . s o l u t i o n } , { x , 0 , 5 , 0 . 5 } ] ;

    T a b l e F o r m t a b l e 1 , T a b l e H e a d i n g s - > { N o n e , { " x " , " y x ] " } } ]

    W a r n i n g : A n i n t e r p o l a t i n g f u n c t i o n m a y o n l y b e e v a l u a t e d o v e r a s p e c i c

    r a n g e . F o r o u r e x a m p l e , w e o n l y a s k e d f o r a n a p p r o x i m a t e s o l u t i o n o v e r t h e

    r a n g e 0 < = x < = 5 . M a t h e m a t i c a w i l l r e f u s e t o c o m p u t e a v a l u e o f t h e i n t e r -

    p o l a t i n g f u n c t i o n o u t s i d e t h i s r a n g e :

    y 6 ] / . s o l u t i o n

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    2 9 N I n t e g r a t e

    T h e N I n t e g r a t e c o m m a n d a p p r o x i m a t e s t h e d e n i t e i n t e g r a l o f a f u n c t i o n

    b e t w e e n t w o l i m i t s . I n s t e a d o f t r y i n g t o n d t h e i n d e n i t e i n t e g r a l , a n d t h e n

    u s i n g t h e F u n d a m e n t a l T h e o r e m o f C a l c u l u s , N I n t e g r a t e u s e s i d e a s b a s e d o n

    R i e m a n n s u m s t o g e t a n a p p r o x i m a t e v a l u e o f t h e i n t e g r a l o f m a n y f u n c t i o n s

    f o r w h i c h t h e c o m m a n d I n t e g r a t e ( 2 3 ) c a n n o t g e t t h e e x a c t v a l u e .

    C l e a r x ]

    N I n t e g r a t e S i n x ^ 3 ] , { x , 0 , 1 } ]

    W a r n i n g : N I n t e g r a t e r e q u i r e s n i t e n u m e r i c a l v a l u e s f o r t h e u p p e r a n d

    l o w e r l i m i t s o f t h e i n t e g r a l . Y o u d e n i t e l y c a n n o t u s e N I n t e g r a t e f o r i n t e g r a l s

    w i t h a n u p p e r o r l o w e r l o w e r b o u n d o f I n n i t y ( 4 9 .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 0 N S o l v e

    T h e N S o l v e c o m m a n d t r i e s t o n d a l l t h e r o o t s o f a n a l g e b r a i c e q u a t i o n , u s i n g

    a p p r o x i m a t e m e t h o d s .

    T h e e q u a t i o n t o b e s o l v e d i s s p e c i e d u s i n g a d o u b l e e q u a l s i g n . T h e s e c o n d

    a r g u m e n t i s t h e n a m e o f t h e v a r i a b l e t o b e s o l v e d f o r .

    C l e a r x ]

    2 7

  • 8/6/2019 Ma Thematic A Glossary

    28/50

    N S o l v e x ^ 2 = = 7 , x ]

    H e r e ' s h o w N S o l v e f a i l s o n a s i m p l e e q u a t i o n w h o s e r o o t s a r e 2 a n d 4 . N o t i c e

    t h a t N S o l v e c a n ' t s o l v e t h i s p r o b l e m a n y b e t t e r t h a n S o l v e c a n , b e c a u s e t h i s

    i s n o t a n a l g e b r a i c e q u a t i o n i n v o l v i n g p o l y n o m i a l s . T h e t e r m 2

    x

    i s c o n s i d e r e d

    \ t r a n s c e n d e n t a l " . H o w e v e r , N S o l v e s h o u l d b e a b l e t o n d t h e r o o t s o f m o s t

    p o l y n o m i a l e q u a t i o n s , w h e r e a s S o l v e w i l l f a i l f o r m o s t p o l y n o m i a l s o f d e g r e e 5

    o r g r e a t e r .

    N S o l v e x ^ 2 = = 2 ^ x , x ]

    Y o u m a y a l s o w i s h t o r e f e r t o t h e c o m m a n d s S o l v e ( 4 8 ) o r F i n d R o o t ( 2 0 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 1 N S u m

    N S u m n u m e r i c a l l y e s t i m a t e s t h e v a l u e o f a n i n n i t e s u m .

    T o e s t i m a t e t h e s u m o f t h e t e r m s

    1

    2

    n

    , t h e c o m m a n d w o u l d b e

    C l e a r n ]

    N S u m 1 / ( 2 ^ n ) , { n , 1 , I n f i n i t y } ]

    S i n c e N S u m o n l y u s e s n u m e r i c a l t e c h n i q u e s , i t c a n n o t s u m s y m b o l i c q u a n -

    t i t i e s , a n d t h e a n s w e r s i t p r o d u c e s m a y b e s l i g h t l y o r g r e a t l y i n a c c u r a t e . F o r

    i n s t a n c e , t h e a c t u a l s u m o f t h e t e r m s

    1

    n

    i s i n n i t e , b u t h e r e i s w h a t N S u m t e l l s

    u s :

    N S u m 1 / n , { n , 1 , I n f i n i t y } ]

    I f y o u a r e s u m m i n g s y m b o l i c q u a n t i t i e s , o r n e e d a n e x a c t a n s w e r , y o u s h o u l d

    r e f e r t o t h e c o m m a n d S u m ( 5 1 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 2 P a r a m e t r i c P l o t

    M o s t p l o t s a r e o f f u n c t i o n s t h a t c a n b e e x p r e s s e d i n t h e f o r m y = f ( x ) . B u t t h e r e

    a r e s o m e o b j e c t s w e ' d l i k e t o d r a w t h a t d o n ' t t t h i s p a t t e r n . I n p a r t i c u l a r , t h e

    p o i n t s o n a c i r c l e a r e e x a c t l y t h e p o i n t s w h i c h s a t i s f y t h e r e l a t i o n s h i p x

    2

    + y

    2

    =

    r

    2

    , b u t t h i s e q u a t i o n c a n ' t b e r e d u c e d t o t h e f o r m y = f ( x ) w i t h o u t l e a v i n g o u t

    s o m e p o i n t s . T h e e x p r e s s i o n

    y =

    p

    r

    2

    x

    2

    ( 1 2 )

    2 8

  • 8/6/2019 Ma Thematic A Glossary

    29/50

    o n l y p r o d u c e s t h e t o p h a l f o f t h e c i r c l e , f o r i n s t a n c e .

    I n s u c h a c a s e , i t i s o f t e n p o s s i b l e t o e x p r e s s b o t h t h e x a n d y c o o r d i n a t e s

    o f t h e g r a p h i n t e r m s o f a h e l p i n g v a r i a b l e , c a l l e d a p a r a m e t e r . F o r i n s t a n c e ,

    t h e x a n d y c o o r d i n a t e s o f a c i r c l e o f r a d i u s r c a n b e e x p r e s s e d i n t e r m s o f a

    p a r a m e t e r t a s :

    C l e a r r , t , x , y ]

    r = 2 ;

    x t _ ] : = r * C o s t ]

    y t _ ] : = r * S i n t ]

    F o r s u c h a s i t u a t i o n , M a t h e m a t i c a s u p p l i e s t h e P a r a m e t r i c P l o t c o m m a n d ,

    w h i c h i s s i m i l a r t o t h e c o m m a n d P l o t ( 3 3 ) , e x c e p t t h a t i t r e q u i r e s f o r m u l a s f o r

    b o t h x a n d y a s f u n c t i o n s o f t h e p a r a m e t e r :

    P a r a m e t r i c P l o t { x t ] , y t ] } , { t , 0 , 2 * P i } ,

    A s p e c t R a t i o - > A u t o m a t i c ]

    T h e r e a r e m a n y g r a p h i c s o p t i o n s a v a i l a b l e , i n c l u d i n g A s p e c t R a t i o ( 7 ) ,

    A x e s L a b e l ( 9 ) , A x e s O r i g i n ( 1 0 ) , G r i d L i n e s ( 2 1 ) , P l o t L a b e l ( 3 5 ) , P l o -

    t R a n g e ( 3 6 ) , a n d R G B C o l o r ( 4 1 ) .

    T h e c o m m a n d P o l a r P l o t ( 3 8 ) i s d e n e d i n t e r m s o f t h e P a r a m e t r i c P l o t

    c o m m a n d .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 3 P l o t

    T h e m o s t c o m m o n P l o t c o m m a n d p l o t s o n e f u n c t i o n o n a g i v e n x d o m a i n ,

    l e t t i n g M a t h e m a t i c a d e c i d e h o w t o c h o o s e t h e y r a n g e o f t h e p l o t .

    C l e a r f , g , x ]

    P l o t S i n x ] , { x , - P i , P i } ]

    T o p l o t t w o g r a p h s a t t h e s a m e t i m e , y o u c a n s i m p l y i n c l u d e b o t h f o r m u l a s

    i n c u r l y b r a c k e t s . T o m a k e t h i n g s c l e a r e r , w e w i l l g i v e t h e f o r m u l a s n a m e s r s t :

    f x _ ] : = S q r t 1 - x ^ 2 ]

    2 9

  • 8/6/2019 Ma Thematic A Glossary

    30/50

    g x _ ] : = x

    P l o t { f x ] , g x ] } , { x , 0 , 1 } ]

    Y o u c a n a l s o u s e t h e c o m m a n d S h o w ( 4 5 ) t o a c c o m p l i s h t h i s t a s k .

    P l o t s c a n t a k e u p a l o t o f m e m o r y . I f y o u c a n ' t s a v e y o u r n o t e b o o k t o a

    o p p y d i s k b e c a u s e i t ' s t o o l a r g e , t r y d e l e t i n g s o m e o f y o u r p i c t u r e s . A s l o n g

    a s y o u l e a v e t h e a c t u a l P l o t c o m m a n d s i n y o u r l e , y o u c a n e a s i l y g e t y o u r

    p i c t u r e s b a c k t h e n e x t t i m e y o u r u n M a t h e m a t i c a .

    Y o u m a y b e i n t e r e s t e d i n t h e e x a m p l e P l o t a n d D D o n ' t M i x ( 3 4 ) .

    T h e r e a r e m a n y g r a p h i c s o p t i o n s a v a i l a b l e , i n c l u d i n g A s p e c t R a t i o ( 7 ) ,

    A x e s L a b e l ( 9 ) , A x e s O r i g i n ( 1 0 ) , G r i d L i n e s ( 2 1 ) , P l o t L a b e l ( 3 5 ) , P l o -

    t R a n g e ( 3 6 ) , a n d R G B C o l o r ( 4 1 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 4 P l o t a n d D D o n ' t M i x

    I f y o u h a v e d e n e d a f u n c t i o n f , a n d y o u w a n t t o p l o t i t s r s t d e r i v a t i v e , t h e n

    t h e p r o p e r w a y t o d o t h i s i s t o u s e t h e \ p r i m e " o r \ s i n g l e q u o t e " s y m b o l i n t h e

    c o m m a n d P l o t ( 3 3 ) :

    C l e a r f , x ]

    f x _ ] : = S i n x ]

    P l o t f ' x ] , { x , 0 , P i } ]

    Y o u c a n n o t u s e D f x ] , x ] i n t h e P l o t c o m m a n d , e v e n t h o u g h i t m e a n s t h e

    s a m e t h i n g ( t o u s ) a s f ' x ] ! T h i s i s b e c a u s e t h e P l o t c o m m a n d w o u l d s e e t h e

    v a r i a b l e x u s e d t w i c e , o n c e a s a s y m b o l i c a r g u m e n t , a n d o n c e a s t h e r a n g e o f

    p l o t t i n g . S o t h e f o l l o w i n g c o m m a n d w o n ' t w o r k :

    P l o t D f x ] , x ] , { x , 0 , P i } ]

    Y o u m a y w a n t t o r e f e r t o t h e c o m m a n d s D ( 1 4 ) , o r P l o t ( 3 3 ) .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 5 P l o t L a b e l

    P l o t L a b e l i s a n o p t i o n t h a t m a y b e s p e c i e d i n t h e g r a p h i c s c o m m a n d s L i s t -

    P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 ) , P l o t ( 3 3 ) , a n d S h o w ( 4 5 ) .

    T h e P l o t L a b e l o p t i o n p r i n t s a t i t l e o n y o u r p l o t . T h e t i t l e s h o u l d b e

    e n c l o s e d i n d o u b l e q u o t e s :

    3 0

  • 8/6/2019 Ma Thematic A Glossary

    31/50

    C l e a r x ]

    P l o t S i n x ] * S i n 2 * x ] , { x , 0 , 1 0 } ,

    P l o t L a b e l - > " P r o d u c t o f t w o S i n e f u n c t i o n s " ]

    I f y o u h a v e s e v e r a l p l o t s , e a c h w i t h a p l o t l a b e l , a n d y o u s h o w t h e m t o g e t h e r

    w i t h t h e S h o w c o m m a n d , o n l y o n e l a b e l w i l l s h o w u p . I f t h e S h o w c o m m a n d

    s p e c i e s a P l o t L a b e l o p t i o n , t h e n t h a t i s t h e p l o t l a b e l t h a t w i l l a p p e a r .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 6 P l o t R a n g e

    P l o t R a n g e i s a n o p t i o n t h a t m a y b e s p e c i e d i n t h e g r a p h i c s c o m m a n d s L i s t -

    P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 ) , P l o t ( 3 3 ) , a n d S h o w ( 4 5 ) .

    Y o u m a y o f t e n n d t h a t y o u w a n t t o c h a n g e t h e r a n g e t h a t M a t h e m a t i c a

    c h o o s e s f o r t h e g r a p h . T h i s i s e a s y t o d o w i t h t h e P l o t R a n g e o p t i o n . I t c a n

    b e u s e f u l w h e n M a t h e m a t i c a d e c i d e s t o \ c r o p " y o u r g r a p h , o m i t t i n g v e r y h i g h

    o r v e r y l o w v a l u e s . I n t h a t c a s e , y o u c a n u s e t h e o p t i o n

    P l o t R a n g e - > A l l

    t o f o r c e t h e d i s p l a y o f a l l d a t a . I n o t h e r c a s e s , y o u m a y w a n t t o d o s o m e

    \ c r o p p i n g " y o u r s e l f . Y o u m i g h t w a n t t o f o c u s o n w h e r e a g r a p h c r o s s e s t h e x

    a x i s , f o r i n s t a n c e :

    C l e a r f , x ]

    f x _ ] : = ( x + 1 ) * ( x - 2 ) ^ 2 * x

    P l o t f x ] , { x , - 3 , 3 } , P l o t R a n g e - > { - 1 , 1 } ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 7 P o l a r G r i d s

    W h e n d r a w i n g a f u n c t i o n u s i n g p o l a r c o o r d i n a t e s , i t m a y b e c o n v e n i e n t t o s h o w

    a s e t o f p o l a r g r i d l i n e s , t h a t i s , a s e t o f r e g u l a r l y s p a c e d c i r c l e s a n d r a y s .

    T h e f o l l o w i n g M a t h e m a t i c a f u n c t i o n c i r c l e s c a n b e u s e d t o d r a w n c i r c c i r -

    c l e s a r o u n d t h e o r i g i n , w i t h r a d i u s r m i n t o r m a x :

    C l e a r c i r c l e s ]

    3 1

  • 8/6/2019 Ma Thematic A Glossary

    32/50

    c i r c l e s r m i n _ , r m a x _ , n c i r c _ ] : =

    B l o c k { c i r c p l o t } ,

    c i r c p l o t = G r a p h i c s

    T a b l e

    C i r c l e { 0 , 0 } , ( r m i n * ( n c i r c - n ) + r m a x * ( n - 1 ) ) / ( n c i r c - 1 ) ] ,

    { n , 1 , n c i r c }

    ]

    ]

    ]

    T o u s e t h e f u n c t i o n , c h o o s e v a l u e s f o r t h e a r g u m e n t s a n d c a l l c i r c l e s . T h e r e

    w o n ' t b e a n y o u t p u t , e x c e p t f o r a n o t e f r o m M a t h e m a t i c a s a y i n g \ G r a p h i c s " .

    Y o u s h o u l d s a v e t h e o u t p u t o f t h e c o m m a n d a s a v a r i a b l e .

    r m i n = 1 ;

    r m a x = 2 ;

    n c i r c = 1 1 ;

    p 1 = c i r c l e s r m i n , r m a x , n c i r c ]

    T h e g r i d c a n b e d i s p l a y e d a t a n y t i m e u s i n g t h e c o m m a n d S h o w ( 4 5 ) .

    S h o w p 1 , A s p e c t R a t i o - > A u t o m a t i c ]

    T h e f u n c t i o n r a y s c a n b e u s e d t o d r a w n r a y s r a y s f r o m t h e o r i g i n , e x t e n d i n g

    f r o m r a d i u s r m i n t o r m a x :

    C l e a r r a y s ]

    r a y s r m i n _ , r m a x _ , n r a y s _ ] : =

    B l o c k { r a y p l o t } ,

    r a y p l o t = G r a p h i c s

    T a b l e

    L i n e { { r m i n * C o s n ] , r m i n * S i n n ] } ,

    { r m a x * C o s n ] , r m a x * S i n n ] } } ] ,

    { n , 0 , 2 P i - 2 * P i / n r a y s , 2 * P i / n r a y s }

    ]

    ]

    ]

    A s b e f o r e , t h e o u t p u t o f r a y s s h o u l d b e s a v e d i n a v a r i a b l e :

    r m i n = 0 . 5 ;

    r m a x = 2 ;

    n r a y s = 1 0 ;

    p 2 = r a y s r m i n , r m a x , n r a y s ]

    3 2

  • 8/6/2019 Ma Thematic A Glossary

    33/50

    N o w p r e p a r e a g r a p h o f y o u r f u n c t i o n i n p o l a r c o o r d i n a t e s , u s i n g t h e c o m -

    m a n d P a r a m e t r i c P l o t ( 3 2 ) :

    f t _ ] : = 2 * C o s 3 * t ]

    p 3 = P a r a m e t r i c P l o t { f t ] * C o s t ] , f t ] * S i n t ] } , { t , 0 , 2 * P i } ,

    A s p e c t R a t i o - > A u t o m a t i c , P l o t S t y l e - > R G B C o l o r 0 , 0 , 1 ] ]

    T o s h o w y o u r f u n c t i o n a l o n g w i t h t h e c i r c l e s a n d r a y s t h a t f o r m t h e g r i d , u s e

    t h e c o m m a n d S h o w ( 4 5 ) . D o n ' t f o r g e t t h e o p t i o n A s p e c t R a t i o ( 7 ) s o t h a t

    y o u r p l o t d o e s n ' t c o m e o u t s q u a s h e d :

    S h o w p 1 , p 2 , p 3 , A s p e c t R a t i o - > A u t o m a t i c ]

    Y o u m a y a l s o w a n t t o r e f e r t o t h e d i s c u s s i o n o f t h e o p t i o n G r i d L i n e s ( 2 1 ) ,

    u s e d f o r ( x , y ) g r a p h i c s .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 8 P o l a r P l o t

    T h e P o l a r P l o t c o m m a n d p r o d u c e s a p l o t u s i n g a f o r m u l a o f t h e f o r m

    r = f ( ) : ( 1 3 )

    H e r e , w e a r e u s i n g p o l a r c o o r d i n a t e s , ( r ; ) t o r e p r e s e n t p o i n t s i n t h e p l a n e .

    T h e v a l u e r r e p r e s e n t s t h e r a d i u s o r d i s t a n c e o f a p o i n t f r o m t h e o r i g i n , a n d

    o r t h e t a r e p r e s e n t s t h e a n g l e b e t w e e n t h e x - a x i s a n d t h e l i n e f r o m t h e o r i g i n t o

    t h e p o i n t .

    P o l a r P l o t i s n o t a b u i l t - i n M a t h e m a t i c a c o m m a n d , s o y o u h a v e t o r e q u e s t

    t h a t i t b e r e a d i n . O n e m e t h o d o f d o i n g t h i s u s e s t h e N e e d s c o m m a n d . B e w a r e !

    Y o u m u s t t y p e i n t h e d o u b l e q u o t e s a n d t h e b a c k w a r d q u o t e s e x a c t l y a s t h e y

    a p p e a r h e r e !

    C l e a r f , r , t ]

    N e e d s " G r a p h i c s ` G r a p h i c s ` " ]

    T h e c o m m a n d < < c a n b e u s e d i n s t e a d o f N e e d s . H o w e v e r , e v e r y t i m e i t i s

    i n v o k e d , t h e < < c o m m a n d r e a d s i n a n e w c o p y o f t h e r e q u e s t e d c o m m a n d , a n d

    d o e s n o t w i p e o u t t h e o l d c o p i e s . U s i n g < < t w i c e f o r t h e s a m e c o m m a n d c a n

    c a u s e m e m o r y o r l o g i c p r o b l e m s f o r M a t h e m a t i c a .

    ( * D o n ' t e n t e r t h i s c o m m a n d i f " N e e d s " w o r k e d ! * )

    3 3

  • 8/6/2019 Ma Thematic A Glossary

    34/50

    < < G r a p h i c s ` G r a p h i c s `

    Y o u r t h i r d o p t i o n i s s i m p l y t o d e n e t h e P o l a r P l o t c o m m a n d y o u r s e l f :

    ( * D o n ' t e n t e r t h i s c o m m a n d i f y o u e n t e r e d " N e e d s " * )

    ( * o r " < < " ! * )

    P o l a r P l o t r _ , { t _ , t m i n _ , t m a x _ } ] : =

    P a r a m e t r i c P l o t { r * C o s t ] , r * S i n t ] } , { t , t m i n , t m a x } ,

    A s p e c t R a t i o - > A u t o m a t i c ]

    P o l a r P l o t e x p e c t s a f o r m u l a f o r t h e r a d i u s r i n t e r m s o f t h e a n g l e .

    r t h e t a _ ] : = 2 * t h e t a

    P o l a r P l o t r t h e t a ] , { t h e t a , 0 , 2 0 * P i } ]

    I f M a t h e m a t i c a d i d n o t d r a w a p l o t i n r e s p o n s e t o t h e a b o v e c o m m a n d , t h e n

    y o u h a v e n o t l o a d e d P o l a r P l o t s u c c e s s f u l l y .

    B e c a u s e o f t h e w a y P o l a r P l o t i s d e n e d i n t e r m s o f P a r a m e t r i c P l o t ( 3 2 ) ,

    y o u c a n ' t a d d a n y g r a p h i c s o p t i o n s , s u c h a s R G B C o l o r ( 4 1 ) :

    P o l a r P l o t C o s 3 * t ] , { t , 0 , P i } , P l o t S t y l e - > R G B C o l o r 1 , 0 , 0 ] } ]

    S o i f y o u r e a l l y w a n t a e x i b l e w a y o f d o i n g p o l a r p l o t s , y o u w i l l p r o b a -

    b l y w a n t t o u s e t h e f o u r t h o p t i o n , w h i c h i s n o t t o u s e t h e c l u m s y , i n e x i b l e

    P o l a r P l o t c o m m a n d a t a l l , b u t i n s t e a d , u s e t h e b u i l t - i n c o m m a n d P a r a m e t -

    r i c P l o t ( 3 2 ) :

    r t h e t a _ ] : = C o s 3 * t h e t a ]

    P a r a m e t r i c P l o t { r t ] * C o s t ] , r t ] * S i n t ] } ,

    { t , 0 , P i } , A s p e c t R a t i o - > A u t o m a t i c ,

    P l o t S t y l e - > { R G B C o l o r 1 , 0 , 0 ] } , A x e s - > N o n e ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    3 9 P r i m e

    T h e c o m m a n d P r i m e n ] p r o d u c e s t h e n - t h p r i m e n u m b e r . T h i s c o m m a n d w i l l

    o p e r a t e f a i r l y q u i c k l y f o r n a s l a r g e a s 1 0 0 , 0 0 0 , 0 0 0 .

    C l e a r n ]

    3 4

  • 8/6/2019 Ma Thematic A Glossary

    35/50

    H e r e ' s t h e r s t p r i m e n u m b e r :

    P r i m e 1 ]

    a n d h e r e ' s o n e w a y t o p r i n t o u t t h e r s t 1 0 p r i m e s :

    W a r n i n g : T h i s c o m m a n d w o n ' t w o r k p r o p e r l y i n t h e H T M L v e r s i o n .

    D o {

    P r i n t " n = " , n , " P r i m e n ] = " , P r i m e n ] ] } ,

    { n , 1 , 1 0 } ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    4 0 P r i n t

    I f y o u w a n t t o s e e t h e v a l u e o f a v a r i a b l e , y o u c a n s i m p l y t y p e i t s n a m e . F o r

    m o r e c o m p l i c a t e d o u t p u t , t h e P r i n t c o m m a n d c a n h e l p y o u d i s p l a y o u t p u t l i n e s

    t h a t i n c l u d e v a l u e s a n d t e x t .

    W a r n i n g : T h e o u t p u t o f t h i s c o m m a n d i n t h e H T M L d o c u m e n t w i l l h a v e

    l o s t a l l i t s s p a c e s .

    P r i n t " T h e v a l u e o f P i t o 2 0 p l a c e s i s " , N P i , 2 0 ] ]

    F o r a n o t h e r e x a m p l e o f t h e P r i n t c o m m a n d , s e e t h e D o ( 1 6 ) c o m m a n d .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    4 1 R G B C o l o r

    R G B C o l o r i s a n o p t i o n t h a t m a y b e s p e c i e d i n t h e g r a p h i c s c o m m a n d s L i s t -

    P l o t ( 2 5 ) , P a r a m e t r i c P l o t ( 3 2 ) , P l o t ( 3 3 ) , a n d S h o w ( 4 5 ) .

    I f y o u a r e d r a w i n g t w o c u r v e s o n t h e s a m e p l o t , y o u m a y w a n t t o d r a w t h e m

    i n d i e r e n t c o l o r s , u s i n g t h e R G B C o l o r o p t i o n . T h e t h r e e n u m b e r s y o u s p e c i f y

    f o r e a c h l i n e a r e t h e r e l a t i v e a m o u n t s o f r e d , g r e e n a n d b l u e t o b e u s e d , b e t w e e n

    0 a n d 1 .

    C l e a r f , g , x ]

    f x _ ] : = S q r t 1 - x ^ 2 ]

    g x _ ] : = x

    3 5

  • 8/6/2019 Ma Thematic A Glossary

    36/50

    P l o t { f x ] , g x ] } , { x , 0 , 1 } ,

    P l o t S t y l e - > { R G B C o l o r 1 . 0 0 0 , 0 . 0 0 0 , 0 . 0 0 0 ] ,

    R G B C o l o r 0 . 0 0 0 , 1 . 0 0 0 , 0 . 0 0 0 ] } ]

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    4 2 S a m p l i n g P l o t C o o r d i n a t e s

    I n s o m e c a s e s , y o u m i g h t w a n t M a t h e m a t i c a t o r e p o r t t o y o u t h e c o o r d i n a t e s o f

    s p e c i c l o c a t i o n s i n a p l o t t h a t i t h a s d i s p l a y e d . T h i s i s e a s y t o d o i f y o u f o l l o w

    t h e s e s t e p s :

    M o v e t h e c u r s o r s o t h a t i t l i e s w i t h i n t h e p l o t . T h e c u r s o r s h o u l d l o o k

    l i k e a c i r c l e w i t h a p l u s s i g n i n s i d e i t .

    N o w c l i c k o n c e . T h e c u r s o r s h o u l d c h a n g e , t o l o o k l i k e f o u r a r r o w s .

    N o w h o l d d o w n t h e c o m m a n d k e y . O n t h e M a c i n t o s h , t h i s i s t h e k e y

    w i t h t h e \ a p p l e " a n d \ c l o v e r l e a f " , w h i l e o n t h e P C i t i s t h e C T R L o r

    C o n t r o l k e y . M o v e t h e c u r s o r a r o u n d i n t h e p l o t . Y o u s h o u l d n o t i c e t h a t

    t h e c u r r e n t c o o r d i n a t e s o f t h e c u r s o r s h o w u p i n t h e l o w e r l e f t c o r n e r o f

    y o u r M a t h e m a t i c a w i n d o w .

    N o w y o u c a n c o p y t h e c o o r d i n a t e s o f o n e o r m o r e o f t h e p o i n t s o n t h e g r a p h

    i n t o a d a t a a r r a y . T o d o s o :

    M o v e t h e c u r s o r a r o u n d t h e p l o t , a n d c l i c k o n p o i n t s w h o s e c o o r d i n a t e s

    y o u w a n t .

    R e l e a s e t h e c o m m a n d k e y .

    G o t o t h e E d i t m e n u a n d s e l e c t C o p y .

    M o v e t h e c u r s o r t o a t e x t o r g r a p h i c s c e l l , a n d c l i c k .

    G o t o t h e E d i t m e n u a n d s e l e c t P a s t e .

    Y o u w i l l g e t p a i r s o f c o o r d i n a t e s i n a M a t h e m a t i c a a r r a y f o r m a t . Y o u c a n

    a s s i g n t h i s d a t a t o a m a t r i x o r t a b l e , a n d t h e n m a n i p u l a t e i t a n y w a y y o u l i k e .

    C l i c k h e r e t o r e t u r n t o t h e T a b l e o f C o n t e n t s ( 1 ) .

    4 3 S e q u e n c e s

    W e c a n t h i n k o f a s e q u e n c e a s a n e n d l e s s l i s t o f n u m b e r s , w h o s e v a l u e s a r e

    d e t e r m i n e d b y s o m e r u l e . E a c h n u m b e r i n t h e s e q u e n c e i s c a l l e d a t e r m o f t h e

    s e q u e n c e . W e t h i n k o f t h e t e r m s a s b e i n g n u m b e r e d , s t a r t i n g w i t h t e r m 1 o r

    s o m e t i m e s w i t h t e r m 0 .

    3 6

  • 8/6/2019 Ma Thematic A Glossary

    37/50

    C l e a r { f , f i b , n , v a l u e s }

    S o m e s e q u e n c e s c a n b e d e n e d b y w r i t i n g a f o r m u l a f o r t h e n - t h t e r m .

    I n s u c h a c a s e , a n y p a r t i c u l a r t e r m o f t h e s e q u e n c e c a n b e f o u n d s i m p l y b y

    e v a l u a t i n g t h e f o r m u l a . F o r i n s t a n c e , i f t h e n - t h t e r m i s

    2 n + 1

    n

    , t h e n w e c a n

    s y m b o l i z e t h e g e n e r a l t e r m w i t h a f o r m u l a , a n d n d t h e v a l u e o f , s a y , t h e 1 0 - t h

    t e r m b y e v a l u a t i n g t h e f u n c t i o n t h e r e :

    f n _ ] : = ( 2 * n + 1 ) / n

    f 1 0 ]

    W e c a n u s e M a t h e m a t i c a c o m m a n d s l i k e T a b l e o r e v e n P l o t :

    v a l u e s = T a b l e { n , f n ] } , { n , 1 , 5 } ] ;

    T a b l e F o r m v a l u e s ]

    P l o t { 0 , f n ] } , { n , 1 , 5 } ]

    I t ' s u s u a l l y e a s y f o r M a t h e m a t i c a t o c h e c k t h e l i m i t o f t h e s e q u e n c e , o r e v e n

    t o d i e r e n t i a t e i t , w h e n u s i n g L ' H o p i t a l ' s r u l e .

    L i m i t f n ] , n - > I n f i n i t y ]

    I n s o m e c a s e s , h o w e v e r , w e d o n ' t k n o w a f o r m u l a f o r e a c h t e r m . I n s t e a d , w e

    m a y k n o w a r u l e f o r m a k i n g t h e n e x t v a l u e o f t h e s e q u e n c e f r o m t h e p r e v i o u s

    v a l u e s . A s e q u e n c e d e n e d i n t h i s w a y i s c a l l e d a r e c u r s i v e s e q u e n c e . F o r

    i n s t a n c e , t h e F i b o n a c c i s e q u e n c e i s d e n e d a s f o l l o w s : t h e r s t t w o t e r m s a r e

    0 a n d 1 , a n d e a c h f o l l o w i n g t e r m i s t h e s u m o f t h e t w o p r e v i