Off[General::spell1];
Needs["Graphics`Colors`"];

(* To do our induction proof we need to force 
Mma to expand some forms a particular way. 
These expansions are of course completely obvious 
but unfortuneately they are not in Mma's standard 
bag of tricks.*)
 
Unprotect[Times,Sin,Expand];
n_*(n_-1)!:=n!
Expand[a_*Sin[(n_+1)*x_]]:=Expand[
			a*Cos[n*x]*Sin[x] + a*Cos[x]*Sin[n*x]]
Protect[Times,Sin,Expand];

Polynomial basics

In this notebook we review the most basic facts about polynomials.

The main Mathematica  functions used are Plot, Reduce and Factor.

?Plot

?Reduce

?Factor

Polynomials and their zeros

A polynomial is a function f:ℝ-> ℝ of the form 
		f(x)=(Subscript[a, 0])+ (Subscript[a, 1])x+(Subscript[a, 2])(x^2)+...+(Subscript[a, n])(x^n).
For Mathematica  input, subscripts and superscripts are a bit tricky, 
so we write a[k] instead of (Subscript[a, k]), and x^k for (x^k), the k-th power of x.

For example, here is the definition of a polynomial called polly:

polly[x_] := -6 + 11x - 6x^2 + x^3

When you give the function polly a number x as input it calculates -6 + 11x - 6(x^2) + (x^3) and returns the value as output.  For example, polly[0] is -6.

You can check your answers by putting the appropriate number between [ and ] in the next input cell below.

polly[.5]

In fact, it is easy to get Mathematica to produce a list of {input,output} pairs for polly:

Table[{k,polly[k]},{k,-4,4}]

The same list of {input,output} pairs can also be displayed neatly as a table:

Table[{k,polly[k]},{k,-4,4}] // TableForm

Mathematica will also make pictures of polly.  
Before entering the next input cell, think carefully about what you expect the graph to look like.

Plot[polly[x],{x,-3,5}]

The x-coordinates of the three points where the graph cuts the x-axis are the zeros of polly.  
They are the solutions of the equation polly[x]==0.  Mathematica  is able to solve this equation:

Reduce[polly[x]==0]

You should know enough about polynomials to be able to guess the answer to the following question:

Factor[polly[x]]

myPolly1[x_] := (x+$$$)(x-$$$)

Plot[myPolly1[x],{x,-3,5}]

myPolly2[x_] := x^2-$$$

Plot[myPolly2[x],{x,-3,5}]

Pictures of polly

Here is one picture of polly:

Plot[polly[x],{x,-5,5}]

There are two problems with this picture:
	• the scales on the two axes are not the same, and
	• not all of the values of polly[x] with x between -5 and 5 are displayed.
Both problems can be fixed.

We can make the scales on the axes the same:

Plot[polly[x],{x,-5,5},AspectRatio->Automatic]

And we can force all the values of polly[x] with x between -5 and 5 to be displayed:

Plot[polly[x],{x,-5,5},PlotRange->All]

If you try to fix both problems at once you will get a picture that is not very useful.  
Can you see why?

Plot[polly[x],{x,-5,5},
     PlotRange->All,
     AspectRatio->Automatic]

It may also be useful to look at polly in the large; but we pay the price of losing fine detail:

Plot[polly[x],{x,-100,100},PlotRange->All]