Exercises – Short Day#
Exercise 1: Python Exercise#
The following questions will show you how you can be more efficient in your work with complex numbers by employing Python.
Question a#
Run the following Python code in your command console Python line for line. When you see text in the code written after the #
symbol, then this is a comment that has no effect on the code - you do not need to copy/type in the comments, but it doesn’t hurt either.
from math import sqrt # This rule enables the use of the square root function sqrt later
Re=3
Im=-2
mod=sqrt(Re**2+Im**2)
mod
What is the meaning of mod
in this program?
Anwer
We have defined mod
in such a way that it computes the modulus of the complex number whose real part is stored as Re
and whose imaginary part is stored as Im
.
Question b#
Now run the below couple of Python code lines in command console Python.
from math import cos, sin, pi #Enables the use of the functions cos and sin as well as the circle constant pi
mod=4 #mod=modulus
Arg=pi/3 #Arg=argument
Re=mod*cos(Arg)
Im=mod*sin(Arg)
Re
Im
print(f"Real part is {Re} and imaginary part is {Im}")
Re==2
This last line has a surprising output. What is the reason for this?
Hint
Manually we find that \(4\cos(\pi/3)=2\). So Python’s answer is a bit surprising. But Python does not compute by hand!
Answer
Python uses numerical algorithms for computing \(\cos(\pi/3)\). This means that the output from a computation such as 4*\cos(pi/3)
will be an approximation and thus will be prone to a small error. The error is small, but that doesn’t matter for the logical comparison that Python performs when you run Re==2
in the last part of the program, which gives the output False
even though we know from our manual calculation that the correct output should have been True
.
Exercise 2: \(\mathrm{arccos}\), \(\mathrm{arcsin}\), and Trigonometric Equations#
This exercise continues from Exercise 7 on Week 2’s Long Day. We are given the sets \(\, A=\left[\,0\,,\,2\pi\,\right]\) and \(\, B=\left[\,-\pi\,,\,\pi\,\right]\,.\)
Question a#
Solve the equation \(\,\displaystyle{\mathrm e^{\,i\cdot v}= \frac{1}{2}-\frac{\sqrt 3}{2}\,i\,}\,\) within the sets \(\,A\,\) and \(\,B\,.\)
Answer
Within \(A\) the solution is \(\,\frac{5\pi}{3}\,.\) Within \(B\) the solution is \(\,-\frac{\pi}{3}\,.\)
Exercise 3: Euler’s Formula#
Question a#
Use Euler’s formula to rewrite \(\cos(3t)\sin(2t)\) to the form \(k_1 \sin(c_1t)+k_2 \sin(c_2t).\)
Hint
You can find Euler’s formula in Equation (3.7) in the textbook. The related Equation (3.9) is even more useful in the context of the exercise.
Hint
In Example 3.5.1 in the textbook a similar problem is worked out. The example can provide inspiration if you are stuck.
Answer
Exercise 4: Polar Coordinates#
Question a#
We are given the numbers \(z_1=1+i\sqrt{3}\,\), \(z_2=-1+i\sqrt{3}\,\), \(z_3=-1-i\sqrt{3}\,\), and \(z_4=1-i\sqrt{3}\,\).
Draw \(z_1\), \(z_2\), \(z_3\), and \(z_4\) in the complex plane and state the rectangular coordinates of the numbers.
Compute the moduli (also known as the absolute values) of \(z_1\), \(z_2\), \(z_3\), and \(z_4\). Conclude that the four numbers are located on a circle centred at \(0\). What is the radius of this circle?
Determine the principal arguments of \(z_1\), \(z_2\), \(z_3\), and \(z_4\) and state the polar coordinates of the numbers.
Hint
For help to computingmodulus and principal argument, see Theorem 3.3.1 (and also Figure 3.5) in the textbook.
Hint
\(\mathrm{arctan}(\sqrt{3})=\pi/3\), since \(\tan(\pi/3)=\frac{\sin(\pi/3)}{\cos(\pi/3)}=\frac{\sqrt{3}/2}{1/2}=\sqrt{3}.\)
Answer
Partial answer:
\(z_1\): The rectangular coordinates of the number are \((1,\sqrt{3})\) while its polar coordinates are \((2,\pi/3)\).
\(z_2\): The rectangular coordinates of the number are \((-1,\sqrt{3})\) while its polar coordinates are \((2,2\pi/3)\).
\(z_3\): The rectangular coordinates of the number are \((-1,-\sqrt{3})\) while its polar coordinates are \((2,-2\pi/3)\).
\(z_4\): The rectangular coordinates of the number are \((1,-\sqrt{3})\) while its polar coordinates are \((2,-\pi/3)\).
Question b#
Someone is about to find the polar coordinates of the complex number \(\,-2+2i\,\,\). He/she chooses to use a pocket calculator. First the following is typed in:
which gives the output \(\,2\sqrt{2}\,\) as the absolute value. Then the following is typed in:
which gives the output \(\,\displaystyle{-\frac {\pi}4}\,.\)
This answer is wrong. Where is the error?
Question c#
Find absolute value and principal argument of the following complex number:
Answer
Absolute value is \(\frac{1}{3}\). Principal argument is \(\frac{2}{3} \, \pi\)
Question d#
About the modulus and argument of three complex numbers \(z_1\), \(z_2\), and \(z_3\) we are informed that:
and
Note that we have not necessarily been given the principal argument of the numbers, but only an argument.
Determine the principal argument of the numbers.
Find the rectangular form of the numbers.
Hint
In regards to determining the principal argument (or “the principal value of the argument” as it is formally stated in the textbook): the principal argument of a complex number is the argument that is located in the interval \(]-\pi,\pi].\) To each of the given arguments, if it is not already within this interval then add a well-chosen multiple of \(2\pi\), such that the result lies within \(]-\pi,\pi].\) Read the beginning of Section 3.3 from the textbook for more information.
Hint
In regards to the rectangular form: Equation (3.4) in the textbook can be of use here.
Answer
The principal arguments are \(\pi\), \(-2\pi/3\), and \(-3\pi/4\).
The numbers in rectangular form are \(-4\), \(-1-i \, \sqrt{3}\), and \(-3 \, \sqrt{2} - i \, 3 \, \sqrt{2}\).
Exercise 5: The Complex Exponential Function#
Question a#
Write the following complex number in rectangular form by the use of Euler’s formula (Equation (3.7) in the textbook) and draw the numbers in the complex plane:
\(\mathrm e^{i \frac{-\pi}{4}}\)
\(\mathrm e^{i\frac{\pi}{2}}\)
\(\mathrm e^{\pi i}\)
\(\mathrm e^{i \frac{5\pi}{4}}\)
What are the (principal) arguments of the numbers?
Answer
Rectangular form \(\frac12 \sqrt{2}- \frac12 \sqrt{2} i\) and argument \(-\pi/4\).
Rectangular form \(i\) and argument \(\pi/2\).
Rectangular form \(-1\) and argument \(\pi\).
Rectangular form \(-\frac12 \sqrt{2}- \frac12 \sqrt{2} i\) and argument \(5\pi/4\) (the principal argument would be \(-3\pi/4\)).
This exercise illustrates that if \(t\) is a real number, then the complex number \(\mathrm e^{it}\) has a modulus of \(1\) and an argument of \(t\).
Question b#
Write the following complex numbers in rectangular form by using Definition 3.4.1 in the textbook:
\(\mathrm e^{i\frac{\pi}{2}}.\)
\(3\mathrm e^{1+\pi i}.\)
Hint
Regarding the rectangular form of \(\mathrm e^{i\frac{\pi}{2}}\): now that we are being asked to use Definition 3.4.1, note that \(\mathrm e^{i\frac{\pi}{2}}=\mathrm e^{0+i\frac{\pi}{2}}.\)
Answer
\(i\). The answer is of course the same as in part 2 of Question a. In fact, Euler’s formula is a special case of Definition 3.4.1, achieved by choosing \(a=0\) and \(b=t\) in Definition 3.4.1.
\(-3\mathrm e\).
Question c#
The complex number \(w=1-i\) is given.
Determine \(|\,w\,|\) and an argument \(\arg(w)\,\).
Determine \(|\,\mathrm e^w\,|\) and an argument \(\arg(\mathrm e^w)\,\).
Hint
Regarding an argument of \(\mathrm e^{1-i}\): a possible approach is to use Definition 3.4.1 to write the number in rectangular form and then to use Theorem 3.3.1 for computing an argument.
Hint
Regarding an argument of \(\mathrm e^{1-i}\): remember that \(\tan(x)=\sin(x) / \cos(x)\) and that \(\mathrm{arctan}\) is the inverse function of \(\tan\).
Answer
\(|\,w\,|=\sqrt{2}\). A possible argument is \(\arg(w)=-\frac{\pi}{4}\,.\)
\(|\,\mathrm e^w\,|=\mathrm e\). A possible argument is \(\arg(\mathrm e^w)=-1\,.\)
Both of the arguments we chose here are in fact the principal arguments (both \(-\frac{\pi}{4}\) and \(-1\) are in the interval \(]-\pi,\pi]\)), but any argument that contains an extra integer multiple of \(2\pi\) would be an answer to the question.
Exercise 6: Derivatives of the Complex Exponential Function#
With the two functions \(f_1: \mathbb{R} \to \mathbb{R}\) and \(f_2: \mathbb{R} \to \mathbb{R}\) given we can define a function \(f: \mathbb{R} \to \mathbb{C}\) by the expression \(f(x)=f_1(x)+if_2(x).\) We will in this exercise assume that the derivatives of \(f_1\) and \(f_2\) exist and we will denote them as usual with \(f_1'\) and \(f_2'\). Then one would define the function \(f': \mathbb{R} \to \mathbb{C}\) by the expression
Question a#
Now let us choose \(f_1(x)=\cos(x)\) and \(f_2(x)=\sin(x)\). Show that it then applies that \(f(x)=\mathrm e^{ix}\) and \(f'(x)=i \mathrm e^{ix}\) for all \(x \in \mathbb{R}.\) In other words it applies that \((\mathrm e^{ix})'=i\mathrm e^{ix}.\)
Hint
Remember Euler’s formula: \(\mathrm e^{ix}=\cos(x)+i \sin(x)\).
Question b#
Let \(a\) and \(b\) be real numbers. State two functions \(f_1: \mathbb{R} \to \mathbb{R}\) and \(f_2: \mathbb{R} \to \mathbb{R}\) such that the function with the expression \(f(x)=f_1(x)+if_2(x)\) fulfills that
Hint
Definition 3.4.1 can be used for rewriting \(\mathrm e^{(a+ib)x}\).
Answer
\(f_1(x)=\mathrm e^{ax} \cos(bx)\) and \(f_2(x)=\mathrm e^{ax} \sin(bx).\)
Question c#
Show that \((\mathrm e^{(a+ib)x})'=(a+ib)\mathrm e^{(a+ib)x}.\)
Hint
To compute \((\mathrm e^{(a+ib)x})'\), one must compute the derivative functions \(f_1'\) and \(f_2'\) from Question b. This can be done by the use of the product rule and the chain rule (where \(a\) and \(b\) are considered constants). If you are in doubt about what exactly the product and chain rules are, then you can find them along with some other rules for differentiation in Appendix 2 of the textbook.