<commit_before>\section{Problem 1 (Problem 2.1 from Allan Taflove book)}
\textit{Use the Taylor's series expansion method to derive a second-order accurate central-difference approximation for $s\frac{\partial u}{\partial x}$}\\

Math

\subsection{Problem 2.2 from Allan Taflove book}
\textit{Repeat problem 2.1, but now derive a fourth-order accurate central-difference approximation for $s\frac{\partial u}{\partial x}$}\\


Math<commit_msg>marvelous ex<commit_after>\section{Problem 1 (Problem 2.1 from Allan Taflove book)}
\textit{Use the Taylor's series expansion method to derive a second-order accurate central-difference approximation for $\sfrac{\partial u}{\partial x}$}\\

For this we are going to use the same approach as at section 2.4 in the Allan Taflove book (\textit{Computational Electrodynamics - The Finite-Difference Time-Domain Method 2nd edition}) at page 38 (pdf-57). Here they are applying the Taylor's series expansion for approximating the second-order derivative. We are going to use the same approach but only for the first-order derivative.\\

To approximate the first-order derivative we will use the Taylor series expansion:
\begin{flalign}
&& u(x_{i}+\Delta x)\vert _{t_{n}} &=  u\vert _{x_{i},t_{n}}+\Delta x \frac{\partial u}{\partial x}\vert _{x_{i},t_{n}}+\frac{(\Delta x)^{2}}{2} \frac{\partial^{2} u}{\partial x^{2}}\vert _{x_{i},t_{n}}+\frac{(\Delta x)^{3}}{6} \frac{\partial^{3} u}{\partial x^{3}}\vert _{x_{i},t_{n}}+\frac{(\Delta x)^{4}}{24} \frac{\partial^{4} u}{\partial x^{4}}\vert _{x_{i},t_{n}}  &
\label{eq:positive_taylor}
\end{flalign}
\begin{flalign}
&& u(x_{i}-\Delta x)\vert _{t_{n}} &= u\vert _{x_{i},t_{n}}-\Delta x \frac{\partial u}{\partial x}\vert _{x_{i},t_{n}}+\frac{(\Delta x)^{2}}{2} \frac{\partial^{2} u}{\partial x^{2}}\vert _{x_{i},t_{n}}-\frac{(\Delta x)^{3}}{6} \frac{\partial^{3} u}{\partial x^{3}}\vert _{x_{i},t_{n}}+\frac{(\Delta x)^{4}}{24} \frac{\partial^{4} u}{\partial x^{4}}\vert _{x_{i},t_{n}} &
\label{eq:negative_taylor}
\end{flalign}

By subtracting \equref{eq:positive_taylor}-\equref{eq:negative_taylor}:
\begin{flalign}
&& u(x_{i}+\Delta x)\vert _{t_{n}}-u(x_{i}-\Delta x)\vert _{t_{n}} &= 2\Delta x \frac{\partial u}{\partial x}\vert _{x_{i},t_{n}}+\frac{(\Delta x)^{3}}{3} \frac{\partial^{3} u}{\partial x^{3}}\vert _{x_{i},t_{n}} &
\label{eq:positive-negative_taylor}
\end{flalign}

The approximate of the first-order derivative will be:
\begin{flalign}
&& \frac{\partial u}{\partial x}\vert _{x_{i},t_{n}} &= \frac{u(x_{i}+\Delta x)\vert _{t_{n}}-u(x_{i}-\Delta x)\vert _{t_{n}}}{2\Delta x}-\frac{(\Delta x)^{2}}{6} \frac{\partial^{3} u}{\partial x^{3}}\vert _{x_{i},t_{n}} &
\label{eq:positive-negative_taylor}
\end{flalign}

Where $\frac{(\Delta x)^{2}}{6} \frac{\partial^{3} u}{\partial x^{3}}\vert _{x_{i},t_{n}}$ is the remainder term.

\subsection{Problem 2.2 from Allan Taflove book}
\textit{Repeat problem 2.1, but now derive a fourth-order accurate central-difference approximation for $\sfrac{\partial u}{\partial x}$}\\


Math (Djam is doing magic :-/ )
{'fraction_non_alphanumeric': 0.21330275229357798, 'fraction_numerical': 0.01998689384010485, 'mean_word_length': 5.268993839835729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2649483', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1024, 'n_words': 284}