using SymPy
using Plots
plotly()
Plots.PlotlyBackend()
This section uses these packages:
In the March 2003 issue of the College Mathematics Journal, Leon M Hall posed 12 questions related to the following figure:
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.
We set up some variables to work symbolically:
@syms a::positive x::real
f(x) = x^2
fp(x) = 2x
m = fp(a)
mᴵ = - 1/m
tl = f(a) + m * (x - a)
nl = f(a) + mᴵ * (x - a)
zs = solve(f(x) ~ nl, x)
q = only(filter(!=(a), zs))
\(- a - \frac{1}{2 a}\)
The first question is simply:
1a. The \(y\) coordinate of \(Q\)
The value is \(f(q)\)
To minimize we solve for critical points:
\(\left[\begin{smallmatrix}\frac{\sqrt{2}}{2}\end{smallmatrix}\right]\)
The lone critical point must be at a minimum. (Given the geometry of the problem, as \(a\) goes to \(\infty\) the height does too, and as \(a\) goes to \(0\) the height will also go to \(\infty\). This can also be seen analytically, as \(q = -a - 1/(2a)\) which goes to \(-\infty\) when \(a\) heads to \(0\) or \(\infty\).)
In the remaining examples we don’t show the code by default.
1b. The length of the line segment \(PQ\)
2a. The horizontal distance between \(P\) and \(Q\)
2b. The area of the parabolic segment
2c. The volume of the rotated solid formed by revolving the parabolic segment around the vertical line \(k\) units to the right of \(P\) or to the left of \(Q\) where \(k > 0\).
- The \(y\) coordinate of the centroid of the parabolic segment
We warm up with the \(x\) coordinate, given by:
a fact noted by the author.
- The length of the arc of the parabola between \(P\) and \(Q\)
- The \(y\) coordinate of the midpoint ofthe line segment \(PQ\)
- The area of the trapezoid bound by the normal line, the \(x\)-axis, and the vertical lines through \(P\) and \(Q\).
- The area bounded by the parabola and the \(x\) axis and the vertical lines through \(P\) and \(Q\)
- The area of the surface formed by revolving the arc of the parabola between \(P\) and \(Q\) around the vertical line through \(P\)
- 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)
- The volume of the solid formed by revolving the parabolic segment around the \(x\)-axis
- The area of the triangle bound by the normal line, the vertical line through \(Q\) and the \(x\)-axis
- The area of the quadrilateral bound by the normal line, the tangent line, the vertical line through \(Q\) and the \(x\)-axis
# @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
tl₀ = a - f(a) / fp(a)
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;
The answers appear here in sorted order, some given as approximate floating point values:
article_answers = (1/(2sqrt(2)), 1/2, sqrt(3/10), 0.558480, 0.564641,
0.569723, 0.574646,
1/sqrt(3), 1/8^(1/4), 1/6^(1/4), .644004, 1/sqrt(2))
(0.35355339059327373, 0.5, 0.5477225575051661, 0.55848, 0.564641, 0.569723, 0.574646, 0.5773502691896258, 0.5946035575013605, 0.6389431042462724, 0.644004, 0.7071067811865475)