# 🌞 Week 9 ## Notes on <u>Integration</u> > **Prepared by:** _Roshan Naidu_ > **Instructor:** _Professor Leon Johnson_ > **Course:** _INFO H611_ > [!NOTE] > Inline math must be wrapped within `$ ... $` and display math within `$$ ... $$` in HackMD. > > Switching to the **Preview Mode** (👁️) would render eveything here to be viewed properly. ## Conventions and Definitions used throughout the writeup • Derivative of a function: $f'(x)$ • Second derivative: $f''(x)$ • Critical point: a point where $f'(x)=0$ or $f'(x)$ is undefined • Local minimum: a point where $f(x)$ is smaller than nearby values • Local maximum: a point where $f(x)$ is greater than nearby values --- ## Q.1. Let $f$ be the Gaussian function in the notebook. Then, the maximum value for $\Phi(x)$ exists at the point $a$, where $f(a) = 0$. In other words, if $f(a) = 0$, then $\Phi(x)$ has reached a maximum. I answered: **False**. Correct answer: **False**. ### **Why I thought it was False** My immediate intuition was that the statement is false because for a Gaussian (normal) distribution the probability density function (PDF) $f(x)$ is strictly positive for every finite \(x\). The cumulative distribution function (CDF) $\Phi(x)$ approaches its maximum value \(1\) only as $x \to +\infty$, not at some finite point $a$ where the PDF equals zero. In short: - The Gaussian PDF $f(x)>0$ for all finite $x$. - $f(a)=0$ would only occur at $a=\pm\infty$ in a limiting sense, not at a finite \(a\). - A CDF attains its maximum value only in the limit, so the claim "exists at the point \(a\) where $f(a)=0$" is misleading/false. ### **Why it was False (Theoretically)** Let the Gaussian PDF and CDF be $$ f(x)=\frac{1}{\sqrt{2\pi}\sigma}\exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right),\qquad \Phi(x)=\int_{-\infty}^{x} f(t)\,dt. $$ Key points: 1. Differentiation relation: $\Phi'(x)=f(x)$. Therefore, a necessary condition for a local extremum of $\Phi$ is $f(x)=0$. 2. For the Gaussian PDF, \(f(x)>0\) for every finite $x\in\mathbb{R}$. The Gaussian density decays to \(0\) only as $x\to\pm\infty$: $$ \lim_{x\to\pm\infty} f(x)=0. $$ 3. The maximum possible value of the CDF is $$ \sup_{x\in\mathbb{R}} \Phi(x)=\lim_{x\to+\infty}\Phi(x)=1, $$ but this value is reached only in the limit $x\to+\infty$, not at any finite \(a\) with $f(a)=0$. Therefore, the statement "the maximum value for $\Phi(x)$ exists at the point \(a\), where $f(a)=0$ is false because (i) $f(a)=0$ does not occur at any finite \(a\) for a Gaussian, and (ii) the maximum of $\Phi$ is an asymptotic limit, not a finite-point extremum where the PDF vanishes. ### **Example** #### Theoretical Take the standard normal distribution $\mathcal{N}(0,1)$: - PDF: $$ f(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}>0\quad\text{for all }x\in\mathbb{R}. $$ - CDF: $$ \Phi(x)=\int_{-\infty}^x \frac{1}{\sqrt{2\pi}}e^{-t^2/2}\,dt,\qquad \lim_{x\to+\infty}\Phi(x)=1. $$ Observations: - There is no finite \(a\) such that \(f(a)=0\). - The maximum of $\Phi$ is \(1\), attained only as $x\to+\infty$. - Thus the claim in the question (that a finite \(a\) with $f(a)=0$ is where $\Phi$ attains its maximum) is incorrect. #### Real-world Suppose $X$ models measurement errors and $X\sim\mathcal{N}(0,\sigma^2)$ Then: - For any physically measurable error \(x\) (finite), the density $f(x)>0$: there is always a nonzero probability density of observing that error. - The probability that the error is less than some threshold \(x\) is $\Phi(x)$, which tends to \(1\) as the threshold becomes arbitrarily large. - There is no finite measurement value \(a\) at which the density becomes exactly zero and simultaneously the CDF "reaches" its maximum. The maximum is only approached as the threshold goes to $+\infty$. This illustrates that in practice the maximum cumulative probability (certainty) is only an asymptotic limit, not a finite-point event where the PDF vanishes. >[!Important] For Gaussian distributions the CDF reaches its maximum only in the limit $x\to+\infty$. The PDF never equals zero at any finite \(x\), so the claim that "if $f(a)=0$ then $\Phi(x)$ has reached a maximum" is **false**. --- ## Q.2. *The error function has a maximum rate of change at \(x = 0\).* I answered: **True**. Correct answer: **True**. ### **Why I thought it was True** My intuition was based on the known shape of the error function $\operatorname{erf}(x)$: - It is an S-shaped sigmoid curve. - Such curves typically increase most steeply at their midpoint. - For $\operatorname{erf}(x)$, this midpoint is at \(x=0\). I also remembered that $\operatorname{erf}(x)$ is closely connected to the Gaussian function, and the Gaussian PDF is highest at \(x=0\), which made it natural to think that the slope (derivative) of $\operatorname{erf}(x)$ is also maximized there. ### **Why it was True (Theoretically)** The error function is defined as: $$ \operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2}\,dt. $$ Differentiate it: $$ \frac{d}{dx}\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} e^{-x^2}. $$ This derivative *is itself a Gaussian function* (scaled), and Gaussian functions satisfy: - Maximum value occurs at \(x = 0\). - They decrease symmetrically as $|x|$ increases. Thus: $$ \max_{x\in\mathbb{R}} \frac{d}{dx}\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} e^{-0^2} = \frac{2}{\sqrt{\pi}}. $$ ### **Example** #### **Theoretical** Consider the derivative: $$ \operatorname{erf}'(x)=\frac{2}{\sqrt{\pi}}e^{-x^2}. $$ Evaluate at a few points: | \(x\) | $\operatorname{erf}'(x)$ | |------|-----------------------------| | \(-2\) | $\frac{2}{\sqrt{\pi}}e^{-4} \approx 0.015$ | | \(-1\) | $\frac{2}{\sqrt{\pi}}e^{-1} \approx 0.207$ | | \(0\) | $\frac{2}{\sqrt{\pi}} \approx 1.128$ | | \(1\) | $\approx 0.207$ | | \(2\) | $\approx 0.015$ | This table clearly shows the **maximum** derivative at \(x=0\). #### **Real-world** The error function appears in: - heat diffusion, - cumulative normal probability approximations, - signal smoothing, - error propagation models. **Example: heat diffusion in a semi-infinite solid** The temperature profile for a material suddenly exposed to a hotter surface is: $$ T(x,t)=T_0 + (T_s - T_0)\,\operatorname{erf}\left(\frac{x}{2\sqrt{\alpha t}}\right), $$ where: - $T_s$ = surface temperature, - $T_0$ = initial temperature, - $\alpha$ = thermal diffusivity. The *steepest temperature gradient* occurs at the boundary \(x=0\). This is because the derivative of the erf-term is largest at \(x=0\), matching the mathematical result. Real-world meaning: - Heat flows fastest initially at the interface. - The steepest slope of the temperature profile is exactly where the erf-function changes fastest at \(x=0\). >[!Important] > The derivative of the error function is a Gaussian, which peaks at \(x=0\). > Hence the error function changes most rapidly at \(x=0\). --- ## Q.3. *The error function does not have an inflection point.* I answered: **True**. Correct answer: **False**. ### **Why I thought it was True** My intuition initially was: - The error function $\operatorname{erf}(x)$ is smooth, S-shaped, and monotonic. - Because it looks like a softened step function, I assumed the curvature gradually decreases without a single “sharp” transition point. - Since sigmoid-like curves sometimes visually look like they “smoothly bend,” I mistakenly thought there might not be a true inflection point. So I chose **True** under the assumption that the curvature does not switch sign at a unique point. ### **Why it was False (Theoretical)** The error function is: $$ \operatorname{erf}(x)=\frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\,dt. $$ Differentiate: 1. First derivative: $$ \operatorname{erf}'(x)=\frac{2}{\sqrt{\pi}} e^{-x^2}. $$ 2. Second derivative: $$ \operatorname{erf}''(x)=\frac{2}{\sqrt{\pi}}(-2x)e^{-x^2} = -\frac{4x}{\sqrt{\pi}} e^{-x^2}. $$ Now analyze the sign of $\operatorname{erf}''(x)$: - For $x<0$: $-4x>0 \Rightarrow \operatorname{erf}''(x)>0$ → concave up - For $x>0$: $-4x<0 \Rightarrow \operatorname{erf}''(x)<0$ → concave down The curvature changes sign exactly at $$ x = 0 $$ This is the textbook definition of an **inflection point** So the statement “The error function does not have an inflection point” is **false**. ### **Examples** #### Theoretical Let the second derivative be: $$ \operatorname{erf}''(x)= -\frac{4x}{\sqrt{\pi}} e^{-x^2} $$ Evaluate around \(x=0\): | \(x\) | $\operatorname{erf}''(x)$ | Curvature | |------|------------------------------|-----------| | -1 | $+\frac{4}{\sqrt{\pi}} e^{-1}$ | concave up | | -0.5 | $+\frac{2}{\sqrt{\pi}} e^{-0.25}$ | concave up | | 0 | \(0\) | **inflection point** | | 0.5 | $-\frac{2}{\sqrt{\pi}} e^{-0.25}$ | concave down | | 1 | $-\frac{4}{\sqrt{\pi}} e^{-1}$ | concave down | This confirms mathematically that curvature switches sign at \(x=0\) #### Real-world The error function arises in the solution to the heat equation for a semi-infinite solid: $$ T(x,t)=T_0+(T_s - T_0)\,\operatorname{erf}\left(\frac{x}{2\sqrt{\alpha t}}\right) $$ Physical interpretation of the inflection point: - The temperature profile bends upward for negative \(x\) (closer to the cooler region). - It bends downward for positive \(x\) (closer to the heated region). - The transition from concave-up to concave-down where heat diffusion “shifts behavior” which occurs at $$ x = 0 $$ the exact inflection point of the error function. This is observable in real heat-transfer curves: the slope is steepest at the inflection point, and curvature switches sign exactly there. >[!Important] > The error function **does** have an inflection point. > It occurs at \(x=0\), where the second derivative changes sign. > Therefore the statement “The error function does not have an inflection point” is **False**. --- ## Q.4. As $x \to \infty$, \(f(x)\) approaches zero from above. This explains the asymptotic behavior of $\Phi$ I answered: **True**. Correct answer: **True**. ### Why I thought it was True I believed the statement was true because the standard normal PDF is $$ f(x)=\frac{1}{\sqrt{2\pi}} e^{-x^{2}/2}, $$ and since the exponential term $e^{-x^2/2}$ rapidly shrinks as \(x\) becomes large, the entire expression tends toward zero. Also, the PDF is always positive, so it “approaches zero from above,” never crossing below zero. Intuitively, I knew that the tails of the normal distribution get flatter and flatter, so I expected the PDF to taper toward zero. ### Why it was True (theoretical) The reason the statement is **true** follows directly from limits: $$ \lim_{x\to\infty} \frac{1}{\sqrt{2\pi}} e^{-x^{2}/2} = 0. $$ Since: - $e^{-x^{2}/2} > 0$ for all real \(x\), - and the exponent $-x^2/2 \to -\infty$, we have: $$ e^{-x^{2}/2} \to 0^+, $$ so the PDF approaches zero **from above**. This also explains why the CDF, $$ \Phi(x)=\int_{-\infty}^{x} f(t)\,dt, $$ approaches **1 asymptotically**: as the PDF becomes negligible for large \(x\), the CDF accumulates nearly all its probability mass. ### Examples #### Theoretical Consider progressively larger values of \(x\): $$ \begin{aligned} f(2) &= 0.0540, \\ f(3) &= 0.00443, \\ f(4) &= 0.000134, \\ f(6) &= 6.08\times 10^{-9} \end{aligned} $$ Even though the values are positive, they decay rapidly toward \(0\). This shows the “thin tail” behavior of the Gaussian distribution. #### Real-world ##### Heights, SAT scores, or standardized metrics** Real-world standardized quantities often resemble a normal distribution. The fact that the PDF goes to zero as \(x\to\infty\) reflects that extremely tall individuals or extremely high scores are possible but exceedingly rare. ##### Diffusion/heat kernel tails** The Gaussian appears as the fundamental solution of the heat equation. The “heat kernel” $$ \frac{1}{\sqrt{4\pi t}} e^{-x^2 / (4t)} $$ also tends to zero as $|x|\to\infty$ Physically, this means temperature disturbances do not propagate infinitely with finite strength — they fade out. ## Q.5. Since \(f\) ranges from \(0\) to $\infty$, and it never touches the x-axis, the total area under the curve \(f\) must diverge to infinity. I answered: **False**. Correct answer: **False**. ### Why I thought it was False I believed the statement was false because I knew from probability theory that the Gaussian (normal) PDF is normalized to integrate to **1**: $$ \int_{-\infty}^{\infty} f(x)\,dx = 1 $$ So even though the function never actually reaches zero, the curve becomes extremely small very fast as $|x|$ grows, meaning its infinite domain does **not** imply infinite area. This contradicted the statement, so I judged it as false. ### Why it was False (Theoretical) The statement is **false** because a function can: - be **positive everywhere**, - extend over an **infinite domain**, - **never touch the x-axis**, **and still have a finite total area**. This happens when the function decays sufficiently fast. For the Gaussian function $$ f(x)=\frac{1}{\sqrt{2\pi}} e^{-x^{2}/2}, $$ the decay rate is *super-exponential* because of the $-x^2$ term in the exponent. Thus: $$ \int_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi}}e^{-x^2/2} \, dx = 1 $$ which is finite. So the conclusion “it must diverge to infinity” is incorrect. ### Examples #### Theoretical A classic mathematical counterexample is: $$ f(x) = e^{-x}. $$ - It is **positive for all $x \ge 0$ - It **never touches the x-axis**. - It extends to **infinity**. - Yet: $$ \int_{0}^{\infty} e^{-x} \, dx = 1 $$ This shows that “never touching the x-axis” does **not** imply infinite area. Another example is any PDF of a proper probability distribution. #### Real-world ##### Gaussian noise in electronics** Thermal noise follows a Gaussian distribution. Even though noise values can theoretically extend to $\pm\infty$, the total probability is exactly **1**, not infinite. This is why engineers can compute the likelihood of noise amplitudes over all ranges. ##### Distribution of human features (height, reaction time, etc.)** These are often modeled with a normal distribution: - The curve never reaches zero. - Possibilities extend indefinitely. - But the total probability of all human values is still exactly **1**. --- ## Q.6. Here, 50% of bull’s-eye hits occur less than $\ln(2)$ hours apart from one another. I answered: **True**. Correct answer: **True**. ### Why I thought it was True I recognized that the situation described in the notebook was modeled using an **exponential distribution**, which is commonly used to describe “time between events.” For an exponential distribution with rate parameter $\lambda = 1$: $$ f(t) = e^{-t}, \qquad t \ge 0. $$ The median of an exponential distribution is a well-known formula: $$ \text{Median} = \frac{\ln(2)}{\lambda}. $$ With $\lambda = 1$, this becomes simply: $$ \ln(2) $$ This means half of all time intervals are less than $\ln(2)$, so the statement intuitively seemed correct. ### Why it was True (Theoretical) Using the cumulative distribution function (CDF) For an exponential distribution with rate $\lambda = 1$: $$ F(t) = 1 - e^{-t}. $$ To find the median \(m\), we solve: $$ F(m) = 0.5. $$ So: $$ 1 - e^{-m} = 0.5 $$ $$ e^{-m} = 0.5 $$ $$ m = \ln(2) $$ This shows that: $$ \int_0^{\ln(2)} f(t) \, dt $$ $$ P(T < \ln(2)) = 0.5. $$ The exponential distribution describes waiting times between random events. The fact that $m = \ln(2)$ means: - There is a **50% chance** that the next event occurs **within $\ln(2)$ hours**. - There is a **50% chance** that it takes longer than $\ln(2)$ hours. $$ F(t) = \int_{0}^{t} f(u)\,du = \int_{0}^{t} e^{-u}\,du = 1 - e^{-t} $$ Thus, the statement is theoretically **true**. ### Examples #### Theoretical ##### Exponential Distribution Median** For rate $\lambda$: $$ \text{Median} = \frac{\ln(2)}{\lambda}. $$ This applies to any exponential random variable such as decay times, inter-arrival times, or service times in queues. ##### Poisson Process Inter-Arrival Times** If bull-eye hits follow a **Poisson process**, then the time between hits is exponential. A direct result: $$ \Pr(T < \ln(2)) = 0.5. $$ #### Real-World ##### Radioactive decay** Time until a nucleus decays is exponential. Half-life is defined by: $$ P(T < t_{1/2}) = 0.5 $$ and: $$ t_{1/2} = \frac{\ln(2)}{\lambda} $$ ##### Customer arrivals in a store** If arrivals follow a Poisson process (often realistic for large populations), the time between customers is exponential. Half the customers arrive within the median wait time. --- ## Q.7. The integral of \(f\) is a function with a defined maximum value, unlike the error function. I answered: **True**. Correct answer: **False**. ### Why I thought it was True I assumed that since the Gaussian function $$ f(x) = e^{-x^2} $$ is positive and bell-shaped, its integral would behave like the area accumulated under a bump. Intuitively, a bell curve has a “finite height,” so I thought: - the integral might rise up to some finite maximum value - and then maybe decrease afterwards - meaning it would have a well-defined point at which it reaches a maximum. This misunderstanding comes from confusing **the height of the Gaussian** with **the behavior of its cumulative integral**. ### Why it was False (theoretical) since both the integral of $f$ $f(t)=e^{-t}$ and the error function $erf(x)$ are bounded with well defined maximum values. $$ f(t)=e^{-t},t>0 $$ $$ F(t)=\int_{0}^{t} e^{-u}\,du =1 - e^{-t} $$ With $t \to \infty$, $F(t)\to 1$ $$ \operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2}\,dt $$ Hence the behaviour is similar to the error function. ### Examples #### Theoretical ##### Error function behavior The error function: $$ \text{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2} dt $$ is strictly increasing and never reaches a maximum. It only approaches 1 as $x\to\infty$ #### Real-World ##### Heat diffusion (error function solution) Solutions to the heat equation on a semi-infinite rod involve the error function. Temperature gradually approaches an equilibrium asymptotically. It rises monotonically but **has no maximum point** — only an equilibrium limit. --- ## Q8. Expected (Average) Density on the Interval $[1,2]$ I answered: **True**. Correct answer: **True**. ### Why I thought it was **True** I believed the statement was true because the notebook consistently showed that the *expected* or *average* value of a quantity over an interval is computed by integrating the function over that interval. In the bullseye example, the density of hits depends on the distance from the center, so to find the expected density inside the orange ring (from radius 1 to radius 2), the notebook demonstrated that we must integrate the density function from $1$ to $2$. This matches the earlier examples where average quantities were always obtained through integration over a specified range. ### Why it is **True** Theoretically The statement is true because the orange shaded in the representation represents proportion of bulls-eye hits occurring between 1 and 2 hours and the interval length is 1,that's why the integral also equals the average density. Integral over the interval $[1,2]$ is: $$ \int_{1}^{2} f(t)\,dt = \int_{1}^{2} e^{-t}\,dt = e^{-1} - e^{-2} $$ Density over the interval $[1,2]$ is: $$ f_{\text{avg}} = \frac{1}{2-1}\int_{1}^{2} e^{-t}\,dt = e^{-1} - e^{-2} $$ This follows from the fundamental principle that the expected value of a continuous quantity over an interval is the integral of the function (the accumulated density) divided by the interval length. Since the orange region corresponds exactly to radii from $1$ to $2$, integrating the density function on that interval correctly computes the expected density within that region. ### Example **Real-World** Imagine archers practicing with a target, where shots tend to spread out farther as distance from the center increases. The probability of a hit at distance $r$ from the center is modeled by some density function $f(r)$ based on collected data. To find the *average* hit density in the orange ring of the target (between circles of radius $1$ m and $2$ m), we integrate the density model from $1$ to $2$. This allows coaches or analysts to quantify how frequently arrows land in that specific zone, helping evaluate accuracy patterns and training progress. --- ## Optional LaTeX Practice Some useful math symbols: $\alpha,\beta,\gamma,\pi,\infty$ $\nabla, \int_0^1 f(x)\,dx, \sum_{i=1}^n i^2$ $\lim_{x\to 0}\frac{\sin x}{x} = 1$ Actions: Fractions: $\tfrac{1}{2}$ Summation: $\sum_{i=1}^n i^2\) → \(\sum_{i=1}^n i^2$ Integral: $\int_0^1 x^2\,dx = \tfrac{1}{3}$ Determinant: $\det(A)$ Inverse: $A^{-1}$ --- ## 🌕 Final Reflection This week’s work on **integration, area, expected values, and continuous density functions** offered a clearer picture of how integrals operate not only as mathematical tools, but as conceptual bridges between *local behavior* and *global outcomes*. Across the questions, I began to see how integration is fundamentally about **accumulation**, whether we accumulate distance, probability, density, or any continuous quantity. The idea that an integral measures “total effect” became especially apparent in problems involving **average value**, where the expected behavior of a system is captured by integrating over an interval and normalizing by its length. A major theme that emerged was the importance of understanding **what the integral represents in context**. For example, integrating a density function between radii \(1\) and \(2\) was not just a symbolic exercise; it reflected the real accumulation of bullseye hits in a specific region of space. This reinforced the broader principle that the choice of interval and the interpretation of the function being integrated directly determine the meaning of the final result. Through theoretical and real-world interpretations, I also appreciated the versatility of integration: - It can describe **physical quantities**, like total mass or energy. - It can represent **probabilistic expectations**, such as the likelihood of landing in a particular region. - It can model **continuous behavior**, like variable density or changing rates. Overall, this week highlighted that: - Integrals are powerful because they unify **geometry, probability, and physical modeling** through the idea of accumulation. - The *average value* formula is not just a computation, but a conceptual reminder that expected behavior arises from **integrating local contributions** over a region. - Understanding what the function represents — not just how to compute the integral — is what makes these tools meaningful in theory and in real-world scenarios. This deeper connection between the symbolic and the practical has made integration feel less like a task and more like a lens for understanding continuous phenomena across mathematics and the world around us.