using SymPy
using Plots
using Roots
49 A dozen minima for a parabola
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
= fp(a)
m = - 1/m
mᴵ = f(a) + m * (x - a)
tl = f(a) + mᴵ * (x - a)
nl = solve(f(x) ~ nl, x)
zs = only(filter(!=(a), zs)) q
\(- a - \frac{1}{2 a}\)
The first question is simply:
1a. The \(y\) coordinate of \(Q\)
The value is \(f(q)\)
= f(q) yvalue
\(\left(- a - \frac{1}{2 a}\right)^{2}\)
To minimize we solve for critical points:
= solve(diff(yvalue, a), a) cps
\(\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\)
Show the code
= sqrt((f(a) - f(q))^2 + (a - q)^2); lseg
2a. The horizontal distance between \(P\) and \(Q\)
Show the code
= a - q; hd
2b. The area of the parabolic segment
Show the code
= simplify(integrate(nl - f(x), (x, q, a))); A
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\).
Show the code
@syms k::nonnegative
= simplify(integrate(2PI*(nl-f(x))*(a - x + k),(x, q, a))); V
- The \(y\) coordinate of the centroid of the parabolic segment
We warm up with the \(x\) coordinate, given by:
= integrate(x * (nl - f(x)), (x, q, a)) / A
xₘ simplify(xₘ)
\(- \frac{1}{4 a}\)
a fact noted by the author.
Show the code
= integrate( (1//2) * (nl^2 - f(x)^2), (x, q, a)) / A
yₘ = simplify(yₘ); yₘ
- The length of the arc of the parabola between \(P\) and \(Q\)
Show the code
= integrate(sqrt(1 + fp(x)^2), (x, q, a)); L
- The \(y\) coordinate of the midpoint of the line segment \(PQ\)
Show the code
= nl(x => (a + q)/2); mp
- The area of the trapezoid bound by the normal line, the \(x\)-axis, and the vertical lines through \(P\) and \(Q\).
Show the code
= 1//2 * (f(q) + f(a)) * (a - q); trap
- The area bounded by the parabola and the \(x\) axis and the vertical lines through \(P\) and \(Q\)
Show the code
= integrate(x^2, (x, q, a)); pa
- The area of the surface formed by revolving the arc of the parabola between \(P\) and \(Q\) around the vertical line through \(P\)
Show the code
# use parametric and 2π ∫ u(t) √(u'(t)^2 + v'(t)^2) dt
uu(x) = a - x
vv(x) = f(a - uu(x))
= 2PI * integrate(uu(x) * sqrt(diff(uu(x),x)^2 + diff(vv(x),x)^2), (x, q, a)); SA
- 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)
Show the code
# find b through mean value theorem,
# then solve for point of intersection
= only(solve(diff(f(x),x) ~ -1/fp(a), x))
b = only(solve(f(b) + fp(a)*(x-b) ~ nl, x))
b′ = sqrt((b-b′)^2 + (f(b) - nl(x=>b′))^2); segment_height
- The volume of the solid formed by revolving the parabolic segment around the \(x\)-axis
Show the code
= integrate(pi * (nl^2 - f(x)^2), (x, q, a)); Vₓ
- The area of the triangle bound by the normal line, the vertical line through \(Q\) and the \(x\)-axis
Show the code
= 1/2 * f(q) * (a - f(a)/(-1/fp(a)) - q); triangle
- The area of the quadrilateral bound by the normal line, the tangent line, the vertical line through \(Q\) and the \(x\)-axis
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
= a - f(a) / fp(a)
tl₀ = (a,q,q,tl₀)
x₁,x₂,x₃,x₄ = (f(a), f(q), 0, 0)
y₁, y₂, y₃, y₄ = (x₁ - x₂)*(y₁ - y₃)/2 - (x₁ - x₃)*(y₁ - y₂)/2 + (x₁ - x₃)*(y₁ - y₄)/2 - (x₁ - x₄)*(y₁ - y₃)/2; quadrilateral
The answers appear here in sorted order, some given as approximate floating point values:
= (1/(2sqrt(2)), 1/2, sqrt(3/10), 0.558480, 0.564641,
article_answers 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)