Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying relation : $$f(xf(y)-f(x))=2f(x)+xy$$$\forall x,y \in \mathbb{R}$
Problem
Source: Viet Nam National Olympiad 2017
Tags: function, algebra
06.01.2017 11:07
As usual, let $P(x,y)$ denote $f(xf(y)-f(x))=2f(x)+xy$ for all $x,y\in \mathbb{R}$. $P(1,y)$ gives $f(f(y)-f(1))=2f(1)+y$ for all $y\in \mathbb{R}$. So, $f$ is bijective. For $t\in \mathbb{R}$ that $f(t)=0$, $P(t,t)$ and $P(t,0)$ give us $$\begin{rcases} f(0)=t^2\\ f(tf(0))=0\implies (tf(0))^2=t^2 \end{rcases} f(0)=f(0)^3\implies f(0)\in \{ 0,1,-1\}.$$ If $f(0)=-1$, we get that $-1=t^2$, contradicting the existence of $t\in \mathbb{R}$. If $f(0)=0$, $P(x,0)$ gives $f(-f(x))=2f(x)$ for all $x\in \mathbb{R}$. By surjectivity, $f(-x)=2x$ for all $x\in \mathbb{R}$, which is not a solution. So, $f(0)=1$. $P(0,0)$ gives $f(-1)=2$ and $P(1,1)$ gives $f(0)=2f(1)+1\implies f(1)=0$. $P(1,x)$ gives $f(f(x))=x$ for all $x\in \mathbb{R}$. So, $f(2)=-1$. $P(x,2)$ gives $f(-x-f(x))=2f(x)+2x$ for all $x\in \mathbb{R}$. For each $x\in \mathbb{R}$, let $z\in \mathbb{R}$ such that $f(z)=x+f(x)$. $P(z,1)$ gives $$f(-f(z))=2f(z)+z=f(-x-f(x))=2f(x)+2x=2x+2f(x)+z\implies z=0.$$Hence, $f(0)=1=x+f(x)$ for all $x\in \mathbb{R}$, and $f(x)=1-x$ for all $x\in \mathbb{R}$.
06.01.2017 13:54
$P(x,y)$: $f(xf(y)-f(x))=2f(x)+xy$. $P(1,x)$: $f(f(x)-f(1))=2f(1)+x$ $\forall x \in \mathbb{R}$. Hence $f$ is bijective. Let $x \neq 0$, $P(x,-\frac{f(x)}{x})$ $\implies$ $f(xf(-\frac{f(x)}{x})-f(x))=f(x)$ $\implies$ $f(-\frac{f(x)}{x})=1+\frac{f(x)}{x}$ $(*)$. Given $a$ s.t. $f(a)=0$, $P(a,a)$ gives $f(0)=a^2$. $P(1,1)$ gives $a^2=2f(1)+1$ $(i)$. $P(1,a)$ gives $f(-f(1))=2f(1)+a$ $(ii)$. $(*)$ for $x=1$ gives $f(-f(1))=1+f(1)$ $(iii)$. For $(i)$, $(ii)$ and $(ii)$, $a \in \{1, -3\}$, anyhow, $a \neq 0$, then apply $(*)$ to $x=a$, we get $f(0)=1$. But $a^2=f(0)=1$, so $a=1$. $P(1,x)$: $f(f(x))=x$ $\forall x \in \mathbb{R}$. $P(f(x),1)$: $f(-x)-f(x)=2x$ $\forall x \in \mathbb{R}$ $(**)$. Let $x \neq 0$. $P(x, f(\frac{f(x)}{x}))$ $\implies$ $f(\frac{f(x)}{x})=\frac{1-2f(x)}{x}$ (***). $(*), (**), (*)$ $\implies$ $2\frac{f(x)}{x}=f(-\frac{f(x)}{x})-f(\frac{f(x)}{x})=1+\frac{f(x)}{x}-\frac{1-2f(x)}{x}$ $\forall x \neq 0$. Therefore $\forall x \neq 0$ $f(x)=1-x$, and $f(0)=1$, hence $f=1-\mathrm{Id}$ which is indeed a solution.
06.01.2017 18:33
My Solution. I proved $f(0)=1, f(1)=0, f(-1)=-2,f(2)=1$ Then $P(1,y): f(f(y))=y$ $P(f(x),1): f(-x)=2x+f(x)$ $P(2,y): f(2f(y)+1)=2(y-1)$ Then prove $f(2(y-1))=2f(y)+1$ and $f(1-y)-2f(y)=3y-2$. From there it's easy to see that $f(x)=1-x$ $\forall x \in \mathbb{R}$ which is indeed the solution.
08.01.2017 13:32
See here http://www.artofproblemsolving.com/community/c6h116957p664323
08.01.2017 13:44
this was in one of my exams it is not too hard I think.
25.08.2017 22:11
My solution: Let $P(x,y)$ be the assertion of $f(xf(y)-f(x))=2f(x)+xy.$ $P(0,0)\implies f(-f(0))=2f(0).$ Suppose $f(0)=a,$ then $f(-a)=2a.(1)$ $P(1,x)\implies f(f(x)-f(1))=2f(1)+x\to f$ is bijective,then $\exists b,$ such that $f(b)=0.$ $$P(b,0)\implies f(ab)=0=f(b)\to ^{injectivity} ab=b.$$Case 1: $b=0.$ Then $f(0)=0.$ $$P(x,0)\implies f(-f(x))=2f(x)\to ^{surjectivity} f(x)=-2x,$$but this isn't solution. Case 2: $a=1,$ then $f(0)=1$ and from $(1)$ $f(-1)=2.$ $P(1,1)\implies f(1)=0.$ $P(1,-1)\implies f(2)=-1.$ $P(x,2)\implies f(-x-f(x))=2(f(x)+x),$ suppose $x+f(x)=f(t),$ since $f$ is surjectiv.Then $f(-f(t))=2f(t).$ $P(t,1)\implies f(-f(t))=2f(t)+t=2f(t)\to t=0.$ Then $x+f(x)=f(t)=1\to f(x)=1-x.$ which this is solution.
25.09.2017 14:06
Ferid.---. wrote: My solution: Let $P(x,y)$ be the assertion of $f(xf(y)-f(x))=2f(x)+xy.$ $P(0,0)\implies f(-f(0))=2f(0).$ Suppose $f(0)=a,$ then $f(-a)=2a.(1)$ $P(1,x)\implies f(f(x)-f(1))=2f(1)+x\to f$ is bijective,then $\exists b,$ such that $f(b)=0.$ $$P(b,0)\implies f(ab)=0=f(b)\to ^{injectivity} ab=b.$$Case 1: $b=0.$ Then $f(0)=0.$ $$P(x,0)\implies f(-f(x))=2f(x)\to ^{surjectivity} f(x)=-2x,$$but this isn't solution. Case 2: $a=1,$ then $f(0)=1$ and from $(1)$ $f(-1)=2.$ $P(1,1)\implies f(1)=0.$ $P(1,-1)\implies f(2)=-1.$ $P(x,2)\implies f(-x-f(x))=2(f(x)+x),$ suppose $x+f(x)=f(t),$ since $f$ is surjectiv.Then $f(-f(t))=2f(t).$ $P(t,1)\implies f(-f(t))=2f(t)+t=2f(t)\to t=0.$ Then $x+f(x)=f(t)=1\to f(x)=1-x.$ which this is solution. Can you explain to me in a more specific way why in case 1 from $f(-f(x))=2f(x)$ and by surjectivity we can get $f(x)=-2x$? Clearly from case 1 we have $P(1,1)$ which means $0=2f(1)+1$ which leads to $f(1)=-\frac{1}{2}$ and it does not satisfy $f(x) =-2x$?
25.09.2017 15:31
Caspper wrote: Ferid.---. wrote: My solution: Let $P(x,y)$ be the assertion of $f(xf(y)-f(x))=2f(x)+xy.$ $P(0,0)\implies f(-f(0))=2f(0).$ Suppose $f(0)=a,$ then $f(-a)=2a.(1)$ $P(1,x)\implies f(f(x)-f(1))=2f(1)+x\to f$ is bijective,then $\exists b,$ such that $f(b)=0.$ $$P(b,0)\implies f(ab)=0=f(b)\to ^{injectivity} ab=b.$$Case 1: $b=0.$ Then $f(0)=0.$ $$P(x,0)\implies f(-f(x))=2f(x)\to ^{surjectivity} f(x)=-2x,$$but this isn't solution. Case 2: $a=1,$ then $f(0)=1$ and from $(1)$ $f(-1)=2.$ $P(1,1)\implies f(1)=0.$ $P(1,-1)\implies f(2)=-1.$ $P(x,2)\implies f(-x-f(x))=2(f(x)+x),$ suppose $x+f(x)=f(t),$ since $f$ is surjectiv.Then $f(-f(t))=2f(t).$ $P(t,1)\implies f(-f(t))=2f(t)+t=2f(t)\to t=0.$ Then $x+f(x)=f(t)=1\to f(x)=1-x.$ which this is solution. Can you explain to me in a more specific way why in case 1 from $f(-f(x))=2f(x)$ and by surjectivity we can get $f(x)=-2x$? Clearly from case 1 we have $P(1,1)$ which means $0=2f(1)+1$ which leads to $f(1)=-\frac{1}{2}$ and it does not satisfy $f(x) =-2x$? Hey Caspper,be careful I wrote this isn't solution.
26.09.2017 07:36
Ferid.---. wrote: Caspper wrote: Ferid.---. wrote: My solution: Let $P(x,y)$ be the assertion of $f(xf(y)-f(x))=2f(x)+xy.$ $P(0,0)\implies f(-f(0))=2f(0).$ Suppose $f(0)=a,$ then $f(-a)=2a.(1)$ $P(1,x)\implies f(f(x)-f(1))=2f(1)+x\to f$ is bijective,then $\exists b,$ such that $f(b)=0.$ $$P(b,0)\implies f(ab)=0=f(b)\to ^{injectivity} ab=b.$$Case 1: $b=0.$ Then $f(0)=0.$ $$P(x,0)\implies f(-f(x))=2f(x)\to ^{surjectivity} f(x)=-2x,$$but this isn't solution. Case 2: $a=1,$ then $f(0)=1$ and from $(1)$ $f(-1)=2.$ $P(1,1)\implies f(1)=0.$ $P(1,-1)\implies f(2)=-1.$ $P(x,2)\implies f(-x-f(x))=2(f(x)+x),$ suppose $x+f(x)=f(t),$ since $f$ is surjectiv.Then $f(-f(t))=2f(t).$ $P(t,1)\implies f(-f(t))=2f(t)+t=2f(t)\to t=0.$ Then $x+f(x)=f(t)=1\to f(x)=1-x.$ which this is solution. Can you explain to me in a more specific way why in case 1 from $f(-f(x))=2f(x)$ and by surjectivity we can get $f(x)=-2x$? Clearly from case 1 we have $P(1,1)$ which means $0=2f(1)+1$ which leads to $f(1)=-\frac{1}{2}$ and it does not satisfy $f(x) =-2x$? Hey Caspper,be careful I wrote this isn't solution. Oh yeah sorry I can see it now But I still don't get it why by surjectivity we can get $f(x)=-2x$?
26.09.2017 08:23
Caspper wrote: Oh yeah sorry I can see it now But I still don't get it why by surjectivity we can get $f(x)=-2x$? From surjectivity in $f(f(x))=-2f(x),$ we can write $f(x)=y$ then $f(y)=-2y.$
16.12.2017 20:18
here is my solution at the exam : some my thought :f(xf(y)-f(x))=2f(x)+xy (1) f is bijective(easy). exist a:f(a)=0 then x=a in (1):f(af(y))=ay (2) y=0 in (2) then a=0 or f(0)=1.If a=0 then f(x)=-2x(not okay).Then f(0)=1 then x=y=1 in (1) then f(1)=0 then x=1 in (1):f(f(y))=y(3). y=1 in (1):f(-f(x))=x+2f(x) then replace x by f(x):f(-x)=2x+f(x)(4) then f(-1)=2 then f(2)=-1.then f(2f(y)+1)=2y-2=f(f(2y-2)) and f(2y-2)=2f(y)+1.x=-1 in (1) f(-f(y)-2)=4-y=f(f(4-y)) then f(4-y)+f(y)=-2 but (4):f(y-4)+f(y)=6-2y then y by 2y: f(y)+f(y-2)=4-2y then f(y)+f(y-1)=3-2y then f(y)-f(y-2)=-2 then f(y)=1-y.
28.03.2018 21:30
Strong_TTM wrote: Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying relation : $$f(xf(y)-f(x))=2f(x)+xy$$$\forall x,y \in \mathbb{R}$
31.12.2019 19:08
24.08.2020 16:13
Most of above solutions are too clever. Here is a more stupid way to think about this problem. Only $f(x)=1-x$ works; it's easy to check that it does. Let $P(x,y)$ denote the functional equation. Part I: $f(0)=1$, $f(1)=0$, and $f(-1)=2$ First, by fixing $x\ne 0$ and varying $y$, it's easy to see that $f$ must be bijective. Thus, take the unique real $t$ such that $f(t)=0$. We deduce that $$P(t,0)\implies f(tf(0)) = 0 \implies tf(0)=t.$$If $t=0$ (or $f(0)=0$), then $P(x,0)\implies f(-f(x)) = 2f(x)$. Thus, by surjectivity, $f(x)=-2x$ for all $x$, not a solution. Otherwise, we get that $f(0)=1$. Thus, $P(0,0)\implies f(-1)=2$. Now it remains to prove that $f(1)=1$. To do so, we consider $$P(t,t)\implies f(0)=t^2\implies t=\pm 1$$but $t$ cannot be $-1$ since we already have $f(-1)=2$. Hence, $t=1$ or $f(1)=0$. Part II: Conclusion Before we present the key steps, plug in $P(1,y)$ to get that $f$ is an involution. The key claim is the following. Claim: $f(x+4)=f(x)-4$ for all $x\in\mathbb{R}$. Proof: Plug in \begin{align*} P(f(x),1)&\implies f(-x) = 2x+f(x) \\ P(-1,f(x))&\implies f(-x-2) = 4-f(x) \implies f(x+2)+2x = -f(x) \end{align*}Plug in $x\to x+2$ in the last equation and combine with it to get $$f(x+4)+f(x+2)+2x+4=0 \implies f(x+4)-f(x)+4=0,$$hence the claim. $\blacksquare$ To end the game, we consider \begin{align*} P(x,f(y)) &\implies f(xy-f(x)) = 2f(x)+xf(y) \\ P(x,f(y+4)) &\implies f(xy+4x-f(x)) = 2f(x)+xf(y) - 4x \end{align*}Hence, $$f(xy+4x-f(x)) = f(xy-f(x)) - 4x.$$Finally, plug in $y=\tfrac{f(x)}{x}$ to get $f(4x) = 1-4x$ for all $x\ne 0$. This equation is trivially true when $x=0$, hence $f(x)=1-x$ for all real $x$ as desired.
28.10.2020 17:15
Ans:$f(x)=1-x$. It is easy to see that it satisfies the given equation. Let $P(x,y)$ denote the given assertion, assume there exists real numbers $a,b$ such that $f(a)=f(b)$, pick $x\ne 0$, we have \[P(x,a), P(x,b) \implies 2f(x)+xa=2f(x)+xb \implies a=b\]so $f$ is injective. Now notice that $P(-2, f(-2))\implies f(\lambda )=0$ for some real number $\lambda$. We then have \[P(x,0)\implies f(xf(0)-f(x))=2f(x) \ \ \ (1)\]\[P(\lambda ,\lambda )\implies f(0)=\lambda ^2 \ \ \ (2)\]\[P(\lambda , x) \implies f(\lambda f(x))=\lambda x \ \ \ (3)\]\[P(x, \lambda )\implies f(-f(x))=2f(x)+\lambda x \ \ \ (4)\]Using $P(\lambda ,0)$ we have \[f(\lambda f(0))=0 \implies \lambda f(0)=\lambda ^3=\lambda \implies \lambda =0, -1, 1.\]Case 1: $\lambda =0$. We have from $(2)$, $f(0)=0$ and from $(1)$, we have $f(-f(x))=2f(x)$, also \[P(1,1) \implies 0=f(0)=2f(1)+1\implies f(1)=-\frac{1}{2}.\]Now, \[f(-f(1))=f(\frac{1}{2})=2f(1)=-1 \implies f(-f(\frac{1}{2}))=f(1)=-\frac{1}{2}=2f(\frac{1}{2})=-2\]a contradiction. Case 2: $\lambda =-1$. We have $f(-1)=0$ and from $(3)$, we have $f(-f(x))=-x$ which implies that from $(4)$, let $x\rightarrow -f(x)$, \[f(x)=f(-f(-f(x)))=2f(-f(x))+f(x)=-2x+f(x)\]for all real number $x$, a contradiction. Case 3: $\lambda=1$. We have $f(1)=0$, from $(3)$, we have $f(f(x))=x$ and from $(4)$, let $x\rightarrow f(x)$, this gives us \[f(-x)=2x+f(x).\]Then, we observe that $f(-1)=2(1)+f(1)=2$ and $f(2)=f(f(-1))=-1$. Now, we use \[P(f(x),2)\implies f(-f(x)-x)=2x+2f(x)=2(f(x)+x)+f(f(x)+x) \implies f(f(x)+x)=0\implies f(x)+x=1 \implies \boxed{f(x)=1-x}, \ \ \forall x\in \mathbb{R}.\]
29.10.2020 14:05
Easy to show $f$ is bijective. Now,assume $f(z)=0$ and $f(c)=1$ Then, $P(z,c):f(zf(c)=zc \implies 0=f(z)=zc$.Hence,either $f(0)=0$ or $f(0)=1$. If $f(0)=0$ then, $P(x,0):f(-f(x))=2f(x) \implies f(-x)=2x \implies f(x)=-2x$ if$f(0)=1 \implies P(1,1):f(f(1)-f(1))=f(0)=1=2f(1)+1 \implies f(1)=0$ In this case:$P(1,y):f(f(y))=y$ Now,take $P(f(x),-2):f(f(x)f(-2)-x)=0=f(1) \implies f(x)$ is linear. Now,it remains to check $f(x)=ax+b$ and for which $a,b$ this works.
29.10.2020 20:07
it took me some more extra effort to dig in i luckily got the correct answer and proved it
prove unique ness //
13.02.2021 03:21
solved with sina feizi. $f$: bijective $f(-f(f(-1))-f(-1))=f(-1)$ $k=f(-1),f(k)=1-k$ $f(t)=0,f(r)=1$ $f(0)=t^2=f(f(t))$ $f(t^3)=0$ $\implies t=1,0$ case 1: $t=1$ $f(1)=0$ $f(f(y))=y$ $f(0)=1$ $f(f(x)y-x)=2x+f(x)f(y)$ $f(f(x)-x)=2x$ $f(-1)=2$ $f(2)=-1$ $f(-x-f(x))=2x+2f(x)$ $f(t)=x+f(x)$ $f(-f(t))=2x+2f(x)+t=2x+2f(x)\implies t=0$ case 2:$f(0)=0$ $f(-f(x))=2f(x)\implies^{surjectivity} f(x)=-2x $ contradiction.
13.02.2021 07:50
Not too different from https://artofproblemsolving.com/community/c6h116957 Let $P(x,y)$ denote the original proposition. Claim 1: $f$ is bijective. Proof: Fixing an $x \neq 0$ and varying $y$, we get that $f$ is surjective. Hence we can fix a $u$ such that $f(u)=0$. If $f(0)=0$, then $P(x,0)$ $\implies$ $f(-f(x))=2f(x)$ $\implies$ $f(x)=-2x$ for all $x$ by surjectivity, which is clearly not a solution. Therefore, $u \neq 0$. Now, if $f(a)=f(b)$, then comparing $P(a,u)$ and $P(b,u)$ gives $a=b$ as required. $\blacksquare$ Claim 2: There exist real numbers $a,b$ such that $b \neq 0$ and $f(y+a)=f(y)+b$ for all $y$. Proof: Let $a(x)=2xf(x)-f(x)$ and $b(x)=2f(x)-xf(x)$. Clearly $b(x)=0$ $\implies$ $x=2$ or $f(x)=0$. Now $P(x,xf(y)-f(x))$ gives $$f(x^2y+a(x))=x^2f(y)+b(x)$$$$\implies f(y+a(e))=f(y)+b(e)$$for all $y$ where $e= \pm 1$. We can't have $f(1)=f(-1)=0$ by injectivity, so one of $b(1),b(-1)$ is non-zero, which gives the required claim. $\blacksquare$ For $x \neq 0$, choose a $y$ such that $f(y)=\dfrac{f(x)}{x}$. Then comparing $P(x,y)$ and $P(x,y+a)$, we get $$f(x(f(y)+b)-f(x))=2f(x)+xy+ax=ax+f(xf(y)-f(x))$$$$\implies f(bx)=ax+f(0)$$for all $x \neq 0$. Clearly the above holds for $x=0$ as well. Since $b \neq 0$, this means that $f$ is linear, i.e., $f(x)=cx+d$ for some constants $c,d$. Putting this in the original equation and comparing coefficients, we get $c=-1$ and $d=1$, so the only solution is $$\boxed{f(x)=1-x \ \ \forall x \in \mathbb{R}}$$
24.06.2022 04:36
Nice problem! Here from A3.5 Denote the assertion $P(x,y).$ Then, note $P(1,y)$ gives $f(f(y)-f(1))=2f(1)+y,$ implying surjectivity. Then notice $f(x)=f(y) \implies f(f(x)-f(1))=f(f(y)-f(1)) \implies 2f(1)+x = 2f(1)+y \implies x=y,$ implying injectivity. Thus $f$ is bijective. Assume $f(k)=0$ for some $k.$ Then, notice $P(k,0)$ gives $f(kf(0)-f(k))=2f(k)+ky \implies f(kf(0))=0.$ However, since $f(k)=0$ we can reword as $f(kf(0))=f(k) \implies kf(0)=k.$ Note $P(k,k)$ gives $f(kf(k)-f(k))=2f(k)+k^2 \implies f(0)=k^2,$ so $k= \pm \textstyle \sqrt{f(0)},$ so we have two cases, whether $f(0)=1$ or $f(0)=-1.$ Consider the latter. Then, we have $P(0,0)$ gives $f(-f(0))=2f(0) \implies f(1)=-2.$ However, notice that $P(1,0)$ gives $f(f(0)-f(1))=2f(1) \implies f(1)=-4,$ which is a contradiction to $f(1)=-2.$ Thus, $f(0) \neq -1$ and so $f(0)=1.$ With this information, we do a few more substitutions. Note $P(0,0)$ gives $f(-f(0))=2f(0) \implies f(-1)=2.$ Recall from the previous paragraph $P(k,k)$ gives $f(kf(k)-f(k))=2f(k)+k^2 \implies f(0)=k^2,$ so $k= \pm \textstyle \sqrt{f(0)} = \pm 1.$ However, since $f(-1)=2$ it follows $f(1)=0.$ Then, note $P(1,x)$ gives $f(f(x)-f(1))=2f(1)+x \implies f(f(x))=x.$ Along with $f(-1)=2$ we see $f(2)=-1.$ Consider $P(x,2),$ producing \[f(xf(2)-f(x))=2f(x)+2x \implies f(-x-f(x))=2f(x)+2x=2(f(x)+x).\]Due to surjectivity, we know there exists some $m$ such that $f(m)=f(x)+x,$ so we can write $f(-f(m))=2f(m).$ Consider then $P(m,1),$ giving $f(mf(1)-f(m))=2f(m)+m \implies f(-f(m))=2f(m)+m.$ However, recall $f(-f(m))=2f(m),$ so $m=0.$ Therefore, $f(0)=f(x)+x,$ so $f(x)=1-x$ are all such functions satisfying the properties. It suffices to show $f(x)=1-x$ indeed works. This is just basic algebra, verifying both sides are equal. For the left side, we have $f(x(1-y)-(1-x))=f(-xy+2x-1) =xy-2x+2.$ For the right hand side, we have $2(1-x)+xy=xy-2x+2,$ so we see $f(x)=1-x$ indeed satisfies the relation, finishing our proof.
24.06.2022 04:55
Strong_TTM wrote: Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying relation : $$f(xf(y)-f(x))=2f(x)+xy$$$\forall x,y \in \mathbb{R}$ From this: Lemma, setting \(g(x)=-f(x)\) and \(h(x)=2f(x)\), we have that \(f\) is linear. Checking shows that \(f(x)=1-x\).
03.11.2023 17:46
let $P(x,y)$ be the assertion of $f(xf(y)-f(x)) =2f(x)+xy$. $P(1,x)\implies f(f(x)-f(1))=2f(1)+x $$\forall x \in \mathbb{R}$. Hence $f$ is surjective. $\exists a, b: f(a)=f(b), a \neq b$. $P(x,a) \implies f(xf(a)-f(x))=2f(x)+xa$. $P(x,b)\implies f(xf(b)-f(x))=2f(x)+xb$. $\implies f$ is injective $\forall x \in \mathbb{R}$. Hence $f$ is bijective. $\exists z : f(z)=f(x)/x$. $P(x,z) \implies f(0)=2f(x)+xz$ $P(1,1) \implies f(0)=2f(1)+2$ Hence $2f(x)+xz=2f(1)+2$ Hence $f(x)=ax+c \forall x \in \mathbb{R}$ Substituting gives $a^2xy+axc-a^2x-ac+c=2ax+2c+xy$ $\implies a=-1 c=1$ $\implies f(x)=1-x \forall x \in \mathbb{R}$