12.8. Determine the continuous functions $f:\left[\frac{1}{e^{2}} ; e^{2}\right] \rightarrow \mathbb{R}$, for which

$$
\int_{-2}^{2} \frac{1}{\sqrt{1+e^{x}}} f\left(e^{-x}\right) d x-\int_{-2}^{2} f^{2}\left(e^{x}\right) d x=\frac{1}{2}
$$
## Solution:

We obtain

$$
\int_{-2}^{2} \frac{1}{\sqrt{1+e^{x}}} f\left(e^{-x}\right) d x=\left|\begin{array}{c}
x=-t \\
d x=-d t \\
x=-2 \Rightarrow t=2 \\
x=2 \Rightarrow t=-2
\end{array}\right|=\int_{-2}^{2} \frac{1}{\sqrt{1+e^{-t}}} f\left(e^{t}\right) d t
$$

Then

$$
\begin{array}{r}
\int_{-2}^{2} \frac{1}{\sqrt{1+e^{x}}} f\left(e^{-x}\right) d x-\int_{-2}^{2} f^{2}\left(e^{x}\right) d x=\frac{1}{2} \Leftrightarrow \\
\Leftrightarrow \int_{-2}^{2}\left(f^{2}\left(e^{x}\right)-\frac{1}{\sqrt{1+e^{-x}}} f\left(e^{x}\right)\right) d x+\frac{1}{2}=0 \Leftrightarrow \\
\Leftrightarrow \int_{-2}^{2}\left(f\left(e^{x}\right)-\frac{1}{2} \cdot \frac{1}{\sqrt{1+e^{-x}}}\right)^{2} d x+\frac{1}{2}-\frac{1}{4} \int_{-2}^{2} \frac{d x}{1+e^{-x}}=0
\end{array}
$$

We calculate

$$
\int_{-2}^{2} \frac{d x}{1+e^{-x}}=\int_{-2}^{2} \frac{d\left(e^{x}+1\right)}{e^{x}+1}=\left.\ln \left(e^{x}+1\right)\right|_{-2} ^{2}=\ln \left(e^{2}+1\right)-\ln \left(e^{-2}+1\right)=2
$$

and obtain

$$
(1) \Leftrightarrow \int_{-2}^{2}\left(f\left(e^{x}\right)-\frac{1}{2} \cdot \frac{1}{\sqrt{1+e^{-x}}}\right)^{2} d x=0
$$

Considering that the function $h(x)=\left(f\left(e^{x}\right)-\frac{1}{2} \cdot \frac{1}{\sqrt{1+e^{-x}}}\right)^{2}$ is continuous and non-negative on $[-2 ; 2]$, we obtain that the last equality is equivalent to $f\left(e^{x}\right)-\frac{1}{2} \cdot \frac{1}{\sqrt{1+e^{-x}}}=0, \forall x \in[-2 ; 2]$.

It is known that $h(x)=0, \forall x \in[a ; b]$ implies $\int_{a}^{b} h(x) d x=0$.

To prove the truth of the inverse implication (i.e., $\int_{a}^{b} h(x) d x=0, h:[a ; b] \rightarrow \mathbb{R}$, $h$ - continuous on $[a ; b], h(x) \geq 0, \forall x \in[a ; b]$ implies $h(x)=0, \forall x \in[a ; b])$, we will assume the contrary. Suppose $\int_{a}^{b} h(x) d x=0, h:[a ; b] \rightarrow \mathbb{R}, h$ - continuous on $[a ; b], h(x) \geq 0$, $\forall x \in[a ; b]$ but there exists $x_{0} \in[a ; b]$, for which $h\left(x_{0}\right) \neq 0$. From the continuity of the function $h$, it follows that there exists an interval $\left[x_{0}-\varepsilon ; x_{0}+\varepsilon\right] \subset[a ; b], \varepsilon>0$, such that $h(x)>0, \forall x \in\left[x_{0}-\varepsilon ; x_{0}+\varepsilon\right]$. This implies $\int_{a}^{b} h(x) d x \geq \int_{x_{0}-\varepsilon}^{x_{0}-\varepsilon} h(x) d x>0$, which contradicts the assumption $\int_{a}^{b} h(x) d x=0$.

Thus, we obtain $f\left(e^{x}\right)=\frac{1}{2} \cdot \frac{1}{\sqrt{1+e^{-x}}}=0, \forall x \in[-2 ; 2]$, which implies

$$
f(t)=\frac{1}{2} \cdot \sqrt{\frac{t}{1+t}}, \forall t \in\left[\frac{1}{e^{2}} ; e^{2}\right]
$$