Earlier I posted the handwritten notes on how to calculate eigenvalues and eigenfunctions of a boundary eigenvalue problem with the boundary conditions of the "third kind", also called Robin boundary conditions. This was in the context of solving the string equation with the boundary conditions and the initial conditions as follows:
Let $L \gt 0$, \(c\gt 0\), and $h \in \mathbb{R}.$ Let $f:[0,L]\to\mathbb{R}$ and $g:[0,L]\to\mathbb{R}$ be continuous functions whose derivatives are piecewise continuous. We consider the vibrating string equation with a Robin boundary condition at $0$ and the Diriclet boundary condition at $L$: \begin{alignat*}{2} &\text{PDE:} \qquad & & \frac{\partial u^2}{\partial t^2}(x,t) = c^2 \frac{\partial u^2}{\partial x^2}(x,t) \quad \text{where} \quad x \in [0,\pi] \quad \text{and} \quad t \in [0,+\infty) \\ &\text{BCs:} \qquad & & u(0,t) - h \frac{\partial u}{\partial x}(0,t) = 0 \quad \text{and} \quad u(L,t) = 0 \quad \text{for all} \quad t \in [0,+\infty), \\ &\text{ICs:} \qquad & & u(x,0) = f(x) \quad \text{and} \quad \frac{\partial u}{\partial t}(x,0) = g(x) \quad \text{for all} \quad x \in [0,L]. \end{alignat*}
In the earlier notes I stopped after I calculated the natural modes of vibration of the above string. I focused on a string with only positive eigenvalues.
Since in Problem 4 on Assignment 3 I ask you to provide a complete solution of a problem which is a variation on the problem stated above, prompted by students questions in Discussions on Canvas and email, I continued the notes posted above. The previously posted notes finished with finding the natural modes of vibrations of the string described by the PDE and BCs stated above. (I focussed on the problem with positive eigenvalues only.) In the addition to the notes, I present how to find the solution satisfying the initial conditions. Here are the complete notes.
The earlier posted notebook Super_glued_ends_solution_v12.nb contains all the details of a Mathematica implementation of finding a solution of the vibrating string equation with several different Robin boundary conditions. This Mathematica file is important for the Mathematica part of Problem 4 on Assignment 3. A pdf printout of this notebook is Super_glued_ends_solution_v12.pdf. You can download this Mathematica notebook here Super_glued_ends_solution_v12.nb
We finished the problem that we started yesterday. We continued the Mathematica notebook started yesterday. I did not change the name of the notebook, I just continued writing new content in it. A pdf printout of this notebook is 20231204_super_glue.pdf. You can download this updated Mathematica notebook here 20231204_super_glue.nb
For the statement of the problem see the post yesterday. Also, in the post yesterday you can find a link to a more comprehensive Mathematica notebook in which I pay attention to all the details of the graphical presentation of vibrating strings.
Place the cursor over the image to start vibrations.
Place the cursor over the image to start vibrations.
Place the cursor over the image to start vibrations.
Place the cursor over the image to start vibrations.
Place the cursor over the image to start vibrations.
Here I give a hint for Problem 6 on Assignment 3. In part (a) I ask you to establish a mathematical model for the vibrations of a string with the rigid part over the interval \([1,2]\). The string is placed over the interval \([0,5]\). The value of \(x\) in a mathematical model for the vibrations of this string should be restricted to the union \begin{equation*} [0,1] \cup [2,5]. \end{equation*} The fact that the string is rigid over \([1,2]\) should be reflected by boundary conditions involving the values of the function \(u(x,t)\) and its derivative at the points \(x=1\) and \(x=2\). Stating all the conditions carefully, you end up with four boundary conditions: one at \(x=0\), two involving \(x=1\) and \(x=2\), and one at \(x=5\).
Dealing with four boundary conditions is not easy, so to find eigenvalues and eigenfunctions I suggest that you start with the "general" solution on \([0,1] \) of the form \begin{equation*} C_1 \sin(\mu x) \end{equation*} which automatically satisfies the boundary condition at \(x=0\) and with the "general" solution on \([2,5] \) of the form \begin{equation*} C_2 \sin\bigl(\mu (5-x)\bigr) \end{equation*} which automatically satisfies the boundary condition at \(x=5\). In this setting we are left with only two remaining boundary conditions that we can use to set up a linear system for the unknowns \(C_1\) and \(C_2\) which will lead towards an equation which will determine \(\mu\)-s.
What I presented in the preceding paragraph applies only to positive eigenvalues. You need to make necessary adjustments for the negative eigenvalues and zero.
Let \(L \gt 0\), \(c\gt 0\), and $h \in \mathbb{R}.$ Let $f:[0,L]\to\mathbb{R}$ and $g:[0,L]\to\mathbb{R}$ be continuous functions whose derivatives are piecewise continuous. Today we considered the vibrating string equation with a Robin boundary condition at $L$ and the Diriclet boundary condition at $0$:
\begin{alignat*}{2} &\text{PDE:} \qquad & & \frac{\partial u^2}{\partial t^2}(x,t) = c^2 \frac{\partial u^2}{\partial x^2}(x,t) \quad \text{where} \quad x \in [0,\pi] \quad \text{and} \quad t \in [0,+\infty) \\ &\text{BCs:} \qquad & & u(0,t) = 0 \quad \text{and} \quad u(L,t) + h \frac{\partial u}{\partial x}(L,t) = 0 \quad \text{for all} \quad t \in [0,+\infty), \\ &\text{ICs:} \qquad & & u(x,0) = f(x) \quad \text{and} \quad \frac{\partial u}{\partial t}(x,0) = g(x) \quad \text{for all} \quad x \in [0,L]. \end{alignat*}
The emphasis today was on a review of the method and the demonstration of implementation of the method in Mathematica.
The notebook Super_glued_ends_solution_v12.nb contains all the details of a Mathematica implementation of finding a solution of the vibrating string equation with several different Robin boundary conditions. This Mathematica file is important for the Mathematica part of Problem 4 on Assignment 3. A pdf printout of this notebook is Super_glued_ends_solution_v12.pdf. You can download this Mathematica notebook here Super_glued_ends_solution_v12.nb
Case 1. $-L \lt h \lt 0$ In this case, there is one negative eigenvalue and countably many positive eigenvalues. For a general choice of the initial shape $f(x)$ and the initial velocity $g(x)$ the string will break in this case. See the the animation below.
Place the cursor over the image to start vibrations.
However, if we set the initial velocity $g(x)= 0$ and we make a special choice of the initial shape $f(x)$ that is orthogonal to the eigenfunction corresponding to the negative eigenvalue than the string does not break. See the animation below.
Place the cursor over the image to start vibrations.
Case 2. $h = -L$ In this case, $0$ is an eigenvalue and there are countably many positive eigenvalues. For a general choice of the initial shape $f(x)$ and no initial velocity, that is $g(x) = 0,$ the string will not break. This is illustrated in the animation below with $L = \pi$ and $h=-\pi$.
Place the cursor over the image to start vibrations.
For a general choice of the initial velocity $g(x)$ the string breaks. We did not illustrate this case.
Case 3. $h \geq 0$ or $h \leq -L$ In this case, there are no negative eigenvalues, $0$ is not an eigenvalue and there are countably many positive eigenvalues. See the animation below with $L =\pi$ and $h=-4$.
Place the cursor over the image to start vibrations.
In the animation below we used $L =\pi$ and $h=1$.
Place the cursor over the image to start vibrations.
Place the cursor over the image to start vibrations.
Notice that the red part of the string is rigid, while the orange part is governed by the vibrating string equation.
Place the cursor over the image to start vibrations.
Notice that the red part of the string is rigid, while the orange part is governed by the vibrating string equation.
A fundamental aspect of our course is the study of Fourier series of functions. We set a positive real number \( L > 0 \) and focus on real-valued, piecewise continuous functions defined on the interval \( [-L, L] \). We have explored the computation of a Fourier series for such functions and examined the criteria for the convergence of these series. Typically, a Fourier series of a function is an infinite series of trigonometric functions. Specifically, a Fourier series is an infinite series of functions whose partial sums are linear combinations of the constant function \(1\) and the trigonometric functions: \[ 1, \quad \cos\left(\frac{k \pi}{L} x\right), \quad \sin\left(\frac{k \pi}{L} x\right), \quad \text{where} \quad k \in \mathbb{N}. \]
As always on this website \(\mathbb{N}\) denotes the set of positive integers. To denote the set of nonnegative integers we will use the union \(\{0\}\cup\mathbb{N}.\)
One particular kind of trigonometric identities are Power reduction formulas. Below I list several such formulas.
In the context of Fourier series, the power reduction formulas are important since they are in fact finite Fourier series (here \(L=\pi\)) for the powers of trigonometric functions.
\begin{align*} (\sin x)^2 & = \frac{1}{2}-\frac{1}{2} \cos (2 x) \\ (\sin x)^3 & = \frac{3}{4}\sin(x) - \frac{1}{4} \sin(3 x)\\ (\sin x)^4 & = \frac{3}{8} -\frac{1}{2} \cos (2 x)+\frac{1}{8} \cos (4 x)\\ (\sin x)^5 & = \frac{5}{8}\sin (x) - \frac{5}{16} \sin (3 x)+\frac{1}{16} \sin (5 x)\\ (\sin x)^6 & = \frac{5}{16} - \frac{15}{32} \cos (2 x)+\frac{3}{16} \cos (4x)-\frac{1}{32} \cos (6x) \end{align*}
\begin{align*} (\cos x)^2 & = \frac{1}{2}+\frac{1}{2} \cos (2 x) \\ (\cos x)^3 & = \frac{3}{4}\cos (x)+\frac{1}{4} \cos (3 x)\\ (\cos x)^4 & = \frac{3}{8} + \frac{1}{2} \cos (2 x) + \frac{1}{8} \cos(4 x)\\ (\cos x)^5 & = \frac{5}{8}\cos (x)+\frac{5}{16} \cos (3 x)+\frac{1}{16} \cos (5 x)\\ (\cos x)^6 & = \frac{5}{16} + \frac{15}{32} \cos (2 x) + \frac{3}{16} \cos (4x) + \frac{1}{32} \cos (6x) \end{align*}
\begin{align*} (\sin x)(\cos x) & = \frac{1}{2} \sin (2 x) \\ (\sin x)(\cos x)^2 & = \frac{1}{4} \sin (x) + \frac{1}{4} \sin (3 x) \\ (\sin x)(\cos x)^3 & = \frac{1}{4} \sin (2 x) + \frac{1}{8} \sin (4 x) \\ (\sin x)(\cos x)^4 & = \frac{1}{8} \sin (x) + \frac{3}{16} \sin (3 x) + \frac{1}{16} \sin (5 x) \\ (\sin x)(\cos x)^5 & = \frac{5}{32} \sin (2x) + \frac{1}{8} \sin (4 x) + \frac{1}{32} \sin (6 x) \\ (\sin x)^3 & = \frac{3}{4} \sin (x) - \frac{1}{4} \sin (3 x) \\ (\sin x)^3(\cos x) & = \frac{1}{4} \sin (2 x) - \frac{1}{8} \sin (4 x) \\ (\sin x)^3 (\cos x)^2 & = \frac{1}{8} \sin (x) + \frac{1}{16} \sin (3 x) - \frac{1}{16} \sin (5 x) \\ (\sin x)^3(\cos x)^3 & = \frac{3}{32} \sin (2 x) - \frac{1}{32} \sin (6 x) \\ (\sin x)^3(\cos x)^4 & = \frac{3}{64} \sin (x) + \frac{3}{64} \sin (3 x) - \frac{1}{64} \sin (5 x) - \frac{1}{64} \sin (7 x) \\ (\sin x)^3(\cos x)^5 & = \frac{3}{64} \sin (2 x) + \frac{1}{64} \sin (4 x) - \frac{1}{64} \sin (6 x) - \frac{1}{128} \sin (8 x) \\ \end{align*}
In the context of this class, each of the above formulas gives a (finite) Fourier series of the function on the left-hand side of the equality sign.
Also, the above formulas, though not immediately apparent, contain numerous integrals in a disguised form. For example, \[ \int_{-\pi} ^{\pi} (\sin x)^3(\cos x)^4 \sin (3 x) dx = \frac{3 \pi}{64}, \] but also \[ \int_{-\pi} ^{\pi} (\sin x)^3(\cos x)^4 \sin (4 x) dx = 0. \] Do you see why?
In the above formulas, for \( n, k \in \{0\}\cup\mathbb{N}\) with \(k \leq n \), the symbol \( \binom{n}{k} \) (read as "n choose k") denotes the Binomial coefficient. The definition is:
\[ \binom{n}{k} = \frac{n!}{k! \, (n-k)!}, \]
where for \( m \in \mathbb{N} \), \( m! \) (read as "m factorial") is the product of all positive integers up to \( m \). By convention \( 0! = 1 \).
The Base Case: \(0!=1\)
The Recursive Step: For all \(m\in\mathbb{N}\) we set \(m! = \bigl( (m-1)! \bigr) \mkern 2px m\).
For more details, see Factorial.
The recursive definition of the binomial coefficients is as follows:
The Base Case: \begin{equation*} \text{For all} \ \ n \in \{0\}\cup\mathbb{N} \quad \text{we set} \quad \binom{n}{0} = 1 \quad \text{and} \quad \binom{n}{n} = 1. \end{equation*} The Recursive Step: \begin{equation*} \text{For all} \ \ n \in \mathbb{N} \ \ \text{and} \ \ k \in \{1,\ldots,n\} \quad \text{we set} \quad \binom{n+1}{k} = \binom{n}{k-1} + \binom{n}{k}. \end{equation*} At each line below, the recursive step with specific values for \(n\) and \(k\) and the previously evaluated values (that is why it is called a recursion, see the next item below) for the binomial coefficients yields:
\begin{alignat*}{2} &\text{For } n=2, \ k=1 \qquad &&\binom{2}{1} = \binom{1}{0} + \binom{1}{1} = 1 + 1 = 2, \\ &\text{For } n=3, \ k=1 &&\binom{3}{1} = \binom{2}{0} + \binom{2}{1} = 1 + 2 = 3, \\ &\text{For } n=3, \ k=2 &&\binom{3}{2} = \binom{2}{1} + \binom{2}{2} = 2 + 1 = 3, \\ &\text{For } n=4, \ k=1 &&\binom{4}{1} = \binom{3}{0} + \binom{3}{1} = 1 + 3 = 4, \\ &\text{For } n=4, \ k=2 &&\binom{4}{2} = \binom{3}{1} + \binom{3}{2} = 3 + 3 = 6, \\ &\text{For } n=4, \ k=3 &&\binom{4}{3} = \binom{3}{2} + \binom{3}{3} = 3 + 1 = 4, \\ &\text{For } n=5, \ k=1 &&\binom{5}{1} = \binom{4}{0} + \binom{4}{1} = 1 + 4 = 5, \\ &\text{For } n=5, \ k=2 &&\binom{5}{2} = \binom{4}{1} + \binom{4}{2} = 4 + 6 = 10, \\ &\text{For } n=5, \ k=3 &&\binom{5}{3} = \binom{4}{2} + \binom{4}{3} = 6 + 4 = 10, \\ &\text{For } n=5, \ k=4 &&\binom{5}{4} = \binom{4}{3} + \binom{4}{4} = 4 + 1 = 5, \\ & & & \quad \quad \mkern 12px \vdots \end{alignat*}
For more details about this recursion, see Pascal's triangle.
In our exploration of power reduction formulas, we naturally encountered binomial coefficients. This prompted a review of the definition of the binomial coefficients, for which I sought assistance from ChatGPT. I was somewhat surprised that in ChatGPT's basic writing about binomial coefficients, ChatGPT included the recursive definition of the binomial coefficients. That made an impression on me. I realized that I had not been highlighting the fundamental role of recursive definitions in mathematics as much as I should.
Here are two additional questions that I posed to ChatGPT, further exploring these concepts:
Above is a snippet of my interaction with ChatGPT. That is an adequate way to share my interaction on the website. A drawback of sharing a snippet is that one cannot copy-paste from a PNG file.
Next I asked ChatGPT to organize my question and its response in a form that I can post on this website. I was simply stunned with the clarity of ChatGPT's response. You can see the result below.
The only problem I encountered was when I asked ChatGPT to design the icons for the user CU and OpenAI, which you can see in the snippet. I asked ChatGPT to create those yellow and purple icons as close as possible. However, ChatGPT refused based on the copyright concerns. The icons that I show below are created by ChatGPT, the closest to the original ones that I could get.
You:
What is a recursion? What does it mean to "define a function recursively"? Assume that the audience is familiar with the concepts of integers and functions.
ChatGPT:
Recursion is a concept in mathematics and computer science where a function is defined in terms of itself. It involves two key components: the base case and the recursive step.
1. Base Case: This is a simple instance of the problem which can be solved directly, without further recursion. It acts as a stopping point for the recursion. For example, in the factorial function, the base case is \(0! = 1\).
2. Recursive Step: This is where the function calls itself with a simpler or smaller argument. Each recursive call brings the problem closer to the base case. For the factorial function \(n!\), the recursive step is \(n! = n \times (n-1)!\), where \(n > 0\).
To "define a function recursively" means to express the function in terms of simpler instances of itself, leading eventually to the base case. This approach is powerful because it allows for elegant solutions to complex problems by breaking them down into simpler sub-problems.
In the context of the binomial coefficient \(\binom{n}{k}\), a recursive definition involves expressing \(\binom{n}{k}\) in terms of other binomial coefficients with smaller values of \(n\) and/or \(k\), along with base cases like \(\binom{n}{0} = 1\) and \(\binom{n}{n} = 1\).
the first harmonic or fundamental
the second harmonic
the third harmonic
the fourth harmonic
the fifth harmonic
the sixth harmonic
Place the cursor over the image to start vibrations.
We can apply the first differentiation theorem to calculate the Fourier coefficients of the Fourier series of the function $f(x) = \exp(x)$ say on the interval $[-1,1]$. The constant Fourier coefficient is \[ a_0 = \frac{1}{2} \int_{-1}{1} e^x dx = \frac{1}{2} \biggl. e^x \biggr|_{-1}^{1} = \frac{e - e^{-1}}{2} = \sinh(1). \] Since $\exp(x)$ is its own derivative we have the following equalities for the Fourier coefficients: \begin{equation*} a_k = 2 (-1)^{k} \sinh(1) + k \mkern2px\pi \, b_k, \quad b_k = - k\mkern2px\pi \, a_k \quad \text{for all} \quad k\in\mathbb{N}. \end{equation*} Therefore, substituting the expression for $b_k$ into the first equation and solving for $a_k$ we get \[ a_k = 2 \sinh(1) \frac{(-1)^k }{1+(k \pi)^2}, \quad b_k = - 2 \pi \sinh(1)\frac{(-1)^k k }{1+(k \pi)^2} \quad \text{for all} \quad k\in\mathbb{N}. \]
In the next example we apply the differentiation theorem to calculate the coefficients of the Fourier series of the function $f(x) = x$ say on the interval $[-1,1]$. We immediately observe that the function $f$ is odd. Therefore all the coefficients $a_k$ with $k \in \{0\}\cup \mathbb{N}$ are equal to $0$. Therefore we need to deal only with the coefficients $b_k$ with $k\in \mathbb{N}$.
Next we observe that the Fourier series of the derivative $f'(x)$ is \[ f'(x) = 1. \] Thus, the only Fourier coefficient of the derivative is $1$ and all other coefficients are $0$. Substituting this in our formula for the Fourier coefficients of the derivative, using the fact that $a_k = 0$ for all $k \in \{0\}\cup \mathbb{N}$, we get the identities \begin{align*} \frac{1}{2L} \bigl( f(L) - f(-L) \bigr) & = 1 \\ \frac{1}{L} \left( (-1)^{k} \bigl( f(L) - f(-L) \bigr) + k\pi \, b_k \right) & = 0. \end{align*} Substituting $L=1$ and $f(x) = x$ we get \begin{align*} \frac{1}{2} \bigl( 1 - (-1) \bigr) & = 1 \\ (-1)^{k} \bigl( 1 - (-1) \bigr) + k\pi \, b_k & = 0. \end{align*} The first equality holds no information, and the second one yields \[ b_k = -\frac{2}{\pi} \frac{(-1)^{k}}{k} \quad \text{for all} \quad k \in \mathbb{N}. \] Thus the Fourier series for the Fourier periodic extension of the function $f(x) = x$ with $x \in (-1,1)$ is \[ \tilde{f}_{\!\!\rm Fourier}(x) = -\frac{2}{\pi} \sum_{k=1}^{\infty} \frac{(-1)^{k}}{k} \sin\bigl(k\mkern2px \pi \mkern2px x\bigr) \]
In the next example we apply both the differentiation theorem and the integration theorem to calculate the coefficients of the Fourier series of the function $f(x) = \sin(x)$ say on the interval $[-\pi/2,\pi/2]$. We immediately observe that the function $f$ is odd. Therefore all the Fourier coefficients $a_k$ with $k \in \{0\}\cup \mathbb{N}$ are equal to $0$. Therefore we need to deal only with the Fourier coefficients $b_k$ with $k\in \mathbb{N}$.
We use the fact that we know that \[ f'(x) = \cos(x) \quad \text{and} \quad F(x) = 1 - \cos(x) \quad \text{for all} \quad x \in x\in (-\pi/2,\pi/2). \] Consequently we have the following relationship between the Fourier coefficients of the Fourier series for the derivative and the integral: \begin{align*} \frac{1}{2L} \bigl( f(L) - f(-L) \bigr) & = 1 - \frac{L}{\pi}\sum_{k=1}^{\infty} \frac{b_k}{k} \\ \frac{1}{L} \left( (-1)^{k} \bigl( f(L) - f(-L) \bigr) + k\pi \, b_k \right) & = -\left(- \frac{L}{\pi} \frac{b_k}{k}\right). \end{align*} Substituting $L=\pi/2$ and $f(x) = \sin(x)$ we get \begin{align*} \frac{1}{\pi} \bigl(1 - (-1) \bigr) & = 1 - \frac{1}{2}\sum_{k=1}^{\infty} \frac{b_k}{k} \\ \frac{2}{\pi} \left( (-1)^{k} \bigl( 1 - (-1) \bigr) + k \mkern2px \pi \, b_k \right) & = \frac{1}{2} \frac{b_k}{k}. \end{align*} That is \begin{align*} \frac{2}{\pi} & = 1 - \frac{1}{2}\sum_{k=1}^{\infty} \frac{b_k}{k} \\ \frac{4}{\pi} (-1)^{k} + 2 k \mkern2px \, b_k & = \frac{1}{2} \frac{b_k}{k}. \end{align*} Solving for $b_k$ from the second equation yields \[ b_k = - \frac{4}{\pi} (-1)^{k} \frac{1}{ 2 k - \frac{1}{2k} } = \frac{8}{\pi} \frac{(-1)^{k} k}{1 - 4 k^2} \quad \text{for all} \quad k \in \mathbb{N}. \]
Thus the Fourier series for the Fourier periodic extension of the function $f(x) = \sin(x)$ with $x \in (-\pi/2,\pi/2)$ is \[ \tilde{f}_{\!\!\rm Fourier}(x) = \frac{8}{\pi} \sum_{k=1}^{\infty} \frac{(-1)^{k}}{1-4 k^2} \sin\bigl(2 k \mkern2px x\bigr). \]
Applying the above theorems one can calculate the coefficients of the Fourier series for functions whose derivatives and integrals replicate itself. For example for function $e^x$ or $\cosh(x),$ or a periodic extension of $\sin(x)$ restricted to $(-\pi/2, \pi/2)$, of and similar.
We can apply the first differentiation theorem to calculate the coefficients of the Fourier series of the function $\exp(x)$ say on the interval $[-1,1]$. The constant coefficient is \[ a_0 = \sinh(1). \] Since $\exp(x)$ is its own derivative we have the following equalities: \begin{equation*} a_k = 2 (-1)^{k} \sinh(1) + k\pi \, b_k, \quad b_k = - k\pi \, a_k \quad \text{for all} \quad k\in\mathbb{N}. \end{equation*} Therefore, substituting the expression for $b_k$ into the first equation and solving for $a_k$ we get \[ a_k = \frac{2 (-1)^k \sinh(1)}{1+(k \pi)^2}, \quad b_k = -\frac{2 (-1)^k k \pi \sinh(1) }{1+(k \pi)^2} \quad \text{for all} \quad k\in\mathbb{N}. \] We can confirm this by plotting the Fourier periodic extension of $\exp(x)$ on [-1,1]$ and its approximation by its Fourier series in a small Mathematica notebook.
I do understand that the last two definitions might look somewhat weird. The only reason for that is that the ceiling function and the floor function are almost completely absent from our curriculum. That is a fault of our curriculum.
The floor function is defined as follows: For $x \in \mathbb{R}$ we set \[ \lfloor x \rfloor = \max \bigl\{ k \in \mathbb{Z} : k \leq x \bigr\}. \] In words: The floor function of a real number $x$ is defined as the largest integer less than or equal to $x$. This means it rounds $x$ down to the nearest integer. For example, $\lfloor \pi \rfloor = 3$, $\lfloor -e \rfloor = -3$.
The ceiling function is defined as follows: For $x \in \mathbb{R}$ we set \[ \lceil x \rceil = \min \bigl\{ k \in \mathbb{Z} : x \leq k \bigr\}. \] In words: The ceiling function of a real number $x$ is the smallest integer greater than or equal to $x$. This means it rounds $x$ up to the nearest integer. For example, $\lceil \pi \rceil = 4$, $\lceil -e \rceil = -2$.
The book gives a descriptive definition in English of the concept of a periodic extension. The above formula involving the ceiling and floor function is the only way that I was able to translate the definition from English into Mathish. The figures below illustrate the definition with some simple functions $f$. Here is the Mathematica notebook which I used to produce these figures.
In the figure below the function $f$ is the restriction of the function $x \mapsto x$ (in blue) to the interval $[1,4)$. The red function is the periodic extension.
In the figure below the function $f$ is the restriction of the function $x \mapsto x^2-2$ (in blue) to the interval $[-2,2)$. The red function is the periodic extension.
In the figure below the function $f$ is the restriction of the function $x \mapsto \cos(x)$ (in blue) to the interval $[0,\pi)$. The red function is the periodic extension.
Recall that in Problem 5 on Assignment 1 we solved the following problem:
Problem. Let $K$ and $L$ be positive real numbers. Find the real function $u$ defined on the rectangle \[ [0, K] \times [0, L] = \bigl\{(x,y) \in \mathbb{R}^2 : 0 \leq x \leq K \ \ \text{and} \ \ 0 \leq y \leq L \bigr\} \] such that $u$ satisfies Laplace's partial differential equation: \begin{equation*} \frac{\partial^2 u}{\partial x^2}(x,y) + \frac{\partial^2 u}{\partial y^2}(x,y) = 0 \end{equation*} and the boundary conditions \begin{alignat*}{2} u(x,0) & = \frac{b-a}{K} x + a, & \qquad u(x,L) & =\frac{c-d}{K} x + d \quad \text{for all} \quad x \in [0, K], \\ u(0,y) & =\frac{d-a}{L} y + a, & \qquad u(K,y) & = \frac{c-b}{L} y + b \quad \text{for all} \quad y \in [0,L], \\ \end{alignat*} where $a, b, c$ and $d$ are arbitrary real numbers.
Notice that the above boundary conditions are chosen such that \[ u(0,0) = a, \quad u(K,0) = b, \quad u(K,L) = c, \quad u(0,L) = d. \]
Solution. The solution obtained in Problem 5 on Assignment 1 was \[ u(x,y) = a + \frac{b-a}{K} x + \frac{d-a}{L} y + \frac{a-b+c-d}{K L}xy. \]
Thus, we know how to solve Laplace's equation on a rectangle whenever the boundary conditions are line segments.
Let $P$ and $Q$ be continuous real valued functions defined on $\mathbb{R}$. Let $Y_1 : \mathbb{R} \rightarrow \mathbb{R}$ and $Y_2: \mathbb{R} \rightarrow \mathbb{R}$ be linearly independent solutions of the homogeneous linear equation (HLE) \begin{equation*} Y^{\prime\prime}(x)+P(x) Y^{\prime}(x)+Q(x)Y(x)= 0, \ x \in \mathbb{R}. \end{equation*} Then all solutions of the HLE are given by the formula \[ Y(x) = c_1 Y_1(x) + c_2 Y_2(x), \ \ x \in \mathbb{R}, \] where $c_1$ and $c_2$ are arbitrary constants.
The solution \[ Y(x) = c_1 Y_1(x) + c_2 Y_2(x), \ \ x \in \mathbb{R}, \] is called the general solution of the HLE.
A pair of linearly independent solutions of the HLE is called a fundamental set of solutions of the HLE.
Below, we always have $x \in \mathbb{R}$.
Therefore, $\cos(x)$ and $\sin(x)$ satisfy the following linear homogeneous second-order differential equation with constant coefficients \[ Y''(x) + Y(x) = 0. \] Since the preceding differential equation is linear homogeneous equation, any linear combination of $\cos(x)$ and $\sin(x)$ is also a solution. In fact, all solutions of the preceding differential equation are given by the following expression \[ c_1 \cos(x) + c_2 \sin(x), \quad \text{where} \quad c_1, c_2 \in \mathbb{R}. \] The preceding expression is called the general solution of $Y''(x) + Y(x) = 0.$
There is something special about $\cos(x)$ and $\sin(x)$ that I must mention here. Look at the values of $\cos(x)$ and $\sin(x)$ and its derivatives at $0$: \[ \begin{array}{c} \Big.\bigl(\cos(x)\bigr)\Big|_{x=0} = 1 \\ \Big.\bigl(\cos(x)\bigr)'\Big|_{x=0} = 0 \end{array} \qquad \text{and} \qquad \begin{array}{c} \Big.\bigl(\sin(x)\bigr)\Big|_{x=0} = 0 \\ \Big.\bigl(\sin(x)\bigr)'\Big|_{x=0} = 1 \end{array} \]
Therefore, $\cos(\mu x)$ and $\sin(\mu x)$ satisfy the following linear homogeneous second-order differential equation with constant coefficients \[ Y''(x) + \mu^2 Y(x) = 0. \] This equation can be written as an "eigenvalue equation" \[ -Y''(x) = \mu^2 Y(x) \] Since the preceding differential equation is linear homogeneous equation, any linear combination of $\cos(\mu x)$ and $\sin(\mu x)$ is also a solution. In fact, all solutions of the preceding differential equation are given by the following expression \[ c_1 \cos(\mu x) + c_2 \sin(\mu x), \quad \text{where} \quad c_1, c_2 \in \mathbb{R}. \] The preceding expression is called the general solution of $-Y''(x) = \mu^2 Y(x).$
Therefore, $\cosh(\mu x)$ and $\sinh(\mu x)$ satisfy the following linear homogeneous second-order differential equation with constant coefficients \[ Y''(x) - \mu^2 Y(x) = 0. \] This equation can be written as an "eigenvalue equation" \[ Y''(x) = \mu^2 Y(x) \] Since the preceding differential equation is linear homogeneous equation, any linear combination of $\cosh(\mu x)$ and $\sinh(\mu x)$ is also a solution. In fact, all solutions of the preceding differential equation are given by the following expression \[ c_1 \cosh(\mu x) + c_2 \sinh(\mu x), \quad \text{where} \quad c_1, c_2 \in \mathbb{R}. \] The preceding expression is called the general solution of $Y''(x) = \mu^2 Y(x).$
The Mathematica code for the right picture above (it uses some definitions in the preceding command):MyOptionsD = Sequence[ImageResolution -> 600, Axes -> True, AxesLabel -> {None, None, None}, AxesOrigin -> {Automatic, Automatic, Automatic}, Boxed -> True, DisplayFunction -> Identity, FaceGrids -> None, FaceGridsStyle -> Automatic, ImageSize -> 500, Lighting -> {{"Ambient", White}}, BoundaryStyle -> None, Method -> {"DefaultGraphicsInteraction" -> {"Version" -> 1.2`, "TrackMousePosition" -> {True, False}, "Effects" -> {"Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2}, "Droplines" -> {"freeformCursorMode" -> True, "placement" -> {"x" -> "All", "y" -> "None"}}}}, "RotationControl" -> "Globe"}, PlotRangePadding -> {Scaled[0.02`], Scaled[0.02`], Scaled[0.02`]}, Ticks -> {Automatic, Automatic, Automatic}, ViewPoint -> {-1.0311155006393165`, 2.874130096265292`, 1.4581416303238175`}, ViewVertical -> {0.15265090977010184`, -0.40303458278204485`, 0.9023640201316004`}]; fbth[\[Theta]_] = 2 Cos[\[Theta]/2]^6; gtfbth = ParametricPlot3D[{Cos[\[Theta]], Sin[\[Theta]], fbth[\[Theta]]}, {\[Theta], -Pi, Pi}, PlotStyle -> {RGBColor[0, 0.6, 0], Thickness[0.01]}, PlotPoints -> {100}]; disks = Graphics3D[ { {FaceForm[RGBColor[0.75, 0.75, 0.75]], Opacity[0.25], Polygon[{Cos[#], Sin[#], 0} & /@ Range[-Pi, Pi, Pi/64]]}, {GrayLevel[0.5], Thickness[0.003], Line[{Cos[#], Sin[#], 0} & /@ Range[-Pi, Pi, Pi/64]]} }, Lighting -> {{"Ambient", White}} ]; EqSolDiskBC = Show[{gtfbth, disks}, PlotRange -> {{-1.05, 1.05}, {-1.05, 1.05}, {-.05, 2.05}}, BoxRatios -> {1, 1, 1}, MyOptionsD]
Clear[wwSd]; wwSd[r_, \[Theta]_] := 5/8 + 15 /16 r Cos[\[Theta]] + 3/8 r^2 Cos[2 \[Theta]] + 1/16 r^3 Cos[3 \[Theta]]; soluD = ParametricPlot3D[{r Cos[\[Theta]], r Sin[\[Theta]], wwSd[r, \[Theta]]}, {r, 0, 1}, {\[Theta], -Pi, Pi}, PlotStyle -> {Opacity[0.7]}, PlotPoints -> {30, 100}, Mesh -> {10, 50}, MeshStyle -> {{Thickness[0.002], RGBColor[0, 0.5, 0.5], Opacity[0.5]}, {Thickness[0.002], RGBColor[0, 0.5, 0.5], Opacity[0.5]}}, BoundaryStyle -> Directive[{Thickness[0.002], RGBColor[0, 0.5, 0.5], Opacity[0.5]}]]; EqSolDisk = Show[{soluD, gtfbth, disks}, PlotRange -> {{-1.05, 1.05}, {-1.05, 1.05}, {-.05, 2.05}}, BoxRatios -> {1, 1, 1}, MyOptionsD]
The solutions for the functions $A(x)$ and $B(t)$ are : \begin{equation*} B(t) = \exp\left(\!-\frac{m^2 \pi^2}{L^2} \kappa\, t \right), \qquad A(x) = \sin\left(\frac{m \pi}{L} x\right), \end{equation*} where $\kappa$ and $L$ are given positive real numbers and $m$ is any positive integer.
Thus, we have obtained the sequence of solutions for $u_m(x,t)$ given by \[ u_m(x,t) = \exp\left(\!-\frac{m^2 \pi^2}{L^2} \kappa\, t \right) \sin\left(\frac{m \pi}{L} x\right) \quad \text{where} \quad m \in \mathbb{N}. \] We use $\mathbb{N}$ to denote the set of all positive integers. A good exercise is to verify that the preceding formula for $u(x,t)$ indeed solves the heat equation with the Dirichlet boundary conditions, the problem stated above.
A graph might be even nicer without a Mesh.Plot3D[x Sinc[y x], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}, PlotStyle -> {Opacity[0.85]}, Exclusions -> None, PlotPoints -> {151, 151}, Mesh -> {55, 55}, MeshStyle -> {{GrayLevel[0.35], Thickness[0.001]}, {GrayLevel[0.35], Thickness[0.001]}}, ClippingStyle -> False, PlotRange -> {-2 Pi, 2 Pi}, ImageSize -> 800, Axes -> False, Boxed -> True, BoxRatios -> {1, 1, 1}, ViewAngle -> Automatic, ViewCenter -> {0.5`, 0.5`, 0.5`}, ViewMatrix -> Automatic, ViewPoint -> {2.5075250998820904`, -1.6385753275514336`, \ -1.5739722899089035`}, ViewProjection -> Automatic, ViewRange -> All, ViewVector -> Automatic, ViewVertical -> {-0.34286271463298007`, 0.30614344718399633`, -0.8880998528661083`}]
Plot3D[x Sinc[y x], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}, PlotStyle -> {Opacity[1]}, Exclusions -> None, PlotPoints -> {151, 151}, Mesh -> {0, 0}, ClippingStyle -> False, PlotRange -> {-2 Pi, 2 Pi}, ImageSize -> 800, Axes -> False, Boxed -> False, BoxRatios -> {1, 1, 1}, ViewAngle -> Automatic, ViewCenter -> {0.5`, 0.5`, 0.5`}, ViewMatrix -> Automatic, ViewPoint -> {2.5075250998820904`, -1.6385753275514336`, \ -1.5739722899089035`}, ViewProjection -> Automatic, ViewRange -> All, ViewVector -> Automatic, ViewVertical -> {-0.34286271463298007`, 0.30614344718399633`, -0.8880998528661083`}]
Plot[Sinc[x], {x, -3 Pi - 3.4, 3 Pi + 3.4}, PlotStyle -> {{Red, Thickness[0.004]}}, PlotRange -> {{-3 Pi - 1.4, 3 Pi + 1.4}, {-0.7, 1.4}}, Ticks -> {Range[-5 Pi, 5 Pi, Pi/2], Range[-2, 2, 0.5]}, AspectRatio -> Automatic, Background -> Black, ImageSize -> 800]
The lime curves in the picture above are sine curves with different amplitudes and frequencies: in the formula $x\operatorname{sinc}(xy)$, we keep $y$ fixed and $x$ varies. The exception is $y=0$. In this case, the lime curve is a straight line. In some sense, this picture indicates that the lime straight line is a sine that forgot to oscillate.
The Mathematica code for the above picture:Plot3D[x Sinc[y x], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}, PlotStyle -> {White, Opacity[0.25]}, Exclusions -> None, PlotPoints -> {151, 151}, Mesh -> {0, 75}, MeshStyle -> {{RGBColor[0.196, 0.804, 0.196], Thickness[0.0015]}}, ClippingStyle -> False, PlotRange -> {-2 Pi, 2 Pi}, ImageSize -> 800, Axes -> False, Boxed -> False, BoxRatios -> {1, 1, 1}, Background -> Black, ViewAngle -> Automatic, ViewCenter -> {0.5`, 0.5`, 0.5`}, ViewMatrix -> Automatic, ViewPoint -> {2.5075250998820904`, -1.6385753275514336`, \ -1.5739722899089035`}, ViewProjection -> Automatic, ViewRange -> All, ViewVector -> Automatic, ViewVertical -> {-0.34286271463298007`, 0.30614344718399633`, -0.8880998528661083`}]
The red curves in the picture above are graphs of sinc functions with different amplitudes and frequencies: in the formula $x\operatorname{sinc}(xy)$, we keep $x$ fixed and $y$ varies.
The Mathematica code for the above picture:Plot3D[x Sinc[y x], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}, PlotStyle -> {White, Opacity[0.25]}, Exclusions -> None, PlotPoints -> {151, 151}, Mesh -> {75, 0}, MeshStyle -> {{RGBColor[{1, 0, 0}], Thickness[0.0015]}}, ClippingStyle -> False, PlotRange -> {-2 Pi, 2 Pi}, ImageSize -> 800, Axes -> False, Boxed -> False, BoxRatios -> {1, 1, 1}, Background -> Black, ViewAngle -> Automatic, ViewCenter -> {0.5`, 0.5`, 0.5`}, ViewMatrix -> Automatic, ViewPoint -> {2.5075250998820904`, -1.6385753275514336`, \ -1.5739722899089035`}, ViewProjection -> Automatic, ViewRange -> All, ViewVector -> Automatic, ViewVertical -> {-0.34286271463298007`, 0.30614344718399633`, -0.8880998528661083`}]
In the picture above, I show both sines and sincs together, lime and red together.
The Mathematica code for the above picture:Plot3D[x Sinc[y x], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}, PlotStyle -> {White, Opacity[0.25]}, Exclusions -> None, PlotPoints -> {151, 151}, Mesh -> {75, 75}, MeshStyle -> {{RGBColor[{1, 0, 0}], Thickness[0.002]}, {RGBColor[0.196, 0.804, 0.196], Thickness[0.002]}}, ClippingStyle -> False, PlotRange -> {-2 Pi, 2 Pi}, ImageSize -> 800, Axes -> False, Boxed -> False, BoxRatios -> {1, 1, 1}, Background -> Black, ViewAngle -> Automatic, ViewCenter -> {0.5`, 0.5`, 0.5`}, ViewMatrix -> Automatic, ViewPoint -> {2.5075250998820904`, -1.6385753275514336`, \ -1.5739722899089035`}, ViewProjection -> Automatic, ViewRange -> All, ViewVector -> Automatic, ViewVertical -> {-0.34286271463298007`, 0.30614344718399633`, -0.8880998528661083`}]
Although we did not finish the process until the end, I will state the final solutions for $A(x)$ and $B(t)$: \begin{align*} B(t) & = \exp\left(\!-\frac{m^2 \pi^2}{L^2} \kappa\, t \right), \\ A(x) & = \sin\left(\frac{m \pi}{L} x\right), \end{align*} where $\kappa$ and $L$ are given positive real numbers and $m$ is any positive integer.
Thus, we have obtained the sequence of solutions for $u(x,t)$ given by \[ u(x,t) = \exp\left(\!-\frac{m^2 \pi^2}{L^2} \kappa\, t \right) \sin\left(\frac{m \pi}{L} x\right) \quad \text{where} \quad m \in \mathbb{N}. \] We use $\mathbb{N}$ to denote the set of all positive integers. A good exercise is to verify that the preceding formula for $u(x,t)$ indeed solves the heat equation with the Dirichlet boundary conditions, the problem stated above.
Part ii. The internal sources in the annulus are given by $Q(r) = r$ where $1 \leq r \leq b$. The units of this function are $\displaystyle \frac{\operatorname{cal}}{\operatorname{cm}^3 \operatorname{sec}}.$ To get the total heat energy generated we need to integrate the function $Q(r)$ over the annulus. Since the height of the annulus is $1$, the total heat energy generated in the annulus is \[ \int_{0}^{2\pi} \int_1^b r \mkern 1mu r \mkern 1mu dr \mkern 1mu d\theta = \frac{2}{3}\bigl(b^3 - 1\bigr)\mkern 1mu \pi. \]
The given boundary conditions tell us about the heat energy that leaves the annulus. Based on Fourier's Law the flux along the inner circle is $-5$ in units $\frac{\operatorname{cal}}{\operatorname{cm}^2 \operatorname{sec}}.$ To get the total heat that leaves the annulus along the inner circle we multiply $5$ with the surface area $2\pi$, getting $10\pi$. The flux along the outer circle is $4$ in units $\frac{\operatorname{cal}}{\operatorname{cm}^2 \operatorname{sec}}.$ To get the total heat that leaves the annulus along the outer circle we multiply $4$ with the surface area $2b\pi$, getting $8 b \pi$. Thus the total amount of the heat energy that leaves the annulus is $10\pi+8 b \pi$.
For the annulus to have the equilibrium temperature we must have \[ \frac{2}{3}\bigl(b^3 - 1\bigr)\mkern 1mu \pi = 10\pi+8 b \pi. \] The last equation simplifies to \[ b^3 - 12 b - 16 = 0, \] the same equation we obtained in i.
The webpage The Laplacian in Polar Coordinates contains a derivation of the Laplacian in polar coordinates: \[ \bigl(\nabla^2 w \bigr) (r,\theta) = \frac{1}{r^2} \frac{\partial^2 w}{\partial \theta^2}(r,\theta) + \frac{1}{r} \frac{\partial}{\partial r} \left( r \frac{\partial w}{\partial r}(r,\theta) \right). \] Here $w(r,\theta)$ is a function of $r \in (0,+\infty)$ and $\theta \in [0, 2\pi)$.
For example, consider the following function in the orthogonal coordinate system $xy$, \[ u(x,y) = x y\bigl(x^2 + y^2\bigr) \quad x,y \in \mathbb{R}. \] One can think of this function as giving a temperature at each point in the $xy$-plane. So, at the point $P$ whose coordinates in $xy$ orthogonal coordinate system are $(2,2)$ the temperature is $32.$ The same temperature in polar coordinates is given by the function \[ w(r,\theta) = r^4 (\cos \theta)(\sin \theta) \quad r \in [0,+\infty), \quad \theta \in [0, 2 \pi). \] The same point $P$ from above has coordinates $r = 2\sqrt{2},$ $\theta = \pi/4.$ So, the temperature at the point $P$ is \[ w\bigl(2\sqrt{2}, \pi/4 \bigr) = 2^4 2^2 (\sqrt{2}/2) (\sqrt{2}/2) = 32. \] The Laplacian of the function $u(x,y)$ is \[ (\nabla^2 u)(x,u) = \frac{\partial^2 u}{\partial x^2}(x,y) + \frac{\partial^2 u}{\partial y^2}(x,y) = 12 x y. \] The Laplacian of the function $w(r,\theta)$ is \[ (\nabla^2 w)(r,\theta) = \frac{1}{r^2} \frac{\partial^2 w}{\partial \theta^2}(r,\theta) + \frac{1}{r} \frac{\partial}{\partial r} \left( r \frac{\partial w}{\partial r}(r,\theta) \right) = 12 r^2 (\cos \theta)(\sin \theta). \] As expected, we have \[ 12xy \quad \text{in polar coordinates is} \quad 12 r^2 (\cos \theta)(\sin \theta). \]
The Mathematica notebook posted in the preceding item is partly written by ChatGPT with Mathematica plugin. Here is the original GhatGPT written notebook PiecewiseFunctions.nb.
If you want ChatGPT to generate a Mathematica notebook for you, then you need to ask a question like this: "Can you provide me with Wolfram Language code that, when executed in Mathematica, will generate a notebook with [specific content or topic]?" ChatGPT will generate code that will create the content that you requested. I did this in OpenAI's GPT-4, but the free version of OpenAI's GPT-3.5 generated answer would likely provide a similar answer, but the exact phrasing, depth, or structure might differ slightly.
Notice that ChatGPT generated code will produce a notebook in the directory $UserDocumentsDirectory. Mathematica will tell you this directory if you execute (CTRL+Ener) $UserDocumentsDirectory in an input cell.
To use the ChatGPT code you need to create a Mathematica notebook with the code given by ChatGPT. I have done it in this Mathematica notebook Test_GPT.nb. There is only one command in this notebook. You just execute that command and you will find a notebook created in your $UserDocumentsDirectory.
Place the cursor over the image to see the diffusion of the dye.