I'm suffering from the procedure I found, which is contradictory.
The original question is:
Let $f$ be differentiable. For all $x, y \in \mathbb R$, $$f(x+y)=f(x-y)+2f(y)+xy$$ Suppose $f'(0)=1$ and find $f(x)$.
My procedure was:
Put $x=y=0$: $$f(0)=f(0)+2f(0)+0$$ $$f(0)=0$$
Put $x=y=\frac{h}{2}$:
$$f(h)=2f\left(\frac{h}{2}\right)+\frac{h^2}{4}$$
Substituting $x=x+\frac{h}{2}, y=\frac{h}{2}$ brings:
$$f'(x)=\lim_{h\to0} \frac{f(x+h)-f(x)}{h}=\lim_{h \to 0}\frac{2f\left(\frac{h}{2}\right)+\frac{h}{2}\left(x+\frac{h}{2}\right)}{h}=\lim_{h\to0}\frac{f(h)+\frac{h}{2}x}{h}\\=\lim_{h\to0}\frac{f(h)-f(0)}{h-0}+\frac{x}{2}=\frac{x}{2}+1$$ $$f(x)=\frac{x^2}{4}+x+c$$ where $c$ is constant. Since $f(0)=0,\space\space c=0$
However, when we substitute $x=0$ to the given condition, $$f(y)=f(-y)+2f(y)+0(y)$$ $$-f(y)=f(-y)$$ which informs that $f$ is odd: contradiction!
Could you please help me to find the error? Thanks.
I think you made no mistake. It's just that the conditions are incoherent, they offer no solution (even without the condition $f'(0)=1$). There is no differentiable $f$ that satisfies $$\tag1 f(x+y)=f(x-y)+2f(y)+xy. $$ If we take $(1)$ and differentiate with respect to $x$, we get $$\tag2 f'(x+y)=f'(x-y)+y. $$ If instead we differentiate $(1)$ with respect to $y$, we get $$\tag3 f'(x+y)=-f'(x-y)+2f'(y)+x. $$ If we add $(2)$ and $(3)$ we get $$ 2f'(x+y)=2f'(y)+x+y. $$ When $x=0$, we get $$ 2f'(y)=2f'(y)+y, $$ so $(1)$ can only hold for a differentiable function if $y=0$.