My document

Review for test 2 in MTH229

Test 2 will be on the 10th of November.

As with the first test, you can use the computer and the internet, but you can not use your phone during the test or communicate with others in any way during the test.

As with the first test, some questions will require you to show your Julia commands to receive full credit.

Here are some sample questions. Any similarity to actual questions is not intended and should not be inferred.

Limits

As in class, we use the following packages:

using MTH229
using Plots

(Unfortunately, plotly() doesn’t work within this HTML page, so our graphics are static.)

Question

Consider the function

\[ f(x) = \frac{x}{3 - \sqrt{x + 9}} \]

We wish to graphically identify the limit at \(0\).

f(x) = x / (3 - sqrt(x + 9))
plot(f, -1, 1)

What is the value?


How can you tell?

Question

Let

\[ f(x) = \left(\frac{a^x - x\cdot \log(a)}{b^x - x\cdot \log(b)}\right)^{1/x^2} \]

For some \(a\) and \(b\) we have a graph of \(f\):

Based on the graphic, what is \(\lim_{x \rightarrow 0}f(x)\)?


Question

Let

\[ f(x) = \left(\frac{a^x - x\cdot \log(a)}{b^x - x\cdot \log(b)}\right)^{1/x^2} \]

For some \(a\) and \(b\) we have the following output from the lim function of MTH229:

a, b = 4, 2
f(x) = ((a^x - x*log(a)) / (b^x - x*log(b)))^(1/x^2)
lim(f, 0)
6Γ—2 Matrix{Float64}:
 0.1     2.13034
 0.01    2.06377
 0.001   2.05663
 0.0001  2.05591
 1.0e-5  2.05584
 1.0e-6  2.05599

What is the suggested value of the limit as \(x \rightarrow 0\)?


Question

We can do limits with SymPy too. However, like numeric and graphical limits, there can be issues with symbolic limits.

Does the following limit found by SymPy agree with the one you just found?

@syms x
a, b = 4, 2
f(x) = ((a^x - x*log(a)) / (b^x - x*log(b)))^(1/x^2)
limit(f(x), x=>0)
∞

Does this code find the proper limit?

@syms x a b
f(x) = ((a^x - x*log(a)) / (b^x - x*log(b)))^(1/x^2)
L = limit(f(x), x=>0)
L(a =>4, b=>2)
      2         2   
   log (2)   log (4)
 - ─────── + ───────
      2         2   
β„―                   

Question

Let

\[ L = \lim_{x \rightarrow 4} \frac{\sqrt{x}-2}{x-4} \]

Using lim, find the suggested value of \(L\)


Using limit what is the exact value of \(L\)?

Question

Let

\[ f(x) = \frac{x+1}{|x+1|} \]

Using SymPy compute:

\[ L = \lim_{x \rightarrow -1+} f(x) \]


Using SymPy compute:

\[ L = \lim_{x \rightarrow -1-} f(x) \]


Does the limit at \(-1\) exist?

Derivatives

Question

What does the following code compute?

f(x) = cos(x)
c, h = pi/4, 1e-6
(f(c + h) - f(c)) / h
-0.7071071347342084

How accurate do you expect the answer to be?

Question

True or false: the forward difference quotient is simply the slope of the secant line between \(x=c\) and \(x=c+h\). When \(h\) is small, this secant line and tangent line have slopes which are approximately the same, but are not expected to be equal.

Question

When the MTH229 package is loaded, the notation f' can be used to find the automatic derivative of the function f. This automatic derivative numerically computes fully accurate derivatives up to slight numeric differences.

For example, the function \(f(x) = x\cdot e^{-2x^2}\) has a derivative at \(1\) of \(-3/e^2\). If f(x) = x*exp(-2x^2) how accurate is f'(1) (in absolute value)?


For the same function, plot the derivative over \([0,3]\). At what \(x\) value is the derivative smallest? (Answer from the graph).


Question

Let \(f(x) = \sin(\sin^2(x))\). Graph \(f\) and its derivative over the interval \([0, \pi]\). The graph of the derivative intersects the graph of \(f\) between the endpoints at what \(x\) value? Numerically find your answer.


Question

Symbolic derivatives are easy to take: just make x symbolic and the call diff. For example:

@syms x
diff(x*sin(x), x)
xβ‹…cos(x) + sin(x)

The only problem is the resulting derivative can grow in complexity. How many summands after simplification does the derivative of have?

@syms x
x*sin(x)*(1-cos(x))
xβ‹…(1 - cos(x))β‹…sin(x)

(That is, how many terms are added in the answer after SymPy simplifies?)


Interpreting the first and second derivative

Question

These graphs were produced using the plotif function from the MTH229 package. Select the one which corresponds to plotif(f,f',a,b) for some choice of f, a, and b.

Question

Let \(f(x) = \sin(x - \cos(x))\). Consider these commands:

f(x) = sin(x - cos(x))
fzeros(f', 0, 2pi)
2-element Vector{Float64}:
 1.5707963267948966
 4.71238898038454

What do they do mathematically:

Now consider:

f(x) = sin(x - cos(x))
fzeros(f'', 0, 2pi)
3-element Vector{Float64}:
 0.8602451023996021
 2.281347551190191
 4.712398004144786

What do they do mathematically:

Question

For some function, the following sign chart is produced

f (generic function with 1 method)
sign_chart(f', -1, 1)
3-element Vector{NamedTuple{(:DNE_0_∞, :sign_change), Tuple{Float64, String}}}:
 (DNE_0_∞ = 0.0, sign_change = "+ β†’ -")
 (DNE_0_∞ = 0.45018361129487355, sign_change = "- β†’ +")
 (DNE_0_∞ = 0.8767262153950625, sign_change = "+ β†’ -")

What can be said about the value 0.4501...?

Question

For some function \(f(x)\) the following code is run?

f (generic function with 1 method)
cps = fzeros(f', -1, 1)
2-element Vector{Float64}:
 -0.5235987755982989
  0.3246979402390842
f''.(cps)
2-element Vector{Float64}:
 -1.0956249566358063
  2.6831915802117856

Classify the value 0.3246979402390842.

Classify the value 0.3246979402390842.

Question

The derivative of \(f(x)\) is given by

\[ f'(x) = \cos(x - \sin^2(x)). \]

Plot \(f'\) over the interval \([-1,1/2]\). Graphically identify the critical point of \(f(x)\).


At the critical point, \(f(x)\) has:

Is this funny?

Question

pemdas

Is the above image funny or informative?