I am solving this exercice:
Let $I_0$ a neighbourhood of $0$, let $g\in C^1(I_0)$ such that $g(0)<0$. Define $$ f_\beta(x)=\int_{\sin(x)-\beta x}^{x^2} g(y)\,dy\,\,\,\, \forall \beta \in \mathbb{R} $$ Find the values of $\beta$ such that $x_0=0$ is a (local) maximum for $f_\beta$.
I started with $$ f'_\beta(x)=2xg(x^2)-(\cos(x)-\beta)g(\sin(x)-\beta x) $$ requiring $f'_\beta(0)=0$ I get $\beta=1$. (is it correct?)
Then let $I_0^-$ a left neighbourhood of $0$, I have $2xg(x^2)>0$ and $-(\cos(x)-1)g(\sin(x)- x)<0$, so I cannot say that $f'_1>0$ in $I_0^-$, that was my guess.
How can I do?
hint
$ g $ is continuous at $ x_0=0 $, and $ g(0)<0 \implies $
$$(\exists \eta>0)\;:\: g((-\eta,\eta))\subset (-\infty,0)$$
but
$$\lim_{x\to 0}(\sin(x)-x))=0\implies $$ $$(\exists \delta_1>0)\;:\; (\forall x\in(-\delta_1,\delta_1)) \;$$ $$\sin(x)-x\in(-\eta,\eta)$$
and
$$\lim_{x\to 0}x^2=0\implies$$ $$(\exists \delta_2>0)\;:\;\forall x\in(-\delta_2,\delta_2)\;$$ $$ x^2\in(-\eta,\eta)$$
Put $ \delta=\min(\delta_1,\delta_2)$.
then $$\forall x\in(-\delta,\delta)$$ $$[\sin(x)-x,x^2]\subset(-\eta,\eta)$$
from here, you can prove that $ f_1(x)\le 0$.