# Joint distribution of sum of random variables and their product

I have two independent random variables X and Y with given pmf. I want to calculate joint probability of W=X+Y and Z=XY, is the below formula correct for calculating it?

$$P(W=w,Z=z) = \sum_{k}P(X=k)P(Y=w-k \ \land Y = \frac{z}{k})$$

and by this, I want to show whether these two RV are dependent or independent.

I have to mention that I already calculate pmf for both W and Z.

The formula is "almost" correct. It is not unthinkable that $$P(X=0)>0$$ and in that case $$k$$ ranges over a set that contains $$0$$. That gives troubles because $$\frac{z}{k}$$ is part of the expression.
$$P\left(W=w,Z=z\right)=P\left(X+Y=w,XY=z\right)=\sum_{k}P\left(X=k\right)P\left(X+Y=w,XY=z\mid X=k\right)=$$$$\sum_{k}P\left(X=k\right)P\left(k+Y=w,kY=z\mid X=k\right)=\sum_{k}P\left(X=k\right)P\left(Y=w-k,kY=z\right)$$where the last equality is based on independence. Observe that $$Y=\frac{z}{k}$$ is replaced by $$kY=z$$.
Further note that for almost every $$k$$ the event $$\{Y=w-k,kY=z\}$$ is empty, so that you can hardly speak of "summation" because almost all terms are $$0$$.
A route that avoids the summation is:$$P\left(W=w,Z=z\right)=P\left(X+Y=w,XY=z\right)=P\left(X\left(w-X\right)=z\right)$$ You know the PMF of $$X$$ and based on that knowledge you can find the PMF of $$X(w-X)$$ for every $$w$$.