This commit is contained in:
jverzani
2025-01-24 11:04:54 -05:00
parent ff0f8a060d
commit 92f4cba496
28 changed files with 1070 additions and 124 deletions

View File

@@ -66,14 +66,18 @@ $$
\text{average} = \frac{1}{\pi-0} \int_0^\pi \sin(x) dx = \frac{1}{\pi} (-\cos(x)) \big|_0^\pi = \frac{2}{\pi}
$$
Visually, we have:
Visually:
```{julia}
plot(sin, 0, pi)
plot!(x -> 2/pi)
#| label: fig-integral-mean-value
#| fig-cap: "Area under sine curve is equal to area of rectangle"
plot(sin, 0, pi, legend=false, fill=(:forestgreen, 0.25, 0))
plot!(x -> 2/pi, fill=(:royalblue, 0.25, 0))
```
In @fig-integral-mean-value the area under the sine curve ($2 = (-\cos(\pi)) - (-\cos(0))$) is equal to the area under the average (also $2 = 2/\pi \cdot \pi$).
##### Example
@@ -91,7 +95,7 @@ What is the average value of the function $e^{-x}$ between $0$ and $\log(2)$?
$$
\begin{align*}
\text{average} = \frac{1}{\log(2) - 0} \int_0^{\log(2)} e^{-x} dx\\
\text{average} &= \frac{1}{\log(2) - 0} \int_0^{\log(2)} e^{-x} dx\\
&= \frac{1}{\log(2)} (-e^{-x}) \big|_0^{\log(2)}\\
&= -\frac{1}{\log(2)} (\frac{1}{2} - 1)\\
&= \frac{1}{2\log(2)}.
@@ -103,8 +107,8 @@ Visualizing, we have
```{julia}
plot(x -> exp(-x), 0, log(2))
plot!(x -> 1/(2*log(2)))
plot(x -> exp(-x), 0, log(2), legend=false, fill=(:forestgreen, 0.25, 0))
plot!(x -> 1/(2*log(2)), fill=(:royalblue, 0.25, 0))
```
## The mean value theorem for integrals