### Student work for the second meeting

including solutions to the first homework assignment and a solution to the student task in the second meeting

Possible solutions to the first homework assignment
First, here is a complete solution to the first meeting's homework problems. A version of what I hoped students would hand in follows, accompanied by a discussion of the Maple commands.

```> nextprime(5555555555);
5555555557
> ifactor(5555555557);
(5555555557)
> degree(((1+2*x^2)^5-3*y^3)^(10));
100
> coeff(coeff(((1+2*x^2)^5-3*y^3)^(10),x^(18)),y^(15));
-64053051955200```
The nextprime instruction asks for (reasonably enough!) the first prime after its argument. If you believe in nextprime, that answer alone is enough. You can find this function by exploring with the help command. The ifactor is a further verification. I decided that I would "check" using the instruction ifactor which asks for integer factorization, and the result indicated this was prime. I typed 5555555555 for fun. There are lots and lots of ten digit primes. The command ifactor should have been found by students during work in the first class. By the way, finding a prime by testing random 10 digit long strings will likely be successful with after only a few attempts (this is good, because internet security usually depends on similar guesses!).

degree gives the total degree (in all variables) of a polynomial. The command coeff(coeff(((1+2*x^2)^5-3*y^3)^(10),x^(18)),y^(15)); "nests" two coeff commands. You can learn about these commands by looking at help for degree and coeff.

Typographical hints (using different fonts) were given for these commands in the assignment sheet.

Student task in class in the second meeting
Here is a complete solution to the problem that students were asked to solve in class on Monday, September 15: discover and verify a formula for the sum of the first n squares: 12+22+32+...n2. The discussion which follows tries to explain each step. I hope this is helpful in solving your homework problem.

```> v:=n->add(j^2,j=1..n);
2
v := n -> add(j , j = 1 .. n)
> v(4);1+4+9+16;
30
30
j
w := n -> add(C[j] n , j = 0 .. 3)
> coefficients:=solve({seq(v(j)=w(j),j=1..4)});
coefficients:={C[0]=0,C[1]=1/6,C[2]=1/2,C[3]=1/3}
> w1:=n->subs(coefficients,w(n));
w1:=n->subs(coefficients, w(n))
> w1(n);
2        3
1/6 n + 1/2 n  + 1/3 n
> w1(n+1)–w1(n)–(n+1)^2;
2          3     2      3
(n + 1)    (n + 1)     n      n
1/6 – -------- + -------- – ---- - ----
2          3        2      3
> expand(%);
0```
• The instruction v:=n->add(j^2,j=1..n); defines a function v which adds the squares, j^2, as j goes from j=1 to n.
• The instruction v(4);1+4+9+16; checks up on the typing! It computes the sum with the function and directly by asking Maple to add the numbers.
• The instruction w:=n->add(C[j]*n^j,j=0..3); asks Maple to create a cubic polynomial which is the guess at the "shape" of the answer. This is an abbreviation for C[0]*n^0+C[1]*n^1+C[2]*n^2+C[3]*n^3 which, written in more usual notation, is C[0]+C[1]n+C[2]n2+C[3]n3. The numbers C[0], C[1], C[2], and C[3] are unknown coefficients in the polynomial.
• The instruction coefficients:=solve({seq(v(j)=w(j),j=1..4)}); asks for solutions to the equations obtained by matching information for the numbers (we got them through v) and the model (gotten from w). I put in 4 equations since there are 4 unknowns. The coefficients:= assigns the answers to the name, coefficients.
• The instruction w1:=n->subs(coefficients,w(n)); just substitutes the coefficients (using the answers gotten from solve) into the formula for w(n) and gets a new function, w1(n). This just decreases the amount of typing which is needed.
• When we asks for w1(n) the answer is as expected -- the cubic with the coefficients substituted in.
• We already know that w1(n) and v(n) (the model and the experimental data) agree for n=1, n=2, n=3, and n=4. We need a way to check them forever. So w1(n+1)–w1(n)–(n+1)^2; compares the growth of w1 from n to n+1 to (n+1)2. If the result is 0, then we are done. We've verified our model begins with the correct data, and this would verify that the model grows correctly. Note that the answer seems to be a mess.
• The final instruction, expand(%); asks Maple to expand and do various algebraic things. The result is 0, so we are done with our proof.

The result
We have checked that

``` 2  2  2        2              2      3
1 +2 +3 + ... +n =(1/6)n+(1/2)n +(1/3)
```
is true when n is any positive integer.