I stumbled upon the function $$f(x)=\sin(x)(\sin(x)+2\cos(x)).$$ Now I noticed this function has maximum and minimum values $$\frac{1\pm\sqrt5}{2}$$ which are exactly the golden ratio and its conjugate.
Computationally, this can be verified, but I wondered if there is also an intuitive (geometric) explanation of the golden ratio appearing here.
You mean in fact that the maximal or minimal values taken by the function are the golden ratio $\Phi$ or its conjugate $1-\Phi$.
Here is an explanation. The derivative of
$$f(x)=\sin(x)(\sin(x)+2\cos(x)) \ \ (*)$$
is
$$f'(x)=\cos x (\sin x + 2 \cos x)+\sin x(\cos x -2 sin x).$$
which can be written
$$f'(x)=2 (\cos^2 x - \sin^2 x) + 2 sin x \cos x=2 \cos 2x +\sin 2 x$$
Thus, $f'(x)$ is equal to zero if and only if $\tan 2x=-2$. Knowing relationship $\tan 2x = (2 \tan x)/(1- (\tan x)^2 )$, we have now to solve $2T/(1-T^2)=-2$ (by setting $T=\tan x$) which amounts to:
$$T^2=T+1 \ \ \ (1)$$
Thus $T$ is either $T_1=1.618....$ (golden ratio), or $T_2=-0.618...$ (its conjugate).
Now, we have to go back to (*) because it is the extremal values of $f$ that we are interest in. We can write the expression of $f(x)$ under a form that only involves $\tan x$:
$$f(x)=\sin^2 x + 2 \sin \cos x=\dfrac{\tan^2x}{1+\tan^2 x}+\dfrac{2 \tan x}{1+\tan^2 x} \ \ (2)$$
The extreme values of $f(x)$ are obtained for one of the $T_k$s above.
Let us denote by $T$ any of these two (that both verify (1)).
Equation (2) becomes : $\dfrac{T^2+2T}{1+T^2}$ which is equal... to $T$.
Indeed, $T^2+2T=(1+T^2)T$ is immediately brought back to (1).