Exercise 1: Approximating Polynomials. By Hand
For each of the following functions, find the approximating polynomials of the first and second degree expanded from the point $x_0=0\,.$
-
$f(x)=\e^x\,,\,\,x\in \Bbb R\,$
-
$f(x)=\cos (x)\,,\,\,x\in \Bbb R\,$
-
$f(x)=\e^{\sin( x)}\,,\,\,x\in \Bbb R\,$
The function
can of course not be expanded as a Taylor polynomial about the expansion point $x_0=0\,.$ So instead, determine the approximating polynomial of the first and second degree of $\,f\,$ with expansion point $x_0=1\,.$
Exercise 2: Introduction to Maple
The mathematics software Maple by Maplesoft is one among several mathematical tools in use in education and research at DTU. This exercise constitutes a short introduction to the most important aspects, including a guide to have you adjust the software settings appropriately. If you are familiar with Maple already, then you can skim this exercise and quickly move ahead to the next ones. If you are not familiar with Maple, then it is important that you spend some time to get acquainted with the software which will be used extensively in our course from here on.
Where Do I Get Maple?
Download the installation files to your computer from this site. Log in with your DTU ID, find the most recent version of Maple, and choose a fitting installation file for your operating system. During installation you will need the license key (“Activation key Stand alone”).
Configuration of Maple
When you begin using Maple there are two options you must consider:
- Do I wish to work in worksheet mode or in document mode, and
- do I wish to write command lines using 1D notation (“MapleNotation”) as programmer’s style or 2D notation (“2D-Math Notation”) with formatting.
Lectures and demos in this course mainly use 1D notation and worksheet mode, which has a programmer’s feel and a more clear separation of command lines from text lines. You can achieve this same setup by following the steps below (you are free to use any configuration of your choice, but expect teachers and examples to refer to the 1D notation setup) (note, there can be slight differences between the Windows and Mac versions of Maple regarding how menu points are labelled):
- In the Maple menu, go to “Tools” $\rightarrow$ “Options” $\rightarrow$ “Interface” $\rightarrow$ “Default format for new worksheets” and choose “Worksheet”. Then click “Apply Globally”.
- Then go to “Tools” $\rightarrow$ “Options” $\rightarrow$ “Display” $\rightarrow$ “Input display” and choose “Maple Notation”. Then click “Apply Globally”.
- Restart Maple. You are now ready!
Möbius Quizzes Run on a Maple Engine
When you enter answers into Möbius for the Weekly Tests and Theme exercises you must use 1D notation (“MapleNotation”). You therefor must make yourself skilled in this syntax regardless of your choice of configuration above. In highshools that use the Maple software, “2D-Math Notation” is often used rather than “MapleNotation”, in particular because that allows for easier use of the left-side pallettes with formatting possibilities for the input. At DTU we prefer the raw text code of “MapleNotation”, which is considered more scientific and with easier error-check and which avoids formatting issues and hidden characters. This choice of notation fits to that of a typical programming language.
Mini-tutorial on Maple
-
Start Maple.
-
As your very first step, and a command you should always start out with in any new Maple sheet, write (next to the
>
symbol)restart
and pressEnter
. Maple executes the command when pressingEnter
. This command initializes (empties) the memory of the sheet. -
Now try the following calculation on a new line:
2 + 2
.
In general, Maple accepts an input and provides an output. You write input in the form of commands or calculations on a command line (indicated with >
), and Maple provides an output in the form of a solution, rewritten expression or similar. The output is by default centered and in blue such that output can clearly be distinguished from input. You can suppress (hide) an output by typing a colon :
after the input - the input will still be evaluated by Maple, e.g. if you assign a value to a symbol, but no output is shown. You can write several different calculations on the same line by separating them with a semicolon ;
- in older versions of Maple, any line had to be ended with a ;
, even if there was nothing to separate.
- Maple can of course be used as a simple calculator, but its more interesting qualities lie in its ability to execute symbolic operations. For example, on a math line try to differentiate $\sin(x)$ with respect to $x$ with the command
diff(sin(x) , x)
.
Here you are using the command diff
. Two parameters or arguments, sin(x)
and x
, are given to the command, separated by a comma ,
. Note that you can add extra spaces if you wish between these parts of a command line to help with the overview. Some arguments are required, such as these two (if you omit them, then you’ll receive an error message), others are optional.
-
One of Maple’s biggest strengths is plotting. The simplest plotting command is
plot
. You can plot the function $\sin(x)$ in the interval between 0 and 5 with the commandplot(sin(x), x=0..5)
. Note how the syntax for an interval is two consecutive punctuation marks. You can achieve equal unit sizes on the axes by adding the argumentscaling=constrained
and you can change colour withcolor=red
, resulting in a command line that looks like this:plot(sin(x), x=0..5, scaling=constrained,color=red)
. -
There is a plentitude of optional arguments and possibilities to adjust and professionalise your plots. To look for more such options and to investigate the possibilites further, we recommend that you make use of Maple’s help function often by leading the problematic command name with a questions mark on an empty command line:
?plot
. This will open Maple’s help window - scroll down to see plenty of examples of the command in use, or consider the list of possible arguments and other details to find the options you are looking for.
Here is one more example of a plot, here with more arguments added. Have a guess at the output and the effect of each argument before running the command. plot([sin(x),x^2],x=0..5,y=-2..2,color=[red,blue],scaling=constrained);
.
(The ^
character creates exponents.)
Writing text in Maple
Every time you press Enter
, the current line will be executed and you will jump to the next line ready to type new mathematical input to be executed. Now and then you will instead need to write non-executable text lines to describe your executable lines.
- Jump to an empty line and use the shortkey combination
Ctrl
+t
(on Mac typicallyCmnd
+t
) to convert that line to a text line. Now write some text. PressCtrl
+m
(on an empty text line) to convert back to an executable math line.
Note how an executable math line in 1D notation is initiated with a >
symbol whereas a non-executable text line is not.
- While writing text on a text line, press
F5
to switch to mathematical formatting. You can now write non-executable mathematical expressions with 2D formatting. In this non-executable 2D environment, try typing1/2
to see the 2D formatting appearing, and try typingPi
and then pressEsc
to create a pi symbol. PressF5
(maybe a few times) to return to regular text.
Maple is not a very rich text editor. When you write reports and assignments, then you can use Maple to write the whole thing in, but we rather recommend an actual text editor instead, such as Word, Latex, Writer or the like. Maple is your strong mathematical engine and plotting tool whose graphs you can copy/paste into your actual text editor, and whose sheets you can export as .pdf and add as appendices to your assignments. Maple is, though, a handy all-round tool for smaller hand-ins and you may use it for your exams in 01006 where time does not allow for exporting and merging appendices. Throughout the course try to work both with Maple’s text features and math features to get used to when the software is and isn’t smart to use.
Learn Maple along the way or seek external ressources
You have now scratched at the very basics of Maple. Your Maple skills will improve gradually while doing the rest of the exercises. In the following exercise, you will try to redo Exercise 1 in Maple.
If you find Maple very difficult, then we’d recommend a clear separation. Try solving an exercise by hand first, and then redo the exercise in Maple while setting it up nicely in a sheet. That will separate your learning of the material from your learning of Maple. Once in a while DTU or the IDA association offers free courses on Maple (not associated with our course or course administration) and you might also be able to find further external ressources.
Exercise 3: Illustrations of Taylor Approximations
Plot some of the four functions from Exercise 1 together with their approximating polynomials of the first and second degree.
Exercise 4: Investigations of Approximating Polynomials
Use Maple to determine the 9th-degree approximating polynomial $P_9(x)$ with expansion point $x_0=0$ of the function $\sin(x)$. Plot $\sin( x)$ and $P_9(x)$ in the same coordinate system. How far out to the sides can you get the approximating polynomial to follow the function? (Experiment with the degree of the polynomial.)
From here on you may choose to solve exercises either by hand or using Maple if not specified. Be careful not to skip out on the conceptual understanding of a method by thoughtless use of Maple commands - you are in charge of your own learning. As a rule of thumb, any topic that you work with for the first time should be done by hand or as a mix of manual work and Maple (simulated manually) as far as possible and timewise reasonable.
Exercise 5: Estimation of Errors by Approximation
A function $\,f:\Bbb R\rightarrow \Bbb R\,$ is given by
State the domain $\mathrm D(f)\,$ of $\,f\,.$
Determine the approximating polynomial $\,P_3(x)\,$ of degree 3 of $\,f\,$ expanded from point $\,x_0=1\,.$
Justify that the remainder function $\,R_3(x)\,$ that corresponds to $\,P_3(x)\,$ can be expressed by
for a $\,\xi\,$ between $\,1\,$ and $\,x\,.$ Show by estimation of the remainder function that the absolute value of the error you incur by using $\,\displaystyle{P_3\left(\frac 32\right)}\,$ instead of $\,\displaystyle{f\left(\frac 32\right)}\,$ is less than or equal to $\,\displaystyle{\frac 5{2^7}}\,.$
Exercise 6: Introduction to complex Numbers with Maple
Download and work through the Maple demo about complex numbers (see the agenda for today). In the demo the relevant Maple commands for this exercise are presented.
In this exercise you should use Maple to solve the problems. You have in previous weeks solved similar exercises using paper and pencil. Reflect on those answers while solving the problems below with Maple - remember that you sometimes have to elaborate on the output that Maple provides for it to be a complete answer.
What is $i^2$, $i^3$, $(-i)^4$ og $(-i)^{-5}\,?$
Determine the real part and the imaginary part of
and write the result on rectangular form.
Given $w=1-i\,$,
- determine $|\,w\,|$ and $\mathrm{Arg}(w)\,$
- determine $|\,\e^w\,|$ and $\mathrm{Arg}(\e^w)\,$
Write the following complex numbers on rectangular form:
Compute the solutions to the equation
Compute for every $\,t\in \reel\,$ the derivatives of the following functions:
Exercise 7: Approximation of Complex Functions of a Real Variable
Approximating polynomials of complex functions of a real variable are stated using the same formula as real functions of a real variable. In the following we will consider the function
Determine the approximating polynomial $\,P_3\,$ of at most degree three of $\,f\,$ expanded from point $\,x_0=0\,.$
Determine the approximating polynomial $\,Q_3\,$ of the third degree of $\,f\,$ expanded from point $\,x_1=\frac{\pi}2\,.$ (If you feel comfortable with the manual method, then train your use of Maple’s mtaylor
command. Remember that the degree has to be typed as one higher.)
The number $1$ is closer to $\,x_1=\frac{\pi}2\,$ than to $\,x_0=0\,.$ Why is it still most likely a smarter choice to use $\,P_3\,$ than $\,Q_3\,$ if you need an approximated value of $\,f(1)\,?$
Exercise 8: Taylor’s Limit Formula. By Hand
This exercise gives a method for the computation of the limit value of a fraction for which both the numerator and the denominator go towards zero.
State for the function $\ln(1+x)$ Taylor’s limit formula (Theorem 4.8) with the expansion point $x_{0}=0$ of degrees 1, 2 and 3.
Which of the results from a) cannot be used to find the limit value:
What is the above limit value?
Advanced: Now compute using Taylor’s limit formula the following limit value:
The answer to question b) is different if one uses the (more precise) first formula at equation (4-25) in Theorem 4.7 for the remainder term, instead of the epsilon function. Show that, using this one can can find the required limit using just the first-degree approximation with the remainder term.