# Functional equation arising in computing an integral

Let $$f(x)$$ be a twice differentiable function (with a continuous second derivative) satisfying the identity: $$f \left(\frac{x}{2} \right)+f \left(\pi-\frac{x}{2} \right)=\frac{f(x)}{2}$$

Determine $$f(x)$$.

This functional equation arose when I was computing the value of an integral (I replaced $$a$$ by $$a/2$$ and $$\pi - a/2$$, added the two and then substituted $$t=x^2$$);

$$I(a)=\int_0^1 \dfrac{\log|x^2-2x\cos a+1|}{x} dx$$

I have tried many things with this functional equation, like trying to find $$f(0),f(\pi)(f(2\pi)$$, etc but I was unsuccessful. Then I tried to prove injectivity or surjectivity and again failed because I couldn't get a conclusive result. Next, I differentiated the equation twice to obtain $$f''(t)+f''(\pi -t)=2f''(2t)$$. Since $$f''(x)$$ is continuous, it is bounded but I couldn't use that fact either. I have a feeling that given the simplicity of the functional equation, the solution to it must be symmetric about some point but I have no way of finding this point or proving this assertion either. What can I do to solve this functional equation?

EDIT:At the back of the book, a hint is given: try proving that $$f''(x)$$ is constant using continuity. Can someone help me understand how I can develop an alternate solution by proving this? I think it must involve somewhat similar reasoning as in Functional equation $f (x) = f \left (\frac x2 \right ) + f \left (\frac x2 + \frac 12\right)$ but I'm unsuccessful in applying it.

• See similar question here. Commented May 22 at 8:06
• Why not attempt to apply Fourier Transform to your equation ? Commented May 22 at 8:24
• A combination of Mathematica integration and Wikipedia identities suggests the following result: $$I(a)=\frac{\pi^2}{6}-\frac12 (a-\pi)^2,\qquad 0\leq a\leq 2\pi.$$ This is obviously symmetric about $a=\pi$. Commented May 22 at 8:37
• Are you sure? I thought $I(0)$ should be negative since the argument of log is always lesser than 1 in that case but your function is positive? SORRY, misread it Commented May 22 at 9:01
• Sorry @JeanMarie, I'm not well acquainted with Fourier transforms, but if you have an answer using it, I'll try my best to understand it! Commented May 22 at 9:05

First, observe that the integral inherits all the symmetries of the cosine function: $$I(a)=I(a+2\pi)=I(2\pi-a)$$ Invoking continuity as well, it suffices to consider $$a\in (0,\pi)$$.

Now consider that $$I'(a)=\int_0^1 \frac{2\sin a~dx}{x^2-2x\cos a+1}=\int_0^1 \frac{2\sin a~dx}{(x-\cos a)^2+\sin^2 a}.$$ Under the substitution $$x=\cos a+u \sin a$$, the corresponding indefinite integral yields

\begin{align} \int \frac{2\sin a~dx}{(x-\cos a)^2+\sin^2 a} &= \int \frac{2\sin a~ (\sin a~du)}{(1+u^2)\sin^2 a}\\ &=2\int \frac{du}{1+u^2}\\ &=\tan^{-1}u=\tan^{-1}\left(\frac{x-\cos a}{\sin a}\right) \end{align} Note that this substitution is well-defined for all $$a\in (0,\pi)$$. Therefore the definite integral evaluates to \begin{align} I'(a) &=2\tan^{-1}\left(\frac{1-\cos a}{\sin a}\right)-2\tan^{-1}\left(\frac{0-\cos a}{\sin a}\right)\\ &=2\tan^{-1}\left(\frac{2\sin^2 (a/2)}{2\sin (a/2)\cos(a/2)}\right)+ 2\tan^{-1}\cot(a)\\ &=2\tan^{-1}\tan\left(\frac{a}{2}\right)+2\tan^{-1}\tan\left(\frac{\pi}{2}-a\right)\\ &=2\cdot \frac{a}{2}+2\cdot\left(\frac{\pi}{2}-a\right)=\pi-a \end{align} where in the second line we have used the double-angle trig identities; the simplifications of inverse tangent are valid so long as $$0 and $$0<\pi/2-a<0$$, both of which follow from $$a\in(0,\pi)$$. Integrating this result yields $$I(a)=-\frac{1}{2}(\pi-a)^2+C$$ It remains to evaluate $$I(a)$$ for some value of $$a$$ to determine the value of $$C$$. To relate this to a familiar result, my preference is to evaluate in the limit $$a\to 0^+$$ by expanding term-by-term: \begin{align} \lim_{a\to 0^+}I(a)=C-\frac{\pi^2}{2} &=\int_0^1 \log(1-2x+x^2)\frac{dx}{x}\\ &=2\int_0^1 \log(1-x)\frac{dx}{x}\\ &=-2 \int_0^1 \sum_{k=1}^\infty \frac{x^{k-1}}{k}dx\\ &=-2 \sum_{k=1}^\infty \frac{1}{k^2}=-2\frac{\pi^2}{6}=-\frac{\pi^2}{3} \end{align} Hence $$C=I(\pi)=\pi^2/6$$ and we conclude $$I(a)=\frac{\pi^2}{6}-\frac{(\pi-a)^2}{2},\qquad 0 Invoking the symmetries and continuity of the original integral, this extends to $$I(a)=\frac{\pi^2}{6}-\frac12 [\pi-(a\mod 2\pi)]^2$$ which is valid for for all real $$a$$.

• I should also acknowledge that, while this answer may look different in spirit from Claude's answer via polylogarithms, there is less of a difference than it may appear. The key result used in Claude's answer is due to Euler (equation (1) here, and my approach is essentially that due to Lewin in the linked source. (The only difference is that I preferred to work in terms of inverse tangent rather than splitting into partial fractions.) Commented May 22 at 13:59
• Very nice and élégant solution Commented May 23 at 14:31

$$J=\int\dfrac{\log\left(x^2-2x\cos a+1\right)|}{x} \,dx=\int\frac{\log \left(x-e^{-i a}\right)+\log \left(x-e^{i a}\right)}{x} \,dx$$ gives $$I(a)=\int_0^1\dfrac{\log\left(x^2-2x\cos a+1\right)|}{x} \,dx=-\text{Li}_2\left(e^{-i a}\right)-\text{Li}_2\left(e^{i a}\right)$$ which is $$\frac{\pi^2}6-\frac 12 \big(a- (2 n+1)\pi\big)^2 \qquad \text{for} \qquad 2n\pi \leq a \leq 2(n+1)\pi$$ as already given by @Semiclassical in comments.

• For additional connective tissue, the polylogarithm identity amounts to the Fourier series $$\sum_{k=1}^\infty \frac{1}{k^2}\cos(ka)=\frac{\pi^2}{12}-\frac{1}{4} (a - \pi)^2$$ where the equality is valid for $0<a<2\pi$ (and periodically extended, etc etc). Commented May 22 at 10:45

I found a solution using the boundness of $$f''(x)$$; the functional equation upon differentiating twice yields;

$$f''(x/2)+f''(\pi - x/2) = 2f''(x)$$

Suppose, the continuous $$f''(x)$$ attains its maximum at some $$c$$, $$f''(c)=M$$ and minimum at $$b$$, $$f''(b)=m$$. So, the range of $$f''(x)$$ is $$[m,M]$$. Setting $$x=c$$ in the functional equation,

$$f''(c/2)+f''(\pi - c/2) = 2f''(c)=2M$$

Since the maximum value that the LHS can attain is at $$2M$$, for equality to hold, $$f''(c/2)=f''(\pi - c/2)=M$$.

By repeating this argument by setting $$x=c/2,c/4,c/8...c/2^n$$, I obtain;

$$f''(c)=f''(c/2)=f''(c/4)=...=\lim_{n \to ∞}f''(c/2^n)= f''(0)$$ ( I shifted the limit inside the function because of its continuity) i.e. the maximum of $$f''(x)$$ is attained at $$x=0$$.

By the same argument, applied to $$f''(b)=m$$, I obtain that $$f''(0)$$ must also be the minimum of $$f''(x)$$. Hence, $$f''(x)$$ is a constant function equal to $$f''(0)$$ i.e. $$f(x)$$ is a quadratic whose coefficients can be determined from the initial conditions.

Just to add a grain of salt to the discussion. If we restrict $$a$$, there is a Fourier series for the integrand:

$$2\sum_{k=1}^{\infty} \frac{x^k\cos(ka)}{k} = \ln(1-2x\cos a +x^2), \quad 0

Hence

$$I(a) = \frac{1}{2} \int_{0}^1 \frac{\ln(1-2x\cos a +x^2)}{x}dx = \sum_{k=1}^{\infty}\frac{\cos(ka)}{k}\int_{0}^{1} x^{k-1}dx = \sum_{k=1}^{\infty}\frac{\cos(ka)}{k^2}$$

Then

$$\sum_{k=1}^{\infty}\frac{\cos(ka)}{k^2} = \frac{1}{2}\left[\operatorname{Li}_2(e^{ia})+\operatorname{Li}_2(e^{-ia})\right]$$

as was shown by other users.

Therefore, using the last property in this list.

$$\operatorname{Li}_2(z) +\operatorname{Li}_2\left(\frac{1}{z}\right) = - \frac{\pi^2}{6} - \frac{(\ln(-z))^2}{2}$$

we have

$$\frac{1}{2}\left[\operatorname{Li}_2(e^{ia})+\operatorname{Li}_2(e^{-i a})\right] = \frac{1}{2}\left[-\frac{\pi^2}{6}+\frac{\operatorname{atan2}^2(-\sin(a),-\cos(a))}{2} \right] = \begin{cases} \displaystyle \;\; \frac{\pi^2}{6} &\quad a=0 \\ \displaystyle -\frac{\pi^2}{12} +\frac{(a-\pi)^2}{4} & \displaystyle \quad 0

$$\sum_{k=1}^{\infty} \frac{x^k\cos(ka)}{k} = \Re \sum_{k=1}^{\infty} \frac{(xe^{ia})^k}{k}$$