Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment 1, MACM 204, Fall 2022

Copyright, Michael Monagan.

The purpose of this assignment is to learn the basics of Maple: how to input formulas, how to graph

functions, solve equations, calculate derivatives and integrals, and to program some loops .

Due 11pm Monday September 26th.  Late penalty.  -20% for up to 24 hours late.  0 after that.

Do all calculations in Maple.  Please put your name and student number on top of each Maple worksheet,

Question 1

Consider the function f x = x2 e x .  Construct a plot of [ f x ,f ' x ,f '' x ] on the same graph for the domain 0 x 6.

Using an option, colour the three functions red, green and blue and include a suitable title.  Read the help page for ?plot,options.

Solution 1

Question 2

Using the evalf command, calculate the following values to 20 decimal places.

1

= 3.141 ... , =1.414..., e = 2.718..., e x2 dx = 0.746 ... and f ' 1 = 3.42 ... where

f x = tan(x).

Solution 2

Question 3

Consider the polynomials f := x4 1 and g := x4 4 x3 8 x 4 and

h x4 4 x3 4 x2 8 x 4.

Graph each separately on a suitable domain for x so that we can see all real roots . Now factor the polynomials using the factor command.

Why does the factor command not factor them into linear factors?

Now, using solve, solve for the roots .  Using Maple, verify that the 4 roots of the polynomial g are correct.

Now, using fsolve, solve for numerical approximations of the roots, including the complex roots . Read the help page for ?fsolve to find out how to get the complex roots .

Solution 3

Question 4

Shown in the plot below is a plot of f := x5 4 x4 4 x 1 on the domain - 1 < x < 4.5. Shown also is the line tangent to f x at x = 3 .




Use Maple to reproduce the plot.  Do this by using the diff and eval commands to compute the slope










Now express the area enclosed by the tangent line and f x as a definite integral.

Solution 4

Question 5

A car is travelling at velocity v t = 30 t 4 t kmph.

What is the maximum velocity on   0 t 4 ?

How far does the car travel on 0 t 4 ?

Solution 5

Question 6

Consider the two equations y2 = x3 x and x2 y2 = 1 which are the equations of an eliptic curve and a circle.  Graph the two curves together using the implicitplot command in the plots package.    Improve the smoothness of the plot using the grid option.  The circle will appear distorted.  Find out

from ?plot,options how to scale the axes so that the circle looks like a circle (so that the plot looks like the figure below).

2

1

0

1

2

0 0.5 1

You can read off from the plot roughly where the curves intersect.



The last four questions are to get you to write some loops and to experiment.

Question 7

Suppose you are given a Maple list R of numbers which are the roots of a polynomial f x .  Write a


Solution 7

Question 8

If f x g x dx = 0  we say f x and g x are orthogonal on a, b .  Show that sin n x and

a

cos m x are orthogonal on , for all 1 n 5, 1 m 5, n m .  Use a double for

loop.  To force Maple to print something use the print(...) command.

Solution 8

Question 9


Consider the odd primes  3, 5, 7, 11, 13, 17, 19, etc.

Let S be the odd primes congruent to 1 mod 4 and T be the odd primes congruent to 3 mod 4. So S = 5, 13, 17, 29, etc. and T = 3, 7, 11, 19, 23, etc.

Suppose we go through the odd primes in order counting the number of primes in S and T. So at the first step S = { } and T = {3} so T has more primes than S .

At the second step S = {5} and T = {3} so S and T have the same number of primes . At the third step S = {5} and T = {3,7} so T has more primes than S again.

Here is a little table counting the size of S and T for the first 10 primes

Prime

3

5

7

11

13

17

19

23

29

31

|S |

0

1

1

1

2

3

3

3

4

4

|T|

1

1

2

3

3

3

4

5

5

6

Notice that TS for the first 10 primes . Does it ever happen that S T  ? Yes, it does . When?

How often?

Using the builtin nextprime command write a loop that counts S and T for primes up to 10^6 and prints out the the first time S T and, at the end, how often S T .

Solution 9

Question 10