5.5 Quadratic Equations

Quadratic equations are of the form: f(x) = (ax^2)+bx+c where a,b,c are constants with a≠ 0.  The graphs of quadratic equations are called parabolas, which probably sound familiar.  Parabolas open up or down depending on the coefficient a in front of the (x^2) term.  If a > 0, the parabola opens and up if a < 0 the parabola opens down. The axis of symmetry is located at the x-coordinate x = -(b/(2a)) which also corresponds to  the minimum (a > 0) and maximum (a < 0) values of the quadratic functions, respectively.

What follows will be a couple of examples.

F1[x_]:=2x^2-3x-2;

F2[x_]:=-3x^2+5x+1;

VPlots = ListPlot[{{3/4,F1[3/4]},{5/6,F2[5/6]}}, PlotStyle->{Black}, PlotMarkers->{"✶",12},PlotLegends->{"Vertex Points"}];

QPlots = Plot[{F1[x],F2[x]},{x,-3,3}, PlotStyle->{{Red, Thickness[0.004]},{Blue,Thickness[0.004]}}, PlotRange-> {{-2,3},{-8,8}},PlotLegends->{"F1(x), a > 0", "F2(x), a < 0"}];

Show[QPlots, VPlots]

Example 5.14

Projectile motion is one of the most popular physical behaviours which can be modeled by a quadratic equation.  Neglecting wind resistance and keeping things ‘simple’, the height y and horizontal distance x are related by
y(x) = -16(1+(s^2))((((x/(Subscript[v, 0]))))^2)+sx
where s is the slope of the inclination of the cannon barrel, (Subscript[v, 0]) is the initial velocity in ft/sec, and x is the distance downrange in ft.

y[s_,v0_,x_]:=-16*(1+(s^2))((((x/v0)))^2)+s*x

We are given that s=0.5 and (Subscript[v, 0])= 250 ft/sec.

y[0.5,250,x]

QuadPlot = Plot[y[0.5,250,x],{x,0,1600},AxesLabel->{"downrange (ft)","vertical (ft)"}]

Part 1

To find how far downrange the projectile travels, we need to find where the function is equal to zero.  Clearly one solution is x=0, so we want the other solution, which is given by x=1562.5 ft downrange.

Solve[y[0.5,250,x]==0,x]

Part 2

We can use the Maximize command, or we can use the formula for the vertex.  Either way, we see that the maximum height of the projectile occurs 781.25 ft downrange, with an elevation of 192.31 ft.

Maximize[y[0.5,250,x],x,Reals]

y[0.5,250,x]

0.5/(0.00032*2)

y[0.5,250,781.25]

Part 3

So 1540 ft downrange there is a 20 ft tall wall... We shall add this to the picture.

WallPlot = Graphics[{ Gray, Thickness[0.004],Line[{{1540,0},{1540,20}}]}];

Show[QuadPlot,WallPlot]

Show[{QuadPlot,WallPlot}, PlotRange->{{1500,1600},{0,50}}]

y[0.5,250,1540]

NSolve[y[0.5,v0,1540]==20,v0]

NSolve[y[s,250,1540]==20,s]

QuadPlotNew = Plot[{y[0.5,250,x],y[0.5,251.481,x],y[0.509613,250,x],y[2.02691,250,x]},{x,0,1600},AxesLabel->{"downrange (ft)","vertical (ft)"},PlotLegends->{"s=0.5, v0=250","s=0.5, v0=251.481","s=0.509613,v0=250","s=2.02691,v0=250"}];

Show[{QuadPlotNew,WallPlot}, PlotRange->{{0,1600},{0,750}}]

Show[{QuadPlotNew,WallPlot}, PlotRange->{{1500,1600},{0,50}}]

Example 5.15

Scribner rule for estimating amount of lumber that can be obtained from a log:
V = (L/16)(0.79(D^2)-2D-4)
V is volume in board feet, L is the length of the log in feet, and D is the diameter of the smaller end of the log in inches.

Part 1

V[L_,D_]:=(L/16)*(0.79(D^2)-2D-4)

Plot[V[16,D],{D,6,28}]

2/(2*0.79)

Part 2

The min and max occur at the left and right endpoints of the interval [6, 28]. V(16,6) = 12.44 board feet, and V(16,28) = 559.36 board feet.

V[16,6]

V[16,28]

Part 3

The graph is concave up, so as the diameter increases, the rate of additional board feet obtained from the lumber increases per inch diameter.

Example 5.16

Here we have some data that we wish to fit to a quadratic equation:

OspreyData = {{0,8},{1,18},{2,18},{3,7}};

OspreyDataPlot = ListPlot[OspreyData,  PlotStyle->Red, PlotMarkers->{"✶",16},PlotLegends->{"Osprey Data",LegendMarkers->Automatic}]

Part 2

OspreyDataBestFitQuad = LinearModelFit[OspreyData,{1,t,t^2},t]

Part 3

OspreyQuadPlot=Plot[OspreyDataBestFitQuad[t],{t,0,6}, PlotStyle->{Blue, Thickness[0.004]},PlotLegends->{"Best Fit Line",LegendMarkers->Automatic}];

Show[OspreyDataPlot,OspreyQuadPlot, PlotRange->{{0,4},{0,20}}, AxesLabel->{"years after 1992","Osprey"}]

Part 4

We simply need to evaluate the best fit quadratic at t=4 years (after 1992).  It turns out there will be -14.25 osprey which we assume means there will be no more osprey.

OspreyDataBestFitQuad[4]

Exercise 9

We have a table of data which shows the number (in millions) of women employed outside the home:

({{Year, Number (millions)}, {1942, 16.11}, {1943, 18.70}, {1944, 19.17}, {1945, 19.03}, {1946, 16.78}})

EmployData = {{0,16.11},{1,18.7},{2,19.17},{3,19.03},{4,16.78}};

Part a.

The quadratic model is given by the LinearModelFit command:

EmployDataBestFitQuad = LinearModelFit[EmployData ,{1,t,t^2},t]

Part b.

Our function is called: EmployDataBestFitQuad(t), and we need to plug in t=5 to get the value 5 years after 1942 (1947) for the number of millions of women employed outside the home, which happens to be 13.314 million.

EmployDataBestFitQuad [5]

Part c.

The quadratic model does not appear to be a good model, as the actual values appear to be increasing, whereas in the quadratic model, the values will be decreasing as t gets larger.

EmployDataBestFitQuad [6]

Exercise 12.

We simply compute the slopes between successive points.  Note that data set 2 is linear, while data set 1 is not!

DataSet1 = {{0,10},{1,17},{2,26},{3,37},{4,50}};
DataSet2 = {{0,10},{1,17},{2,24},{3,31},{4,38}};

Table[N[(DataSet1[[i+1]][[2]]-DataSet1[[i]][[2]])/(DataSet1[[i+1]][[1]]-DataSet1[[i]][[1]])],{i,1,Length[DataSet1]-1}]

Table[N[(DataSet2[[i+1]][[2]]-DataSet2[[i]][[2]])/(DataSet2[[i+1]][[1]]-DataSet2[[i]][[1]])],{i,1,Length[DataSet1]-1}]

DataSet1BestFitQuad = LinearModelFit[DataSet1 ,{1,t,t^2},t]

DataSet2BestFitLine = LinearModelFit[DataSet2,{1,t},t]

DataPlots = ListPlot[{DataSet1,DataSet2}, PlotLegends->{"Set 1","Set2"}, PlotStyle->{Blue, Red}, PlotMarkers->{{"▽",16},{"✶",12}}];

FuncPlots = Plot[{DataSet1BestFitQuad[t],DataSet2BestFitLine [t]},{t,0,4}, PlotStyle-> {Blue, Red}];

Show[DataPlots,FuncPlots]