Bivariate Limits - Maple Help

 Bivariate Limits

The limit command has been enhanced for the case of limits of quotients of two bivariate analytic functions (i.e., functions in two variables for which a Taylor expansion exists at the limit point). Many such limits that could not be determined previously are now computable.

In Maple 2016, the following limit calls would return unevaluated, but they can now be computed in Maple 2017.

 >
 > $\mathrm{limit}\left(f,\left\{x=0,y=0\right\}\right)$
 ${-1}{..}{1}$ (1)
 > $g≔\frac{\mathrm{cos}\left({x}^{2}\right)+{y}^{3}-1}{{x}^{2}+{y}^{2}}:$
 > $\mathrm{limit}\left(g,\left\{x=0,y=0\right\}\right)$
 ${0}$ (2)

Plot these two functions in the neighborhood of the origin:

 > $\mathrm{pf}≔\mathrm{plot3d}\left(f,x=-0.5..0.5,y=-0.5..0.5,\mathrm{axes}=\mathrm{boxed}\right):\mathrm{pf}$
 > $\mathrm{pg}≔\mathrm{plot3d}\left(g,x=-0.5..0.5,y=-0.5..0.5,\mathrm{axes}=\mathrm{boxed}\right):\mathrm{pg}$

In the latter example, you can visually verify the existence of the limit.

In the first example, by inspecting the graph you can identify two different directions with different limits, namely $y=x$ and $y=-x$. Indeed:

 > $\mathrm{f__1}≔\genfrac{}{}{0}{}{f}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{y=x};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\underset{x\to 0}{lim}\mathrm{f__1}$
 $\mathrm{f__1}{≔}\frac{{\mathrm{sin}}{}\left({{x}}^{{2}}\right)}{{2}{-}{2}{}{\mathrm{cos}}{}\left({x}\right)}$
 ${1}$ (3)
 > $\mathrm{f__2}≔\genfrac{}{}{0}{}{f}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{y=-x};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\underset{x\to 0}{lim}\mathrm{f__2}$
 $\mathrm{f__2}{≔}{-}\frac{{\mathrm{sin}}{}\left({{x}}^{{2}}\right)}{{2}{-}{2}{}{\mathrm{cos}}{}\left({x}\right)}$
 ${-1}$ (4)
 > $\mathrm{with}\left(\mathrm{plots}\right):$
 > $\mathrm{c1}≔\mathrm{spacecurve}\left(\left[x,x,1\right],x=-0.5..0.5,\mathrm{color}=\mathrm{red},\mathrm{thickness}=3\right):$
 > $\mathrm{c2}≔\mathrm{spacecurve}\left(\left[x,-x,-1\right],x=-0.5..0.5,\mathrm{color}=\mathrm{blue},\mathrm{thickness}=3\right):$
 > $\mathrm{display}\left(\mathrm{pf},\mathrm{c1},\mathrm{c2}\right)$

How does Maple determine these limits? Let us consider a circle $C$ given by ${x}^{2}+{y}^{2}={r}^{2}$, where we will later let . Using the theory of Lagrange multipliers, the extremal values (maxima and minima) of the function $f$  on the circle, for a fixed radius $r$, satisfy the condition that the gradient of the function and the gradient of the constraint equation of the circle are parallel:

 > $C≔{x}^{2}+{y}^{2}-{r}^{2}:$
 > $\mathrm{with}\left(\mathrm{VectorCalculus}\right):\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $\mathrm{df}≔\mathrm{normal}~\left(\mathrm{Jacobian}\left(\left[f\right],\left[x,y\right]\right)\right)$
 ${\mathrm{df}}{≔}\left[\begin{array}{cc}{-}\frac{{y}{}{\mathrm{cos}}{}\left({x}{}{y}\right){}{\mathrm{cos}}{}\left({x}\right){+}{y}{}{\mathrm{cos}}{}\left({x}{}{y}\right){}{\mathrm{cos}}{}\left({y}\right){-}{2}{}{y}{}{\mathrm{cos}}{}\left({x}{}{y}\right){+}{\mathrm{sin}}{}\left({x}{}{y}\right){}{\mathrm{sin}}{}\left({x}\right)}{{\left({-}{2}{+}{\mathrm{cos}}{}\left({x}\right){+}{\mathrm{cos}}{}\left({y}\right)\right)}^{{2}}}& {-}\frac{{x}{}{\mathrm{cos}}{}\left({x}{}{y}\right){}{\mathrm{cos}}{}\left({x}\right){+}{x}{}{\mathrm{cos}}{}\left({x}{}{y}\right){}{\mathrm{cos}}{}\left({y}\right){-}{2}{}{x}{}{\mathrm{cos}}{}\left({x}{}{y}\right){+}{\mathrm{sin}}{}\left({x}{}{y}\right){}{\mathrm{sin}}{}\left({y}\right)}{{\left({-}{2}{+}{\mathrm{cos}}{}\left({x}\right){+}{\mathrm{cos}}{}\left({y}\right)\right)}^{{2}}}\end{array}\right]$ (5)
 > $\mathrm{dC}≔\mathrm{Jacobian}\left(\left[C\right],\left[x,y\right]\right)$
 ${\mathrm{dC}}{≔}\left[\begin{array}{cc}{2}{}{x}& {2}{}{y}\end{array}\right]$ (6)
 > $\mathrm{eq}≔\mathrm{numer}\left(\mathrm{normal}\left(\mathrm{Determinant}\left(⟨⟨\mathrm{df},\mathrm{dC}⟩⟩\right)\right)\right)$
 ${\mathrm{eq}}{≔}{2}{}{\mathrm{cos}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}{}{y}\right){}{{x}}^{{2}}{-}{2}{}{\mathrm{cos}}{}\left({x}\right){}{\mathrm{cos}}{}\left({x}{}{y}\right){}{{y}}^{{2}}{+}{2}{}{\mathrm{cos}}{}\left({y}\right){}{\mathrm{cos}}{}\left({x}{}{y}\right){}{{x}}^{{2}}{-}{2}{}{\mathrm{cos}}{}\left({y}\right){}{\mathrm{cos}}{}\left({x}{}{y}\right){}{{y}}^{{2}}{-}{2}{}{\mathrm{sin}}{}\left({x}{}{y}\right){}{\mathrm{sin}}{}\left({x}\right){}{y}{+}{2}{}{\mathrm{sin}}{}\left({x}{}{y}\right){}{\mathrm{sin}}{}\left({y}\right){}{x}{-}{4}{}{\mathrm{cos}}{}\left({x}{}{y}\right){}{{x}}^{{2}}{+}{4}{}{\mathrm{cos}}{}\left({x}{}{y}\right){}{{y}}^{{2}}$ (7)

Thus, the maximal and minimal values of $f$  on $C$ occur when both $C=0$ and $\mathrm{eq}=0$. For the bivariate limit, this means that it is sufficient to consider only those critical paths satisfying $\mathrm{eq}=0$. In order to solve this equation, first approximate it by a multivariate Taylor series at the origin, up to terms of order 8 or higher.

 > $\mathrm{eq2}≔\mathrm{mtaylor}\left(\mathrm{eq},\left[x,y\right],8\right)$
 ${\mathrm{eq2}}{≔}{-}{{x}}^{{4}}{+}{{y}}^{{4}}{+}\frac{{1}}{{12}}{}{{x}}^{{6}}{+}\frac{{1}}{{4}}{}{{x}}^{{4}}{}{{y}}^{{2}}{-}\frac{{1}}{{4}}{}{{x}}^{{2}}{}{{y}}^{{4}}{-}\frac{{1}}{{12}}{}{{y}}^{{6}}$ (8)

Now consider $y$ the main variable and try to solve the equation $\mathrm{eq2}=0$ in terms of univariate Taylor series $y=s\left(x\right)$, and start by looking at the lowest degree terms of $\mathrm{eq2}$, specifically

 > $\mathrm{select}\left(\mathrm{degree}=4,\mathrm{eq2}\right)$
 ${-}{{x}}^{{4}}{+}{{y}}^{{4}}$ (9)
 > $\mathrm{factor}\left(\right)$
 ${-}\left({x}{-}{y}\right){}\left({x}{+}{y}\right){}\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)$ (10)

You see that there are two approximate solutions which make the lowest degree terms of $\mathrm{eq2}$ vanish, specifically, $y=x$ and $y=-x$. In this example, these actually make the original equation $\mathrm{eq}$ vanish identically:

 > $\genfrac{}{}{0}{}{\mathrm{eq}}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{y=x}$
 ${0}$ (11)
 > $\genfrac{}{}{0}{}{\mathrm{eq}}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{y=-x}$
 ${0}$ (12)

Indeed, these are exactly the same two paths from above leading to the extremal values $1$ and $-1$. Since you have found two directions with different limits, you can conclude that the bivariate limit does not exist. The third factor, ${x}^{2}+{y}^{2}$, does not admit any real solutions and can therefore be ignored.
The following graph depicts both critical paths in the $x$, $y$-plane.

 > $\mathrm{implicitplot}\left(\mathrm{eq},x=-0.5..0.5,y=-0.5..0.5,\mathrm{numpoints}=10000,\mathrm{thickness}=2\right)$

Note that the critical paths are not necessarily always lines. For example, in the second example above:

 > $\mathrm{dg}≔\mathrm{normal}~\left(\mathrm{Jacobian}\left(\left[g\right],\left[x,y\right]\right)\right)$
 ${\mathrm{dg}}{≔}\left[\begin{array}{cc}{-}\frac{{2}{}{x}{}\left({\mathrm{sin}}{}\left({{x}}^{{2}}\right){}{{x}}^{{2}}{+}{\mathrm{sin}}{}\left({{x}}^{{2}}\right){}{{y}}^{{2}}{+}{{y}}^{{3}}{+}{\mathrm{cos}}{}\left({{x}}^{{2}}\right){-}{1}\right)}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)}^{{2}}}& {-}\frac{{y}{}\left({-}{3}{}{{x}}^{{2}}{}{y}{-}{{y}}^{{3}}{+}{2}{}{\mathrm{cos}}{}\left({{x}}^{{2}}\right){-}{2}\right)}{{\left({{x}}^{{2}}{+}{{y}}^{{2}}\right)}^{{2}}}\end{array}\right]$ (13)
 > $\mathrm{eq}≔\mathrm{numer}\left(\mathrm{normal}\left(\mathrm{Determinant}\left(⟨⟨\mathrm{dg},\mathrm{dC}⟩⟩\right)\right)\right)$
 ${\mathrm{eq}}{≔}{-}{2}{}{x}{}{y}{}\left({2}{}{\mathrm{sin}}{}\left({{x}}^{{2}}\right){+}{3}{}{y}\right)$ (14)
 > $\mathrm{implicitplot}\left(\mathrm{eq},x=-0.5..0.5,y=-0.5..0.5,\mathrm{numpoints}=100000,\mathrm{thickness}=3\right)$

In this example, $\mathrm{eq}$ factors into linear factors, and you obtain the following solutions for the critical paths:

 >
 $\left[\begin{array}{c}{x}{=}{0}\\ {y}{=}{0}\\ {y}{=}{-}\frac{{2}}{{3}}{}{\mathrm{sin}}{}\left({{x}}^{{2}}\right)\end{array}\right]$ (15)

The limits along all of the critical paths are identical:

 > $\mathrm{g__1}≔\genfrac{}{}{0}{}{g}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{\mathrm{paths}\left[1\right]};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\underset{y\to 0}{lim}\mathrm{g__1}$
 $\mathrm{g__1}{≔}{y}$
 ${0}$ (16)
 > $\mathrm{g__2}≔\genfrac{}{}{0}{}{g}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{\mathrm{paths}\left[2\right]};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\underset{x\to 0}{lim}\mathrm{g__2}$
 $\mathrm{g__2}{≔}\frac{{\mathrm{cos}}{}\left({{x}}^{{2}}\right){-}{1}}{{{x}}^{{2}}}$
 ${0}$ (17)
 > $\mathrm{g__3}≔\genfrac{}{}{0}{}{g}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{\mathrm{paths}\left[3\right]};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\underset{x\to 0}{lim}\mathrm{g__3}$
 $\mathrm{g__3}{≔}\frac{{\mathrm{cos}}{}\left({{x}}^{{2}}\right){-}\frac{{8}{}{{\mathrm{sin}}{}\left({{x}}^{{2}}\right)}^{{3}}}{{27}}{-}{1}}{{{x}}^{{2}}{+}\frac{{4}{}{{\mathrm{sin}}{}\left({{x}}^{{2}}\right)}^{{2}}}{{9}}}$
 ${0}$ (18)

This is a proof that the bivariate limit of $g$ at the origin exists and is equal to $0$.

The following graph depicts the function $g$ as well as all of the critical paths:

 > $\mathrm{curve__1}≔\mathrm{plots}\left[\mathrm{spacecurve}\right]\left(\left[\mathrm{rhs}\left(\mathrm{paths}\left[1\right]\right),y,\mathrm{g__1}\right],y=-0.5..0.5,\mathrm{color}=\mathrm{red},\mathrm{thickness}=3\right):$
 > $\mathrm{curve__2}≔\mathrm{plots}\left[\mathrm{spacecurve}\right]\left(\left[x,\mathrm{rhs}\left(\mathrm{paths}\left[2\right]\right),\mathrm{g__2}\right],x=-0.5..0.5,\mathrm{color}=\mathrm{red},\mathrm{thickness}=3\right):$
 > $\mathrm{curve__3}≔\mathrm{plots}\left[\mathrm{spacecurve}\right]\left(\left[x,\mathrm{rhs}\left(\mathrm{paths}\left[3\right]\right),\mathrm{g__3}\right],x=-0.5..0.5,\mathrm{color}=\mathrm{red},\mathrm{thickness}=3\right):$
 >
 > 

In general, the critical equation does not factor into linear factors, and then series approximations for all the critical paths are used.