Pre-Requisite Knowledge

Functions and Mathematica

In Mathematica,

built-in funcitons and constants all start with a capital letter.  For example, Pi and Sin (for π and sine, respectively).  Square braces enclose the arguments for functions.

You execute a command by pressing Shift-Enter on the regular keyborad or just Enter on the numeric keypad.

Pi

Sin[2 Pi/3]

N[Sin[2 Pi/3]] (* This represents a comment.  Also, the N[] function gives a numerical approximation of exact numbers. *)

users can define their own functions.

Simple functions are created using one of the versions of equality (equals or colon equals).  For now, we will use equals which causes an immediate assignment and evaluation.  Notice, below, that on the left, the independent variable is written as x_ and on the right hand side the independent variable is just x.

myNewFunction[x_]=3 x^2-7  (* A new function is created *)

myNewFunction[3] (* Now we evaluate the function at a value *)

myNewFunction[a+b] (* We don't have to use numbers, but Mathematica doesn't "do" anything with symbols *)
Expand[myNewFunction[a+b]] (* Placing the output of the function in the Expand[] function forces Mathematica to, well, expand everaythgin and collect like terms. *)

More complicated functions are really small programs called Modules (more about these later).

The Four Views of a Function

Recall that a function, let’s call it myFun, is a relation between one set, called the domain, to another set, called the range, where each item in the domain is paired with exactly one item in the range.

Verbal

Take a real number, square it, multiply the result by 3 and subtract 5.

Algebaic

myFun(x) = 3 (x^2)-5.

myFun[x_]=3 x^2-5   (* Again, note that we have 'x_' on the left, and just 'x' on the right. Also, the operation of multiplication can be indicated by a space or the typical '*' symbol. Exponents are written using '^'. *)

Numerical

Here we’ll use the Table[] command to create a table of ordered pairs.  This generates a list of lists.  In Mathematica, a list is created by using curly braces {}.  Each ordered pair is actually a list, {x, y}.  The ordered pairs become a list of lists by the outside curly braces.

Table[{x, myFun[x]}, {x, -2,2}]

It looks a little complicated.  A more familiar view of the data can be constructed by also using the TableForm[] command.

TableForm[
Table[{x, myFun[x]}, {x, -2,2}]
]

We can do better by adding some column headings so that we know what we just created.

TableForm[
Table[{x, myFun[x]}, {x, -2,2}],
TableHeadings->{None,{"x","y = myFun(x)"}}    (* No Row labels, but do use column labels. *)
]

Or even nicer, we can have: (Please do this)

TableForm[
Table[{x, myFun[x]}, {x, -2,2}],
TableHeadings->{None,{"x",Row[{"y = ", myFun[x]}]}} ,   (* No Row labels, but do use column labels. Include the actual function used *)
TableAlignments->Center  (* Let's go ahead and center vertically *)
]

Graphical

The last view of a function is graphical.

Plot[myFun[x], {x, -2, 2}]

Again, not very exciting.  Don’t ever give me something so very boring.

Plot[
myFun[x], {x, -2,2} ,(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", "y"} (* Yes, you should label the axes *)
]

What if you want to include the function, like “y =  3 (x^2)-5” automatically?  Include the Row[] command in your axes label.  So, all you have to do is change the “myFun(x)” to another function and it will automatically label things correctly for you.  I like this.

Plot[
myFun[x], {x, -2,2} ,(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y = ", myFun[x]}]} (* Yes, you should label the axes *)
]

What about multiple functions?  Here is what I’d like you to do.  Use the PlotLegends[] command.  Also, we update the PlotStyle option to contain options for each function.  This requires a list of lists!

myFun2[x_]=4 Cos[3 x]

Plot[
{myFun[x],myFun2[x]}, {x, -2,2} ,(*Notice that two functions plotted together becom a list. This is the function being plotted and the domain to use *)
PlotStyle->{{Blue, Thick},{Red,Thick}}, (* Notice that you need a list of lists! *)
AxesLabel->{"x", "y"}, (* Yes, you should label the axes *)
PlotLegends->"Expressions" (* This will generate a legend for the graph *)
]

Of course, if you don’t have a color printer, then you should do the following.

Plot[
{myFun[x],myFun2[x]}, {x, -2,2} ,(*Notice that two functions plotted together becom a list. This is the function being plotted and the domain to use *)
PlotStyle->{{Blue, Thick},{Red,Dashed,Thick}}, (* Notice that you need a list of lists! *)
AxesLabel->{"x", "y"}, (* Yes, you should label the axes *)
PlotLegends->"Expressions" (* This will generate a legend for the graph *)
]

To plot points (easily) on top of a graph of a function, please use the Epilog option.  The Epilog option does “something” (in this case plotting points) at the end. This way it appears that we have placed points on top of the graph.  The command Point[], which takes a list of points (i.e. a list of lists!), and the option PointSize[] (how big are these points?) are used.

myPoints = Table[{x, myFun[x]}, {x, -2,2,0.5}] (* We need some points to plot.  Note that I included "0.5" in the domain for x.  This indicates that we start at -2 and increase by 0.5 until we reach 2. *)

Plot[
myFun[x], {x, -2,2} ,(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y = ", myFun[x]}]}, (* Yes, you should label the axes *)
Epilog->{PointSize[Large],Point[myPoints]} (* Here it is. We use the command Point[] and option PointSize[] to generate our points *)
]

Finally, sometimes it is nice to show the table, the graph, and plotted points all together.  Here’s one way to do that. Notice that I use a semi-colon after each statement.  This keeps Mathematica from generating any output.

Here we’re doing several new things.  In Mathematica, we can save any output, even a plot! So, the first few lines generate output (which is suppressed via the semi-colon) that is saved for later use.  The command GraphicsGrid allows us to place most anything into a grid.  It takes a list of lists, the inner lists correspond to rows of objects.  In this example, the inner list (there is only one of them here...) contains two objects, a formatted table and a plot.  This is a very convenient way to combine multiple plots/objects together!

myFun2[x_]=Expand[(x-2)(3-x)(x+1)];
myPtsTogether = Table[{x, myFun2[x]},{x, {-1,0,2,3}}]; (* Just the intercepts! *)
myPtsAsATable=TableForm[
myPtsTogether,
TableHeadings->{None,{"x",Row[{"y = ", myFun2[x]}]}} ,   (* No Row labels, but do use column labels. Include the actual function used *)
TableAlignments->Center  (* Let's go ahead and center vertically *)
];
myPlotTogether=Plot[
myFun2[x], {x, -1.125,3.5} ,(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y = ", myFun2[x]}]}, (* Yes, you should label the axes *)
Epilog->{PointSize[Large],Point[myPtsTogether]} (* Here it is. We use the command Point[] and option PointSize[] to generate our points *)
];
GraphicsGrid[{
{myPtsAsATable, myPlotTogether}
},
ImageSize->600]

More Graphing of Functions -- Transformations

Consider a function f(x) and choose real numbers a, b, c, and d.  We can use these numbers to transform the graph of f by considering the graph of y=a f(b x+c)+d.  So, what happens?  We use Mathematica’s Manipulate[] command to find out.  Notice that 5 points are always plotted on the graph to help you see how the transformations change the graph.  You’ll notice that the code is hidden for this example.  It is a little more complicated...user beware!

transformF[x_]=x^2;
Manipulate[
(* Always plot 5 points - these points are transformed along with the function *)
start = (-2-c)/b;
stop = (2-c)/b;
step = (stop-start)/4;
myPoints = Table[{x,a transformF[b x+c]+d}, {x, start, stop,step}];
(* Plot the function *)
Plot[
a transformF[b x+c]+d,
{x, start, stop},
PlotRange->{{-8.5,8.5}, {-10.5,10.5}}, (* This controls our viewing window *)
Epilog->{PointSize[Medium], Point[myPoints]}
],
(* Below are the variables we can change *)
Style["Controls",12, Bold], 
Delimiter,(* Just makes a line between controls *)
{{a,1}, {-2,-1,-0.5,0.5,1,2}}, (* a starts at 1 and has values -2, -1, -0.5, 0.5, 1, or 2 *)
{{b, 1},{-2,-1,-0.5,0.5,1,2}}, (* b starts at 1 and has values -2, -1, -0.5, 0.5, 1, or 2 *)
Delimiter,
{{c,0},-2,2, Appearance->"Labeled"}, (* c starts at 0 and varies continuously from -2 to 2 *)
{{d,0},-2,2, Appearance->"Labeled"}, (* d starts at 0 and varies continuously from -2 to 2 *)
Delimiter,
(* The basic function used *)
Style["Basic Function", 12, Bold],
Style[Row[{"y = ", transformF[x]}], 12],
Delimiter,
(* This updates the transformation of the basic function *)
Style["Transformed Function, y = a f(b x + c) + d", 12, Bold],
Dynamic[Style[Row[{"y = ", a transformF[b x+c]+d}], 12]],
ControlPlacement->Left
]

transformF2[x_]=Sqrt[x];
Manipulate[
(* Always plot 5 points - these points are transformed along with the function *)
start = (0-c)/b;
stop = (4-c)/b;
step = (stop-start)/4;
myPoints = Table[{x,a transformF2[b x+c]+d}, {x, start, stop,step}];
(* Plot the function *)
Plot[
a transformF2[b x+c]+d,
{x, start, stop},
PlotRange->{{-12.5,12.5}, {-6.5,6.5}}, (* This controls our viewing window *)
Epilog->{PointSize[Medium], Point[myPoints]}
],
(* Below are the variables we can change *)
Style["Controls",12, Bold], 
Delimiter,(* Just makes a line between controls *)
{{a,1}, {-2,-1,-0.5,0.5,1,2}}, (* a starts at 1 and has values -2, -1, -0.5, 0.5, 1, or 2 *)
{{b, 1},{-2,-1,-0.5,0.5,1,2}}, (* b starts at 1 and has values -2, -1, -0.5, 0.5, 1, or 2 *)
Delimiter,
{{c,0},-2,2, Appearance->"Labeled"}, (* c starts at 0 and varies continuously from -2 to 2 *)
{{d,0},-2,2, Appearance->"Labeled"}, (* d starts at 0 and varies continuously from -2 to 2 *)
Delimiter,
(* The basic function used *)
Style["Basic Function", 12, Bold],
Style[Row[{"y = ", transformF2[x]}], 12],
Delimiter,
(* This updates the transformation of the basic function *)
Style["Transformed Function, y = a f(b x + c) + d", 12, Bold],
Dynamic[Style[Row[{"y = ", a transformF2[b x+c]+d}], 12]],
ControlPlacement->Left
]

Polynomials

Recall that a polynomial has the form

({{({{p(x) = (Subscript[a, n])(x^n)+(Subscript[a, n-1])}})(x^(n-1))+⋯+(Subscript[a, 1])x+(Subscript[a, 0])}})

provided that (Subscript[a, n])≠0.  The domain is all real numbers.

There is also the notion of a power function, namely y=c (x^n), where c is not zero, and n is any real number.  The command GraphicsGrid[] is used to gather six different plots into a three by two grid (or matrix).  If you dig through the code, you’ll see a couple of Epilog statements which use InfiniteLine[].  The InfiniteLine[] command is used to create the asymptotes.  Please use this where appropriate.  Mathematica will often try to create vertical (not slant or horizontal) asymptotes at exclusion points.  You can turn this behavior off by using the Exclution command.  You give it an equation where the problem occurs and Mathematica will ignore those x values. (You guessed it, the following is a slightly more complicated example of GraphicsGrid.)

GraphicsGrid[
{
{ (* Row one *)
(* First plot on row 1 *)
Plot[2, {x, -2,2},(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Style["Constant: y = c", Bold,14]}, (* Yes, you should label the axes *)
Ticks->None (* No tick marks *)
],
(* Second plot on row 1 *)
Plot[x, {x, -2,2},(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Style["Linear: y = x", Bold,14]}, (* Yes, you should label the axes *)
Ticks->None (* No tick marks *)
]
},
{ (* Row two *)
(* First plot on row 2 *)
Plot[x^2, {x, -2,2},(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Style[Row[{"EVEN power: y = ",x^(n)}], Bold,14]}, (* Yes, you should label the axes *)
Ticks->None (* No tick marks *)
],
(* Second plot on row 2 *)
Plot[x^(-2), {x, -2,2},(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Style[Row[{"EVEN power > 1: y = ",x^(-n)}], Bold,14]}, (* Yes, you should label the axes *)
Ticks->None, (* No tick marks *)
Exclusions->{x==0}, (* Yup, we have a domain problem at x = 0 *)
Epilog->{
{Red,Dashed,Thick,InfiniteLine[{{0,0},{0,1}}]}, (* Vertical asymptote...two points are needed to make a line! *)
{Red,Dashed,Thick,InfiniteLine[{{0,0},{1,0}}]}  (* Horizontal asymptote...two points are needed to make a line! *)
}
]
},
{ (* Row three *)
(* First plot on row 3 *)
Plot[x^3, {x, -2,2},(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Style[Row[{"ODD power > 1: y = ",x^(n)}], Bold,14]}, (* Yes, you should label the axes *)
Ticks->None (* No tick marks *)
],
(* Second plot on row 3 *)
Plot[x^(-3), {x, -2,2},(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Style[Row[{"ODD power: y = ",x^(-n)}], Bold,14]}, (* Yes, you should label the axes *)
Ticks->None ,(* No tick marks *)
Exclusions->{x==0}, (* Yup, we have a domain problem at x = 0 *)
Epilog->{
{Red,Dashed,Thick,InfiniteLine[{{0,0},{0,1}}]}, (* Vertical asymptote...two points are needed to make a line! *)
{Red,Dashed,Thick,InfiniteLine[{{0,0},{1,0}}]}  (* Horizontal asymptote...two points are needed to make a line! *)
}
]
}
},
PlotLabel->Style["The Power Functions", Bold, 18],
ImageSize->600 (* Make everything a bit bigger *)
]

Lines

Some common properties we all should remember.

m represents the slope of the line.  Recall that given two points ((Subscript[x, 0]),(Subscript[y, 0])) and ((Subscript[x, 1]),(Subscript[y, 1]))

({{({{m=(Rise/Run)=(((Subscript[y, 1])-(Subscript[y, 0]))/((Subscript[x, 1])-(Subscript[x, 0])))}, {y-(Subscript[y, 0])=m (x-(Subscript[x, 0]))   (Point-Slope Form)}})}})

Given the slope m and y-intercept b, we know

({{({{y=m x + b    (Slope-Intercept Form)}})}})

Factoring Polynomials

For a polynomial, we often want to write it in factored form

({{({{p(x)=c (((x-(Subscript[r, 1])))^(Subscript[m, 1]))}}) (((x-(Subscript[r, 2])))^(Subscript[m, 2]))⋯ (((x-(Subscript[r, k])))^(Subscript[m, k])).}})

Each of the (Subscript[r, 1]), (Subscript[r, 2]),…,(Subscript[r, k]) are the zeros or roots or x-intercepts of the polynomial.

The (Subscript[m, 1]), (Subscript[m, 2]),…,(Subscript[m, k]) represents the multiplicity of the root.  When sketching a graph, an even multiplicity indicates that you “bounce” at the corresponding x-intercept and at an odd multiplicity you “cross” at the corresponding x-intercept.

The degree of the polynomial is d= (Subscript[m, 1]) (Subscript[m, 2])⋯ (Subscript[m, k]).  When sketching the graph, the degree determines the end behavior or overall shape of the graph.  See one of the figures above!

For quadratic functions f(x)=a (x^2)+b x+c, we can always find the roots by using the quadratic formula

({{({{x=((-b±(Sqrt[(b^2)-4 a c]))/(2 a))}}).}})

Recall that the descriminant (b^2)-4 a c determines the kind and number of roots.

({{({{(b^2)-4 a c>0   Then there are two real roots}, {(b^2)-4 a c=0   Then there is only one (repeated) root}, {(b^2)-4 a c<0   Then there are two complex roots}})}})

For cubic and quartic (degrees 3 and 4, respectively) there are also formulas for determining the roots.  They are, however, a bit messy.

For quintic and higher (degree 5 or higher), there is no general formula for determining the roots.

However, Mathematica is nice and gives us a Factor[] command, which is only useful when it can be factored using integers (OK, tiny lie here, but you really don’t want to know about the hoops you have to jump through to extend this past integers!)

Factor[-5+14 x-8 (x^2)]  (* Factors nicely *)

Factor[-2000+4600 x-4085 (x^2)+1737 (x^3)-351 (x^4)+27 (x^5)]  (* This one works too *)

Factor[2 x^2-3x+5] (* Indicates a failure to factor over the integers *)

When Factor[] fails, you need to try Solve[].  This tries to find the roots of the polynomial.  Note that you need to feed Solve[] an equation and tell it which variable to solve.  In Mathematica, a single = indicates assignment and a double equal, ==, indicates an equation.

Solve[2 x^2-3x+5==0,x]  (* The "real" problem that Factor[] had is that the roots are complex numbers. *)

Solve[-5+14 x-8 (x^2)==0,x]

Solve[-2000+4600 x-4085 (x^2)+1737 (x^3)-351 (x^4)+27 (x^5)==0,x]

Solve[x^4-4==0,x]  (* Two real roots, and two complex roots *)

One option that is nice is Reals:

Solve[x^4-4==0,x, Reals]  (* Thus, Mathematica only returns the real roots *)

Solve[a x^2+b x+c==0,x] (* Yup, it knows the quadratic formula *)

Solve[a x^3+b x^2+c x+d==0,x]  (* Execute this line for the cubic formula *)

Solve[a x^4+b x^3+c x^2+d x+e==0,x]  (* Execute this line for the quartic formula *)

Trigonometric Functions

The six trigonometric functions can be defined in several different ways.

Triangle based definitions

Graphics[{
{EdgeForm[{Thick,Blue}],White,Polygon[{{0,0},{4,0},{4,2}}]},
Line[{{3.95,0.2},{3.8,0.2},{3.8,0.05}}],
Text[Style[Ant,Medium],{2,-0.25}],
Text[Style[Bat,Medium],{4.25,1}],
Text[Style[Cat,Medium],{2,1.25}],
Text[Style[θ,Medium],{0.6,0.125}],
Text[Style[sin[θ]==(Bat/Cat), Medium],{5.5,2}],
Text[Style[cos[θ]==(Ant/Cat), Medium],{5.5,1}],
Text[Style[tan[θ]==(Bat/Ant), Medium],{5.5,0}],
Text[Style[csc[θ]==(Cat/Bat)==(1/(sin[θ])), Medium],{7.5,2}],
Text[Style[sec[θ]==(Cat/Ant)==(1/(cos[θ])), Medium],{7.5,1}],
Text[Style[cot[θ]==(Ant/Bat)==(1/(tan[θ])), Medium],{7.5,0}]
},
ImageSize->600]

Circlular based definitions are based upon a unit circle. Note that there are some domain restrictions...we can never divide by zero!  So, be careful with tangent, cosecant, secant, and cotangent because their denominator is sometimes zero!

Graphics[{
{Black, Thick,Circle[{0,0},2]},
Line[{{-2.3, 0}, {2.3, 0}}],
Line[{{0,-2.25}, {0,2.25}}],
{Blue,Thick,Line[{{0,0},{2 Cos[5 Pi/6],2Sin[5 Pi/6]}}]},
{Blue,Thick,Dashed,Line[{{2 Cos[5 Pi/6],0},{2 Cos[5 Pi/6],2Sin[5 Pi/6]}}]},
{Blue,PointSize[Large], Point[{{2 Cos[5 Pi/6],2Sin[5 Pi/6]}}]},
Line[{{2 Cos[5 Pi/6]+0.05,0.2},{2 Cos[5 Pi/6]+0.2,0.2},{2 Cos[5 Pi/6]+0.2,0.05}}],
{Red,Dashed,Circle[{0,0},0.35,{0,5 Pi/6}]},
Text[Style[θ,Medium,Red],{0.15,0.45}],
{Darker[Brown],Dashed,Circle[{0,0},0.35,{5 Pi/6,Pi}]},
Text[Style[α,Medium,Darker[Brown]],{-0.45,0.09}],
Text[Style[1,Medium,Blue],{-1,0.7}],
Text[Style["x = cos(θ)",Medium,Blue],{-1,-0.2}],
Text[Style["y = sin(θ)",Medium,Blue],{-1.35,0.35}],
Text[Style["(x, y)",Medium,Blue],{2 Cos[5 Pi/6]-0.15,2Sin[5 Pi/6]+0.15}],
Text[Style[sin[θ]==y, Medium],{3,1}],
Text[Style[cos[θ]==x, Medium],{3,0}],
Text[Style[tan[θ]==(y/x), Medium],{3,-1}],
Text[Style[csc[θ]==(1/y)==(1/(sin[θ])), Medium],{4.5,1}],
Text[Style[sec[θ]==(1/x)==(1/(cos[θ])), Medium],{4.5,0}],
Text[Style[cot[θ]==(x/y)==(1/(tan[θ])), Medium],{4.5,-1}]
},
ImageSize->600
]

Note that α is called a reference angle and is inside a reference triangle. Given 0≤θ≤2 π, you should do one of the following:

({{({{θ in Quadrant I:  α=θ}, {θ in Quadrant II:  α=π-θ}, {θ in Quadrant III:  α=θ-π}, {θ in Quadrant IV:  α=2π-θ}})}})

Also, remember that there are two “special” triangles which are related to the unit circle through the reference angle, usually called α.  These help you label your triangle in the unit circle when α=(π/6), (π/4), or (π/3) (i.e (30^∘), (45^∘), or  (60^∘), respectively).

You need to know the unit circle.    If you want to be slightly horrified, then look at the code which generates and labels the unit circle.

myAngles = Table[i, {i, {0, Pi/6, Pi/4, Pi/3, Pi/2,2 Pi/3, 3 Pi/4, 5 Pi/6, Pi, 7 Pi/6, 5 Pi/4, 4 Pi/3, 3 Pi/2, 5 Pi/3, 7 Pi/4, 11 Pi/6}}];
pts=Table[{2 Cos[ θ], 2 Sin[ θ]}, {θ,{ 0, Pi/6, Pi/4, Pi/3, Pi/2,2 Pi/3, 3 Pi/4, 5 Pi/6, Pi, 7 Pi/6, 5 Pi/4, 4 Pi/3, 3 Pi/2, 5 Pi/3, 7 Pi/4, 11 Pi/6}}];
pts2=Table[{1.5 Cos[ θ], 1.5Sin[ θ]}, {θ,{ 0, Pi/6, Pi/4, Pi/3, Pi/2,2 Pi/3, 3 Pi/4, 5 Pi/6, Pi, 7 Pi/6, 5 Pi/4, 4 Pi/3, 3 Pi/2, 5 Pi/3, 7 Pi/4, 11 Pi/6}}];
pts3=Table[{2.5 Cos[ θ],2.5 Sin[ θ]}, {θ,{ 0, Pi/6, Pi/4, Pi/3, Pi/2,2 Pi/3, 3 Pi/4, 5 Pi/6, Pi, 7 Pi/6, 5 Pi/4, 4 Pi/3, 3 Pi/2, 5 Pi/3, 7 Pi/4, 11 Pi/6}}];
Show[
Graphics[{Black, Thick,Circle[{0,0},2]}],
Graphics[{PointSize[Large],Point[pts]}],
Graphics[Line[{{-2.3, 0}, {2.3, 0}}]],
Graphics[Line[{{0,-2.25}, {0,2.25}}]],
Graphics[Line[{{0,0}, pts[[2]]}]],
Graphics[Line[{{0,0}, pts[[3]]}]],
Graphics[Line[{{0,0}, pts[[4]]}]],
Graphics[Line[{{0,0}, pts[[6]]}]],
Graphics[Line[{{0,0}, pts[[7]]}]],
Graphics[Line[{{0,0}, pts[[8]]}]],
Graphics[Line[{{0,0}, pts[[10]]}]],
Graphics[Line[{{0,0}, pts[[11]]}]],
Graphics[Line[{{0,0}, pts[[12]]}]],
Graphics[Line[{{0,0}, pts[[14]]}]],
Graphics[Line[{{0,0}, pts[[15]]}]],
Graphics[Line[{{0,0}, pts[[16]]}]],
Table[
Graphics[
Text[
StyleForm[
StringForm[" (``, ``) ", pts[[i]][[1]]/2, pts[[i]][[2]]/2]
, FontSize->16
], 
pts3[[i]], Background->White
]
],
{i,1,16}
],
Table[
Graphics[
If[myAngles[[i]]==Pi/2 || myAngles[[i]]==Pi || myAngles[[i]]==3 Pi/2,
Text[
StyleForm[
StringForm[" ((``)^∘), `` ", 180/Pi  myAngles[[i]],myAngles[[i]]],
FontSize->16], 
pts2[[i]], Background->White
],
If[myAngles[[i]]>Pi/2 && myAngles[[i]] < 3 Pi/2,
Rotate[Text[
StyleForm[
StringForm[" ((``)^∘), `` ", 180/Pi  myAngles[[i]],myAngles[[i]]],
FontSize->16], 
pts2[[i]], Background->White
] ,myAngles[[i]]-Pi
],
Rotate[Text[
StyleForm[
StringForm[" ((``)^∘), `` ", 180/Pi  myAngles[[i]],myAngles[[i]]],
FontSize->16], 
pts2[[i]], Background->White
] ,myAngles[[i]]
]
]
]
],
{i, 1,16}
],
ImageSize->700
]

Go back and look at identities. A few you should know are the Pythagorean Identities, Sum/Difference Identities, and Double Angle Identities.

Using Mathematica.

Sin[5 Pi/6]
Cos[5 Pi/6]
Tan[7 Pi/6]
Cot[Pi]  (* This one is undefined...Mathematica reports it as "ComplexInfinity" *)

Graphing -- I’ll show you a few and you should really figure out the rest!

Plot[
Sin[x], {x, -2 Pi,2 Pi} ,(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y = sin(x)"}]} (* Yes, you should label the axes *)
]

Uh oh.  This is not how we normally label the tick-marks on our axes.  Where are all the πs?  We need to use Ticks->{{x labels}, {y labels}} to help up out.

Plot[
Sin[x], {x, -2 Pi,2 Pi} ,(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y = sin(x)"}]},(* Yes, you should label the axes *)
Ticks->{{-2 Pi, -3Pi/2,-Pi,-Pi/2,0,Pi/2,Pi,3Pi/2,2Pi},{-1,1}}  (* x-labels and y-labels *)
]

Again, we should probably combine our views of functions to deepen our understanding.  I usually plot the “5 Interesting Points/Features”.  So, here goes.

xLabelsForSin=Table[p, {p, 0, 2 Pi, Pi/2}]; (* Create the x-labels *)
myFivePoints=Table[{i, Sin[i]}, {i, {0, Pi/2, Pi, 3 Pi/2, 2 Pi}}]; (* These vary if certain shifts occur! *)
myFivePointsAsTable=TableForm[
myFivePoints,
TableHeadings->{None,{"x",Row[{"y = ", Sin[x]}]}} ,   (* No Row labels, but do use column labels. Include the actual function used *)
TableAlignments->Center  (* Let's go ahead and center vertically *)
];
mySinPlot=Plot[
Sin[x], {x, 0,2 Pi} ,(* This is the function being plotted and the domain to use *)
PlotStyle->{Blue, Thick}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y = sin(x)"}]}, (* Yes, you should label the axes *)
Ticks->{xLabelsForSin, {-1,1}}, (* We can use a Table command to generate the labels!!!! *)
Epilog->{PointSize[Large],Point[myFivePoints]} (* Here it is. We use the command Point[] and option PointSize[] to generate our points *)
];
GraphicsGrid[{
{myFivePointsAsTable, mySinPlot}
},
ImageSize->Large]

Plot[
{Sin[x],Csc[x]}, {x, -0.01,2 Pi+0.01} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Red, Dashed},{Blue, Thick}}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y = csc(x)"}]} ,(* Yes, you should label the axes *)
Ticks->{xLabelsForSin,{ -4,-2,2,4}}, (* Nice labels...*)
PlotLegends->"Expressions",(* This will generate a legend for the graph *)
Exclusions->{Sin[x]==0}, (* Whenever sin(x) = 0, we have an asymptote! *)
ExclusionsStyle->Directive[Blue, Dashed,Thick] (* This is similar to using Epilog and InfiniteLine to draw asymptotes. This will only be helpful with Vertical Asymptotes. *)
]

One thing to notice is that I widened the domain slightly so that the asymptotes on either end would show.

Solving Trigonometric Equations

Now, to solve cos(x)=((-1)/2), we need to find a reference angle, α, determine which quadrants (in this case we’re in 2 and 3) so that we can solve it over one period, and then add 2 k π to generate all soltions.  Note that Mathematica will do all of this for you...more or less.

Solve[Cos[x]==-1/2,x]

Notice that we have the 2 k π, it is written as 2 π C[1].  However, it did not solve over 0 to 2π.  However, the solutions are equivalent.  Hint:  try plotting ((2π)/3) and -((2π)/3) along with the solutions over 0 to 2π (they are ((2π)/3) and ((4π)/3).)

Solve[Cos[x]==Sin[x],x]

This next one is interesting...Solve[] fails to find a solutions.

Solve[Cos[x]==x,x]

The graph clearly indicates that there is exacly one solution.

Plot[{Cos[x],x}, {x, -Pi,Pi} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Red, Thick},{Blue, Thick}}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y"}]} ,(* Yes, you should label the axes *)
PlotLegends->"Expressions"
]

We can turn to FindRoot[] (Numerical approximation to a solution) to approximate the solution.  Based on the graph, I think the root is “near” x=1.  So, I feed that as my initial guess.

FindRoot[Cos[x]==x,{x,1}]

Let’s check by plotting the point (0.7390851332151607`, 0.7390851332151607`) on the graph.  Looks good.

Plot[{Cos[x],x}, {x, -Pi,Pi} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Red, Thick},{Blue, Thick}}, (* There are lots of colors and styles to choose from *)
AxesLabel->{"x", Row[{"y"}]} ,(* Yes, you should label the axes *)
PlotLegends->"Expressions",
Epilog->{PointSize[Large], Point[{{0.7390851332151607`,0.7390851332151607`}}]}
]

A word of caution about FindRoot...it only finds ONE root “close” to the initial guess.  Graphing is quite important when approximating roots!

Solve[x^2==4,x]  (* Solve reports exact answers for both roots *)
FindRoot[x^2==4,{x,1}] (* FindRoot only finds (approximation to) the Nearest root *)

Plot[{x^2,4}, {x, -2.5,2.5} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Red, Thick},{Blue, Thick}}, (* There are lots of colors and styles to choose from *)
PlotLabel->Style["Solutions to (x^2) = 4",18,Bold], (* Here we give an overall title to the graph *)
AxesLabel->{"x", "y"} ,(* Yes, you should label the axes *)
PlotLegends->"Expressions",
Epilog->{PointSize[Large], Point[{{-2,4}, {2, 4}}]}
]

Inverse Functions

Basic Ideas

Recall that a function maps one set (called the domain) to another (called the range) with the restriction that no element in the domain maps to more than one element in the range.  However, this does not say that elements in the range can’t be reused.  The very special case where we have a function which uses every element in the range excactly once is said to be one-to-one and has an inverse.

Note that two functions, f, and g, are called inverses if f(g(x))=x  for all x in the domain of g, and at the same time, g(f(x))=x  for all x in the domain of f.

You might recall that (x^3) and (x^(1/3)) (use CubeRoot[x] rather than (x^((1/3))) to avoid some odd issues...) are inverses of each other.

CubeRoot[x]^3//FullSimplify
CubeRoot[x^3]//FullSimplify

The graphical concept of testing whether or not a function is 1-1 is best illustrated by the horizontal line test:  If any horizontal line crosses the graph of a function in more than one point, then the function is not 1-1.  Consequently, if every horizontal line intersects the graph of a function in at most one point, then the function is 1-1 and hence, has an inverse.

GraphicsGrid[{
{
Plot[{x^2,-1,0,1,2.5,4}, {x, -2.5,2.5} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Blue, Thick},{Red, Thick},{Red, Thick},{Red, Thick},{Red, Thick},{Red, Thick}}, (* There are lots of colors and styles to choose from *)
PlotLabel->Style["Not One-To-One",18,Bold], (* Here we give an overall title to the graph *)
AxesLabel->{"x", "y"} (* Yes, you should label the axes *)
],
Plot[{x^3,-12,-6,0,6,10}, {x, -2.5,2.5} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Blue, Thick},{Red, Thick},{Red, Thick},{Red, Thick},{Red, Thick},{Red, Thick}},
PlotLabel->Style["Is One-To-One",18,Bold], (* Here we give an overall title to the graph *)
AxesLabel->{"x", "y"} (* Yes, you should label the axes *)
]
}
},
ImageSize->800]

You might recall that (x^3) and (x^(1/3)) (use CubeRoot[x] rather than (x^((1/3))) to avoid some odd issues...) are inverses of each other. One interesting propert of inverse functions is that they are a reflection across the line y=x.

Plot[{x^3,CubeRoot[x], x}, {x, -2,2} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Red, Thick},{Blue, Thick}, {Darker[Green], Dashed}}, (* There are lots of colors and styles to choose from *)
PlotLabel->Style["Inverse Functions",18,Bold], (* Here we give an overall title to the graph *)
AxesLabel->{"x", "y"} ,(* Yes, you should label the axes *)
PlotRange->2, (* Step two steps in all directions *)
AspectRatio->Automatic,(* Gives us a "square" plot with axes tickmarks evenly spaced *)
PlotLegends->"Expressions"
]

Trigonometric Inverses

Mathematica provides the following inverse trigonometric functions which take as their domain numbers and returns angles in radian measure: ArcSin[], ArcCos[], ArcTan[], ArcCsc[], ArcSec[], and ArcCot[].  Remember, when defining inverse trigonometric functions, we first placed restrictions on the regular trigonometric functions (Sin[], Cos[], etc) to force them to be one-to-one functions.  So, I recommend that you check remember the various domains/ranges of all 12 functions (and any restrictions which need to occur).

Exponential and Logarithmic Functions

Basic Ideas

In Mathematica, the exponential function (e^x) is calculated by Exp[x] and the Natural Logarithm is Lox[x].  Note that this is a departure from most textbooks which define Log[x] to be the base 10 logarithm rather than the base e logarithm.  To calculate logarithms using other bases, use Log[x, b].

Exp[2] (* Exact answer *)
N[Exp[2]] (*Approximate answer *)
Log[2] (* Exact answer *)
N[Log[2]] (*Approximate answer *)
Log[2, 6] (*Exact answer, base 6...notice the use of the change of base formula. *)
N[Log[2, 6]](*Approximate answer, base 6*)

Note that the exponential function (e^x) and natural logarithm are inverses of each other.

Plot[{Exp[x],Log[x], x}, {x, -2,2} ,(* This are the functions being plotted and the domain to use *)
PlotStyle->{{Red, Thick},{Blue, Thick}, {Darker[Green], Dashed}}, (* There are lots of colors and styles to choose from *)
PlotLabel->Style["Inverse Functions",18,Bold], (* Here we give an overall title to the graph *)
AxesLabel->{"x", "y"} ,(* Yes, you should label the axes *)
PlotRange->2, (* Step two steps in all directions *)
AspectRatio->Automatic,(* Gives us a "square" plot with axes tickmarks evenly spaced *)
PlotLegends->"Expressions"
]