# if $f\left(x+y,\frac{y}{x}\right)= x^2-y^2$ then $f(x,y)=?$

So, I have to find $f(x,y)$ if the following holds:

$$f\left(x+y,\frac{y}{x}\right)= x^2-y^2$$

I thought about replacing $x+y=X$, and $y/x=Y$, but now where do I replace this $x$ and $y$ that I've found?

-
Don't forget to accept an answer to this question. It's good policy to wait for a while to see if you get more answers before accepting, but make sure to accept an answer if you got at least one that you liked. Thanks. –  Git Gud Mar 18 '13 at 21:07
If you get answers that are helpful, you can "accept" one answer per question, but upvote as many as you'd like. To accept an answer, just click on the $\checkmark$ to the left of the answer you'd like to accept. –  amWhy Mar 18 '13 at 21:32

Set $X=x+y,Y=\frac{y}{x}$. Can you solve for $x,y$ as functions of $X,Y$?
OK, good. you can easily find $x=\frac{X}{1+Y},y=\frac{XY}{1+Y}$, so that $f(X,Y)=\left( \frac{X}{1+Y} \right)^2-\left( \frac{XY}{1+Y} \right)^2$ –  user1337 Mar 18 '13 at 20:58