This is worth 5 points extra credit if done properly and turned in by May 4.
Get this as an ipynb file for IJulia.
L'Hopital's Rule is a valuable tool for computing certain limits, limits of a particular indeterminate form. These forms are of type $0/0$ and $\infty/\infty$.
The question is to determine if the following has a limit, and if it does what is it:
$$~ \lim_{x \rightarrow c} \frac{f(x)}{g(x)}. ~$$The basic idea is if you plug in "c" and you get the indeterminate forms above, then if
$$~ L = \lim_{x \rightarrow c} \frac{f'(x)}{g'(x)}, ~$$then this same $L$ is the answer to the first question.
In julia
we can approach this numerically. First, let's load some packages:
using Plots using Roots Base.ctranspose(f::Function) = D(f)
ctranspose (generic function with 38 methods)
And let's look at a favorite example – whose answer is known by other means – $\sin(x)/x$ at $c=0$.
f(x) = sin(x) g(x) = x c = 0 f(c)/g(c) # NaN is indeterminate f'(c) / g'(c) # We can plug in to get the limit!
1.0
So the limit is $1$.
Some times, we get the $f'(c)/g'(c)$ is also of indeterminate form. In that case, if $f''(x)/g''(x)$ has a limit at $c$, then so will $f(x)/g(x)$, etc. If higher-order derivatives are need, the syntax is f''
, f'''
, ...
Compute the following limit with the aid of L'Hopital's rule.
$$~ \lim_{x \rightarrow 1} \tan(\frac{\pi x}{2}) \ln(x). ~$$