Different ways to find limits?

21 visualizaciones (últimos 30 días)
Ilias Thanos
Ilias Thanos el 4 de Abr. de 2020
Editada: John D'Errico el 4 de Abr. de 2020
Cant think of any way to find limits except by downloading Symbolic Math Toolbox and using the syms and limit commands. Is there any other way?

Respuestas (1)

John D'Errico
John D'Errico el 4 de Abr. de 2020
Editada: John D'Errico el 4 de Abr. de 2020
So my response of a simple, succinct "Yes" is not enough? Drat. It did answer the question as asked.
Actually, I was thinking about pencil and paper. Perhaps L'Hospital's rule. :) Another standard technique is to use a Taylor series approximation of some part of the problem. Inspection will usually give you the needed answer there.
Ameer is correct though, as my limest & residuest routines would apply. I'd kind of forgotten about them, having written those tools so long ago. I won't claim them to be so terribly exciting though. Again, some simple time spent with pencil and paper would do as well much of the time. And one would learn more about the process of computing a limit along the way.
fun = @(x) sin(x)./x;
[fval,errest] = limest(fun,0)
fval =
1
errest =
3.58440115339741e-15
So it is pretty confident the limit of (sin(x)./x), as x--> 0 is 1. Not terribly exciting.
How about a limit as x--> inf? Lets try
f(x) = 3 - exp(-x)/x
the limit of f(x), as x--> inf should be 3, since exp(-x) will dominate x as x gets large.
fun1 = @(x) 3 - exp(-x)./x;
fun2 = @(x) fun1(1./x);
[fval,errest] = limest(fun2,0)
fval =
3
errest =
2.02764348964816e-14
It is a boring limit, since MATLAB can evaluate fun1(inf) simply enough.
fun1(inf)
ans =
3
This will be a better test. That is, find the limit of
f(x) = (2*x +3)/(x-2)
as x--> inf. Yes, it is pretty clear the result would be 2.
fun1 = @(x) (2*x + 3)./(x-2);
fun1(inf)
ans =
NaN
fun1 fails to evaluate at x==inf, since then we have the case inf/inf, which results in NaN.
fun2 = @(x) fun1(1./x);
[fval,errest] = limest(fun2,0)
fval =
2
errest =
5.06910872412039e-15
So even though fun1 fails to evaluate for x==inf, the limit is as expected, and limest is confident in the result.
A slightly more difficult problem would be something like:
f(x) = (x.*exp(x)-exp(x)+1)./x.^2
as x--> 0. This is more difficult, because it fiddles with the Taylor seies of exp(x), resulting in massive subtractive cancellation near x==0.
fun = @(x) (x.*exp(x)-exp(x)+1)./x.^2;
fun(0)
ans =
NaN
[fval,errest] = limest(fun,0)
fval =
0.500000000094929
errest =
1.5695794977038e-09
So, while successful in teasing out the limiting behavior at x==0, the error estimate is larger. That reflects the problem of subtractive cancellation. If I were to kill off more terms in the series, I could make things worse yet. However, a good pencil and paper solution would just derive a Taylor series for the numerator of that expression. The limit as x-->0 would be pretty clear then. Again pencil and paper wins.
Ok, so how about a problem where the limit fails to exist. Will limest recognize the problem?
fun = @(x) sin(1./x)
fun =
function_handle with value:
@(x)sin(1./x)
fun(0)
ans =
NaN
[fval,errest] = limest(fun,0)
fval =
0.775477503783188
errest =
0.144329285985063
So while it returns a prediction, the error estimate is relatively immense in context of a limit. It suggests the true limit, if it does exist, is very poorly defined. Of course, we should know that this function does lack any limit as x-->0.
Still, nothing to get too excited about. Pencil and paper would have done as well in all cases, and probably with less effort. Not as much fun to write though. ;-)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by