Exam 1 -- Lab portion 
(1/3 of total exam grade)

MAT 229, Spring 2025

Name: Wyatt Ethier

Great work, Wyatt: I’ve got nothing else to say! :)
Prof. Long

Instructions:

In this portion of the exam, you will study a function, called “f”, defined in the cell below:

f[x_]:=-36 x-5 (x^3)+(x^5)

“Show your work”: document your thoughts or any issues encountered in the notebook (using comments or text cells).

If you get stuck, don’t panic. Ask me a question.

At the end of the hour, please email your final notebook to me at longa@nku.edu. I should be able to execute your file and see the solutions clearly.

Featured commands:

Plot (Options: PlotRange, PlotStyle)

Solve (Options: Real)

ListPlot (Options: PlotStyle)

Show

Integrate

Exercises:

Plot f on the interval [-3.25,3.25] (5 pts).

Plot[f[x],{x,-3.25,3.25}]

Find the local extrema of f by solving for where the derivative of f is equal to 0. Numerical approximations are fine, and you should ignore any imaginary or complex roots (8 points). Create a list “extrema” of the pairs {x,f(x)} (2 points)

fp[x_]=D[f[x],x]
solutions1 = Solve[fp[x]==0,x]

min=x/.solutions1[[4]]
max=x/.solutions1[[3]]
extrema = {{max,f[max]},{min,f[min]}}

Find the inflection points of f by solving for where the second derivative is equal to 0. Numerical approximations are fine, and you should ignore any imaginary or complex roots (8 points). Create a list “inflection” of the pairs {x,f(x)} (2 points)

fpp[x_]=D[fp[x],x]
solutions2 =x/.Solve[fpp[x]==0,x]

inflection ={{solutions2[[1]],f[solutions2[[1]]]},{solutions2[[2]],f[solutions2[[2]]]},{solutions2[[3]],f[solutions2[[3]]]}}

Define the local linearization to f  at x=(1/2)  (whose graph is the tangent line when x=(1/2)).  Call it locallinear. (10 points)

tangentF[x_]=fp[1/2](x-1/2)+f[1/2] (*defining the tangent line*)
Plot[{f[x],tangentF[x]},{x,-3.25,3.25}] (*plotting to check my work*)

locallinear = tangentF[x]

Define a function called g, which is the antiderivative of f  whose value is 0 at x=0 .  (10 points)

g[x_]=Integrate[f[x],x]
g[0]

Provide four graphs:

a. A graph of f and its first and second derivatives on the interval [-3.25, 3.25] (8 points). Make the graph of f Blue and the two derivatives Dashed (2 points).

Plot[{f[x],fp[x],fpp[x]},{x,-3.25,3.25},PlotStyle->{Blue,Dashed,Dashed}]

b. A graph of f with points indicating the locations of the extrema and the inflection points  on the interval [-3.25, 3.25] (8 points). Make the extreme points Red and the inflection points Blue (2 points). Extra Credit: make the points Large for 3 points.

Show[
Plot[f[x],{x,-3.25,3.25}],
ListPlot[extrema,PlotStyle->{Red,PointSize[Large]}],
ListPlot[inflection,PlotStyle->{Blue,PointSize[Large]}]
]

c. A graph of the difference between f and locallinear on the interval [0,1]  (8 points).  Comment on how well the local linearization approximates f on this interval (2 points).

Plot[f[x]-locallinear,{x,0,1}] (*not very well because it has about 1.5 range of error*)

d. A graph of f and its antiderivative g on the interval [-3.25, 3.25] (8 points). Make the range [-200, 100] (2 points).

Plot[{f[x],g[x]},{x,-3.25,3.25},PlotRange->{-200,100}]