lots of cleanup
This commit is contained in:
@@ -16,8 +16,11 @@ gr();
|
||||
|
||||
---
|
||||
|
||||
In the March 2003 issue of the College Mathematics Journal, Leon M Hall posed 12 questions related to the following figure:
|
||||
In the March 2003 issue of the College Mathematics Journal, Leon M Hall posed 12 questions related to @fig-parabola-tangent-normal-CMJ. The figure shows $f(x) = x^2$, the tangent line at $P = (a, f(a))$ (for $a > 0$), and the *normal* line at $(a, f(a))$. The questions all involve finding the value $a$ which minimizes a related quantity that has been previously discussed.
|
||||
|
||||
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
a₀ = 7/8
|
||||
@@ -63,10 +66,11 @@ end
|
||||
make_plot()
|
||||
```
|
||||
|
||||
The figure shows $f(x) = x^2$, the tangent line at $(a, f(a))$ (for $a > 0$), and the *normal* line at $(a, f(a))$. The questions all involve finding the value $a$ which minimizes a related quantity.
|
||||
A parabola with tangent and normal line at point $P$
|
||||
:::
|
||||
|
||||
|
||||
We set up some variables to work symbolically:
|
||||
The solutions are a bit of fun. To approach them, we set up some variables to work symbolically:
|
||||
|
||||
```{julia}
|
||||
@syms a::positive x::real
|
||||
@@ -86,6 +90,7 @@ The first question is simply:
|
||||
|
||||
> 1a. The $y$ coordinate of $Q$
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-y-coordinate}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
let
|
||||
@@ -94,6 +99,9 @@ let
|
||||
end
|
||||
```
|
||||
|
||||
Emphasis of $y$ coordinate of $Q$
|
||||
:::
|
||||
|
||||
The value is $f(q)$
|
||||
|
||||
```{julia}
|
||||
@@ -111,7 +119,7 @@ The lone critical point must be at a minimum. (Given the geometry of the problem
|
||||
::: {.callout-note}
|
||||
## We hide the code
|
||||
|
||||
In the remaining examples we don't show the code by default.
|
||||
In the remaining examples we don't immediately show the code to describe the value to optimize; it is hidden in a collapsed block.
|
||||
|
||||
:::
|
||||
|
||||
@@ -119,12 +127,15 @@ In the remaining examples we don't show the code by default.
|
||||
|
||||
> 1b. The length of the line segment $PQ$
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-PQ-line-segment}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
plot!([q₀, a₀], [f(q₀), f(a₀)], linewidth=5)
|
||||
```
|
||||
|
||||
Emphasis of line segment connecting $P$ and $Q$
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
@@ -138,12 +149,15 @@ lseg = sqrt((f(a) - f(q))^2 + (a - q)^2);
|
||||
> 2a. The horizontal distance between $P$ and $Q$
|
||||
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-PQ-horizontal-distance-PQ}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
plot!([q₀, a₀], [f(a₀), f(a₀)], linewidth=5)
|
||||
```
|
||||
|
||||
Emphasis of horizontal distance between $P$ and $Q$
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
@@ -155,7 +169,7 @@ hd = a - q;
|
||||
|
||||
> 2b. The area of the parabolic segment
|
||||
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-area-parabolic-segment}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
@@ -165,6 +179,8 @@ ys = vcat(f.(xs′), normal.(reverse(xs′)), f(first(xs′)))
|
||||
plot!(xs, ys, fill=(:green, 0.25, 0))
|
||||
```
|
||||
|
||||
Emphasis of parabolic segment formed by the normal line
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
@@ -189,14 +205,15 @@ V = simplify(integrate(2PI*(nl-f(x))*(a - x + k),(x, q, a)));
|
||||
|
||||
> 3. The $y$ coordinate of the centroid of the parabolic segment
|
||||
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-centroid-parabolic-segment}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
scatter!(p, [-1/(4a₀)], [1], marker=(10, :diamond))
|
||||
p
|
||||
```
|
||||
|
||||
Emphasis of centrood of the parabolic segment formed by the normal line
|
||||
:::
|
||||
|
||||
We warm up with the $x$ coordinate, given by:
|
||||
|
||||
@@ -218,7 +235,7 @@ yₘ = simplify(yₘ);
|
||||
|
||||
> 4. The length of the arc of the parabola between $P$ and $Q$
|
||||
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-arc-length-parabola}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
@@ -227,6 +244,9 @@ plot!(xs, f.(xs), linewidth=5)
|
||||
p
|
||||
```
|
||||
|
||||
Emphasis of arc-length along parabola
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
#| code-summary: "Show the code"
|
||||
@@ -237,7 +257,7 @@ L = integrate(sqrt(1 + fp(x)^2), (x, q, a));
|
||||
|
||||
> 5. The $y$ coordinate of the midpoint of the line segment $PQ$
|
||||
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-y-coordinate-of-PQ}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
@@ -247,6 +267,8 @@ scatter!([mid], [normal(mid)], markersize=5)
|
||||
p
|
||||
```
|
||||
|
||||
Emphasis of $y$ intercept for line $PQ$
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
@@ -258,7 +280,7 @@ mp = nl(x => (a + q)/2);
|
||||
|
||||
> 6. The area of the trapezoid bound by the normal line, the $x$-axis, and the vertical lines through $P$ and $Q$.
|
||||
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-trapezoid-normal-segment}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
@@ -267,6 +289,10 @@ plot!([q₀, a₀, a₀, q₀, q₀],
|
||||
p
|
||||
```
|
||||
|
||||
Emphasis of traapezoid bounded by the normal line
|
||||
:::
|
||||
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
#| code-summary: "Show the code"
|
||||
@@ -277,6 +303,7 @@ trap = 1//2 * (f(q) + f(a)) * (a - q);
|
||||
|
||||
> 7. The area bounded by the parabola and the $x$ axis and the vertical lines through $P$ and $Q$
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-area-under-parabola}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
p = make_plot()
|
||||
@@ -287,6 +314,8 @@ plot!(xs, ys, fill=(:green, 0.25, 0))
|
||||
p
|
||||
```
|
||||
|
||||
Area under the parabola between $P$ and $Q$
|
||||
:::
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -299,6 +328,7 @@ pa = integrate(x^2, (x, q, a));
|
||||
|
||||
> 8. The area of the surface formed by revolving the arc of the parabola between $P$ and $Q$ around the vertical line through $P$
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-surface-area-rotation}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
let
|
||||
@@ -310,6 +340,8 @@ let
|
||||
end
|
||||
```
|
||||
|
||||
Surface area formed by revolving arc through $P$
|
||||
:::
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -325,6 +357,7 @@ SA = 2PI * integrate(uu(x) * sqrt(diff(uu(x),x)^2 + diff(vv(x),x)^2), (x, q, a))
|
||||
|
||||
> 9. The height of the parabolic segment (i.e. the distance between the normal line and the tangent line to the parabola that is parallel to the normal line)
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-height-parabolic-segment}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
# distance point to a line
|
||||
@@ -339,6 +372,9 @@ plot!(x -> f(b₀) + (-1/fp(a₀))*(x - b₀), -1, 1/2)
|
||||
plot!([b₀,x₀], [f(b₀), normal(x₀)]; linewidth=5)
|
||||
```
|
||||
|
||||
Emphasis of the height of the parabolic segment
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
#| code-summary: "Show the code"
|
||||
@@ -354,6 +390,7 @@ segment_height = sqrt((b-b′)^2 + (f(b) - nl(x=>b′))^2);
|
||||
|
||||
> 10. The volume of the solid formed by revolving the parabolic segment around the $x$-axis
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-volume-formed-on-revolving-parabolic-segment}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
let
|
||||
@@ -365,6 +402,8 @@ let
|
||||
end
|
||||
```
|
||||
|
||||
Volume formed by revolving parabolic segment around $x$ axis
|
||||
:::
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
#| code-summary: "Show the code"
|
||||
@@ -375,6 +414,7 @@ Vₓ = integrate(pi * (nl^2 - f(x)^2), (x, q, a));
|
||||
|
||||
> 11. The area of the triangle bound by the normal line, the vertical line through $Q$ and the $x$-axis
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-area-triangle-normal-line-x-axis}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
make_plot()
|
||||
@@ -384,7 +424,8 @@ xlims!((-2, p₀ + 0.2))
|
||||
plot!([p₀,q₀,q₀,p₀], [0,f(q₀),0,0];
|
||||
fill=(:green, 0.25,0))
|
||||
```
|
||||
|
||||
Emphasis of triangle formed along normal line
|
||||
:::
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
#| code-summary: "Show the code"
|
||||
@@ -396,27 +437,27 @@ triangle = 1/2 * f(q) * (a - f(a)/(-1/fp(a)) - q);
|
||||
|
||||
> 12. The area of the quadrilateral bound by the normal line, the tangent line, the vertical line through $Q$ and the $x$-axis
|
||||
|
||||
::: {#fig-parabola-tangent-normal-CMJ-quadrilateral-normal-line}
|
||||
```{julia}
|
||||
#| echo: false
|
||||
make_plot()
|
||||
plot!([a₀,q₀,q₀,a₀-f(a₀)/fp(a₀),a₀],
|
||||
[f(a₀), f(q₀), 0, 0,f(a₀)], fill=(:green, 0.25, 0))
|
||||
```
|
||||
|
||||
Emphasis of quadrilateral bounded by normal line and tangent line
|
||||
:::
|
||||
|
||||
```{julia}
|
||||
#| code-fold: true
|
||||
#| code-summary: "Show the code"
|
||||
# @syms x[1:4], y[1:4]
|
||||
# v1, v2, v3 = [[x[i]-x[1],y[i]-y[1], 0] for i in 2:4]
|
||||
# area = 1//2 * last(cross(v3,v2) + cross(v2, v1)) # 1/2 area of parallelogram
|
||||
# print(simplify(area))
|
||||
# (x₁ - x₂)*(y₁ - y₃)/2 - (x₁ - x₃)*(y₁ - y₂)/2 + (x₁ - x₃)*(y₁ - y₄)/2 - (x₁ - x₄)*(y₁ - y₃)/2
|
||||
# use shoelace formula
|
||||
# (1/2) * (x₁⋅y₂-y₁⋅x₂ + x₂⋅y₃-y₂⋅x₃ + x₃⋅y₄-y₃⋅x₄ + x₄⋅y₁-y₄⋅x₁)
|
||||
tl₀ = a - f(a) / fp(a)
|
||||
x₁,x₂,x₃,x₄ = (a,q,q,tl₀)
|
||||
x₁, x₂, x₃, x₄ = (a, q, q, tl₀)
|
||||
y₁, y₂, y₃, y₄ = (f(a), f(q), 0, 0)
|
||||
quadrilateral = (x₁ - x₂)*(y₁ - y₃)/2 - (x₁ - x₃)*(y₁ - y₂)/2 + (x₁ - x₃)*(y₁ - y₄)/2 - (x₁ - x₄)*(y₁ - y₃)/2;
|
||||
quadrilateral = (1/2) * (x₁*y₂ - y₁*x₂ + x₂*y₃ - y₂*x₃ + x₃*y₄ - y₃*x₄ + x₄*y₁ - y₄*x₁);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
The answers appear here in sorted order, some given as approximate floating point values:
|
||||
|
||||
Reference in New Issue
Block a user