How to find a limit without syms and limit function
Show older comments
Let's take the limit
. How can i calculate it without using syms and matlab's function limit?
Accepted Answer
More Answers (1)
John D'Errico
on 6 Oct 2021
Edited: John D'Errico
on 6 Oct 2021
You can use my limest function. It is on the file exchange.
>> fun= @(x) (x.^3 - 1)./(x-1)
fun =
function_handle with value:
@(x)(x.^3-1)./(x-1)
Now use limest. It even provides an estimate of how well it thinks that limit is known.
[L,errest] = limest(fun,1)
L =
3
errest =
2.20957326622612e-14
Is that correct? l'hopital would tell me of course. Thus, if I differentiate the numerator and the demoninator, we would have 3^x^2/1. At x==1, that is 3.
The symbolic toolbox would agree, but you don't want to see that.
syms X
F = (x^3-1)/(x-1)
limit(F,1)
ans =
3
But we can still use the symbolic TB, without use of limit, just using l'hopital...
subs(diff(X^3-1),X,1)/subs(diff(X-1),X,1)
ans =
3
As expected, it returns 3 as the desired limit.
You can find limest on the file exchange, here:
LIMEST uses an adaptive, multi-order Richardson extrapolation scheme, modified to provide also an estimate of the uncertainty at the extrapolation point, all of my invention.)
Categories
Find more on MATLAB Mobile Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!