How to use integration or differentiation to optimize frequency in achieving a specific phase angle?
The complex voltage phasor at the resistor is
$$V_R=V_S\frac{R}{R+\frac{1}{j\omega C}}= V_S\frac{j\omega RC}{1+j\omega RC}$$
For the capacitor we get
$$V_C=V_S\frac{\frac{1}{j\omega C}}{R+\frac{1}{j\omega C}}=V_S\frac{1}{1+j\omega RC}$$
For \$V_R\$ and \$V_C\$ to have a \$45\$ degree phase shift with respect to \$V_S\$, we need to have equal real and imaginary parts:
$$\omega RC = 1\quad\Rightarrow\quad f=\frac{1}{2\pi RC}$$

Of course there's always a frequency-independent phase shift of \$90\$ degrees between \$V_R\$ and \$V_C\$.