# Finding $\int_{-2}^8xf(x)dx$ given $\int_{-2}^8f(x)dx$

I have a continuous function $f:[-2,8]\rightarrow\mathbb{R}$ for which is true that $f(6-x)=f(x)\forall x\in[-2,8]$. Let: $$\int_{-2}^8f(x)dx=10$$ Now, I want to find the: $$\int_{-2}^8xf(x)dx$$ I am thinking of using both the methods of u-substitution and integration by parts, but I need some help. Any ideas?

Using the substitution $w=6-x$, we obtain

\begin{aligned} \int_{-2}^8xf(x)dx&=\int_{-2}^8(6-(6-x))f(6-(6-x))dx\\\\ &=-\int_{8}^{-2}(6-w)f(6-w)dw\\\\ &=\int_{-2}^{8}(6-w)f(6-w)dw\\\\ &=\int_{-2}^{8}(6-w)f(w)dw\\\\ &=6\int_{-2}^{8}f(w)dw-\int_{-2}^{8}wf(w)dw\\\\ &=60-\int_{-2}^{8}xf(x)dx \end{aligned} and thus $$2\int_{-2}^{8}xf(x)dx=60$$ i.e. $$\int_{-2}^{8}xf(x)dx=30.$$

Here's a cute trick.

If the problem is well-posed, then the solution must be independent of $f$. Therefore, you can take $$f(x)\equiv1$$ which is consistent with the hypotheses, and calculate $$\int_{-2}^8x\ \mathrm dx\equiv 30$$

Easy peasy!

• That is so cool! I have a question: how do you know exactly if the answer is independent of $f(x)$? If the problem is well-posed seems like a very vague metric to me. Thanks! :) – Gaurang Tandon Feb 12 '18 at 15:33
• @GaurangTandon Well, the problem may be ill-posed (say, because of a typo, or because your professor is evil). The method here is convenient as a cross-check, or in a multiple choice test. Otherwise you'll have to work harder (as in the other answers). I just wanted to show a trick that will produce the "correct answer" as easily as possible, provided an answer exists at all. – AccidentalFourierTransform Feb 12 '18 at 15:35
• I had to upvote this, as actually, realizing this shows you understand how mathematics work :-) – yo' Feb 12 '18 at 15:42

You're given: $$I=\int_{-2}^8xf(x)dx$$

Use the $a+b-x$ property on this definite integral to get:

\begin{align} I&=\int_{-2}^8 (6-x)\cdot f(6-x)dx \\ &=\int_{-2}^8 (6-x)\cdot f(x)dx \tag{\because f(6-x)=f(x) given} \\ &=6\int_{-2}^8f(x)-I \end{align}

and you can solve it from here.

• More surprises from math.meta.stackexchange.com/q/370/290189 – GNUSupporter 8964民主女神 地下教會 Feb 12 '18 at 13:25
• My favorite is tooltip text, since sometimes you need to put explations on long lines. The font and color tables can be a quick reference. – GNUSupporter 8964民主女神 地下教會 Feb 12 '18 at 13:35
• @GaurangTandon As you ask about formatting, I would never use \because and \therefore in textual proofs. They are intended for automated proofs and proof verification, not for human-readable texts. This would ultimately solve your formatting issue :-) – yo' Feb 12 '18 at 15:30
• @GaurangTandon Well, \because is the thing you were using at high school, but this usage itself is wrong. This over-symbolism make things cluttered and difficult to read. I would omit the parenthesis completely, and write after the displayed equation something like: "where we used the hypothesis $f(6-x)=f(x)$." – yo' Feb 12 '18 at 15:55
• @GaurangTandon Yes, more verbose is correct of course. Mathematics is dense enough on itself already. – yo' Feb 12 '18 at 16:36

Note the following formula we always have, $$\color{red}{\int_a^bg(x)dx= \int_a^bg(a+b-x)dx}$$

Then with $a=-2,~b=8$ and given that $f(x) = f(6-x)$ we get $$I= \int_{-2}^8 xf(x)dx= \int_{-2}^8 (6-x)f(6-x)dx=6\int_{-2}^8 f(x)dx-\int_{-2}^8 xf(x)dx\\=60-I$$

hence solving for I we obtain, $$I=\int_{-2}^8 xf(x)dx=30$$

$$I:=\int_{-2}^8 x f(x)dx=-\int_8^{-2} (6-x) f(6-x)dx=\int_{-2}^8 (6-x) f(6-x)dx$$ so that

$$I+I=\int_{-2}^8 (x+6-x)f(6-x)dx=6\int_{-2}^8f(x)dx.$$