# Find $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying $f(x+y)^2=f(x)^2+yf(x)+xf(y)+y^2$ - Solved.

Find $$f: \mathbb{R} \rightarrow \mathbb{R}$$ satisfying $$f(x+y)^2=f(x)^2+yf(x)+xf(y)+y^2$$

It's solved, but I'm posting it to share it.

\begin{align} &P(x, y): f(x+y)^2=f(x)^2+yf(x)+xf(y)+y^2 \\ &P(y, x):f(x+y)^2=x^2+yf(x)+xf(y)+f(y)^2. \\ &\therefore f(x)^2-x^2=f(y)^2-y^2=c. \\ &\therefore f(x)= \pm \sqrt{x^2+c}. \\ &\text{Substituting to the original F.E.: } x^2+2xy+y^2+c = x^2+y^2+c \pm \Big(y\sqrt{x^2+c}+x\sqrt{y^2+c}\Big). \\ &\therefore 2xy= \pm y\sqrt{x^2+c} \pm x\sqrt{y^2+c}. \\ &\Rightarrow 4x^2y^2=x^2y^2+y^2c + x^2y^2+x^2c + 2xy\sqrt{(x^2+c)(y^2+c)}. \\ &\Rightarrow 2x^2y^2-(x^2+y^2)c=2xy\sqrt{(x^2+c)(y^2+c)}. \\ & \therefore 4x^4y^4 + (x^2+y^2)^2c^2 - 4x^2y^2(x^2+y^2)c = 4x^2y^2(x^2+c)(y^2+c). \\ &\Rightarrow 4x^4y^4+(x^2+y^2)c^2-4x^2y^2(x^2+y^2)c=4x^4y^4+4x^4y^2c + 4x^2y^4c + 4x^2y^2c^2 \\ &\Rightarrow (x^2+y^2)c^2-4x^2y^2(x^2+y^2)c=4x^2y^2(x^2+y^2+c)c \\ & \text{if } c=0: \text{Solution.} \\ &\text{if } c \neq 0: (x^2+y^2)c-4x^2y^2(x^2+y^2)=4x^2y^2(x^2+y^2+c). \\ &\Rightarrow (x^2+y^2-4x^2y^2)c=8x^2y^2(x^2+y^2). \\ & \therefore c = \frac {8x^2y^2(x^2+y^2)}{(x^2+y^2-4x^2y^2)}, \text{ which isn't constant, Contradiction.} \\ & \therefore c = 0. \\ & \text{Contributing this to the original F.E.: } x^2+2xy+y^2=x^2+y^2 \pm 2xy \\ & \Rightarrow f(x)=x.\end{align}

If you have another solution, please post it to the answer with a spoiler code. How to put math equations in a "spoiler" block?

Substitute $$x = 1$$ and $$y = 0$$ to get $$f(0) = 0$$.
Substitute $$x = 0$$ to get $$f(y)^2 = y^2$$.
The equation then becomes $$(x + y)^2 = x^2 + x f(y) + y f(x) + y^2$$ which simplifies to $$2xy = x f(y) + y f(x)$$. Plug in $$y = 1$$ to get $$2x = x f(1) + f(x)$$; then $$f(x) = (2 - f(1)) x$$.
Then in particular $$f(1) = 2 - f(1)$$. So $$f(1) = 1$$. Then $$f(x) = x$$.
We easily verify that $$f(x) = x$$ is a solution. So the only solution here is $$f(x) = x$$.