Calculating the partial derivatives of the piecewise function Define $ f:R^2→R $ by
$ f(x,y) := \begin{cases}
 \frac{2 x^2 -4 x + 6 y^3 - 13 y^2 + 8 y +1}{x- y}, \quad &\text{if }x\neq y; \\
 0,\quad &\text{if }x=y. 
\end{cases} $
I'm trying to solve for $\frac{\partial f}{\partial x}(1,1) $ and  $\frac{\partial f}{\partial y}(1,1) $.
I've tried to solve it a few times but I'm not quite sure if I'm solving it correctly. I tried a couple different techniques but I'm not quite sure which one applies and if I'm applying them correctly.
I know neither one of them are $0$ but I seem to get that answer quite often for the partial derivative with respect to x.
Technique 1:
$\lim _{x\to 1}\frac{f\left(x,\:1\right)-f\left(1,\:1\right)}{x-1}=\lim \:_{x\to \:1}\:\frac{\left(\frac{2\:x^2\:-4\:x\:+\:2}{x-\:1}\right)}{x-1}= \lim \:_{x\to \:1}\:\frac{\left(\frac{2\:\left(x-1\right)^2}{x-\:1}\right)}{x-1}= \lim \:_{x\to \:1}\:\frac{\left(2\:\left(x-1\right)\right)}{x-1} = 2$
$\lim \:_{y\to \:1}\frac{f\left(1,\:y\right)-f\left(1,\:1\right)}{y-1} = \lim \:\:_{y\to \:\:1}\:\frac{\left(\frac{\:6\:y^3\:-\:13\:y^2\:+\:8\:y\:-1}{1-\:y}\right)}{y-1} = \lim \:\:_{\to \:\:1}\:\frac{\left(\frac{\left(y-1\right)^2\left(6y-1\right)}{1-\:y}\right)}{y-1} 
= 
\lim\:\:\:_{y\to \:\:\:1}\:\left(\frac{\left(y-1\right)^2\left(6y-1\right)}{\left(1-y\right)\left(y-1\right)}\right) = \lim \:\:\:_{y\to \:\:\:1}\:\left(\frac{\left(y-1\right)\left(6y-1\right)}{\left(1-y\right)}\right) = \lim _{y\to 1}-6y+1 = -5$
The other technique is that I first take the partial derivative to x from the function and call it $g(x)$ for clarity. Then I set y=1 in $g(x)$ (the partial derivative). Then I solve the limit of x approaching $1$ for $g(x)$.
I would really appreciate any help on fixing my solution for this. If it's correct, can someone explain why exactly it's correct and how I can check this. Also are both techniques equivalent?
Thanks $:)$
 A: I think you need to develope a gut feeling of what these definitions mean.
Surjective or onto means every element gets mapped to.
If $(a,b)\in \mathbb N$ then they are both non-negative.  So for $(a,-b)$ then $a$ in non-negative and $-b$ is non-positive.  So no pair $(c,d)\in \mathbb Z$ where $d$ is positive and/or if $c$ is negative will get mapped to.
So not surjective.
Injective means when things are mapped the are mapped distinctly.  There are multiple ways to think of that and test that.  It can mean if two things are mapped to the same think then the things being mapped are the same.  It can mean if you map two different things you get different results.  Or, and in the case this is the best approach, it can mean if you have a result, you can always work backward and find a unique input.
So if $f(something) = (c,d)$ and the definition of $f(a,b) = (a,-b)$ then the $c$ can only have come from $c$.  And the $d$ can only have come from $|d|$ (and therefore $d = -|d|$ and is negative.
Anything else wouldn't work.  If $(a,b) \ne (c,|d|)$ then either $a \ne c$ or $b\ne |d|$.  If $a\ne c$ then $(a,-b) \ne (c,d)$.  And if $b\ne |d|$ then $-b \ne -|d| = d$, so $(a,-b) \ne (c,d)$.
Your proofs as you have edited them are fine.  You just have to believe them now.
