# Find f ?

## Find differentiable $f$ for which we have $f \left(x\right) + f \left(y\right) = f \left(x + y\right) - x y - 1 ,$$x$$\in$$\mathbb{R}$ , $y$$\in$$\mathbb{R}$ & $f ' \left(0\right) = - 1$

The function is $f \left(x\right) = {x}^{2} / 2 - x - 1$

#### Explanation:

Totally unnecesary - see my other answer
$\textcolor{red}{f \left(x + y\right) = f \left(x\right) + f \left(y\right) + x y + 1}$

The following method is used to solve differential equations, but it oddly works here. Consider an equation
$\textcolor{b l u e}{g \left(x + y\right) = g \left(x\right) + g \left(y\right)}$

If the function h(x) satisfies the red equation and g(x) satisfies the blue one, then $f \left(x\right) = g \left(x\right) + h \left(x\right)$ still satisfies the red equation. That's because, when you add red and blue equations you get
$g \left(x + y\right) + h \left(x + y\right) = g \left(x\right) + h \left(x\right) + g \left(y\right) + h \left(y\right) + x y + 1$
$f \left(x + y\right) = f \left(x\right) + f \left(y\right) + x y + 1$
And if $g \left(x\right)$ doesn't fit in blue, then $f \left(x\right)$ doesn't fit in red, so all solutions of red are of the form $f \left(x\right) = g \left(x\right) + h \left(x\right)$.

This is particularly useful here, because instead of finding all solutions to red eq., we have to find one solution to red (even by guessing) and then all solutions to blue one (which is much easier).

Finding all solutions to blue
Functions satisfying blue equation are called additive.
Let's try taking $\frac{d}{\mathrm{dy}}$ of both sides. We get
$\frac{d}{\mathrm{dy}} \left(g \left(x + y\right)\right) = \frac{d}{\mathrm{dy}} \left(g \left(x\right) + g \left(y\right)\right)$
$g ' \left(x + y\right) \frac{d}{\mathrm{dy}} \left(x + y\right) = \frac{d}{\mathrm{dy}} \left(g \left(y\right)\right)$
$g ' \left(x + y\right) \cdot 1 = g ' \left(y\right)$

the right side is x-independent so the left side must be as well. That means that $g ' \left(x\right)$ is constant and $g \left(x\right)$ is linear.
If we plug in a linear function $b x + c$ to blue, we get
$b \left(x + y\right) + c = b x + c + b y + c$
$b \left(x + y\right) + c = b \left(x + y\right) + 2 c$
thus $c = 0$. Now all functions of the form $g \left(x\right) = a x$ would satisfy blue. The others won't.

Finding a solution to red

The second degree term $x y$ suggests, that maybe some quadratic might fit. So we try to plug $h \left(x\right) = a {x}^{2} + c$ in. The bx term is ignored since we know that b is arbitrary.
$a {\left(x + y\right)}^{2} + c = a {x}^{2} + c + a {y}^{2} + c + x y + 1$
$a {x}^{2} + 2 a x y + a {y}^{2} = a {x}^{2} + a {y}^{2} + c + x y + 1$
$2 a x y = x y + c + 1$
Comparing sides gives us
$2 a = 1$ and $0 = c + 1$
$a = \frac{1}{2}$ and $c = - 1$
So one of the solutions to red is $h \left(x\right) = {x}^{2} / 2 - 1$

The finish

All solutions are of the form $f \left(x\right) = g \left(x\right) + h \left(x\right) = {x}^{2} / 2 + a x - 1$, but we have one more condition $f ' \left(0\right) = - 1$. The easiest way is to derive, plug in 0 and compare.
$f ' \left(x\right) = x + a$
$f ' \left(0\right) = a = - 1$
So the final answer is $f \left(x\right) = {x}^{2} / 2 - x - 1$

Dec 19, 2017

See below.

#### Explanation:

Making $y = - x$ we have

$f \left(x - x\right) = f \left(x\right) + f \left(- x\right) + x \left(- x\right) + 1$ or

$f \left(0\right) = f \left(x\right) + f \left(- x\right) - {x}^{2} + 1$

Now making $x = y = 0$ we have

$f \left(0\right) = 2 f \left(0\right) + 1 \Rightarrow f \left(0\right) = - 1$ and then

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

Now considering $f \left(x\right) = a {x}^{2} + b x + c$ we have

$a {x}^{2} + b x + c + a {x}^{2} - b x + c = {x}^{2} - 2$ and then

$\left\{\begin{matrix}2 a = 1 \\ 2 c = - 2\end{matrix}\right.$

The value for $b$ is obtained knowing that

$f ' \left(0\right) = b = - 1$ and finally

$f \left(x\right) = \frac{1}{2} {x}^{2} - x - 1$ is a solution.

NOTE

Assuming that $f \left(x\right)$ can be developed in Taylor series around $x = 0$ or $f \left(x\right) = {\sum}_{k = 0}^{n} {a}_{k} {x}^{k}$ we have

${\sum}_{k = 0}^{n} {a}_{k} \left({\left(x + y\right)}^{k} - {x}^{k} - {y}^{k}\right) = x y + 1$

For $k = 0$ we have

${a}_{0} \left(1 - 1 - 1\right) = 1 \Rightarrow {a}_{0} = - 1$

for $k = 1$

${a}_{1} \left(x + y - x - y\right) = 0 \Rightarrow {a}_{1}$ can be any real number.

for $k = 2$

${a}_{2} \left({\left(x + y\right)}^{2} - {x}^{2} - {y}^{2}\right) = 2 x y {a}_{2} = x y \Rightarrow {a}_{2} = \frac{1}{2}$

now for $k > 2$

${a}_{k} \left({\left(x + y\right)}^{k} - {x}^{k} - {y}^{k}\right) = 0 \Rightarrow {a}_{k} = 0$

${a}_{1}$ is defined by the condition $f ' \left(0\right) = - 1$

$f \left(x\right) = {x}^{2} / 2 - x + 1$

#### Explanation:

$f \left(x + y\right) = f \left(x\right) + f \left(y\right) + x y + 1$
Function is differentiable, so we can differentiate both sides with respect to $y$.
$\frac{d}{\mathrm{dy}} \left(f \left(x + y\right)\right) = \frac{d}{\mathrm{dy}} \left(f \left(x\right) + f \left(y\right) + x y + 1\right)$

Using chain rule and sum rule
$f ' \left(x + y\right) \frac{d}{\mathrm{dy}} \left(x + y\right) = f ' \left(y\right) + x$

Setting $y = 0$
$f ' \left(x\right) = f ' \left(0\right) + x = x - 1$

Integrating gives us
$f \left(x\right) = {x}^{2} / 2 - x + c$

Finding $c$ is covered by previous answers to this question.
Either plug this solution in to your equation or find $f \left(0\right)$ by setting $y = 0$ in your equation.

Dec 24, 2017

$f \left(x\right) = \frac{1}{2} {x}^{2} - x - 1$

#### Explanation:

Another method using elementary techniques...

Given:

$f \left(x\right) + f \left(y\right) = f \left(x + y\right) - x y - 1$

We find:

$f \left(0\right) = f \left(0\right) + f \left(0\right) - f \left(0\right) = f \left(0 + 0\right) - 0 \cdot 0 - 1 - f \left(0\right) = - 1$

Note that:

$f \left(x + y\right) = f \left(x\right) + f \left(y\right) + x y + 1$

So putting $c = f \left(1\right)$ and $y = 1$, we have:

$f \left(0\right) = - 1$

$f \left(1\right) = c$

$f \left(2\right) = f \left(1\right) + f \left(1\right) + 1 \cdot 1 + 1 = 2 c + 2$

$f \left(3\right) = f \left(2\right) + f \left(1\right) + 2 \cdot 1 + 1 = 3 c + 5$

In general:

$f \left(n + 1\right) = f \left(n\right) + c + n + 1$

Let's use the method of differences to find the general formula for $f \left(n\right)$:

Write out the sequence of the first few values:

$\textcolor{b l u e}{- 1} , c , 2 c + 2 , 3 c + 5$

Write out the sequence of differences between consecutive terms:

$\textcolor{b l u e}{c + 1} , c + 2 , c + 3$

Write out the sequence of differences of those differences:

$\textcolor{b l u e}{1} , 1$

Having reached a constant sequence, we can use the first term of each of these sequences as coefficients to write:

f(x) = color(blue)(-1)/(0!) + color(blue)(c+1)/(1!)x+color(blue)(1)/(2!)x(x-1)

$\textcolor{w h i t e}{f \left(x\right)} = \frac{1}{2} {x}^{2} + \left(c + \frac{1}{2}\right) x - 1$

Then:

$f ' \left(x\right) = x + c + \frac{1}{2}$

So:

$- 1 = f ' \left(0\right) = 0 + c + \frac{1}{2}$

Hence $c = - \frac{3}{2}$ and:

$f \left(x\right) = \frac{1}{2} {x}^{2} - x - 1$