A $c\in \left(0, \frac{\pi}{2}\right)$ such that $f'(c)+\int_0^c f\left(x\right)dx=f\left(\frac{\pi}{2}\right)$ let $f:\left[0,\frac{\pi}{2}\right]\to \mathbb{R}$ be a $C^1$ class function. Prove that $\exists c\in \left(0, \frac{\pi}{2}\right)$ such that $f'(c)+\int_0^c f\left(x\right)dx=f\left(\frac{\pi}{2}\right)$.
I didn't make much progress, I thought about using integration by parts, but I wasn't successful. I also thought that maybe we should find some nice auxiliary function to which we should apply Rolle's theorem, but I couldn't think of any.
 A: Let $g(x) =\int_{0}^{x}f(t)\,dt$ and then we are supposed to show that $$g''(c) +g(c) =g' \left(\frac{\pi} {2} \right)$$ for some $c\in(0,\pi/2)$ given $g(0)=0$.
Consider $$F(x) =g(x) \cos x-g'(x) \sin x$$ so that $$F'(x) =-(g(x)+g' '(x)) \sin x$$ Now $$F(0)=0,F\left(\frac{\pi} {2} \right)=-g'\left(\frac{\pi} {2} \right)$$ and hence $$\dfrac{F\left(\dfrac{\pi} {2} \right)-F(0)}{\cos\left(\dfrac{\pi} {2} \right)-\cos 0}=-\frac{F'(c)}{\sin c} $$ for some $c\in(0,\pi/2)$ by Cauchy Mean Value Theorem. This gives us $$g'\left(\frac{\pi} {2} \right)=g(c)+g''(c)$$ as desired. You don't need $f\in C^{1} $ but just that $f$ is differentiable on $(0,\pi/2)$.
A: It is far from being the answer, but notice that if $f(x): [a, b] \to \mathbb{R}$ is $C^1$, then we know that
$$\exists c \in (a, b): \frac{2h}{\pi}f'(c) + \frac{\pi}{2h}\int_a^c f(x)dx = f(b)$$
This can be shown by defining $\phi(x) = \frac{2hx}{\pi} + a$, where $h = b - a$ and using the statement in the OP's question, applied to $g(x) = f(\phi(x))$.
But this is nowhere closer to proving the statement, it just shows it can be generalized...
The $\pi$ showing up might hint at something to someone else... I am still kind of clueless about what is going on.
