Finding Limits of Two variables
3 views (last 30 days)
Show older comments
How can I write a program to find the limit of two variables. ( e.g. limit 2x^2 + y^3 ) where X tends to sqrt(y) & y tends to infinity .
0 Comments
Answers (2)
Sulaymon Eshkabilov
on 19 Feb 2023
Edited: Sulaymon Eshkabilov
on 19 Feb 2023
Here is a small example:
syms x y f(x, y)
f(x, y) = 2*x^2 + y^3;
XLIM = limit(f(x,y), x, sqrt(Inf))
YLIM = limit(f(x,y), y, Inf)
1 Comment
John D'Errico
on 19 Feb 2023
Edited: John D'Errico
on 19 Feb 2023
Note that this one at a time approach fails. In fact, it may well fail much of the time. For example, what is the limit of x/y, as both x and y approach zero? Is it 1? Is it inf? Is it zero? Cogent arguments exist for any of those three choices, and for infinitely many other choices. This is why the one at a time approach is generally incorrect when working with limits. If you choose only one path, you can easily be misled.
John D'Errico
on 19 Feb 2023
Edited: John D'Errico
on 19 Feb 2023
As stated in my comment to @Sulaymon Eshkabilov, the one variable at a time solution is rarely correct. Again, I'll give my example, of trying to find the limit of x/y, as both x and y approach zero.
- If you choose to set x to zero first, then the limit would appear to be 0, since 0/y is zero anywhere along the path.
- If you set x==y, then the limmit would appear to be 1, since again, the value of x/x is always 1 at any point along that path.
- If you set y = 0, then x/0 is alwys greater than any finnite number, commonly called inf. Therefore the limmit would appear to be inf.
- If you set x==k*y, for ANY non-zero constant k, then the limit would appear to be k.
In fact, a limit exists only if the limit is the same regardless of how you approach the limit point, that is, what path you take does not change the limit you would assign. This is a requirement for a limit to exist at that point.
You can do some reading online to learn more about these concepts. Any search that starts with "Limits in two dimensions" will probably hit something useful.
Of course, the example given by @M.I Muhit is fairly simple, since it along any path where y--> inf, the limit will also be inf. x for that function is irrelevant. Perhaps a more interesting question is a problem to find the limit of the function
syms x y
Z = (x - y^2)/(x+y)
As both x and y approach zero. We can use a similar approach as above. Thus if we follow some path through the plane that approaches zero, all such paths must approach the same limit.
limit(subs(Z,x,0),y,0)
limit(subs(Z,y,x),x,0)
limit(subs(Z,y,0),x,0)
Again, do you see the problem? Different paths, different limits.
I'll try one more. Perhaps this one will work. Again, try some simple paths.
W = (x^2 + y^2)/(x-y)
limit(subs(W,x,0),y,0) % the path with x==0
limit(subs(W,y,0),x,0) % the path with y==0
Well, at least along two simple paths, the limit seems well defined.
limit(subs(W,x,y),x,0) % along the path x==y
But there still seems to be a problem. Clearly when x==y (but not zero), the function is best represented as inf, yet that is inconsistent with the other results.
I should probably give an example where the limit is well defined, but hopefully you get the idea by now. Oh, well, how about this one?
U = (x^3 + y^3)/(x^2 + y^2)
For that function, however you approach zero, the numerator will always dominate the denominator, in the sense that it always goes faster to zero than the denominator, regardless of the path taken. So that function will probably have a well defined limit as both x and y approach zero.
0 Comments
See Also
Categories
Find more on Linear Algebra 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!