Find an example of a function $f(x)\neq-2x$ such that $\int_{0}^{1} \left[ -2x-f(x) \right]{\rm d}x = 0$

Find an example of a function $f(x)\neq-2x$ such that $$\int_{0}^{1} \left[ -2x-f(x) \right]{\rm d}x = 0$$

I'm looking for a nudge in the right direction rather than a complete solution.

• Hint: Find a "nice" function $g(x)$ which is not identically $0$ but such that $\int_0^1 g(x)\,dx=0$. Commented Dec 13, 2015 at 18:06
• Break up the integrals, and then some answers should be more obvious. Commented Dec 13, 2015 at 18:07
• Changing a function at a single point does not change the integral so $f(x) = -2x$ with $f(0) =$whatever $\not= 0$ would work. Commented Dec 13, 2015 at 20:13

HINT: You can get one such $f(x)$ by using the fact $$\int_0^1 (1-2x) dx=0$$

Can you use it to find a suitable $f(x)$?

Again, rewrite the above as $$\int_0^1 (\frac{1}{2}-x) dx=0$$

Can you use this to find another suitable $f(x)$?

Well do a little bit of integration to show that $$\int(-2x-f(x))dx=-x^2-\int f(x)dx$$ which means that $$\int_{0}^{1}(-2x-f(x))dx=-1-\left. \int f(x)dx \right |_{x=1}+\left. \int f(x)dx \right |_{x=0}=0$$ Therefore $$F(0)-F(1)=1$$ where $$f(x)=\frac{d}{dx}F(x)$$ So if you can find a suitable $F$, which has a kinder looking requirement to satisfy. You can just take the derivative to get back $f$.

HINT:

$$\int_0^1\left[-2x-f(x)\right]\space\text{d}x=0\Longleftrightarrow$$ $$-2\int_0^1 x\space\text{d}x-\int_0^1 f(x)\space\text{d}x=0\Longleftrightarrow$$ $$-2\int_0^1 x\space\text{d}x-\int_0^1 f(x)\space\text{d}x=0\Longleftrightarrow$$ $$-2\left[\frac{x^2}{2}\right]_0^1-\int_0^1 f(x)\space\text{d}x=0\Longleftrightarrow$$ $$-\left[x^2\right]_0^1-\int_0^1 f(x)\space\text{d}x=0\Longleftrightarrow$$ $$-\left(1^2-0^2\right)-\int_0^1 f(x)\space\text{d}x=0\Longleftrightarrow$$ $$-1-\int_0^1 f(x)\space\text{d}x=0\Longleftrightarrow$$ $$-\int_0^1 f(x)\space\text{d}x=1\Longleftrightarrow$$ $$\int_0^1 f(x)\space\text{d}x=-1$$