+ (a) Analysis for f(x) = 9 + 8x - x^2. (Using actual distance function.)

- We enter the function and determine where it crosses the axes in order to get a reasonable plot.

Input := 

f[x_] = 9 - 8x - x^2;
Input := 

solRoots = Solve[f[x]==0,x] //N
Output =


{{x -> -9.}, {x -> 1.}}

Input := 

xl = x/.solRoots[[1]]; xr = x/.solRoots[[2]];
Input := 

fPlot = Plot[f[x],{x,xl,xr},AspectRatio->Automatic]
Output =


-Graphics-

- We believe that the circle will be tangent to the curve at two points, say (x0, f(x0)) and (x1, f(x1)) and tangent to the x-axis at say (a, 0). We need to determine these three values: x0, x1, and a.

- We find the lines perpendicular to the curve at the points of tangency and determine where they intersect. Then the distances from each of the tangency points to the center of the inscribed circle should be the same and should be equal to the height from the x-axis.

Input := 

eq0 = y - f[x0] == -1/f'[x0] (x - x0);
Input := 

eq1 = y - f[x1] == -1/f'[x1] (x - x1);
Input := 

sol = Expand[Solve[{eq0,eq1},{x,y}]];

- pt is the point of intersection of the lines perpendicular to the curve at the points of tangency.

Input := 

pt = {x,y}/.sol[[1]];

- So we see we have the point of intersection pt = (x, y) in terms of x0 and x1. We need to determine x0 and x1 and hence need two equations in these unknowns. Thus we determine the x0 and x1 values so that

(1) the distance from pt to (x1, f(x1)) is the same as the distance from pt to (x0, f(x0)) and

(2) the distance from the x axis to pt is the same as the distance from pt to, say (x0, f(x0)).

- (1) leads to equation d1 and (2) leads to equation d2.

Input := 

d1 = Sqrt[(pt[[1]] - x0)^2 + (pt[[2]] - f[x0])^2] ==
		Sqrt[(pt[[1]] - x1)^2 + (pt[[2]] - f[x1])^2]; 
Input := 

d2 = Sqrt[(pt[[1]] - x0)^2 + (pt[[2]] - f[x0])^2] == 
		pt[[2]];

- We solve for x0 and x1. Be sure to play with a number of starting values in order to get sensible answers which appear reasonable in the diagram.

Input := 

solp = FindRoot[{d1,d2},{x0,-8},{x1,0},
				MaxIterations->50]
Output =


{x0 -> -8.47214, x1 -> 0.472136}

- So now we have the x coordinates of our two points of tangency (x0, f(x0)) and (x1, f(x1)) on the curve. We call them z0 and z1 respectively.

Input := 

z0 = x0/.solp; z1 = x1/.solp;

- And we determine the point, newpt, which will serve as the center of the circle.

Input := 

newpt = pt/.solp
Output =


{-4., 4.5}

- This means our contact with the x-axis occurs at point (a, 0) where a is given below:

Input := 

a = pt[[1]]/.solp 
Output =


-4.

- And the radius of the maximum inscribed circle is given by rad below:

Input := 

rad = pt[[2]]/.solp
Output =


4.5

- We plot the two points of tangency (x0, f(x0)) and (x1, f(x1)) on the curve.

Input := 

pts = Show[Graphics[{PointSize[.1],Point[{z0,f[z0]}],
	Point[{z1,f[z1]}],Point[{a,0}]}],
	AspectRatio->Automatic,
	PlotRange->{{-10,4},{-4,10}}]
Output =


-Graphics-

- We plot the circle which is tangent to the two points (x0, f(x0)) and (x1, f(x1)) on the curve and the x-axis.

Input := 

circle = ParametricPlot[{rad Cos[t] + a,
	rad Sin[t] + rad},
	{t,0, 2 Pi},
	AspectRatio->Automatic,
	PlotRange->{{-10,4},{-4,10}}]
Output =


-Graphics-

- And we superimpose all three plots to see the situation.

Input := 

Show[fPlot,pts,circle]
Output =


-Graphics-

- Finally we determine the area of this maximum circle inscribed in our region.

Input := 

MaxArea = Pi newpt[[2]]^2//N
Output =


63.6173