I said that this function is not an injection because $p(1, 2) = 6 = p(5, 1)$
But it is not always easy to find values and I wanted to know if there was a way of showing its not an injection by deriving a contraction using the definition of injection.
given $p(a, b) = p(c,d)$
$\frac{(a+1)b(b+1)}{2}$ = $\frac{(c+1)d(d+1)}{2}$
I get really confused when dealing with function with $R^2$ and now since there are 4 different variables I don't really know where to go from here. Any help would be appreciated.
I don't think there is a general rule. In this case I first noticed that $a$ and $c$ each only appear once, so I could try to pick useful values for $b,d$ and choose $a,c$ to fit. The trick seems to be getting the factors $b,b+1$ accounted for, so maybe we choose $b=3, d=8$. That way $b(b+1)=12, d(d+1)=72,$ so $b(b+1)$ divides into $d(d+1)$. Now we need $(a+1)=6(c+1), a=6c+5$. We find $p(11,3)=p(1,8)=72$
Another way is to recognize that you can let $a$ be whatever it needs to be as long as $b$ is small so its divisors are covered. Let $b=1$ and you can write $(a+1)1(1+1)=(c+d)d(d+1), a=\frac 12(c+1)d(d+1)-1$. Pick $c,d$ as you wish and compute $a$.