Week 9: Exercises#
Note
By the Jacobian we will in these exercise refer to the Jacobian function \(\sqrt{\det(\pmb{J}^T \pmb{J})}\) (i.e., the “distortion factor”, meaning the area/volume correction factor), which more officially is known as the geometric tensor. The term Jacobian is generally also used for both the Jacobian matrix as well as the Jacobian determinant, so you should be cautious when using this term and be careful with how it is defined in context. To avoid confusion, we will in these exercises always write out these terms in full.
Exercises – Long Day#
1: A simple Line Integral in the Plane#
In this exercise we will integrate a scalar function along a straight line.
Question a#
Consider the straight line \(\mathcal{L}\) from \(\left(0,0\right)\) to \(\left(3,4\right)\) in the plane \(\mathbb{R}^2\). Provide a parametrization \(r\left(u\right)\) for the line that uses \(u\in \left[0,1\right]\), and determine the corresponding Jacobian function.
Question b#
We are given the function \(f\left(x,y\right)=x+y\). Calculate the line integral \(\int_{\mathcal{L}} f\, \mathrm{d}s\).
2: Line Integral of a Scalar Function in 3D Space#
We consider a circle \(\mathcal{C}\) in \((x,y,z)\) space given by
Question a#
State the center and radius of \(\mathcal{C}\). Choose a parametric representation \(\pmb r(u)\) for \(\mathcal{C}\) corresponding to one complete revolution of the circle. Determine its corresponding Jacobian function.
Answer
Center is at \((0,1,1)\). A possible choice of parametrization is \(\pmb r(u)=(2\cos(u),2\sin(u)+1,1)\) where \(u \in [0,2\pi[\,\). The Jacobian function is \(\Vert \pmb r'(u) \Vert =2\).
Question b#
We are given the function \(f(x,y,z)=x^2+y^2+z^2\). Determine the restriction \(f(\pmb r(u))\), and calculate the line integral
Answer
The restriction of the function to the curve (using the parametrization chosen in question a) is \(f(\pmb r(u))=6+4\sin(u)\). The line integral of \(f\) along \(\mathcal{C}\) is:
Question c#
In the textbook it is mentioned that the line integral is independent of the chosen parameterization of the circle. Try with other parameterizations, and compute the line integral based on them. To get a new parametrization of the same geometry, you can, for instance, change the direction of traversal or the traversal speed, or you can re-parameterize, for example using \(t = -2\pi u\) with a fitting new parameter interval.
Question d#
Does the line integral depend on the location of the circle? For example, try translating/moving the circle by 1 unit in the direction of the \(y\) axis and compute the line integral again.
Answer
The line integral of course depends on the location of the circle. This is to be expected when the function \(f\) is not constant.
3: The Length of a Hanging Cable#
We consider a non-elastic, freely hanging cable suspended between two poles, influenced only by gravity (and the tension forces in the cable). The mathematical form describing the shape of this cable is known as a catenary. The equation is
where \(a\) is the distance to the lowest point above the \(x\) axis. We will assume that the cable is fixed at \(y=5\) (meaning, \(y \in [a,5]\)). For this exercise it is useful to remember the relation \(\cosh^2 (x) - \sinh^2 (x) = 1\).
Question a#
Assume that \(0 < a \le 5\). Provide a parametrization for the curve
In particular, pay attention to your choice of parameter interval (you may use SymPy’s solve command to determine the parameter interval end-points). Then, find the norm of the tangent vector (that is, the Jacobian function).
Question b#
Plot the curve for \(a=0.5, a=1, a=2\) with Python. Write out the integration formula for the length of the curve \(\mathcal{C}_a\). Find a decimal approximation of the length of the curves \(\mathcal{C}_{0.5}\), \(\mathcal{C}_1\), and \(\mathcal{C}_2\) using Python.
4: Line Integral of Vector Field I#
In the \((x,y)\) plane we are given a vector field
as well as a curve \(\mathcal{C}\) by the equation
Question a#
Provide a parametrization of \(\mathcal{C}\). Determine the corresponding Jacobian function and check that your parametrization is regular.
Question b#
Now calculate the tangential line integral
5: Line Integral of Vector Field II#
In \((x,y,z)\) space we are given a vector field
as well as a curve \(\mathcal{C}\) with the parametric representation
Question a#
Argue that \(\pmb{r}\) is a regular \(C^1\) parametrization.
Question b#
Calculate the tangential line integral
6: Integration of Vector Field along Stair Line#
In the plane we consider an arbitrary point \(\pmb{x}=(x_1,x_2)\) as well as the vector field
Question a#
Calculate the tangential line integral of \(\pmb{V}\) along the straight line \(\mathcal{C}\) from \(\pmb{x}_0=\pmb{0}\) to \(\pmb{x}\).
Answer
Question b#
By the stair line from \(\pmb{x}_0=\pmb{0}\) to \(\pmb{x}\) we mean the piece-wise straight line that passes from \((0,0)\) to the point \((x_1,0)\) and then from \((x_1,0)\) to \((x_1,x_2)\).
On a piece of paper with an \((x_1,x_2)\) coordinate system, sketch the stair line for different choices of \(\pmb{x}\). Then calculate the tangential line integral of \(\pmb{V}\) along the stair line \(\mathcal{T}\) from \(\pmb{x}_0=\pmb{0}\) to \(\pmb{x}\).
Hint
See more about the stair-line method in this weeks Python demoes.
Hint
Answer
Question c#
Determine, based on your answer to questions a and b, whether \(\pmb{V}\) is a gradient vector field.
Answer
The answer is no since the line integral is not path-independent.
Question d#
There is an easier way to determine whether a vector field is a gradient vector field (at least when the vector field is defined on all of \(\mathbb{R}\)). What is this method?
Hint
Determine the Jacobian matrix of \(\pmb{V}\). Find the two lemmas in the textbook that are relevant.
Answer
For vector fields on an open and simply connected domain (as in this exercise) the vector field is a gradient vector field if and only if the Jacobian matrix is symmetric.
7: A very long Curve#
The linear spiral curve \(\mathcal{C}\) in \(\mathbb{R}^2\) is parametrized by \(\pmb{r}: [0,1] \to \mathbb{R}^2\) where
Note that the domain of \(\pmb{r}\) is bounded and closed (just as we are used to). It can furthermore be shown that the curve is continuous, so \(C^0\), but not \(C^1\). In the textbook, chapter 7, it is required that the curves are \(C^1\), as unexpected things can happen when the curves are not \(C^1\). We want to illustrate that in this exercise.
Question a#
Plot the curve. Show (you may use Python) that the norm of the tangent vector is
for \(u \in ]0,1]\).
Question b#
Let \(\epsilon < 1\). Calculate the length \(\ell_\epsilon\) of the curve \(\pmb{r}(u)\) for \(u \in [\epsilon,1]\). Find \(\lim_{\epsilon \to 0} \ell_\epsilon\). What is the length \(\ell_0\) of the curve \(\mathcal{C}\)?
Exercises – Short Day#
1: The Antiderivative Problem in \(\mathbb{R}^3\)#
In 3D space we consider an arbitrary point \(\pmb{x}=(x_1,x_2,x_3)\), as well as the two vector fields
and
Question a#
Determine the Jacobian matrix of \(\pmb{V}\). Is \(\pmb{V}\) a gradient vector field?
Question b#
State all antiderivatives of \(\pmb{V}\).
Hint
Calculate the tangential line integral of \(\pmb{V}\), for instance along the stair line from \(\pmb{0}\) to \(\pmb{x}\).
Hint
By the stair line from \(\pmb{0}\) to \(\pmb{x}\) we mean the piece-wise straight line that passes from \((0,0,0)\) to the point \((x_1,0,0),\) then from \((x_1,0,0)\) to \((x_1,x_2,0)\), and finally from \((x_1,x_2,0)\) to \((x_1,x_2,x_3)\).
Hint
See more about the stair-line method in this week’s Python demoes.
Answer
The line integral is
and all antiderivatives are thus
Question c#
Let \(\mathcal{H}\) be a helix with the parametric representation
Calculate the tangential line integral
Hint
You don’t have to find the Jacobian function of \(\pmb{r}\). There is an easier method by using the answer to question b.
Question d#
Calculate using Sympy the tangential line integral of \(\pmb{W}\) along a straight line from \(\pmb{0}\) to the arbitrary point \(\pmb{x}\).
Question e#
Investigate whether \(\pmb{W}\) is a gradient vector field, and if so then state all antiderivatives.
Answer
Yes, \(\pmb W\) is a gradient vector field. This can be seen by simply realizing that \(\nabla f = \pmb{W}\). All antiderivatives are
2: What can have an Antiderivative?#
For scalar functions of one variable we saw that if \(F'(x) = f(x)\), then \(\int_a^b f(x)\,\mathrm dx = F(b) - F(a)\) (see the fundamental theorem of calculus). In this exercise we will discuss whether a similar “shortcut” exists for calculating integrals with multiple variables. First, we must be clear on which types of functions the question is even relevant for. In previous exercises we have found antiderivatives to vector fields \(\pmb{V}:\mathbb{R}^n \to \mathbb{R}^n\). Remember that vector fields are vector functions \(\pmb{f}:\mathbb{R}^n \to \mathbb{R}^k\) for which \(n=k\). But what if the dimensions \(n\) and \(k\) do not match?
Question a#
Consider a scalar function of two variables, e.g. \(f(x,y) = x y^2\). If we seek a “fundamental theorem” similar to \(F(b) - F(a)\), then \(F\) must be a scalar function. If \(F\) is a scalar function, then its derivative is the gradient \(\nabla F\), which is a vector.
Discuss why \(F\) must be a scalar function, and explain why the equation \(\nabla F = f\) is mathematically impossible. Why can we not have an “antiderivative” to a usual scalar function \(f(x,y)\) similar to the 1D case?
Question b#
The line integral of a vector field \(\pmb{V}\) is calculated as \(\int_{\mathcal{C}} \pmb{V} \cdot \mathrm d\pmb{s}\). Assume that we have a function \(\pmb{f} : \mathbb{R}^3 \to \mathbb{R}^2\) (the output is a 2D vector, but the input is 3D).
Can we define the tangential line integral of this function along a curve in 3D space?
Hint
Consider the dimension of the tangent vector \(\pmb{r}'(u)\) and the dot product in the definition.
Question c#
Lemma 7.4.1 in the textbook states
For this lemma to make sense, certain conditions must be fulfilled for the dimension of \(\pmb{V}\) and \(f\), respectively.
Argue that if we are in \(\mathbb{R}^n\), then \(f\) (also known as the potential) must be a scalar function, and the vector field \(\pmb{V}\) must have a dimension of \(n=k\) (so its output is in \(\mathbb{R}^n\)). Why is the case \(n=k\) (where the vector field maps from \(\mathbb{R}^n\) to \(\mathbb{R}^n\)) the only case for which the link between antiderivatives and line integrals makes sense?
3: Vector Field over a Circular Disc. In Sympy#
For this exercise you may use Sympy.
Let \(U = \{ (x,y) \mid \frac{1}{4} < x^2 + y^2 < 1 \}\) be given. Consider the vector field
Question a#
Is the domain \(U\)…
open?
bounded?
curve-connected?
simply connected?
star-shaped?
Answer
Yes
Yes
Yes
No
No
Question b#
Determine whether \(\pmb{V}\) is \(C^0\) and \(C^1\). Find the Jacobian matrix for \(\pmb{V}\) and determine whether it is symmetric.
Answer
\(\pmb{V}\) is both \(C^0\) and \(C^1\). In fact, the vector field is \(C^\infty\) on \(U\). The Jacobian matrix is symmetric, since both non-diagonal terms can be written as \(-(x - y)(x + y)/(x^2 + y^2)^2\). If it is not yet clear from your result, then try using factor() on the terms.
Question c#
Find the gradient of the arcustangent function \(f(x,y) = \mathrm{atan2}(y,x)\). The function is in SymPy given by f = atan2(y,x) and is a variant of \(\arctan(y/x)\).
Question d#
Plot the function \(f\) on \(U\). Is \(f(x,y)\) an antiderivative of \(\pmb{V}\)?
Answer
No. Even though \(\pmb{V}\)’s Jacobian matrix is symmetric, the domain is not star-shaped which can cause trouble for the existence of antiderivatives, even for vector fields with symmetric Jacobian matrices. The problem with the chosen function \(f\) is that we do not have a reasonable definition along \(x=0\) due to the sign-switch on \(y\). Antiderivatives are differentiable and thus continuous, but the function \(f\) is not continuous (and thus not differentiable) for \(x=0\), where \(y\) intersects the \(x\) axis.
4: Flow Curves of a Vector Field#
A linear vector field \(\pmb V\) in the \((x,y)\) plane is given by
We imagine that we at time \(t=0\) release a particle inside a force field at the point \((x_0,y_0)\), and we want to model the trajectory (curve) \(\pmb{r}(t)\) of the particle as a function of time. Such curves are known as integral curves or flow curves. They are solutions to the differential equation system:
where \(\pmb{x}_0\) is the initial point.
This week’s Python demoes can be of great help in this exercise, but try doing as much of this exercise by hand as you can.
Question a#
Determine the matrix of the differential equation system and find (you may use Sympy’s eigenvects()) the eigenvalues and corresponding eigenvectors of the matrix.
Hint
The vector field is written in matrix form \(\displaystyle{\pmb{V}= A \begin{bmatrix}x\\ y\end{bmatrix}}\) where \(A\) is the system’s matrix.
Question b#
We are now being informed that the flow curve \(\pmb{r}_1(t)\) passes through the point \((0,-1)\) at time \(t=0,\) and that the flow curve \(\pmb{r}_2(t)\) passes through \((0,\frac 12)\) at time \(t=0\). Find, using the results from question a and these given initial conditions, a parametric representation for \(\pmb{r}_1(t)\) and \(\pmb{r}_2(t)\).
Answer
\(\displaystyle{\pmb{r}_1(t)=\begin{bmatrix}1/2\exp(-1/4t)-1/2\exp(1/2t)\newline -1/2\exp(-1/4t)-1/2\exp(1/2t)\end{bmatrix}}\).
\(\displaystyle{\pmb{r}_2(t)=\begin{bmatrix}1/4\exp(1/2t)-1/4\exp(-1/4t)\newline 1/4\exp(1/2t)+1/4\exp(-1/4t)\end{bmatrix}}\).
Question c#
Make a Python illustration that shows both the vector field and the two flow curves.