# Function with the property $f(a+b)=f(a)+f(b)+2ab$

Let $$f: \mathbb{R} \to \mathbb{R}$$ and let's define $$f$$ such that the following property holds $$f(a+b)=f(a)+f(b)+2ab \text{ for all } a,b.$$ Also let the function be differentiable at $$0$$ and $$f'(0) = 3.$$

Show that the function is differentiable everywhere and determine the derivative $$f'(x)$$.

Since $$f(0) = 0$$ and we have that $$\lim_{h\to0} \frac{f(h)}{h} = 3$$.

So $$\frac{f(x+h)-f(h)}{h} = \frac{f(x)+f(h)+2xh}{h} = \frac{f(h)}{h}+2xh = 3+2xh$$

so it's differentiable and the derivative is $$f'(x)=3+2xh$$? I feel like i should have gotten rid of the $$h$$?

• Alternatively, if $g:\mathbb{R}\to\mathbb{R}$ is given by $$g(x):=f(x)-x^2$$ for each $x\in\mathbb{R}$, then $$g(x+y)=g(x)+g(y)$$ for all $x,y\in\mathbb{R}$. This is known as Cauchy's Functional Equation. Since $f$ is differentiable at some point, it is continuous at that point. Therefore, $g$ is continuous at this point as well, which implies that there exists $k\in\mathbb{R}$ such that $g(x)=kx$. Therefore, $$f(x)=kx+x^2$$ for all $x\in\mathbb{R}$, so $$f'(x)=k+2x$$ for each $x\in\mathbb{R}$. Since $f'(0)=3$, we get $k=3$. Apr 11, 2020 at 19:03

There is a tiny mistake:

$$f'(x) = \lim_{h\to 0}\frac{f(x+h) - f(\color{red}x)}{h} = \lim_{h\to 0}\frac{f(h) + 2xh}{h} = f'(0) + 2x = 3+2x.$$

PS. From there,

$$f(x) = f(0) +x f'(0) + x^2 = 3x + x^2.$$

We could also solve this question with partial derivatives. I find this method to be quite straightforward and easy to evaluate: $$f(a+b)=f(a)+f(b)+2ab$$ Partially differentiating w.r.t. a: $$f'(a+b)=f'(a)+2b$$ Substituting $$a=0$$ because we know $$f'(0)=3$$ : $$f'(b)=3+2b$$ Solving this differential equation: $$f(b)=3b+2b^2+c$$ Since $$f(0)=0$$ , $$c$$ is $$0$$, giving us: $$\boxed {f(x)=3x+2x^2}$$

• The link given in the answer explains why partial differentiation works in this case. Please give it a read. Apr 11, 2020 at 19:24
• No, the link doesn't really explain why partial differentiation works (in both the link's question and this question). In both questions, it is necessary to establish differentiability of $f$ before doing the partial differentiation. Apr 11, 2020 at 19:54
• @Batominovski as the other answers here have explained the differentiability, I didn't think OP needed another explanation. Also in the link I have provided, I'm referring to the accepted answer. Since the answer is accepted, it's an (obvious) assumption that the OP's question about the credibility of partial differentiation has been satisfactorily answered. Apr 11, 2020 at 20:01
• OK, fine. Although this means you are doing more than necessary amount of work. (In all other answers, as they establish differentiability of $f$, they find what $f'$ is, and so getting $f$ from here is straightforward.) But that is not to say that using partial differentiation is not a good method. I have seen its very good uses, but for this problem, it creates more work than necessary. Apr 11, 2020 at 20:09
• Hmm. Okay maybe I should learn more math to comment on what's easy and what's not. Forgive me. Apr 11, 2020 at 20:13

You almost get it correctly, except that the definition of $$f'(x)$$ should be:

$$\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$$

So, the argument should look like this: $$\lim_{h\to0}\frac{f(x+h)-f(x)}{h} = \lim_{h\to0}\frac{(f(x)+f(h)+2xh)-f(x)}{h} = \lim_{h\to0}\left(\frac{f(h)}h + 2x\right)$$

HINT: Note that $$f(a+b)-(a+b)^2=(f(a)-a^2)+(f(b)-b^2)$$ any use Cauchy functional equation.