Consider the unitary operator $U$ on the Hilbert space $H:=L^2([0,\frac\pi2])$, that takes $\cos((2k+1)x)$ to $\sin((2k+1)x)$, for $k\in\mathbb N$ (both are orthogonal basis). How can we explicitly write it in exponential form, $U=e^{iA}$ for a bounded self-adjoint operator $A$?
By the spectral theorem for normal operators, every unitary operator on a complex Hilbert space $H$ can be written this way. For instance, since $\text{ spec } U\subset \partial B_\mathbb{C}(0,1)$, such $A$ can be given by the Borel functional calculus. Nevertheless, in most concrete cases like the above, I have no clue about how to compute explicitly the exponential form.
I would be also glad to see similar examples, so feel free to change the data, if it helps you (but I'd prefer to accept an answer to the original problem).
note. In the above case, one can split $H$ as $H_+\oplus H_-$, where $H_+$ and $H_-$ are the closed subspaces spanned resp. by $\{\cos((4j+1)x)\}_{j\in\mathbb N}$, $\{\cos((4j+3)x)\}_{i\in\mathbb N}$.
Then $ Uf(x) = f(\frac\pi2-x)$ for all $f\in H_+ $ and $ Uf(x) = -f(\frac\pi2-x) $ for all $ f\in H_-. $ However, this doesn’t seem to help, since the decomposition is not $U$-invariant.
(edit Jan 11, 2025) After suggestion of Christian Remling, here is the (infinite) matrix of $U$ w.r.to the orthonormal basis $ \phi_k:=\frac2{\sqrt \pi}\cos((2k+1)x)$. It turns out to be a curious superposition of a $\color{blue}{\text {Hankel}}$ matrix and a $\color{red}{\text {Toeplitz}}$ matrix. Note that each column is a permutation of $\big(\frac1{2m+1}\big)_{m\in\mathbb Z}$, and each column is obtained from the preceding by switching pairs of adjacent coefficients, so that negative coefficients slowly migrate to infinity.
$$U=\frac2\pi\,\begin{bmatrix} \color{blue}1 & \color{red}1 & \color{blue}{\frac13} & \color{red}{\frac13}& \color{blue}{\frac15} & \color{red}{\frac15}&\color{blue}{\frac17} &\dots \\ \color{red}{-1} & \color{blue}{\frac13} & \color{red} 1 & \color{blue}{\frac15} & \color{red}{\frac13} & \color{blue}{\frac17}& \color{red}{\frac15}&\dots \\ \color{blue}{\frac13} & \color{red}{-1} & \color{blue}{\frac15} & \color{red}{1}& \color{blue}{\frac17} & \color{red}{\frac13}&\color{blue}{\frac19} &\dots \\ \color{red}{-\frac13} & \color{blue}{\frac15} & \color{red} {-1} & \color{blue}{\frac17} & \color{red}1 & \color{blue}{\frac19}&\color{red}{\frac13}&\dots \\ \color{blue}{\frac15} & \color{red}{-\frac13} & \color{blue}{\frac17} & \color{red}{-1}& \color{blue}{\frac19} & \color{red}{1}&\color{blue}{\frac1{11}}&\dots \\ \color{red}{-\frac15} & \color{blue}{\frac17} & \color{red} {-\frac13} & \color{blue}{\frac19} & \color{red}{-1} & \color{blue}{\frac1{11}}&\color{red}{1} &\dots \\ \color{blue}{\frac17} & \color{red}{-\frac15} & \color{blue}{\frac19} & \color{red}{-\frac13}& \color{blue}{\frac1{11}} & \color{red}{-1}& \color{blue}{\frac1{13}}&\dots \\ \color{red}{-\frac17} & \color{blue}{\frac19} & \color{red} {-\frac15} & \color{blue}{\frac1{11}} & \color{red}{-\frac13} &\color{blue}{\frac1{13}}&\color{red}{-1} &\dots \\ \vdots & \vdots & \vdots & \vdots& \vdots& \vdots & \vdots & \ddots \end{bmatrix}$$